libosmo-netif 1.7.0.10-3a9e Osmocom network interface library

sctp.h
1#pragma once
2
3#include <osmocom/core/utils.h>
4#include <netinet/sctp.h>
5
6/* Relevant SCTP RFCs:
7 * rfc9260 (obsoletes rfc4960): SCTP protocol
8 * rfc5061: SCTP Dynamic Address Reconfiguration
9 * rfc6458: SCTP Sockets API Extensions
10 */
11
12 extern const struct value_string osmo_sctp_assoc_chg_strs[];
13 static inline const char *osmo_sctp_assoc_chg_str(enum sctp_sac_state val)
14{ return get_value_string(osmo_sctp_assoc_chg_strs, val); }
15
16 extern const struct value_string osmo_sctp_paddr_chg_strs[];
17 static inline const char *osmo_sctp_paddr_chg_str(enum sctp_spc_state val)
18{ return get_value_string(osmo_sctp_paddr_chg_strs, val); }
19
20 extern const struct value_string osmo_sctp_sn_type_strs[];
21 static inline const char *osmo_sctp_sn_type_str(enum sctp_sn_type val)
22{ return get_value_string(osmo_sctp_sn_type_strs, val); }
23
24 extern const struct value_string osmo_sctp_sn_error_strs[];
25 static inline const char *osmo_sctp_sn_error_str(enum sctp_sn_error val)
26{ return get_value_string(osmo_sctp_sn_error_strs, val); }
27
28 enum osmo_sctp_op_error {
29 OSMO_SCTP_OP_ERR_INVALID_STREAM_ID = 1,
30 OSMO_SCTP_OP_ERR_MISS_MAND_PARAM = 2,
31 OSMO_SCTP_OP_ERR_STALE_COOKIE = 3,
32 OSMO_SCTP_OP_ERR_NO_RESOURCES = 4,
33 OSMO_SCTP_OP_ERR_UNRESOLV_ADDR = 5,
34 OSMO_SCTP_OP_ERR_UNKN_CHUNK_TYPE = 6,
35 OSMO_SCTP_OP_ERR_INVALID_MAND_PARAM = 7,
36 OSMO_SCTP_OP_ERR_UNKN_PARAM = 8,
37 OSMO_SCTP_OP_ERR_NO_USER_DATA = 9,
38 OSMO_SCTP_OP_ERR_COOKIE_RX_WHILE_SHUTDOWN = 10,
39 OSMO_SCTP_OP_ERR_RESTART_ASSC_NEW_ADDR = 11,
40 OSMO_SCTP_OP_ERR_UNER_INITED_ABORT = 12,
41 OSMO_SCTP_OP_ERR_PROTO_VERSION = 13,
42};
43 extern const struct value_string osmo_sctp_op_error_strs[];
44 static inline const char *osmo_sctp_op_error_str(enum osmo_sctp_op_error val)
45{ return get_value_string(osmo_sctp_op_error_strs, val); }
46
47 extern const struct value_string osmo_sctp_spinfo_state_strs[];
48 static inline const char *osmo_sctp_spinfo_state_str(enum sctp_spinfo_state val)
49{ return get_value_string(osmo_sctp_spinfo_state_strs, val); }
50
51 extern const struct value_string osmo_sctp_sstat_state_strs[];
52 static inline const char *osmo_sctp_sstat_state_str(enum sctp_sstat_state val)
53{ return get_value_string(osmo_sctp_sstat_state_strs, val); }