Pau Espin Pedrol | 867b130 | 2024-01-24 16:14:28 +0100 | [diff] [blame] | 1 | module DIAMETER_ts29_212_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.212 |
| 12 | */ |
| 13 | |
| 14 | import from General_Types all; |
| 15 | import from DIAMETER_Types all; |
| 16 | import from DIAMETER_Templates all; |
| 17 | import from Osmocom_Types all; |
| 18 | import from Misc_Helpers all; |
| 19 | |
| 20 | /******************************* |
| 21 | * S6a 3GPP TS 29.212 section 7 |
| 22 | *******************************/ |
| 23 | |
| 24 | /* 3GPP TS 29.212 Section 5.1 */ |
| 25 | const uint32_t c_DIAMETER_3GPP_Gx_AID := 16777238; |
| 26 | |
| 27 | /* 3GPP TS 29.212 5.6.2 Credit-Control-Request (CC-Request, CCR) Command */ |
| 28 | template (present) PDU_DIAMETER |
| 29 | tr_DIA_Gx_CCR(template (present) DCC_NONE_CC_Request_Type req_type := INITIAL_REQUEST) |
| 30 | := tr_DIAMETER(flags:='11000000'B, cmd_code:=Credit_Control, |
| 31 | avps := superset( |
| 32 | tr_AVP_SessionId, |
| 33 | tr_AVP_OriginHost, |
| 34 | tr_AVP_OriginRealm, |
| 35 | tr_AVP_DestinationRealm, |
| 36 | tr_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)), |
| 37 | tr_AVP_CcReqType(req_type), |
| 38 | tr_AVP_CcReqNum(?) |
| 39 | )); |
| 40 | |
| 41 | /* 3GPP TS 29.212 5.6.3 Credit-Control-Answer (CC-Answer, CCA) Command */ |
| 42 | template (value) PDU_DIAMETER |
| 43 | ts_DIA_Gx_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| 44 | template (value) octetstring sess_id, |
| 45 | template (value) DCC_NONE_CC_Request_Type req_type, |
| 46 | template (value) AVP_Unsigned32 req_num) |
| 47 | := ts_DIAMETER(flags:='01000000'B, cmd_code:=Credit_Control, |
| 48 | app_id:=int2oct(c_DIAMETER_3GPP_Gx_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id, |
| 49 | avps := { |
| 50 | ts_AVP_SessionId(sess_id), |
| 51 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 52 | ts_AVP_OriginHost("pcrf.localdomain"), |
| 53 | ts_AVP_OriginRealm("localdomain"), |
| 54 | ts_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)), |
| 55 | ts_AVP_CcReqType(req_type), |
| 56 | ts_AVP_CcReqNum(req_num), |
| 57 | ts_AVP_PCC_3GPP_QoS_Information({ |
| 58 | ts_AVP_PCC_3GPP_APN_Aggregate_Max_Bitrate_UL(33554432), |
| 59 | ts_AVP_PCC_3GPP_APN_Aggregate_Max_Bitrate_DL(52428800) |
| 60 | }), |
| 61 | ts_AVP_PCC_3GPP_Default_EPS_Bearer_QoS({ |
| 62 | ts_AVP_PCC_3GPP_QoS_Class_Identifier(9), |
| 63 | ts_AVP_PCC_3GPP_AllocRetenPrio(2) |
| 64 | }) |
| 65 | // supported features |
| 66 | // origin |
| 67 | }); |
| 68 | |
| 69 | } /* module */ |