This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
pespin gerrit-no-reply at lists.osmocom.orgpespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/26340 )
Change subject: Introduce sctp.h to provide SCTP related functionalities
......................................................................
Introduce sctp.h to provide SCTP related functionalities
These value_strings are taken from existing private ones in
libosmo-sccp.git osmo_ss7.c, and are moved here in order to be
reused by other projects, such as osmo-hnodeb.
Change-Id: Ica6f01851fb94e31f4ef097494bb1b8a95597ba6
---
M include/osmocom/netif/Makefile.am
A include/osmocom/netif/sctp.h
M src/Makefile.am
A src/sctp.c
4 files changed, 49 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/40/26340/1
diff --git a/include/osmocom/netif/Makefile.am b/include/osmocom/netif/Makefile.am
index 39df08a..d9d030b 100644
--- a/include/osmocom/netif/Makefile.am
+++ b/include/osmocom/netif/Makefile.am
@@ -8,4 +8,8 @@
rtp.h \
stream.h
+if ENABLE_LIBSCTP
+osmonetif_HEADERS += sctp.h
+endif
+
osmonetifdir = $(includedir)/osmocom/netif
diff --git a/include/osmocom/netif/sctp.h b/include/osmocom/netif/sctp.h
new file mode 100644
index 0000000..2b2e072
--- /dev/null
+++ b/include/osmocom/netif/sctp.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include <osmocom/core/utils.h>
+
+enum sctp_sac_state;
+extern const struct value_string osmo_sctp_assoc_chg_strs[];
+static inline const char *osmo_sctp_assoc_chg_str(enum sctp_sac_state val)
+{ return get_value_string(osmo_sctp_assoc_chg_strs, val); }
+
+enum sctp_sn_type;
+extern const struct value_string osmo_sctp_sn_type_strs[];
+static inline const char *osmo_sctp_sn_type_str(enum sctp_sn_type val)
+{ return get_value_string(osmo_sctp_sn_type_strs, val); }
diff --git a/src/Makefile.am b/src/Makefile.am
index 7e71c71..438b58e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,3 +20,7 @@
rs232.c \
rtp.c \
stream.c
+
+if ENABLE_LIBSCTP
+libosmonetif_la_SOURCES += sctp.c
+endif
diff --git a/src/sctp.c b/src/sctp.c
new file mode 100644
index 0000000..c24e0f7
--- /dev/null
+++ b/src/sctp.c
@@ -0,0 +1,28 @@
+#include <netinet/sctp.h>
+#include <osmocom/netif/sctp.h>
+
+const struct value_string osmo_sctp_assoc_chg_strs[] = {
+ { SCTP_COMM_UP, "COMM_UP" },
+ { SCTP_COMM_LOST, "COMM_LOST" },
+ { SCTP_RESTART, "RESTART" },
+ { SCTP_SHUTDOWN_COMP, "SHUTDOWN_COMP" },
+ { SCTP_CANT_STR_ASSOC, "CANT_STR_ASSOC" },
+ { 0, NULL }
+};
+
+const struct value_string osmo_sctp_sn_type_strs[] = {
+ { SCTP_ASSOC_CHANGE, "ASSOC_CHANGE" },
+ { SCTP_PEER_ADDR_CHANGE, "PEER_ADDR_CHANGE" },
+ { SCTP_SHUTDOWN_EVENT, "SHUTDOWN_EVENT" },
+ { SCTP_SEND_FAILED, "SEND_FAILED" },
+ { SCTP_REMOTE_ERROR, "REMOTE_ERROR" },
+ { SCTP_PARTIAL_DELIVERY_EVENT, "PARTIAL_DELIVERY_EVENT" },
+ { SCTP_ADAPTATION_INDICATION, "ADAPTATION_INDICATION" },
+#ifdef SCTP_AUTHENTICATION_INDICATION
+ { SCTP_AUTHENTICATION_INDICATION, "AUTHENTICATION_INDICATION" },
+#endif
+#ifdef SCTP_SENDER_DRY_EVENT
+ { SCTP_SENDER_DRY_EVENT, "SENDER_DRY_EVENT" },
+#endif
+ { 0, NULL }
+};
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/26340
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ica6f01851fb94e31f4ef097494bb1b8a95597ba6
Gerrit-Change-Number: 26340
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211123/cc6ea3c7/attachment.htm>