libosmogb 1.13.1.1-afb4 Osmocom Gb library

gsm_08_16.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <stdint.h>
9#include <arpa/inet.h>
10#include <osmocom/core/utils.h>
11
17 struct gprs_ns_hdr {
18 uint8_t pdu_type;
19 uint8_t data[0];
20} __attribute__((packed));
21
22
24 struct gprs_ns_ie_ip4_elem {
25 uint32_t ip_addr;
26 uint16_t udp_port;
27 uint8_t sig_weight;
28 uint8_t data_weight;
29} __attribute__ ((packed));
30
32 struct gprs_ns_ie_ip6_elem {
33 struct in6_addr ip_addr;
34 uint16_t udp_port;
35 uint8_t sig_weight;
36 uint8_t data_weight;
37} __attribute__ ((packed));
38
39 extern const struct value_string gprs_ns_pdu_strings[];
40
42 enum ns_pdu_type {
43 NS_PDUT_UNITDATA = 0x00,
44 NS_PDUT_RESET = 0x02,
45 NS_PDUT_RESET_ACK = 0x03,
46 NS_PDUT_BLOCK = 0x04,
47 NS_PDUT_BLOCK_ACK = 0x05,
48 NS_PDUT_UNBLOCK = 0x06,
49 NS_PDUT_UNBLOCK_ACK = 0x07,
50 NS_PDUT_STATUS = 0x08,
51 NS_PDUT_ALIVE = 0x0a,
52 NS_PDUT_ALIVE_ACK = 0x0b,
53 /* TS 48.016 Section 10.3.7, Table 10.3.7.1 */
54 SNS_PDUT_ACK = 0x0c,
55 SNS_PDUT_ADD = 0x0d,
56 SNS_PDUT_CHANGE_WEIGHT = 0x0e,
57 SNS_PDUT_CONFIG = 0x0f,
58 SNS_PDUT_CONFIG_ACK = 0x10,
59 SNS_PDUT_DELETE = 0x11,
60 SNS_PDUT_SIZE = 0x12,
61 SNS_PDUT_SIZE_ACK = 0x13,
62};
63
65 enum ns_ctrl_ie {
66 NS_IE_CAUSE = 0x00,
67 NS_IE_VCI = 0x01,
68 NS_IE_PDU = 0x02,
69 NS_IE_BVCI = 0x03,
70 NS_IE_NSEI = 0x04,
71 /* TS 48.016 Section 10.3, Table 10.3.1 */
72 NS_IE_IPv4_LIST = 0x05,
73 NS_IE_IPv6_LIST = 0x06,
74 NS_IE_MAX_NR_NSVC = 0x07,
75 NS_IE_IPv4_EP_NR = 0x08,
76 NS_IE_IPv6_EP_NR = 0x09,
77 NS_IE_RESET_FLAG = 0x0a,
78 NS_IE_IP_ADDR = 0x0b,
79 NS_IE_TRANS_ID = 0xff, /* osmocom. Spec has this IE but without IEI! */
80};
81
83 enum ns_cause {
84 NS_CAUSE_TRANSIT_FAIL = 0x00,
85 NS_CAUSE_OM_INTERVENTION = 0x01,
86 NS_CAUSE_EQUIP_FAIL = 0x02,
87 NS_CAUSE_NSVC_BLOCKED = 0x03,
88 NS_CAUSE_NSVC_UNKNOWN = 0x04,
89 NS_CAUSE_BVCI_UNKNOWN = 0x05,
90 NS_CAUSE_SEM_INCORR_PDU = 0x08,
91 NS_CAUSE_PDU_INCOMP_PSTATE = 0x0a,
92 NS_CAUSE_PROTO_ERR_UNSPEC = 0x0b,
93 NS_CAUSE_INVAL_ESSENT_IE = 0x0c,
94 NS_CAUSE_MISSING_ESSENT_IE = 0x0d,
95 /* TS 48.016 Section 10.3.2, Table 10.3.2.1 */
96 NS_CAUSE_INVAL_NR_IPv4_EP = 0x0e,
97 NS_CAUSE_INVAL_NR_IPv6_EP = 0x0f,
98 NS_CAUSE_INVAL_NR_NS_VC = 0x10,
99 NS_CAUSE_INVAL_WEIGH = 0x11,
100 NS_CAUSE_UNKN_IP_EP = 0x12,
101 NS_CAUSE_UNKN_IP_ADDR = 0x13,
102 NS_CAUSE_UNKN_IP_TEST_FAILED = 0x14,
103};
ns_cause
ns_cause
NS Cause (TS 08.16, Section 10.3.2, Table 13)
Definition: gsm_08_16.h:83
ns_pdu_type
ns_pdu_type
NS PDU Type (TS 08.16, Section 10.3.7, Table 14)
Definition: gsm_08_16.h:42
gprs_ns_ie_ip6_elem::sig_weight
uint8_t sig_weight
Definition: gsm_08_16.h:35
gprs_ns_pdu_strings
const struct value_string gprs_ns_pdu_strings[]
Definition: gprs_ns.c:397
gprs_ns_ie_ip6_elem::ip_addr
struct in6_addr ip_addr
Definition: gsm_08_16.h:33
gprs_ns_ie_ip6_elem::udp_port
uint16_t udp_port
Definition: gsm_08_16.h:34
ns_ctrl_ie
ns_ctrl_ie
NS Control IE (TS 08.16, Section 10.3, Table 12)
Definition: gsm_08_16.h:65
gprs_ns_ie_ip4_elem::ip_addr
uint32_t ip_addr
Definition: gsm_08_16.h:25
gprs_ns_ie_ip6_elem::data_weight
uint8_t data_weight
Definition: gsm_08_16.h:36
__attribute__
enum ns_pdu_type __attribute__
gprs_ns_ie_ip4_elem::sig_weight
uint8_t sig_weight
Definition: gsm_08_16.h:27
gprs_ns_hdr::pdu_type
uint8_t pdu_type
NS PDU type.
Definition: gsm_08_16.h:18
gprs_ns_ie_ip4_elem::udp_port
uint16_t udp_port
Definition: gsm_08_16.h:26
gprs_ns_hdr::data
uint8_t data[0]
variable-length payload
Definition: gsm_08_16.h:19
gprs_ns_ie_ip4_elem::data_weight
uint8_t data_weight
Definition: gsm_08_16.h:28
NS_CAUSE_INVAL_NR_NS_VC
@ NS_CAUSE_INVAL_NR_NS_VC
Definition: gsm_08_16.h:98
NS_CAUSE_BVCI_UNKNOWN
@ NS_CAUSE_BVCI_UNKNOWN
Definition: gsm_08_16.h:89
NS_CAUSE_INVAL_ESSENT_IE
@ NS_CAUSE_INVAL_ESSENT_IE
Definition: gsm_08_16.h:93
NS_CAUSE_UNKN_IP_TEST_FAILED
@ NS_CAUSE_UNKN_IP_TEST_FAILED
Definition: gsm_08_16.h:102
NS_CAUSE_PROTO_ERR_UNSPEC
@ NS_CAUSE_PROTO_ERR_UNSPEC
Definition: gsm_08_16.h:92
NS_CAUSE_INVAL_NR_IPv4_EP
@ NS_CAUSE_INVAL_NR_IPv4_EP
Definition: gsm_08_16.h:96
NS_CAUSE_PDU_INCOMP_PSTATE
@ NS_CAUSE_PDU_INCOMP_PSTATE
Definition: gsm_08_16.h:91
NS_CAUSE_SEM_INCORR_PDU
@ NS_CAUSE_SEM_INCORR_PDU
Definition: gsm_08_16.h:90
NS_CAUSE_UNKN_IP_ADDR
@ NS_CAUSE_UNKN_IP_ADDR
Definition: gsm_08_16.h:101
NS_CAUSE_INVAL_NR_IPv6_EP
@ NS_CAUSE_INVAL_NR_IPv6_EP
Definition: gsm_08_16.h:97
NS_CAUSE_EQUIP_FAIL
@ NS_CAUSE_EQUIP_FAIL
Definition: gsm_08_16.h:86
NS_CAUSE_INVAL_WEIGH
@ NS_CAUSE_INVAL_WEIGH
Definition: gsm_08_16.h:99
NS_CAUSE_MISSING_ESSENT_IE
@ NS_CAUSE_MISSING_ESSENT_IE
Definition: gsm_08_16.h:94
NS_CAUSE_OM_INTERVENTION
@ NS_CAUSE_OM_INTERVENTION
Definition: gsm_08_16.h:85
NS_CAUSE_NSVC_BLOCKED
@ NS_CAUSE_NSVC_BLOCKED
Definition: gsm_08_16.h:87
NS_CAUSE_TRANSIT_FAIL
@ NS_CAUSE_TRANSIT_FAIL
Definition: gsm_08_16.h:84
NS_CAUSE_UNKN_IP_EP
@ NS_CAUSE_UNKN_IP_EP
Definition: gsm_08_16.h:100
NS_CAUSE_NSVC_UNKNOWN
@ NS_CAUSE_NSVC_UNKNOWN
Definition: gsm_08_16.h:88
NS_PDUT_BLOCK_ACK
@ NS_PDUT_BLOCK_ACK
Definition: gsm_08_16.h:47
NS_PDUT_RESET_ACK
@ NS_PDUT_RESET_ACK
Definition: gsm_08_16.h:45
NS_PDUT_UNBLOCK_ACK
@ NS_PDUT_UNBLOCK_ACK
Definition: gsm_08_16.h:49
NS_PDUT_RESET
@ NS_PDUT_RESET
Definition: gsm_08_16.h:44
NS_PDUT_UNBLOCK
@ NS_PDUT_UNBLOCK
Definition: gsm_08_16.h:48
SNS_PDUT_CHANGE_WEIGHT
@ SNS_PDUT_CHANGE_WEIGHT
Definition: gsm_08_16.h:56
SNS_PDUT_CONFIG
@ SNS_PDUT_CONFIG
Definition: gsm_08_16.h:57
SNS_PDUT_ADD
@ SNS_PDUT_ADD
Definition: gsm_08_16.h:55
NS_PDUT_STATUS
@ NS_PDUT_STATUS
Definition: gsm_08_16.h:50
NS_PDUT_ALIVE_ACK
@ NS_PDUT_ALIVE_ACK
Definition: gsm_08_16.h:52
SNS_PDUT_CONFIG_ACK
@ SNS_PDUT_CONFIG_ACK
Definition: gsm_08_16.h:58
SNS_PDUT_SIZE
@ SNS_PDUT_SIZE
Definition: gsm_08_16.h:60
NS_PDUT_UNITDATA
@ NS_PDUT_UNITDATA
Definition: gsm_08_16.h:43
SNS_PDUT_SIZE_ACK
@ SNS_PDUT_SIZE_ACK
Definition: gsm_08_16.h:61
NS_PDUT_BLOCK
@ NS_PDUT_BLOCK
Definition: gsm_08_16.h:46
SNS_PDUT_ACK
@ SNS_PDUT_ACK
Definition: gsm_08_16.h:54
SNS_PDUT_DELETE
@ SNS_PDUT_DELETE
Definition: gsm_08_16.h:59
NS_PDUT_ALIVE
@ NS_PDUT_ALIVE
Definition: gsm_08_16.h:51
NS_IE_IPv6_EP_NR
@ NS_IE_IPv6_EP_NR
Definition: gsm_08_16.h:76
NS_IE_IPv4_LIST
@ NS_IE_IPv4_LIST
Definition: gsm_08_16.h:72
NS_IE_VCI
@ NS_IE_VCI
Definition: gsm_08_16.h:67
NS_IE_IPv4_EP_NR
@ NS_IE_IPv4_EP_NR
Definition: gsm_08_16.h:75
NS_IE_IP_ADDR
@ NS_IE_IP_ADDR
Definition: gsm_08_16.h:78
NS_IE_NSEI
@ NS_IE_NSEI
Definition: gsm_08_16.h:70
NS_IE_MAX_NR_NSVC
@ NS_IE_MAX_NR_NSVC
Definition: gsm_08_16.h:74
NS_IE_IPv6_LIST
@ NS_IE_IPv6_LIST
Definition: gsm_08_16.h:73
NS_IE_BVCI
@ NS_IE_BVCI
Definition: gsm_08_16.h:69
NS_IE_CAUSE
@ NS_IE_CAUSE
Definition: gsm_08_16.h:66
NS_IE_TRANS_ID
@ NS_IE_TRANS_ID
Definition: gsm_08_16.h:79
NS_IE_PDU
@ NS_IE_PDU
Definition: gsm_08_16.h:68
NS_IE_RESET_FLAG
@ NS_IE_RESET_FLAG
Definition: gsm_08_16.h:77
gprs_ns_hdr
Common header of GPRS NS.
Definition: gsm_08_16.h:17
gprs_ns_ie_ip4_elem
Section 10.3.2c List of IP4 Elements.
Definition: gsm_08_16.h:24
gprs_ns_ie_ip6_elem
Section 10.3.2d List of IP6 Elements.
Definition: gsm_08_16.h:32
value_string
utils.h