Remove lksctp dependency in favor of kernel's sctp.
Change-Id: I572ae41c8c0fa9ffd90392f2717ad10017d632d0
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/network/BUILD b/aos/network/BUILD
index a6e2c51..d98b43b 100644
--- a/aos/network/BUILD
+++ b/aos/network/BUILD
@@ -156,7 +156,6 @@
deps = [
"//aos:unique_malloc_ptr",
"//aos/util:file",
- "//third_party/lksctp-tools:sctp",
"@com_github_google_glog//:glog",
],
)
@@ -175,7 +174,6 @@
target_compatible_with = ["@platforms//os:linux"],
deps = [
":sctp_lib",
- "//third_party/lksctp-tools:sctp",
],
)
@@ -260,7 +258,6 @@
"//aos:unique_malloc_ptr",
"//aos/events:shm_event_loop",
"//aos/events/logging:log_reader",
- "//third_party/lksctp-tools:sctp",
],
)
@@ -294,7 +291,6 @@
target_compatible_with = ["@platforms//os:linux"],
deps = [
":sctp_lib",
- "//third_party/lksctp-tools:sctp",
],
)
diff --git a/aos/network/sctp_client.cc b/aos/network/sctp_client.cc
index b7b7a93..a87dfc6 100644
--- a/aos/network/sctp_client.cc
+++ b/aos/network/sctp_client.cc
@@ -1,8 +1,8 @@
#include "aos/network/sctp_client.h"
#include <arpa/inet.h>
+#include <linux/sctp.h>
#include <net/if.h>
-#include <netinet/sctp.h>
#include <sys/socket.h>
#include <cstdlib>
diff --git a/aos/network/sctp_lib.cc b/aos/network/sctp_lib.cc
index 2658271..6030ea7 100644
--- a/aos/network/sctp_lib.cc
+++ b/aos/network/sctp_lib.cc
@@ -1,9 +1,10 @@
#include "aos/network/sctp_lib.h"
#include <arpa/inet.h>
+#include <linux/sctp.h>
#include <net/if.h>
#include <netdb.h>
-#include <netinet/sctp.h>
+#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@@ -211,7 +212,7 @@
status.sstat_assoc_id = assoc_id;
socklen_t size = sizeof(status);
- const int result = getsockopt(fd, SOL_SCTP, SCTP_STATUS,
+ const int result = getsockopt(fd, IPPROTO_SCTP, SCTP_STATUS,
reinterpret_cast<void *>(&status), &size);
if (result == -1 && errno == EINVAL) {
LOG(INFO) << "sctp_status) not associated";
@@ -265,7 +266,7 @@
subscribe.sctp_association_event = 1;
subscribe.sctp_stream_change_event = 1;
subscribe.sctp_partial_delivery_event = 1;
- PCHECK(setsockopt(fd(), SOL_SCTP, SCTP_EVENTS, (char *)&subscribe,
+ PCHECK(setsockopt(fd(), IPPROTO_SCTP, SCTP_EVENTS, (char *)&subscribe,
sizeof(subscribe)) == 0);
}
diff --git a/aos/network/sctp_lib.h b/aos/network/sctp_lib.h
index 14509e4..8eb57d3 100644
--- a/aos/network/sctp_lib.h
+++ b/aos/network/sctp_lib.h
@@ -2,7 +2,7 @@
#define AOS_NETWORK_SCTP_LIB_H_
#include <arpa/inet.h>
-#include <netinet/sctp.h>
+#include <linux/sctp.h>
#include <memory>
#include <optional>
diff --git a/aos/network/sctp_server.cc b/aos/network/sctp_server.cc
index cfc8512..fb736de 100644
--- a/aos/network/sctp_server.cc
+++ b/aos/network/sctp_server.cc
@@ -1,10 +1,10 @@
#include "aos/network/sctp_server.h"
#include <arpa/inet.h>
+#include <linux/sctp.h>
#include <net/if.h>
#include <netdb.h>
#include <netinet/in.h>
-#include <netinet/sctp.h>
#include <sys/socket.h>
#include <cstdio>
diff --git a/aos/network/sctp_server.h b/aos/network/sctp_server.h
index 6d0b44e..2831a68 100644
--- a/aos/network/sctp_server.h
+++ b/aos/network/sctp_server.h
@@ -2,10 +2,10 @@
#define AOS_NETWORK_SCTP_SERVER_H_
#include <arpa/inet.h>
+#include <linux/sctp.h>
#include <net/if.h>
#include <netdb.h>
#include <netinet/in.h>
-#include <netinet/sctp.h>
#include <sys/socket.h>
#include <cstdio>