libosmo-sigtran  1.9.0.4-dc82
Osmocom SIGTRAN library
m3ua.h
Go to the documentation of this file.
1 /* RFC 4666 M3UA SCCP User Adaption */
2 
3 /* (C) 2017 by Harald Welte <laforge@gnumonks.org>
4  *
5  * All Rights Reserved
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #pragma once
22 #include <stdint.h>
23 
24 #define M3UA_VERSION 1
25 #define M3UA_PPID 3
26 #define M3UA_PORT 2905
27 
28 /* 3.1.2 Message Classes */
29 #define M3UA_MSGC_MGMT 0
30 #define M3UA_MSGC_XFER 1
31 #define M3UA_MSGC_SNM 2
32 #define M3UA_MSGC_ASPSM 3
33 #define M3UA_MSGC_ASPTM 4
34 #define M3UA_MSGC_RKM 9
35 
36 /* 3.1.3 Message Types */
37 #define M3UA_MGMT_ERR 0
38 #define M3UA_MGMT_NTFY 1
39 
40 #define M3UA_XFER_DATA 1
41 
42 #define M3UA_SNM_DUNA 1
43 #define M3UA_SNM_DAVA 2
44 #define M3UA_SNM_DAUD 3
45 #define M3UA_SNM_SCON 4
46 #define M3UA_SNM_DUPU 5
47 #define M3UA_SNM_DRST 6
48 
49 #define M3UA_ASPSM_UP 1
50 #define M3UA_ASPSM_DOWN 2
51 #define M3UA_ASPSM_BEAT 3
52 #define M3UA_ASPSM_UP_ACK 4
53 #define M3UA_ASPSM_DOWN_ACK 5
54 #define M3UA_ASPSM_BEAT_ACK 6
55 
56 #define M3UA_ASPTM_ACTIVE 1
57 #define M3UA_ASPTM_INACTIVE 2
58 #define M3UA_ASPTM_ACTIVE_ACK 3
59 #define M3UA_ASPTM_INACTIVE_ACK 4
60 
61 #define M3UA_RKM_REG_REQ 1
62 #define M3UA_RKM_REG_RSP 2
63 #define M3UA_RKM_DEREG_REQ 3
64 #define M3UA_RKM_DEREG_RSP 4
65 
66 #define M3UA_IEI_INFO_STRING 0x0004
67 #define M3UA_IEI_ROUTE_CTX 0x0006
68 #define M3UA_IEI_DIAG_INFO 0x0007
69 #define M3UA_IEI_HEARDBT_DATA 0x0009
70 #define M3UA_IEI_TRAF_MODE_TYP 0x000b
71 #define M3UA_IEI_ERR_CODE 0x000c
72 #define M3UA_IEI_STATUS 0x000d
73 #define M3UA_IEI_ASP_ID 0x0011
74 #define M3UA_IEI_AFFECTED_PC 0x0012
75 #define M3UA_IEI_CORR_ID 0x0013
76 
77 /* 3.2 M3UA specific parameters */
78 
79 #define M3UA_IEI_NET_APPEAR 0x0200
80 #define M3UA_IEI_USER_CAUSE 0x0204
81 #define M3UA_IEI_CONG_IND 0x0205
82 #define M3UA_IEI_CONC_DEST 0x0206
83 #define M3UA_IEI_ROUT_KEY 0x0207
84 #define M3UA_IEI_REG_RESULT 0x0208
85 #define M3UA_IEI_DEREG_RESULT 0x0209
86 #define M3UA_IEI_LOC_RKEY_ID 0x020a
87 #define M3UA_IEI_DEST_PC 0x020b
88 #define M3UA_IEI_SVC_IND 0x020c
89 #define M3UA_IEI_ORIG_PC 0x020e
90 #define M3UA_IEI_PROT_DATA 0x0210
91 #define M3UA_IEI_REG_STATUS 0x0212
92 #define M3UA_IEI_DEREG_STATUS 0x0213
93 
94 /* 3.3.1 Payload Data Message */
95 struct m3ua_data_hdr {
96  uint32_t opc; /* Originating Point Code */
97  uint32_t dpc; /* Destination Point Code */
98  uint8_t si; /* Service Indicator */
99  uint8_t ni; /* Network Indicator */
100  uint8_t mp; /* Message Priority */
101  uint8_t sls; /* Signalling Link Selection */
102 } __attribute__ ((packed));
103 
104 /* 3.8.2 Notify */
105 
106 #define M3UA_NOTIFY(type, info) ((info) << 16 | (type))
107 #define M3UA_NOTIFY_T_STATCHG 1
108 #define M3UA_NOTIFY_T_OTHER 2
109 
110 #define M3UA_NOTIFY_I_RESERVED 1
111 #define M3UA_NOTIFY_I_AS_INACT 2
112 #define M3UA_NOTIFY_I_AS_ACT 3
113 #define M3UA_NOTIFY_I_AS_PEND 4
114 
115 #define M3UA_NOTIFY_I_OT_INS_RES 1
116 #define M3UA_NOTIFY_I_OT_ALT_ASP_ACT 2
117 #define M3UA_NOTIFY_I_OT_ASP_FAILURE 3
118 
119 /* 3.6.2 Registration Status */
134 };
135 
143 };
144 
145 /* 3.8.1 Error */
148  /* not used in M3UA */
154  /* not used in M3UA */
156  /* not used in M3UA */
157  /* not used in M3UA */
158  /* not used in M3UA */
162  /* not used in M3UA */
169  /* not used in M3UA */
170  /* not used in M3UA */
173 };
174 
179 };
Definition: m3ua.h:167
Definition: m3ua.h:130
Definition: m3ua.h:168
Definition: m3ua.h:149
Definition: m3ua.h:147
Definition: m3ua.h:124
Definition: m3ua.h:177
Definition: m3ua.h:161
Definition: m3ua.h:122
Definition: m3ua.h:163
uint8_t ni
Definition: m3ua.h:99
Definition: m3ua.h:172
Definition: m3ua.h:176
Definition: m3ua.h:159
Definition: m3ua.h:165
enum m3ua_rkm_reg_status __attribute__
Definition: m3ua.h:160
Definition: m3ua.h:128
Definition: m3ua.h:139
Definition: m3ua.h:123
m3ua_error_code
Definition: m3ua.h:146
m3ua_rkm_reg_status
Definition: m3ua.h:120
Definition: m3ua.h:141
Definition: m3ua.h:166
Definition: m3ua.h:152
Definition: m3ua.h:126
Definition: m3ua.h:164
Definition: m3ua.h:131
Definition: m3ua.h:137
uint8_t mp
Definition: m3ua.h:100
uint32_t opc
Definition: m3ua.h:96
Definition: m3ua.h:95
Definition: m3ua.h:133
Definition: m3ua.h:140
Definition: m3ua.h:142
uint32_t dpc
Definition: m3ua.h:97
Definition: m3ua.h:129
Definition: m3ua.h:132
m3ua_rkm_dereg_satus
Definition: m3ua.h:136
Definition: m3ua.h:150
Definition: m3ua.h:138
Definition: m3ua.h:153
uint8_t sls
Definition: m3ua.h:101
Definition: m3ua.h:151
Definition: m3ua.h:121
m3ua_traffic_mode
Definition: m3ua.h:175
Definition: m3ua.h:171
Definition: m3ua.h:155
Definition: m3ua.h:127
Definition: m3ua.h:178
uint8_t si
Definition: m3ua.h:98
Definition: m3ua.h:125