libosmo-netif: include/osmocom/netif/sctp.h Source File

libosmo-netif 1.7.0.15-fe2d 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
12extern const struct value_string osmo_sctp_assoc_chg_strs[];
13static 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
16extern const struct value_string osmo_sctp_paddr_chg_strs[];
17static 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
20extern const struct value_string osmo_sctp_sn_type_strs[];
21static 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
24extern const struct value_string osmo_sctp_sn_error_strs[];
25static 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
28enum 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};
43extern const struct value_string osmo_sctp_op_error_strs[];
44static 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
47extern const struct value_string osmo_sctp_spinfo_state_strs[];
48static 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
51extern const struct value_string osmo_sctp_sstat_state_strs[];
52static inline const char *osmo_sctp_sstat_state_str(enum sctp_sstat_state val)
53{ return get_value_string(osmo_sctp_sstat_state_strs, val); }