libosmogb  1.6.0.113-b17c
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 
25  uint32_t ip_addr;
26  uint16_t udp_port;
27  uint8_t sig_weight;
28  uint8_t data_weight;
29 } __attribute__ ((packed));
30 
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 
44  NS_PDUT_RESET = 0x02,
46  NS_PDUT_BLOCK = 0x04,
51  NS_PDUT_ALIVE = 0x0a,
53  /* TS 48.016 Section 10.3.7, Table 10.3.7.1 */
54  SNS_PDUT_ACK = 0x0c,
55  SNS_PDUT_ADD = 0x0d,
60  SNS_PDUT_SIZE = 0x12,
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 */
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 {
95  /* TS 48.016 Section 10.3.2, Table 10.3.2.1 */
103 };
NS_CAUSE_INVAL_WEIGH
@ NS_CAUSE_INVAL_WEIGH
Definition: gsm_08_16.h:99
NS_IE_NSEI
@ NS_IE_NSEI
Definition: gsm_08_16.h:70
NS_IE_PDU
@ NS_IE_PDU
Definition: gsm_08_16.h:68
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_ip6_elem::data_weight
uint8_t data_weight
Definition: gsm_08_16.h:36
NS_CAUSE_PROTO_ERR_UNSPEC
@ NS_CAUSE_PROTO_ERR_UNSPEC
Definition: gsm_08_16.h:92
ns_pdu_type
ns_pdu_type
NS PDU Type (TS 08.16, Section 10.3.7, Table 14)
Definition: gsm_08_16.h:42
utils.h
NS_PDUT_BLOCK
@ NS_PDUT_BLOCK
Definition: gsm_08_16.h:46
NS_IE_VCI
@ NS_IE_VCI
Definition: gsm_08_16.h:67
NS_PDUT_ALIVE_ACK
@ NS_PDUT_ALIVE_ACK
Definition: gsm_08_16.h:52
NS_CAUSE_INVAL_NR_NS_VC
@ NS_CAUSE_INVAL_NR_NS_VC
Definition: gsm_08_16.h:98
gprs_ns_hdr::pdu_type
uint8_t pdu_type
NS PDU type.
Definition: gsm_08_16.h:18
SNS_PDUT_CHANGE_WEIGHT
@ SNS_PDUT_CHANGE_WEIGHT
Definition: gsm_08_16.h:56
gprs_ns_ie_ip6_elem::ip_addr
struct in6_addr ip_addr
Definition: gsm_08_16.h:33
NS_CAUSE_INVAL_NR_IPv6_EP
@ NS_CAUSE_INVAL_NR_IPv6_EP
Definition: gsm_08_16.h:97
NS_CAUSE_MISSING_ESSENT_IE
@ NS_CAUSE_MISSING_ESSENT_IE
Definition: gsm_08_16.h:94
gprs_ns_ie_ip6_elem::udp_port
uint16_t udp_port
Definition: gsm_08_16.h:34
NS_CAUSE_INVAL_NR_IPv4_EP
@ NS_CAUSE_INVAL_NR_IPv4_EP
Definition: gsm_08_16.h:96
NS_IE_MAX_NR_NSVC
@ NS_IE_MAX_NR_NSVC
Definition: gsm_08_16.h:74
NS_PDUT_ALIVE
@ NS_PDUT_ALIVE
Definition: gsm_08_16.h:51
NS_CAUSE_EQUIP_FAIL
@ NS_CAUSE_EQUIP_FAIL
Definition: gsm_08_16.h:86
gprs_ns_hdr::data
uint8_t data[0]
variable-length payload
Definition: gsm_08_16.h:19
gprs_ns_ie_ip4_elem
Section 10.3.2c List of IP4 Elements.
Definition: gsm_08_16.h:24
NS_PDUT_RESET
@ NS_PDUT_RESET
Definition: gsm_08_16.h:44
NS_CAUSE_OM_INTERVENTION
@ NS_CAUSE_OM_INTERVENTION
Definition: gsm_08_16.h:85
NS_CAUSE_TRANSIT_FAIL
@ NS_CAUSE_TRANSIT_FAIL
Definition: gsm_08_16.h:84
NS_CAUSE_BVCI_UNKNOWN
@ NS_CAUSE_BVCI_UNKNOWN
Definition: gsm_08_16.h:89
NS_CAUSE_UNKN_IP_ADDR
@ NS_CAUSE_UNKN_IP_ADDR
Definition: gsm_08_16.h:101
gprs_ns_hdr
Common header of GPRS NS.
Definition: gsm_08_16.h:17
NS_IE_BVCI
@ NS_IE_BVCI
Definition: gsm_08_16.h:69
NS_IE_CAUSE
@ NS_IE_CAUSE
Definition: gsm_08_16.h:66
SNS_PDUT_ADD
@ SNS_PDUT_ADD
Definition: gsm_08_16.h:55
NS_PDUT_RESET_ACK
@ NS_PDUT_RESET_ACK
Definition: gsm_08_16.h:45
NS_IE_IP_ADDR
@ NS_IE_IP_ADDR
Definition: gsm_08_16.h:78
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:398
NS_PDUT_BLOCK_ACK
@ NS_PDUT_BLOCK_ACK
Definition: gsm_08_16.h:47
gprs_ns_ie_ip4_elem::udp_port
uint16_t udp_port
Definition: gsm_08_16.h:26
NS_PDUT_UNITDATA
@ NS_PDUT_UNITDATA
Definition: gsm_08_16.h:43
NS_IE_RESET_FLAG
@ NS_IE_RESET_FLAG
Definition: gsm_08_16.h:77
__attribute__
enum ns_pdu_type __attribute__
SNS_PDUT_CONFIG
@ SNS_PDUT_CONFIG
Definition: gsm_08_16.h:57
value_string
NS_IE_IPv4_EP_NR
@ NS_IE_IPv4_EP_NR
Definition: gsm_08_16.h:75
ns_cause
ns_cause
NS Cause (TS 08.16, Section 10.3.2, Table 13)
Definition: gsm_08_16.h:83
SNS_PDUT_ACK
@ SNS_PDUT_ACK
Definition: gsm_08_16.h:54
gprs_ns_ie_ip4_elem::data_weight
uint8_t data_weight
Definition: gsm_08_16.h:28
NS_IE_TRANS_ID
@ NS_IE_TRANS_ID
Definition: gsm_08_16.h:79
NS_PDUT_UNBLOCK
@ NS_PDUT_UNBLOCK
Definition: gsm_08_16.h:48
NS_PDUT_STATUS
@ NS_PDUT_STATUS
Definition: gsm_08_16.h:50
NS_IE_IPv6_LIST
@ NS_IE_IPv6_LIST
Definition: gsm_08_16.h:73
gprs_ns_ie_ip6_elem
Section 10.3.2d List of IP6 Elements.
Definition: gsm_08_16.h:32
NS_CAUSE_UNKN_IP_EP
@ NS_CAUSE_UNKN_IP_EP
Definition: gsm_08_16.h:100
NS_CAUSE_UNKN_IP_TEST_FAILED
@ NS_CAUSE_UNKN_IP_TEST_FAILED
Definition: gsm_08_16.h:102
SNS_PDUT_CONFIG_ACK
@ SNS_PDUT_CONFIG_ACK
Definition: gsm_08_16.h:58
NS_CAUSE_NSVC_UNKNOWN
@ NS_CAUSE_NSVC_UNKNOWN
Definition: gsm_08_16.h:88
NS_CAUSE_SEM_INCORR_PDU
@ NS_CAUSE_SEM_INCORR_PDU
Definition: gsm_08_16.h:90
NS_CAUSE_NSVC_BLOCKED
@ NS_CAUSE_NSVC_BLOCKED
Definition: gsm_08_16.h:87
SNS_PDUT_DELETE
@ SNS_PDUT_DELETE
Definition: gsm_08_16.h:59
gprs_ns_ie_ip4_elem::sig_weight
uint8_t sig_weight
Definition: gsm_08_16.h:27
NS_PDUT_UNBLOCK_ACK
@ NS_PDUT_UNBLOCK_ACK
Definition: gsm_08_16.h:49
gprs_ns_ie_ip4_elem::ip_addr
uint32_t ip_addr
Definition: gsm_08_16.h:25
NS_IE_IPv6_EP_NR
@ NS_IE_IPv6_EP_NR
Definition: gsm_08_16.h:76
SNS_PDUT_SIZE_ACK
@ SNS_PDUT_SIZE_ACK
Definition: gsm_08_16.h:61
NS_CAUSE_PDU_INCOMP_PSTATE
@ NS_CAUSE_PDU_INCOMP_PSTATE
Definition: gsm_08_16.h:91
NS_IE_IPv4_LIST
@ NS_IE_IPv4_LIST
Definition: gsm_08_16.h:72
SNS_PDUT_SIZE
@ SNS_PDUT_SIZE
Definition: gsm_08_16.h:60
NS_CAUSE_INVAL_ESSENT_IE
@ NS_CAUSE_INVAL_ESSENT_IE
Definition: gsm_08_16.h:93