[WIP] DIAMETER_Templates: Add Gx related templates

Change-Id: Ie4080205717ebec714e0325b7062451293687a10
This commit is contained in:
Harald Welte 2019-08-30 20:51:41 +02:00 committed by Harald Welte
parent a43265c8ae
commit 24fa9b76a3
1 changed files with 183 additions and 0 deletions

View File

@ -482,6 +482,159 @@ template (present) GenericAVP tr_AVP_UserName(template (present) octetstring uid
template (value) GenericAVP ts_AVP_UserNameImsi(hexstring imsi) := ts_AVP_UserName(char2oct(hex2str(imsi)));
template (present) GenericAVP tr_AVP_UserNameImsi(hexstring imsi) := tr_AVP_UserName(char2oct(hex2str(imsi)));
/* RFC4005 4.5 */
template (value) GenericAVP ts_AVP_CalledStationId(template (value) octetstring data) := {
avp := {
avp_header:= ts_DIA_Hdr(c_AVP_Code_DNAS_NONE_Called_Station_Id),
avp_data := {
avp_DNAS_NONE_Called_Station_Id := data
}
}
}
template (present) GenericAVP tr_AVP_CalledStationId(template (present) octetstring data := ?) := {
avp := {
avp_header:= ts_DIA_Hdr(c_AVP_Code_DNAS_NONE_Called_Station_Id),
avp_data := {
avp_DNAS_NONE_Called_Station_Id := data
}
}
}
/* RFC4005 6.11.1 */
template (value) GenericAVP ts_AVP_FramedIpAddr(template (value) octetstring data) := {
avp := {
avp_header := ts_DIA_Hdr(c_AVP_Code_DNAS_NONE_Framed_IP_Address),
avp_data := {
avp_DNAS_NONE_Framed_IP_Address := data
}
}
}
template (present) GenericAVP tr_AVP_FramedIpAddr(template (present) octetstring data := ?) := {
avp := {
avp_header := tr_DIA_Hdr(c_AVP_Code_DNAS_NONE_Framed_IP_Address),
avp_data := {
avp_DNAS_NONE_Framed_IP_Address := data
}
}
}
/* RFC4006 8.2 */
template (value) GenericAVP ts_AVP_CcReqNum(template (value) UINT32 req_num) := {
avp := {
avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Number),
avp_data := {
avp_DCC_NONE_CC_Request_Number := req_num
}
}
}
template (present) GenericAVP tr_AVP_CcReqNum(template (present) UINT32 req_num := ?) := {
avp := {
avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Number),
avp_data := {
avp_DCC_NONE_CC_Request_Number := req_num
}
}
}
/* RFC4006 8.3 */
template (value) GenericAVP ts_AVP_CcReqType(template (value) DCC_NONE_CC_Request_Type cc_req_type) := {
avp := {
avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Type),
avp_data := {
avp_DCC_NONE_CC_Request_Type := cc_req_type
}
}
}
template (present) GenericAVP tr_AVP_CcReqType(template (present) DCC_NONE_CC_Request_Type cc_req_type := ?) := {
avp := {
avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Type),
avp_data := {
avp_DCC_NONE_CC_Request_Type := cc_req_type
}
}
}
/* RFC4006 8.47 */
template (value) GenericAVP ts_AVP_SubscriptionIdType(template (value) DCC_NONE_Subscription_Id_Type id_type) := {
avp := {
avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Type),
avp_data := {
avp_DCC_NONE_Subscription_Id_Type := id_type
}
}
}
template (present) GenericAVP tr_AVP_SubscriptionIdType(template (present) DCC_NONE_Subscription_Id_Type id_type) := {
avp := {
avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Type),
avp_data := {
avp_DCC_NONE_Subscription_Id_Type := id_type
}
}
}
/* RFC4006 8.48 */
template (value) GenericAVP ts_AVP_SubscriptionIdData(template (value) octetstring data) := {
avp := {
avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Data),
avp_data := {
avp_DCC_NONE_Subscription_Id_Data := data
}
}
}
template (present) GenericAVP tr_AVP_SubscriptionIdData(template (present) octetstring data := ?) := {
avp := {
avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Data),
avp_data := {
avp_DCC_NONE_Subscription_Id_Data := data
}
}
}
/* RFC4006 8.46 */
template (value) GenericAVP ts_AVP_SubscriptionId(template (value) DCC_NONE_Subscription_Id_Type id_type,
template (value) octetstring id_data) := {
avp := {
avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id),
avp_data := {
avp_DCC_NONE_Subscription_Id := {
ts_AVP_SubscriptionIdType(id_type),
ts_AVP_SubscriptionIdData(id_data)
}
}
}
}
template (present) GenericAVP tr_AVP_SubscriptionId(template (present) DCC_NONE_Subscription_Id_Type id_type,
template (present) octetstring id_data) := {
avp := {
avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id),
avp_data := {
avp_DCC_NONE_Subscription_Id := {
tr_AVP_SubscriptionIdType(id_type),
tr_AVP_SubscriptionIdData(id_data)
}
}
}
}
template (value) GenericAVP ts_AVP_IpCanType(template (value) PCC_3GPP_IP_CAN_Type ip_can) := {
avp := {
avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_IP_CAN_Type),
avp_data := {
avp_PCC_3GPP_IP_CAN_Type := ip_can
}
}
}
template (present) GenericAVP tr_AVP_IpCanType(template (present) PCC_3GPP_IP_CAN_Type ip_can := ?) := {
avp := {
avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_IP_CAN_Type),
avp_data := {
avp_PCC_3GPP_IP_CAN_Type := ip_can
}
}
}
/* TS 29.262 7.3.53 RAND */
@ -1077,10 +1230,37 @@ tr_DIA_CCR(template (present) DCC_NONE_CC_Request_Type req_type := INITIAL_REQUE
tr_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)),
tr_AVP_CcReqType(req_type),
tr_AVP_CcReqNum(?)
tr_AVP_SubscriptionId(END_USER_IMSI, ?),
/* Supported-Features */
/* Network-Request-Support: NETWORK_REQUEST SUPPORTED */
tr_AVP_FramedIpAddr,
tr_AVP_IpCanType(threeGPP_EPS),
tr_AVP_3GPP_RatType(EUTRAN),
/* QoS-Information */
/* Default-EPS-Bearer-QoS */
/* 3GPP-User-Location-Info: TAI + ECGI */
/* 3GPP-MS-TimeZone */
tr_AVP_CalledStationId
));
/* RFC 4006 3.2. Credit-Control-Answer (CCA) Command */
template (present) PDU_DIAMETER
tr_DIA_CCA := tr_DIAMETER('01000000'B, cmd_code:=Credit_Control,
app_id:=int2oct(c_DIAMETER_3GPP_GX_AID, 4),
avps := superset(
tr_AVP_SessionId,
/* AuthAppId */
tr_AVP_CcReqType(INITIAL_REQUEST),
tr_AVP_CcReqNum,
/* QoS-Information */
/* Default-EPS-Bearer-QoS */
/* 3GPP-User-Location-Info: TAI + ECGI */
/* Supported-Features */
tr_AVP_OriginHost,
tr_AVP_OriginRealm,
tr_AVP_ResultCode
));
template (value) PDU_DIAMETER
ts_DIA_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id,
template (value) octetstring sess_id,
@ -1097,12 +1277,14 @@ ts_DIA_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id,
ts_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)),
ts_AVP_CcReqType(req_type),
ts_AVP_CcReqNum(req_num)//,
/* 3GPP-User-Location-Info: TAI + ECGI */
// qos
// default eps bearer qos
// supported features
// origin
});
/* RFC 6733, section 5.5.1 "Device-Watchdog-Request" */
template (value) PDU_DIAMETER
ts_DIA_DWR(template (value) OCTET4 state_id := '00000000'O,
@ -1173,4 +1355,5 @@ tr_DIA_DWA(template (present) OCTET4 state_id := ?,
tr_AVP_OriginStateId(state_id)
));
}