Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 1 | module DIAMETER_ts29_273_Templates { |
| 2 | |
| 3 | /* (C) 2023 by sysmocom s.f.m.c. GmbH <info@sysmocom.de |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * Released under the terms of GNU General Public License, Version 2 or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 10 | * |
| 11 | * Templates for AVPs and messages for TS 29.273 |
| 12 | */ |
| 13 | |
| 14 | import from General_Types all; |
| 15 | import from DIAMETER_Types all; |
| 16 | import from DIAMETER_Templates all; |
Pau Espin Pedrol | 7399673 | 2023-10-23 18:16:21 +0200 | [diff] [blame] | 17 | import from DIAMETER_rfc5447_Templates all; |
Pau Espin Pedrol | 5154e35 | 2024-03-05 13:23:40 +0100 | [diff] [blame] | 18 | import from DIAMETER_ts29_272_Templates all; |
Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 19 | import from Osmocom_Types all; |
| 20 | import from Misc_Helpers all; |
| 21 | |
| 22 | /* 3GPP TS 29.273 Section 8.2 */ |
| 23 | const uint32_t c_DIAMETER_3GPP_SWx_AID := 16777265; |
| 24 | /* 3GPP TS 29.273 Section 9 */ |
| 25 | const uint32_t c_DIAMETER_3GPP_S6b_AID := 16777272; |
| 26 | |
Pau Espin Pedrol | 7399673 | 2023-10-23 18:16:21 +0200 | [diff] [blame] | 27 | /* 5.2.3.3 MIP6-Feature-Vector bits */ |
| 28 | const uint64_t DIA_TS29_373_MIP6_Feature_Vector_PMIP6_SUPPORTED := hex2int('0000010000000000'H); |
| 29 | const uint64_t DIA_TS29_373_MIP6_Feature_Vector_ASSIGN_LOCAL_IP := hex2int('0000080000000000'H); |
| 30 | const uint64_t DIA_TS29_373_MIP6_Feature_Vector_MIP4_SUPPORTED := hex2int('0000100000000000'H); |
| 31 | const uint64_t DIA_TS29_373_MIP6_Feature_Vector_OPTIMIZED_IDLE_MODE_MOBILITY := hex2int('0000200000000000'H); |
| 32 | const uint64_t DIA_TS29_373_MIP6_Feature_Vector_GTPv2_SUPPORTED := hex2int('0000400000000000'H); |
| 33 | |
Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 34 | /******************************* |
| 35 | * SWx 3GPP TS 29.273 section 8 |
| 36 | *******************************/ |
| 37 | |
Pau Espin Pedrol | 9b2ebc0 | 2024-03-05 13:25:19 +0100 | [diff] [blame] | 38 | /* TS 29.273 8.2.3.1 Non-3GPP-User-Data */ |
| 39 | template (value) GenericAVP ts_AVP_3GPP_Non_3GPP_User_Data(template (value) AAA_3GPP_PDN_Type pdn_type, |
| 40 | template (value) charstring apn, |
| 41 | template (value) uint32_t ambr_max_req_ul := 1000000000, |
| 42 | template (value) uint32_t ambr_max_req_dl := 1000000000) := { |
| 43 | avp := { |
| 44 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Non_3GPP_User_Data), |
| 45 | avp_data := { |
| 46 | avp_AAA_3GPP_Non_3GPP_User_Data := { |
| 47 | ts_AVP_3GPP_Non_3GPP_IP_Access(NON_3GPP_SUBSCRIPTION_ALLOWED), |
| 48 | ts_AVP_3GPP_Non_3GPP_IP_Access_APN(NON_3GPP_APNS_ENABLE), |
| 49 | ts_AVP_3GPP_AMBR(ambr_max_req_ul, ambr_max_req_dl), |
| 50 | ts_AVP_3GPP_ContextId(1), |
| 51 | ts_AVP_3GPP_ApnConfig(1, pdn_type, apn) |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /* TS 29.273 8.2.3.3 Non-3GPP-IP-Access */ |
| 58 | template (value) GenericAVP ts_AVP_3GPP_Non_3GPP_IP_Access(template (value) AAA_3GPP_Non_3GPP_IP_Access val := NON_3GPP_SUBSCRIPTION_ALLOWED) := { |
| 59 | avp := { |
| 60 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Non_3GPP_IP_Access), |
| 61 | avp_data := { |
| 62 | avp_AAA_3GPP_Non_3GPP_IP_Access := val |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | |
| 68 | /* TS 29.273 8.2.3.4 Non-3GPP-IP-Access-APN */ |
| 69 | template (value) GenericAVP ts_AVP_3GPP_Non_3GPP_IP_Access_APN(template (value) AAA_3GPP_Non_3GPP_IP_Access_APN val := NON_3GPP_APNS_ENABLE) := { |
| 70 | avp := { |
| 71 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Non_3GPP_IP_Access_APN), |
| 72 | avp_data := { |
| 73 | avp_AAA_3GPP_Non_3GPP_IP_Access_APN := val |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | /* TS 29.273 8.2.3.7 APN-Configuration: The APN-Configuration AVP is of type Grouped AVP and is defined in 3GPP TS 29.272 */ |
| 79 | /* TS 29.273 5.2.3.8 AMBR: Please refer to 3GPP TS 29.272 [29] for the encoding of this AVP. */ |
| 80 | |
Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 81 | /* SIP-Auth-Data-Item , 3GPP TS 29.273 8.2.3.9 */ |
| 82 | template (present) GenericAVP tr_AVP_3GPP_SIPAuthDataItem(template (present) uint32_t num := ?) := { |
| 83 | avp := { |
| 84 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Auth_Data_Item), |
| 85 | avp_data := { |
| 86 | avp_CxDx_3GPP_SIP_Auth_Data_Item := superset( |
| 87 | //tr_AVP_3GPP_SIPItemNumber(num), /* Optional */ |
| 88 | tr_AVP_3GPP_SIPAuthScheme(?)//, /* Optional */ |
| 89 | //tr_AVP_3GPP_SIPAuthenticate(?), /* Optional */ |
| 90 | //tr_AVP_3GPP_SIPAuthorization(?), /* Optional */ |
| 91 | //tr_AVP_3GPP_SIPAuthContext(?), /* Optional */ |
| 92 | //tr_AVP_3GPP_ConfidentialityKey(?), /* Optional */ |
| 93 | //tr_AVP_3GPP_IntegrityKey(?) /* Optional */ |
| 94 | /* TODO: |
| 95 | [ SIP-Digest-Authenticate ] |
| 96 | [ Framed-IP-Address ] |
| 97 | [ Framed-IPv6-Prefix ] |
| 98 | [ Framed-Interface-Id ] |
| 99 | [ Line-Identifier ] |
| 100 | *[AVP] |
| 101 | */ |
| 102 | ) |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | template (value) GenericAVP ts_AVP_3GPP_SIPAuthDataItem(uint32_t num, OCT16 rand, OCT16 ik, OCT16 ck, OCT16 autn, OCT14 auts) := { |
| 107 | avp := { |
| 108 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Auth_Data_Item), |
| 109 | avp_data := { |
| 110 | avp_CxDx_3GPP_SIP_Auth_Data_Item := { |
| 111 | ts_AVP_3GPP_SIPItemNumber(num), |
| 112 | ts_AVP_3GPP_SIPAuthScheme(char2oct("Digest-AKAv1-MD5")), |
| 113 | ts_AVP_3GPP_SIPAuthenticate(rand & autn), |
| 114 | ts_AVP_3GPP_SIPAuthorization(rand & auts), |
| 115 | ts_AVP_3GPP_SIPAuthContext(char2oct("foobar")), |
| 116 | ts_AVP_3GPP_ConfidentialityKey(ck), |
| 117 | ts_AVP_3GPP_IntegrityKey(ik) |
| 118 | /* TODO: |
| 119 | [ SIP-Digest-Authenticate ] |
| 120 | [ Framed-IP-Address ] |
| 121 | [ Framed-IPv6-Prefix ] |
| 122 | [ Framed-Interface-Id ] |
| 123 | [ Line-Identifier ] |
| 124 | *[AVP] |
| 125 | */ |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | /* Multimedia-Auth-Request, 3GPP TS 29.273 8.2.2.1 Authentication Procedure */ |
| 132 | template (present) PDU_DIAMETER |
| 133 | tr_DIA_SWx_MAR(template (present) hexstring imsi := ?, |
| 134 | template (present) octetstring sess_id := ?, |
| 135 | template (present) charstring orig_host := ?, |
| 136 | template (present) charstring orig_realm := ?, |
| 137 | template (present) charstring dest_realm := ?, |
| 138 | template (present) UINT32 hbh_id := ?, |
| 139 | template (present) UINT32 ete_id := ?) := |
| 140 | tr_DIAMETER(flags := '1???????'B, |
| 141 | cmd_code := Multimedia_Auth, |
| 142 | app_id := int2oct(c_DIAMETER_3GPP_SWx_AID, 4), |
| 143 | hbh_id := hbh_id, ete_id := ete_id, |
| 144 | avps := superset( |
| 145 | tr_AVP_SessionId(sess_id), |
| 146 | tr_AVP_VendorSpecAppId(?, ?), |
| 147 | tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 148 | tr_AVP_OriginHost(orig_host), |
| 149 | tr_AVP_OriginRealm(orig_realm), |
| 150 | tr_AVP_DestinationRealm(dest_realm), |
| 151 | tr_AVP_UserNameImsi(imsi), |
| 152 | tr_AVP_3GPP_SIPAuthDataItem(?), |
| 153 | tr_AVP_3GPP_SIPNumAuthDataItems(?) |
| 154 | )); |
| 155 | |
| 156 | /* Multimedia-Auth-Answer, 3GPP TS 29.273 8.2.2.1 Authentication Procedure */ |
| 157 | template (value) PDU_DIAMETER |
| 158 | ts_DIA_SWx_MAA(template (value) hexstring imsi, |
| 159 | template (value) GenericAVP sip_auth_data_item, |
| 160 | template (value) uint32_t vendor_app_id := c_DIAMETER_3GPP_SWx_AID, |
| 161 | template (value) octetstring sess_id := c_def_sess_id, |
| 162 | template (value) charstring orig_host := "hss.localdomain", |
| 163 | template (value) charstring orig_realm := "localdomain", |
| 164 | template (value) UINT32 hbh_id := '00000000'O, |
| 165 | template (value) UINT32 ete_id := '00000000'O) := |
| 166 | ts_DIAMETER(flags := '01000000'B, |
| 167 | cmd_code := Multimedia_Auth, |
| 168 | app_id := int2oct(c_DIAMETER_3GPP_SWx_AID, 4), |
| 169 | hbh_id := hbh_id, |
| 170 | ete_id := ete_id, |
| 171 | avps := { |
| 172 | ts_AVP_SessionId(sess_id), |
| 173 | ts_AVP_VendorSpecAppId(vendor_id_3GPP, valueof(vendor_app_id)), |
| 174 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 175 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 176 | ts_AVP_OriginHost(orig_host), |
| 177 | ts_AVP_OriginRealm(orig_realm), |
| 178 | ts_AVP_UserNameImsi(valueof(imsi)), |
| 179 | sip_auth_data_item, |
| 180 | ts_AVP_3GPP_SIPNumAuthDataItems(1) |
| 181 | }); |
| 182 | |
Pau Espin Pedrol | 6601f22 | 2024-03-05 18:51:09 +0100 | [diff] [blame] | 183 | template (value) PDU_DIAMETER |
| 184 | ts_DIA_SWx_MAA_result(template (value) hexstring imsi, |
| 185 | template (value) GenericAVP result, |
| 186 | template (value) uint32_t vendor_app_id := c_DIAMETER_3GPP_SWx_AID, |
| 187 | template (value) octetstring sess_id := c_def_sess_id, |
| 188 | template (value) charstring orig_host := "hss.localdomain", |
| 189 | template (value) charstring orig_realm := "localdomain", |
| 190 | template (value) UINT32 hbh_id := '00000000'O, |
| 191 | template (value) UINT32 ete_id := '00000000'O) := |
| 192 | ts_DIAMETER(flags := '01000000'B, |
| 193 | cmd_code := Multimedia_Auth, |
| 194 | app_id := int2oct(c_DIAMETER_3GPP_SWx_AID, 4), |
| 195 | hbh_id := hbh_id, |
| 196 | ete_id := ete_id, |
| 197 | avps := { |
| 198 | ts_AVP_SessionId(sess_id), |
| 199 | ts_AVP_VendorSpecAppId(vendor_id_3GPP, valueof(vendor_app_id)), |
| 200 | result, |
| 201 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 202 | ts_AVP_OriginHost(orig_host), |
| 203 | ts_AVP_OriginRealm(orig_realm), |
| 204 | ts_AVP_UserNameImsi(valueof(imsi)) |
| 205 | }); |
| 206 | |
Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 207 | /* Server-Assignment-Request, |
| 208 | * 3GPP TS 29.273 8.1.2.2.2 UE/PDN Registration/DeRegistration Notification |
| 209 | * 3GPP TS 29.273 8.2.2.3 Non-3GPP IP Access Registration Procedure */ |
| 210 | template (present) PDU_DIAMETER |
| 211 | tr_DIA_SWx_SAR(template (present) hexstring imsi := ?, |
| 212 | template (present) octetstring sess_id := ?, |
| 213 | template (present) charstring orig_host := ?, |
| 214 | template (present) charstring orig_realm := ?, |
| 215 | template (present) charstring dest_realm := ?, |
| 216 | template (present) UINT32 hbh_id := ?, |
| 217 | template (present) UINT32 ete_id := ?, |
| 218 | template (present) CxDx_3GPP_Server_Assignment_Type server_ass_type := ?, |
| 219 | template (present) charstring service_selection := ?) := |
| 220 | tr_DIAMETER(flags := '1???????'B, |
| 221 | cmd_code := Server_Assignment, |
| 222 | app_id := int2oct(c_DIAMETER_3GPP_SWx_AID, 4), |
| 223 | hbh_id := hbh_id, ete_id := ete_id, |
| 224 | avps := superset( |
| 225 | tr_AVP_SessionId(sess_id), |
| 226 | tr_AVP_VendorSpecAppId(?, ?), |
| 227 | tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 228 | tr_AVP_OriginHost(orig_host), |
| 229 | tr_AVP_OriginRealm(orig_realm), |
| 230 | tr_AVP_DestinationRealm(dest_realm), |
| 231 | tr_AVP_UserNameImsi(imsi), |
| 232 | tr_AVP_3GPP_ServerAssignmentType(server_ass_type), |
| 233 | tr_AVP_ServiceSelection(service_selection) |
| 234 | )); |
| 235 | |
| 236 | /* Server-Assignment-Answer, |
| 237 | * 3GPP TS 29.273 8.1.2.2.2 UE/PDN Registration/DeRegistration Notification |
| 238 | * 3GPP TS 29.273 8.2.2.3 Non-3GPP IP Access Registration Procedure */ |
| 239 | template (value) PDU_DIAMETER |
| 240 | ts_DIA_SWx_SAA(template (value) hexstring imsi, |
Pau Espin Pedrol | 9b2ebc0 | 2024-03-05 13:25:19 +0100 | [diff] [blame] | 241 | template (value) AAA_3GPP_PDN_Type pdn_type, |
| 242 | template (value) charstring apn, |
Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 243 | template (value) uint32_t vendor_app_id := c_DIAMETER_3GPP_SWx_AID, |
| 244 | template (value) octetstring sess_id := c_def_sess_id, |
| 245 | template (value) charstring orig_host := "hss.localdomain", |
| 246 | template (value) charstring orig_realm := "localdomain", |
| 247 | template (value) UINT32 hbh_id := '00000000'O, |
| 248 | template (value) UINT32 ete_id := '00000000'O) := |
| 249 | ts_DIAMETER(flags := '01000000'B, |
| 250 | cmd_code := Server_Assignment, |
| 251 | app_id := int2oct(c_DIAMETER_3GPP_SWx_AID, 4), |
| 252 | hbh_id := hbh_id, |
| 253 | ete_id := ete_id, |
| 254 | avps := { |
| 255 | ts_AVP_SessionId(sess_id), |
| 256 | ts_AVP_VendorSpecAppId(vendor_id_3GPP, valueof(vendor_app_id)), |
| 257 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 258 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 259 | ts_AVP_OriginHost(orig_host), |
| 260 | ts_AVP_OriginRealm(orig_realm), |
Pau Espin Pedrol | 9b2ebc0 | 2024-03-05 13:25:19 +0100 | [diff] [blame] | 261 | ts_AVP_UserNameImsi(valueof(imsi)), |
| 262 | ts_AVP_3GPP_Non_3GPP_User_Data(pdn_type, apn) |
Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 263 | /* TODO: |
Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 264 | * [ 3GPP-AAA-Server-Name ] |
| 265 | * [ OC-Supported-Features ] |
| 266 | * [ OC-OLR ] ] |
| 267 | * *[ Load ] |
| 268 | * *[ Supported-Features ] |
| 269 | */ |
| 270 | }); |
| 271 | |
| 272 | /******************************* |
| 273 | * S6b 3GPP TS 29.273 section 9 |
| 274 | *******************************/ |
| 275 | |
| 276 | /* TS 29.273 9.2.2.5.1 AA-Request (AAR) */ |
Pau Espin Pedrol | 518e24b | 2024-02-23 17:45:08 +0100 | [diff] [blame] | 277 | template (present) PDU_DIAMETER |
| 278 | tr_DIA_S6b_AAR(template (present) charstring username_nai := ?, |
| 279 | template (present) MIPv6_NONE_MIP6_Feature_Vector mip6_feat_vec := ?, |
| 280 | template (present) charstring apn := ?, |
| 281 | template (present) octetstring sess_id := ?, |
| 282 | template (present) charstring orig_host := ?, |
| 283 | template (present) charstring orig_realm := ?, |
| 284 | template (present) charstring dest_realm := ?, |
| 285 | template (present) UINT32 hbh_id := ?, |
| 286 | template (present) UINT32 ete_id := ?) := |
| 287 | tr_DIAMETER(flags := '1???????'B, |
| 288 | cmd_code := Authorize_Authenticate, |
| 289 | app_id := int2oct(c_DIAMETER_3GPP_S6b_AID, 4), |
| 290 | hbh_id := hbh_id, |
| 291 | ete_id := ete_id, |
| 292 | avps := superset( |
| 293 | tr_AVP_SessionId(sess_id), |
| 294 | /* Optional: DRMP, */ |
| 295 | tr_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_S6b_AID, 4)), |
| 296 | tr_AVP_OriginHost(orig_host), |
| 297 | tr_AVP_OriginRealm(orig_realm), |
| 298 | tr_AVP_DestinationRealm(dest_realm), |
| 299 | tr_AVP_AuthRequestType(AUTHORIZE_ONLY), |
| 300 | tr_AVP_UserName(char2oct_tmpl_present(username_nai)), |
| 301 | tr_AVP_MIP6FeatureVector(mip6_feat_vec), |
| 302 | tr_AVP_ServiceSelection(apn) |
| 303 | /* TODO: Lots other optional */ |
| 304 | )); |
| 305 | |
Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 306 | template (value) PDU_DIAMETER |
Pau Espin Pedrol | 8586b26 | 2024-02-09 18:12:21 +0100 | [diff] [blame] | 307 | ts_DIA_S6b_AAR(template (value) charstring username_nai, |
Pau Espin Pedrol | 7399673 | 2023-10-23 18:16:21 +0200 | [diff] [blame] | 308 | template (value) MIPv6_NONE_MIP6_Feature_Vector mip6_feat_vec, |
Pau Espin Pedrol | 2c2e187 | 2023-10-23 18:31:03 +0200 | [diff] [blame] | 309 | template (value) charstring apn, |
Pau Espin Pedrol | 009ab6f | 2024-03-05 13:25:19 +0100 | [diff] [blame] | 310 | template (value) MIPv4_NONE_MIP_Home_Agent_Address pgw_addr, |
Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 311 | template (value) octetstring sess_id := c_def_sess_id, |
| 312 | template (value) charstring orig_host := "pgw.localdomain", |
| 313 | template (value) charstring orig_realm := "localdomain", |
| 314 | template (value) charstring dest_realm := "localdomain", |
| 315 | template (value) UINT32 hbh_id := '00000000'O, |
| 316 | template (value) UINT32 ete_id := '00000000'O) := |
| 317 | ts_DIAMETER(flags := '11000000'B, |
| 318 | cmd_code := Authorize_Authenticate, |
| 319 | app_id := int2oct(c_DIAMETER_3GPP_S6b_AID, 4), |
| 320 | hbh_id := hbh_id, |
| 321 | ete_id := ete_id, |
| 322 | avps := { |
| 323 | ts_AVP_SessionId(sess_id), |
| 324 | /* Optional: DRMP, */ |
| 325 | ts_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_S6b_AID, 4)), |
| 326 | ts_AVP_OriginHost(orig_host), |
| 327 | ts_AVP_OriginRealm(orig_realm), |
| 328 | ts_AVP_DestinationRealm(dest_realm), |
| 329 | ts_AVP_AuthRequestType(AUTHORIZE_ONLY), |
Pau Espin Pedrol | 8586b26 | 2024-02-09 18:12:21 +0100 | [diff] [blame] | 330 | ts_AVP_UserName(char2oct(valueof(username_nai))), |
Pau Espin Pedrol | 009ab6f | 2024-03-05 13:25:19 +0100 | [diff] [blame] | 331 | ts_AVP_MIP6AgentInfo(pgw_addr), |
Pau Espin Pedrol | 2c2e187 | 2023-10-23 18:31:03 +0200 | [diff] [blame] | 332 | ts_AVP_MIP6FeatureVector(mip6_feat_vec), |
| 333 | ts_AVP_ServiceSelection(valueof(apn)) |
Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 334 | /* TODO: Lots other optional */ |
| 335 | }); |
| 336 | |
| 337 | /* TS 29.273 9.2.2.2.2 AA-Answer (AAA) */ |
| 338 | template (present) PDU_DIAMETER |
| 339 | tr_DIA_S6b_AAA(template (present) octetstring sess_id := ?, |
| 340 | template (present) charstring orig_host := ?, |
| 341 | template (present) charstring orig_realm := ?, |
| 342 | template (present) charstring dest_realm := ?, |
| 343 | template (present) UINT32 hbh_id := ?, |
| 344 | template (present) UINT32 ete_id := ?, |
| 345 | template (present) CxDx_3GPP_Server_Assignment_Type server_ass_type := ?, |
| 346 | template (present) charstring service_selection := ?) := |
| 347 | tr_DIAMETER(flags := '0???????'B, |
| 348 | cmd_code := Authorize_Authenticate, |
| 349 | app_id := int2oct(c_DIAMETER_3GPP_S6b_AID, 4), |
| 350 | hbh_id := hbh_id, ete_id := ete_id, |
| 351 | avps := superset( |
| 352 | tr_AVP_SessionId(sess_id), |
| 353 | /* Optional: DRMP, */ |
| 354 | tr_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_S6b_AID, 4)), |
| 355 | tr_AVP_AuthRequestType(AUTHORIZE_ONLY), |
| 356 | tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| 357 | tr_AVP_OriginHost(orig_host), |
| 358 | tr_AVP_OriginRealm(orig_realm) |
| 359 | )); |
| 360 | |
Pau Espin Pedrol | 518e24b | 2024-02-23 17:45:08 +0100 | [diff] [blame] | 361 | template (value) PDU_DIAMETER |
| 362 | ts_DIA_S6b_AAA(template (value) octetstring sess_id := c_def_sess_id, |
| 363 | template (value) charstring orig_host := "aaa.localdomain", |
| 364 | template (value) charstring orig_realm := "localdomain", |
| 365 | template (value) charstring dest_realm := "localdomain", |
| 366 | template (value) UINT32 hbh_id := '00000000'O, |
| 367 | template (value) UINT32 ete_id := '00000000'O) := |
| 368 | ts_DIAMETER(flags := '01000000'B, |
| 369 | cmd_code := Authorize_Authenticate, |
| 370 | app_id := int2oct(c_DIAMETER_3GPP_S6b_AID, 4), |
| 371 | hbh_id := hbh_id, ete_id := ete_id, |
| 372 | avps := { |
| 373 | ts_AVP_SessionId(sess_id), |
| 374 | /* Optional: DRMP, */ |
| 375 | ts_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_S6b_AID, 4)), |
| 376 | ts_AVP_AuthRequestType(AUTHORIZE_ONLY), |
| 377 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 378 | ts_AVP_OriginHost(orig_host), |
| 379 | ts_AVP_OriginRealm(orig_realm) |
| 380 | }); |
| 381 | |
Pau Espin Pedrol | 4944a5c | 2024-01-24 17:23:01 +0100 | [diff] [blame] | 382 | /* TS 29.273 9.2.2.3.1 Session-Termination-Request (STR) Command, |
| 383 | * Table 9.1.2.3.1/1: S6b Session Termination Request (STR), based on RFC 6733 8.4.1 */ |
| 384 | template (value) PDU_DIAMETER |
| 385 | ts_DIA_S6b_STR(template (value) hexstring imsi, |
| 386 | template (value) BASE_NONE_Termination_Cause term_cause := DIAMETER_LOGOUT, |
| 387 | template (value) octetstring sess_id := c_def_sess_id, |
| 388 | template (value) charstring orig_host := "pgw.localdomain", |
| 389 | template (value) charstring orig_realm := "localdomain", |
| 390 | template (value) charstring dest_realm := "localdomain", |
| 391 | template (value) UINT32 hbh_id := '00000000'O, |
| 392 | template (value) UINT32 ete_id := '00000000'O) := |
| 393 | ts_DIAMETER(flags := '11000000'B, |
| 394 | cmd_code := Session_Termination, |
| 395 | app_id := int2oct(c_DIAMETER_3GPP_S6b_AID, 4), |
| 396 | hbh_id := hbh_id, |
| 397 | ete_id := ete_id, |
| 398 | avps := { |
| 399 | ts_AVP_SessionId(sess_id), |
| 400 | /* Optional: DRMP */ |
| 401 | ts_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_S6b_AID, 4)), |
| 402 | ts_AVP_OriginHost(orig_host), |
| 403 | ts_AVP_OriginRealm(orig_realm), |
| 404 | ts_AVP_DestinationRealm(dest_realm), |
| 405 | ts_AVP_TerminationCause(term_cause), |
| 406 | ts_AVP_UserNameImsi(valueof(imsi)) |
| 407 | /* Optional: OC-Supported-Features */ |
| 408 | }); |
| 409 | |
| 410 | /* TS 29.273 9.2.2.3.2 Session-Termination-Answer (STA) Command, |
| 411 | * Table 9.1.2.3.1/2: S6b Session Termination Answer (STA), based on RFC 6733 8.4.2 */ |
| 412 | template (present) PDU_DIAMETER |
| 413 | tr_DIA_S6b_STA(template (present) DIAMETER_Resultcode res_code := ?, |
| 414 | template (present) octetstring sess_id := ?, |
| 415 | template (present) charstring orig_host := ?, |
| 416 | template (present) charstring orig_realm := ?, |
| 417 | template (present) charstring dest_realm := ?, |
| 418 | template (present) UINT32 hbh_id := ?, |
| 419 | template (present) UINT32 ete_id := ?) := |
| 420 | tr_DIAMETER(flags := '0???????'B, |
| 421 | cmd_code := Session_Termination, |
| 422 | app_id := int2oct(c_DIAMETER_3GPP_S6b_AID, 4), |
| 423 | hbh_id := hbh_id, ete_id := ete_id, |
| 424 | avps := superset( |
| 425 | tr_AVP_SessionId(sess_id), |
| 426 | /* Optional: DRMP */ |
| 427 | tr_AVP_ResultCode(res_code), |
| 428 | tr_AVP_OriginHost(orig_host), |
| 429 | tr_AVP_OriginRealm(orig_realm) |
| 430 | /* Lots other Optional */ |
| 431 | )); |
| 432 | |
Pau Espin Pedrol | 4669b61 | 2023-10-23 17:43:14 +0200 | [diff] [blame] | 433 | } |