blob: c3dbe69587d2c3a697fcec9aa98dba5a67ba7c4b [file] [log] [blame]
Sylvain Munaut12ba7782014-06-16 10:13:40 +02001#pragma once
Harald Welte8648e492012-06-17 13:12:51 +08002
3/* GPRS Networks Service (NS) messages on the Gb interface
4 * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05)
5 * 3GPP TS 48.016 version 6.5.0 Release 6 / ETSI TS 148 016 V6.5.0 (2005-11) */
6
7#include <stdint.h>
8
9/*! \addtogroup libgb
10 * @{
11 */
12
13/*! \file gprs_ns.h */
14
Neels Hofmeyr87e45502017-06-20 00:17:59 +020015/*! Common header of GPRS NS */
Harald Welte8648e492012-06-17 13:12:51 +080016struct gprs_ns_hdr {
17 uint8_t pdu_type; /*!< NS PDU type */
18 uint8_t data[0]; /*!< variable-length payload */
19} __attribute__((packed));
20
Max584f4b62017-05-04 11:59:52 +020021extern const struct value_string gprs_ns_pdu_strings[];
22
Neels Hofmeyr87e45502017-06-20 00:17:59 +020023/*! NS PDU Type (TS 08.16, Section 10.3.7, Table 14) */
Harald Welte8648e492012-06-17 13:12:51 +080024enum ns_pdu_type {
25 NS_PDUT_UNITDATA = 0x00,
26 NS_PDUT_RESET = 0x02,
27 NS_PDUT_RESET_ACK = 0x03,
28 NS_PDUT_BLOCK = 0x04,
29 NS_PDUT_BLOCK_ACK = 0x05,
30 NS_PDUT_UNBLOCK = 0x06,
31 NS_PDUT_UNBLOCK_ACK = 0x07,
32 NS_PDUT_STATUS = 0x08,
33 NS_PDUT_ALIVE = 0x0a,
34 NS_PDUT_ALIVE_ACK = 0x0b,
35 /* TS 48.016 Section 10.3.7, Table 10.3.7.1 */
36 SNS_PDUT_ACK = 0x0c,
37 SNS_PDUT_ADD = 0x0d,
38 SNS_PDUT_CHANGE_WEIGHT = 0x0e,
39 SNS_PDUT_CONFIG = 0x0f,
40 SNS_PDUT_CONFIG_ACK = 0x10,
41 SNS_PDUT_DELETE = 0x11,
42 SNS_PDUT_SIZE = 0x12,
43 SNS_PDUT_SIZE_ACK = 0x13,
44};
45
Neels Hofmeyr87e45502017-06-20 00:17:59 +020046/*! NS Control IE (TS 08.16, Section 10.3, Table 12) */
Harald Welte8648e492012-06-17 13:12:51 +080047enum ns_ctrl_ie {
48 NS_IE_CAUSE = 0x00,
49 NS_IE_VCI = 0x01,
50 NS_IE_PDU = 0x02,
51 NS_IE_BVCI = 0x03,
52 NS_IE_NSEI = 0x04,
53 /* TS 48.016 Section 10.3, Table 10.3.1 */
54 NS_IE_IPv4_LIST = 0x05,
55 NS_IE_IPv6_LIST = 0x06,
56 NS_IE_MAX_NR_NSVC = 0x07,
57 NS_IE_IPv4_EP_NR = 0x08,
58 NS_IE_IPv6_EP_NR = 0x09,
59 NS_IE_RESET_FLAG = 0x0a,
60 NS_IE_IP_ADDR = 0x0b,
61};
62
Neels Hofmeyr87e45502017-06-20 00:17:59 +020063/*! NS Cause (TS 08.16, Section 10.3.2, Table 13) */
Harald Welte8648e492012-06-17 13:12:51 +080064enum ns_cause {
65 NS_CAUSE_TRANSIT_FAIL = 0x00,
66 NS_CAUSE_OM_INTERVENTION = 0x01,
67 NS_CAUSE_EQUIP_FAIL = 0x02,
68 NS_CAUSE_NSVC_BLOCKED = 0x03,
69 NS_CAUSE_NSVC_UNKNOWN = 0x04,
70 NS_CAUSE_BVCI_UNKNOWN = 0x05,
71 NS_CAUSE_SEM_INCORR_PDU = 0x08,
72 NS_CAUSE_PDU_INCOMP_PSTATE = 0x0a,
73 NS_CAUSE_PROTO_ERR_UNSPEC = 0x0b,
74 NS_CAUSE_INVAL_ESSENT_IE = 0x0c,
75 NS_CAUSE_MISSING_ESSENT_IE = 0x0d,
76 /* TS 48.016 Section 10.3.2, Table 10.3.2.1 */
77 NS_CAUSE_INVAL_NR_IPv4_EP = 0x0e,
78 NS_CAUSE_INVAL_NR_IPv6_EP = 0x0f,
79 NS_CAUSE_INVAL_NR_NS_VC = 0x10,
80 NS_CAUSE_INVAL_WEIGH = 0x11,
81 NS_CAUSE_UNKN_IP_EP = 0x12,
82 NS_CAUSE_UNKN_IP_ADDR = 0x13,
83 NS_CAUSE_UNKN_IP_TEST_FAILED = 0x14,
84};