blob: 209ac100ece980297c314c8200a55c13818f29aa [file] [log] [blame]
Pau Espin Pedrol867b1302024-01-24 16:14:28 +01001module 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
14import from General_Types all;
15import from DIAMETER_Types all;
16import from DIAMETER_Templates all;
17import from Osmocom_Types all;
18import from Misc_Helpers all;
19
20/*******************************
21 * S6a 3GPP TS 29.212 section 7
22 *******************************/
23
24/* 3GPP TS 29.212 Section 5.1 */
25const uint32_t c_DIAMETER_3GPP_Gx_AID := 16777238;
26
27/* 3GPP TS 29.212 5.6.2 Credit-Control-Request (CC-Request, CCR) Command */
28template (present) PDU_DIAMETER
29tr_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 */
42template (value) PDU_DIAMETER
43ts_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 */