Loading...
Searching...
No Matches
gsm_08_16.h
Go to the documentation of this file.
#pragma once
#include <stdint.h>
#include <arpa/inet.h>
#include <osmocom/core/utils.h>
struct gprs_ns_hdr {
uint8_t pdu_type;
uint8_t data[0];
} __attribute__((packed));
struct gprs_ns_ie_ip4_elem {
uint32_t ip_addr;
uint16_t udp_port;
uint8_t sig_weight;
uint8_t data_weight;
} __attribute__ ((packed));
struct gprs_ns_ie_ip6_elem {
struct in6_addr ip_addr;
uint16_t udp_port;
uint8_t sig_weight;
uint8_t data_weight;
} __attribute__ ((packed));
extern const struct value_string gprs_ns_pdu_strings[];
enum ns_pdu_type {
NS_PDUT_UNITDATA = 0x00,
NS_PDUT_RESET = 0x02,
NS_PDUT_RESET_ACK = 0x03,
NS_PDUT_BLOCK = 0x04,
NS_PDUT_BLOCK_ACK = 0x05,
NS_PDUT_UNBLOCK = 0x06,
NS_PDUT_UNBLOCK_ACK = 0x07,
NS_PDUT_STATUS = 0x08,
NS_PDUT_ALIVE = 0x0a,
NS_PDUT_ALIVE_ACK = 0x0b,
/* TS 48.016 Section 10.3.7, Table 10.3.7.1 */
SNS_PDUT_ACK = 0x0c,
SNS_PDUT_ADD = 0x0d,
SNS_PDUT_CHANGE_WEIGHT = 0x0e,
SNS_PDUT_CONFIG = 0x0f,
SNS_PDUT_CONFIG_ACK = 0x10,
SNS_PDUT_DELETE = 0x11,
SNS_PDUT_SIZE = 0x12,
SNS_PDUT_SIZE_ACK = 0x13,
};
enum ns_ctrl_ie {
NS_IE_CAUSE = 0x00,
NS_IE_VCI = 0x01,
NS_IE_PDU = 0x02,
NS_IE_BVCI = 0x03,
NS_IE_NSEI = 0x04,
/* TS 48.016 Section 10.3, Table 10.3.1 */
NS_IE_IPv4_LIST = 0x05,
NS_IE_IPv6_LIST = 0x06,
NS_IE_MAX_NR_NSVC = 0x07,
NS_IE_IPv4_EP_NR = 0x08,
NS_IE_IPv6_EP_NR = 0x09,
NS_IE_RESET_FLAG = 0x0a,
NS_IE_IP_ADDR = 0x0b,
NS_IE_TRANS_ID = 0xff, /* osmocom. Spec has this IE but without IEI! */
};
enum ns_cause {
NS_CAUSE_TRANSIT_FAIL = 0x00,
NS_CAUSE_OM_INTERVENTION = 0x01,
NS_CAUSE_EQUIP_FAIL = 0x02,
NS_CAUSE_NSVC_BLOCKED = 0x03,
NS_CAUSE_NSVC_UNKNOWN = 0x04,
NS_CAUSE_BVCI_UNKNOWN = 0x05,
NS_CAUSE_SEM_INCORR_PDU = 0x08,
NS_CAUSE_PDU_INCOMP_PSTATE = 0x0a,
NS_CAUSE_PROTO_ERR_UNSPEC = 0x0b,
NS_CAUSE_INVAL_ESSENT_IE = 0x0c,
NS_CAUSE_MISSING_ESSENT_IE = 0x0d,
/* TS 48.016 Section 10.3.2, Table 10.3.2.1 */
NS_CAUSE_INVAL_NR_IPv4_EP = 0x0e,
NS_CAUSE_INVAL_NR_IPv6_EP = 0x0f,
NS_CAUSE_INVAL_NR_NS_VC = 0x10,
NS_CAUSE_INVAL_WEIGH = 0x11,
NS_CAUSE_UNKN_IP_EP = 0x12,
NS_CAUSE_UNKN_IP_ADDR = 0x13,
NS_CAUSE_UNKN_IP_TEST_FAILED = 0x14,
};
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
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
__attribute__
enum ns_pdu_type __attribute__
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