Allow the definition of AVPs within vendor IDs.

This allows for a more natural organization of AVP definitions: they can now
be grouped by application (including the base application) or vendor ID. This
means we can stop using the "workaround" (for those vendors who define AVPs
but don't have their own application ID) of finding some random application ID
to put in a vendor-specific xml file just to satisfy the parser.

Rework a couple of Vendor-specific xml files as an example.

Note: this does mean that vendor IDs can no longer be defined inside of the
base or other application.  If that's a problem the parser could be made
(through some duplication of code) to understand the old format too.

Change-Id: I5119f0dc7f8e3bbf59e2207046a8bb0f42ab0ca1
Reviewed-on: https://code.wireshark.org/review/8141
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
This commit is contained in:
Jeff Morriss 2015-04-20 13:17:01 -04:00
parent 8b720910d2
commit 847e5179dc
6 changed files with 490 additions and 481 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<application id="16777229" name="3GPP Rx Release 6" uri="http://www.3GPP.org/ftp/Specs/html-info/29211.htm">
<vendor vendor-id="OracleTekelec" code="323" name="Oracle Tekelec">
<avp name="DSR-ApplicationInvoked" code="2468" vendor-bit="must" vendor-id="Oracle_Tekelec">
<avp name="DSR-ApplicationInvoked" code="2468" vendor-bit="must" vendor-id="OracleTekelec">
<type type-name="Enumerated"/>
<enum name="RBAR ID" code="3"/>
<enum name="FABR ID" code="4"/>
<enum name="CPA ID" code="5"/>
<enum name="Policy DRA ID" code="6"/>
</avp>
<avp name="PDRA-Early-Binding" code="2500" vendor-bit="must" vendor-id="Oracle_Tekelec">
<avp name="PDRA-Early-Binding" code="2500" vendor-bit="must" vendor-id="OracleTekelec">
<type type-name="OctetString"/>
</avp>
<avp name="Session-Release-Reason" code="2501" vendor-bit="must" vendor-id="Oracle_Tekelec">
<avp name="Session-Release-Reason" code="2501" vendor-bit="must" vendor-id="OracleTekelec">
<type type-name="OctetString"/>
</avp>
<avp name="MsgCopyAnswer" code="2516" vendor-bit="must" vendor-id="Oracle_Tekelec">
<avp name="MsgCopyAnswer" code="2516" vendor-bit="must" vendor-id="OracleTekelec">
<grouped>
<gavp name="Session-Id"/>
<!-- This grouped AVP holds any AVP -->
</grouped>
</avp>
</application>
</vendor>

View File

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<application id="16777322" name="Verizon Session Recovery" uri="http://www.ietf.org/rfc/rfc4006.txt">
<vendor vendor-id="VerizonWireless" code="12951" name="Verizon Wireless"/>
<avp name="Dummy" code="0" mandatory="must" may-encrypt="yes" protected="may" vendor-bit="must" vendor-id="VerizonWireless">
<type type-name="OctetString"/>
</avp>
</application>
<application id="16777322" name="Verizon Session Recovery" uri="http://www.ietf.org/rfc/rfc4006.txt">
<avp name="Dummy" code="0" mandatory="must" may-encrypt="yes" protected="may" vendor-bit="must" vendor-id="VerizonWireless">
<type type-name="OctetString"/>
</avp>
</application>

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<vendor vendor-id="Vodafone" code="12645" name="Vodafone"/>
<application id="16777234" name="Vodafone Gx+" uri="http://www.ietf.org/internet-drafts/draft-ietf-aaa-diameter-cc-06.txt">
<avp name="Context-Type" code="256" vendor-id="Vodafone" mandatory="mustnot" vendor-bit="must">

View File

@ -168,37 +168,6 @@
<!-- ************************************************************** -->
<!-- ************************************************************** -->
<!-- ************************* Vendors **************************** -->
<!-- ************************************************************** -->
<vendor vendor-id="None" code="0" name="None"/>
<vendor vendor-id="HP" code="11" name="Hewlett Packard"/>
<vendor vendor-id="Sun" code="42" name="Sun Microsystems, Inc."/>
<vendor vendor-id="Merit" code="61" name="Merit Networks"/>
<vendor vendor-id="Nokia" code="94" name="Nokia"/>
<vendor vendor-id="Ericsson" code="193" name="Ericsson"/>
<vendor vendor-id="Oracle_Tekelec" code="323" name="Oracle_Tekelec"/>
<vendor vendor-id="USR" code="429" name="US Robotics Corp."/>
<vendor vendor-id="ALU" code="637" name="ALU Network"/>
<vendor vendor-id="Lucent" code="1751" name="Lucent Technologies"/>
<vendor vendor-id="Huawei" code="2011" name="Huawei"/>
<vendor vendor-id="Deutsche_Telekom_AG" code="2937" name="Deutsche Telekom AG"/>
<vendor vendor-id="Acision" code="3830" name="Acision"/>
<vendor vendor-id="TGPP2" code="5535" name="3GPP2"/>
<vendor vendor-id="Cisco" code="5771" name="Cisco"/>
<vendor vendor-id="SKT" code="5806" name="SK Telecom"/>
<vendor vendor-id="Starent" code="8164" name="Starent"/>
<vendor vendor-id="TGPP" code="10415" name="3GPP"/>
<vendor vendor-id="Vodafone" code="12645" name="Vodafone"/>
<vendor vendor-id="VerizonWireless" code="12951" name="Verizon Wireless"/>
<vendor vendor-id="ETSI" code="13019" name="ETSI"/>
<vendor vendor-id="Tango" code="13421" name="Tango Telecom Limited"/>
<vendor vendor-id="NokiaSolutionsAndNetworks" code="28458" name="Nokia Solutions and Networks"/>
<vendor vendor-id="ChinaTelecom" code="81000" name="China Telecom"/>
<vendor vendor-id="TGPPCX" code="16777216" name="3GPP CX/DX"/>
<!-- *********************** End Vendors ************************** -->
<!-- ************************************************************** -->
<!-- ************************ typedefn's ************************** -->
<!-- ************************************************************** -->
@ -6637,6 +6606,9 @@
</base>
<!-- ********************************************************************** -->
<!-- ************************* Application IDs **************************** -->
<!-- ********************************************************************** -->
<!---
Duplicates should be avoided
16777216 is defined in TGPP.xml
@ -6646,21 +6618,22 @@
16777224 is defined in ChinaTelecom.xml
16777227 is defined in Ericsson.xml
16777228 is defined in starent.xml
16777229 is defined in Oracle.xml
16777234 is defined in Vodafone.xml
16777236 is defined in TGPP.xml
16777237 is defined in TGPP2.xml
16777238 is defined in Cisco.xml
16777267 is defined in TGPP.xml
16777292 is defined in TGPP.xml
16777302 is defined in NokiaSolutionsAndNetworks.xml
16777304 is defined in SKT.xml
16777317 is defined in NokiaSolutionsAndNetworks.xml
16777322 is defined in VerizonWireless.xml
-->
<application id="0" name="Diameter Common Messages" uri="http://www.ietf.org/rfc/rfc3588.txt?number=3588"></application>
<application id="3" name="Diameter Base Accounting" uri="http://www.ietf.org/rfc/rfc3588.txt?number=3588"></application>
<application id="16777219" name="3GPP Wx" uri="http://www.3GPP.org/ftp/Specs/html-info/29234.htm"></application>
<application id="16777229" name="3GPP Rx Release 6" uri="http://www.3GPP.org/ftp/Specs/html-info/29211.htm"></application>
<application id="16777232" name="Ericsson Charging-CIP" uri="http://www.3gpp.org/ftp/Specs/html-info/29210.htm"></application>
<application id="16777238" name="3GPP Gx" uri="http://www.ietf.org/internet-drafts/draft-ietf-aaa-diameter-cc-06.txt"></application>
<application id="16777250" name="3GPP STa" uri="http://www.3gpp.org/ftp/Specs/html-info/29273.htm"></application>
<application id="16777251" name="3GPP S6a/S6d" uri="http://www.ietf.org/rfc/rfc5516.txt?number=5516"></application>
<application id="16777252" name="3GPP S13/S13'" uri="http://www.ietf.org/rfc/rfc5516.txt?number=5516"></application>
@ -6674,6 +6647,34 @@
<application id="16777315" name="Ericsson Diameter Signalling Controller Application (DSC)" uri="http://www.iana.org/assignments/aaa-parameters/aaa-parameters.xml"></application>
<application id="16777327" name="Ericsson Sx" uri="http://www.iana.org/assignments/aaa-parameters/aaa-parameters.xml"></application>
<application id="4294967295" name="Relay" uri="http://www.ietf.org/rfc/rfc6733.txt?number=6733"></application>
<!-- *********************** End Application IDs ************************** -->
<!-- ************************************************************** -->
<!-- ************************* Vendors **************************** -->
<!-- ************************************************************** -->
<vendor vendor-id="None" code="0" name="None"/>
<vendor vendor-id="HP" code="11" name="Hewlett Packard"/>
<vendor vendor-id="Sun" code="42" name="Sun Microsystems, Inc."/>
<vendor vendor-id="Merit" code="61" name="Merit Networks"/>
<vendor vendor-id="Nokia" code="94" name="Nokia"/>
<vendor vendor-id="Ericsson" code="193" name="Ericsson"/>
<vendor vendor-id="USR" code="429" name="US Robotics Corp."/>
<vendor vendor-id="ALU" code="637" name="ALU Network"/>
<vendor vendor-id="Lucent" code="1751" name="Lucent Technologies"/>
<vendor vendor-id="Huawei" code="2011" name="Huawei"/>
<vendor vendor-id="Deutsche_Telekom_AG" code="2937" name="Deutsche Telekom AG"/>
<vendor vendor-id="Acision" code="3830" name="Acision"/>
<vendor vendor-id="TGPP2" code="5535" name="3GPP2"/>
<vendor vendor-id="SKT" code="5806" name="SK Telecom"/>
<vendor vendor-id="Starent" code="8164" name="Starent"/>
<vendor vendor-id="TGPP" code="10415" name="3GPP"/>
<vendor vendor-id="ETSI" code="13019" name="ETSI"/>
<vendor vendor-id="Tango" code="13421" name="Tango Telecom Limited"/>
<vendor vendor-id="NokiaSolutionsAndNetworks" code="28458" name="Nokia Solutions and Networks"/>
<vendor vendor-id="ChinaTelecom" code="81000" name="China Telecom"/>
<vendor vendor-id="TGPPCX" code="16777216" name="3GPP CX/DX"/>
<!-- *********************** End Vendors ************************** -->
&nasreq;
&eap;

View File

@ -178,6 +178,8 @@ grouped_start <grouped>
grouped_end <\/grouped>
vendor_start <vendor
vendor_end<\/vendor>
gavp_start <gavp
ignored_attr [a-z0-9-]+=
@ -395,12 +397,12 @@ description_attr description=\042
}
<COMMAND_ATTRS>{name_attr} { ATTR_STR(cmd->name); }
<COMMAND_ATTRS>{vendor_attr} { ATTR_STR(cmd->vendor); }
<COMMAND_ATTRS>{vendor_attr} { ATTR_STR(cmd->vendor); }
<COMMAND_ATTRS>{code_attr} { ATTR_UINT(cmd->code); }
<COMMAND_ATTRS>{stop} |
<COMMAND_ATTRS>{stop_end} { BEGIN IN_APPL; }
<IN_APPL>{vendor_start} {
<IN_DICT>{vendor_start} {
D(("vendor_start\n"));
vnd = g_new(ddict_vendor_t,1);
@ -417,8 +419,8 @@ description_attr description=\042
<VENDOR_ATTRS>{name_attr} { ATTR_STR(vnd->desc); }
<VENDOR_ATTRS>{vendor_attr} { ATTR_STR(vnd->name); }
<VENDOR_ATTRS>{code_attr} { ATTR_UINT(vnd->code); }
<VENDOR_ATTRS>{stop} |
<VENDOR_ATTRS>{stop_end} { BEGIN IN_APPL; }
<VENDOR_ATTRS>{stop} { BEGIN IN_APPL; }
<VENDOR_ATTRS>{stop_end} { BEGIN IN_DICT; }
<IN_APPL>{typedefn_start} {
D(("typedefn_start\n"));
@ -460,10 +462,10 @@ description_attr description=\042
}
<AVP_ATTRS>{name_attr} { ATTR_STR(avp->name); }
<AVP_ATTRS>{description_attr} { ATTR_STR(avp->description); }
<AVP_ATTRS>{description_attr} { ATTR_STR(avp->description); }
<AVP_ATTRS>{vendor_attr} { ATTR_STR(avp->vendor); }
<AVP_ATTRS>{code_attr} { ATTR_UINT(avp->code); }
<AVP_ATTRS>{stop} { BEGIN IN_AVP; }
<AVP_ATTRS>{stop} { BEGIN IN_AVP; }
<AVP_ATTRS>{stop_end} { BEGIN IN_APPL; }
@ -509,15 +511,20 @@ description_attr description=\042
<ENUM_ATTRS>{name_attr} { ATTR_STR(enumitem->name); }
<ENUM_ATTRS>{code_attr} { ATTR_UINT(enumitem->code); }
<TYPE_ATTRS,GAVP_ATTRS,ENUM_ATTRS>{stop} { BEGIN IN_AVP; }
<TYPE_ATTRS,GAVP_ATTRS,ENUM_ATTRS>{stop} { BEGIN IN_AVP; }
<TYPE_ATTRS,GAVP_ATTRS,ENUM_ATTRS>{stop_end} { BEGIN IN_AVP; }
<IN_AVP>{avp_end} { D(("avp_end\n")); BEGIN IN_APPL; }
<IN_APPL>{application_end} |
<IN_APPL>{base_end} {
<IN_APPL>{application_end} {
D(("application_end\n")); BEGIN IN_DICT;
}
<IN_APPL>{vendor_end} {
D(("vendor_end\n")); BEGIN IN_DICT;
}
<IN_APPL>{base_end} {
D(("base_end\n")); BEGIN IN_DICT;
}
<IN_DICT>{dictionary_end} {
yyterminate();