PCAP decoder and example dictionary
authorEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Thu, 2 Apr 2015 23:27:21 +0000 (01:27 +0200)
committerEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Thu, 2 Apr 2015 23:27:21 +0000 (01:27 +0200)
README.md
example/diameter/pcapDecoder/SConscript [new file with mode: 0644]
example/diameter/pcapDecoder/SConstruct [new file with mode: 0644]
example/diameter/pcapDecoder/dictionary.xml [new file with mode: 0644]
example/diameter/pcapDecoder/main.cpp [new file with mode: 0644]
example/diameter/pcapDecoder/my.pcap [new file with mode: 0644]

index 1b95114..56a695f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -53,6 +53,9 @@ Execute 'sudo scons uninstall'
 ### OpenLDAP:
      sudo apt-get install libldap2-dev
 
+### Pcap:
+     sudo apt-get install libpcap-dev
+
 ### MySql:
      sudo apt-get install libmysqlclient-dev
 
diff --git a/example/diameter/pcapDecoder/SConscript b/example/diameter/pcapDecoder/SConscript
new file mode 100644 (file)
index 0000000..ab3bc06
--- /dev/null
@@ -0,0 +1,38 @@
+Import ('env')
+
+# Process #################################################################
+#pName = "example_<module>_<process>"
+bnames = Dir('..').abspath.rsplit('/', 2)
+pName = "example_" + bnames[-2] + "_" + bnames[-1]
+pPath = pName.replace("_", "/") + "/"
+
+# Anna modules ############################################################
+pwd = str(Dir ('.').abspath);
+anna_libpaths = []
+anna_libs = []
+modules = [ 'core', 'io', 'xml', 'time', 'diameter' ];
+for module in modules:
+  anna_libs.append ("anna_" + module)
+  #module = module.replace("_", ".")
+  anna_libpaths.append (pwd.replace (pPath, ("source/" + module + "/")))
+
+anna_rlibs = list(anna_libs)
+anna_rlibs.reverse()
+
+# Libraries ###############################################################
+# To avoid other libraries accumulation:
+localEnv = env.Clone()
+
+anna_library = { 'LIBS' : anna_rlibs }
+localEnv.MergeFlags (anna_library)
+
+system_library = { 'LIBS' : [ 'xml2', 'rt', 'pcap' ] }
+localEnv.MergeFlags (system_library)
+
+localEnv.Append(LIBPATH = anna_libpaths)
+
+# Linking #################################################################
+result = localEnv.Program (pName, Glob ('*.cpp'))
+
+
+Return ('result')
diff --git a/example/diameter/pcapDecoder/SConstruct b/example/diameter/pcapDecoder/SConstruct
new file mode 100644 (file)
index 0000000..3275f35
--- /dev/null
@@ -0,0 +1,8 @@
+Import ('env')
+
+variant = env ['VARIANT']
+
+result = SConscript ('SConscript', exports='env', variant_dir='%s' % variant, duplicate=0)
+
+Return ('result')
+
diff --git a/example/diameter/pcapDecoder/dictionary.xml b/example/diameter/pcapDecoder/dictionary.xml
new file mode 100644 (file)
index 0000000..99c4b3a
--- /dev/null
@@ -0,0 +1,2141 @@
+<dictionary name="Gx and Rx for PCAP decoder">
+   <vendor name="IETF" code="0"/>
+   <vendor name="3GPP" code="10415"/>
+   <vendor name="ETSI" code="13019"/>
+   <avp name="User-Name" code="1" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="NAS-IP-Address" code="4" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Framed-IP-Address" code="8" may-encrypt="no" v-bit="mustnot" m-bit="may" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Filter-Id" code="11" may-encrypt="no" v-bit="mustnot" m-bit="may" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Class" code="25" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Session-Timeout" code="27" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Called-Station-Id" code="30" may-encrypt="no" v-bit="mustnot" m-bit="may" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Proxy-State" code="33" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="mustnot">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Accounting-Session-Id" code="44" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Acct-Multi-Session-Id" code="50" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Event-Timestamp" code="55" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Time"/>
+   </avp>
+   <avp name="Acct-Interim-Interval" code="85" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Framed-IPv6-Prefix" code="97" may-encrypt="no" v-bit="mustnot" m-bit="may" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Host-IP-Address" code="257" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Address"/>
+   </avp>
+   <avp name="Auth-Application-Id" code="258" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Acct-Application-Id" code="259" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32">
+         <label data="19302" alias="ERICSSON_SCAP"/>
+      </single>
+   </avp>
+   <avp name="Vendor-Specific-Application-Id" code="260" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Vendor-Id" type="Optional" qual="1*"/>
+         <avprule id="Auth-Application-Id" type="Optional" qual="*1"/>
+         <avprule id="Acct-Application-Id" type="Optional" qual="*1"/>
+      </grouped>
+   </avp>
+   <avp name="Redirect-Host-Usage" code="261" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-6">
+         <label data="0" alias="DONT_CACHE"/>
+         <label data="1" alias="ALL_SESSION"/>
+         <label data="2" alias="ALL_REALM"/>
+         <label data="3" alias="REALM_AND_APPLICATION"/>
+         <label data="4" alias="ALL_APPLICATION"/>
+         <label data="5" alias="ALL_HOST"/>
+         <label data="6" alias="ALL_USER"/>
+      </single>
+   </avp>
+   <avp name="Redirect-Max-Cache-Time" code="262" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Session-Id" code="263" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Origin-Host" code="264" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="DiameterIdentity"/>
+   </avp>
+   <avp name="Supported-Vendor-Id" code="265" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Vendor-Id" code="266" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Firmware-Revision" code="267" may-encrypt="no" v-bit="mustnot" m-bit="mustnot" p-bit="mustnot">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Result-Code" code="268" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32">
+         <label data="1001" alias="DIAMETER_MULTI_ROUND_AUTH"/>
+         <label data="2001" alias="DIAMETER_SUCCESS"/>
+         <label data="2002" alias="DIAMETER_LIMITED_SUCCESS"/>
+         <label data="3001" alias="DIAMETER_COMMAND_UNSUPPORTED"/>
+         <label data="3002" alias="DIAMETER_UNABLE_TO_DELIVER"/>
+         <label data="3003" alias="DIAMETER_REALM_NOT_SERVED"/>
+         <label data="3004" alias="DIAMETER_TOO_BUSY"/>
+         <label data="3005" alias="DIAMETER_LOOP_DETECTED"/>
+         <label data="3006" alias="DIAMETER_REDIRECT_INDICATION"/>
+         <label data="3007" alias="DIAMETER_APPLICATION_UNSUPPORTED"/>
+         <label data="3008" alias="DIAMETER_INVALID_HDR_BITS"/>
+         <label data="3009" alias="DIAMETER_INVALID_AVP_BITS"/>
+         <label data="3010" alias="DIAMETER_UNKNOWN_PEER"/>
+         <label data="4001" alias="DIAMETER_AUTHENTICATION_REJECTED"/>
+         <label data="4002" alias="DIAMETER_OUT_OF_SPACE"/>
+         <label data="4003" alias="ELECTION_LOST"/>
+         <label data="4005" alias="DIAMETER_ERROR_MIP_REPLY_FAILURE"/>
+         <label data="4006" alias="DIAMETER_ERROR_HA_NOT_AVAILABLE"/>
+         <label data="4007" alias="DIAMETER_ERROR_BAD_KEY"/>
+         <label data="4008" alias="DIAMETER_ERROR_MIP_FILTER_NOT_SUPPORTED"/>
+         <label data="4010" alias="DIAMETER_END_USER_SERVICE_DENIED"/>
+         <label data="4011" alias="DIAMETER_CREDIT_CONTROL_NOT_APPLICABLE"/>
+         <label data="4012" alias="DIAMETER_CREDIT_LIMIT_REACHED"/>
+         <label data="4241" alias="DIAMETER_END_USER_SERVICE_DENIED"/>
+         <label data="5001" alias="DIAMETER_AVP_UNSUPPORTED"/>
+         <label data="5002" alias="DIAMETER_UNKNOWN_SESSION_ID"/>
+         <label data="5003" alias="DIAMETER_AUTHORIZATION_REJECTED"/>
+         <label data="5004" alias="DIAMETER_INVALID_AVP_VALUE"/>
+         <label data="5005" alias="DIAMETER_MISSING_AVP"/>
+         <label data="5006" alias="DIAMETER_RESOURCES_EXCEEDED"/>
+         <label data="5007" alias="DIAMETER_CONTRADICTING_AVPS"/>
+         <label data="5008" alias="DIAMETER_AVP_NOT_ALLOWED"/>
+         <label data="5009" alias="DIAMETER_AVP_OCCURS_TOO_MANY_TIMES"/>
+         <label data="5010" alias="DIAMETER_NO_COMMON_APPLICATION"/>
+         <label data="5011" alias="DIAMETER_UNSUPPORTED_VERSION"/>
+         <label data="5012" alias="DIAMETER_UNABLE_TO_COMPLY"/>
+         <label data="5013" alias="DIAMETER_INVALID_BIT_IN_HEADER"/>
+         <label data="5014" alias="DIAMETER_INVALID_AVP_LENGTH"/>
+         <label data="5015" alias="DIAMETER_INVALID_MESSAGE_LENGTH"/>
+         <label data="5016" alias="DIAMETER_INVALID_AVP_BIT_COMBO"/>
+         <label data="5017" alias="DIAMETER_NO_COMMON_SECURITY"/>
+         <label data="5024" alias="DIAMETER_ERROR_NO_FOREIGN_HA_SERVICE"/>
+         <label data="5025" alias="DIAMETER_ERROR_END_TO_END_MIP_KEY_ENCRYPTION"/>
+         <label data="5030" alias="DIAMETER_USER_UNKNOWN"/>
+         <label data="5031" alias="DIAMETER_RATING_FAILED"/>
+         <label data="5241" alias="DIAMETER_END_USER_NOT_FOUND"/>
+      </single>
+   </avp>
+   <avp name="Product-Name" code="269" may-encrypt="no" v-bit="mustnot" m-bit="mustnot" p-bit="mustnot">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Session-Binding" code="270" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32">
+         <label data="1" alias="RE_AUTH"/>
+         <label data="2" alias="STR"/>
+         <label data="4" alias="ACCOUNTING"/>
+      </single>
+   </avp>
+   <avp name="Session-Server-Failover" code="271" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-3">
+         <label data="0" alias="REFUSE_SERVICE"/>
+         <label data="1" alias="TRY_AGAIN"/>
+         <label data="2" alias="ALLOW_SERVICE"/>
+         <label data="3" alias="TRY_AGAIN_ALLOW_SERVICE"/>
+      </single>
+   </avp>
+   <avp name="Multi-Round-Time-Out" code="272" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Disconnect-Cause" code="273" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-2">
+         <label data="0" alias="REBOOTING"/>
+         <label data="1" alias="BUSY"/>
+         <label data="2" alias="DO_NOT_WANT_TO_TALK_TO_YOU"/>
+      </single>
+   </avp>
+   <avp name="Auth-Request-Type" code="274" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-3">
+         <label data="0" alias="RESERVED"/>
+         <label data="1" alias="AUTHENTICATE_ONLY"/>
+         <label data="2" alias="AUTHORIZE_ONLY"/>
+         <label data="3" alias="AUTHORIZE_AUTHENTICATE"/>
+      </single>
+   </avp>
+   <avp name="Auth-Grace-Period" code="276" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Auth-Session-State" code="277" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="STATE_MAINTAINED"/>
+         <label data="1" alias="NO_STATE_MAINTAINED"/>
+      </single>
+   </avp>
+   <avp name="Origin-State-Id" code="278" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Failed-AVP" code="279" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="AVP" type="Mandatory" qual="1*"/>
+      </grouped>
+   </avp>
+   <avp name="Proxy-Host" code="280" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="mustnot">
+      <single format-name="DiameterIdentity"/>
+   </avp>
+   <avp name="Error-Message" code="281" may-encrypt="no" v-bit="mustnot" m-bit="mustnot" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Route-Record" code="282" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="mustnot">
+      <single format-name="DiameterIdentity"/>
+   </avp>
+   <avp name="Destination-Realm" code="283" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="DiameterIdentity"/>
+   </avp>
+   <avp name="Proxy-Info" code="284" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="mustnot">
+      <grouped>
+         <avprule id="Proxy-Host" type="Mandatory"/>
+         <avprule id="Proxy-State" type="Mandatory"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Re-Auth-Request-Type" code="285" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="AUTHORIZE_ONLY"/>
+         <label data="1" alias="AUTHORIZE_AUTHENTICATE"/>
+      </single>
+   </avp>
+   <avp name="Accounting-Sub-Session-Id" code="287" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned64"/>
+   </avp>
+   <avp name="Authorization-Lifetime" code="291" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Redirect-Host" code="292" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="DiameterURI"/>
+   </avp>
+   <avp name="Destination-Host" code="293" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="DiameterIdentity"/>
+   </avp>
+   <avp name="Error-Reporting-Host" code="294" may-encrypt="no" v-bit="mustnot" m-bit="mustnot" p-bit="may">
+      <single format-name="DiameterIdentity"/>
+   </avp>
+   <avp name="Termination-Cause" code="295" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="1-8">
+         <label data="1" alias="DIAMETER_LOGOUT"/>
+         <label data="2" alias="DIAMETER_SERVICE_NOT_PROVIDED"/>
+         <label data="3" alias="DIAMETER_BAD_ANSWER"/>
+         <label data="4" alias="DIAMETER_ADMINISTRATIVE"/>
+         <label data="5" alias="DIAMETER_LINK_BROKEN"/>
+         <label data="6" alias="DIAMETER_AUTH_EXPIRED"/>
+         <label data="7" alias="DIAMETER_USER_MOVED"/>
+         <label data="8" alias="DIAMETER_SESSION_TIMEOUT"/>
+      </single>
+   </avp>
+   <avp name="Origin-Realm" code="296" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="DiameterIdentity"/>
+   </avp>
+   <avp name="Experimental-Result" code="297" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Vendor-Id" type="Mandatory"/>
+         <avprule id="Experimental-Result-Code" type="Mandatory"/>
+      </grouped>
+   </avp>
+   <avp name="Experimental-Result-Code" code="298" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32">
+         <label data="5061" alias="INVALID_SERVICE_INFORMATION"/>
+         <label data="5062" alias="FILTER_RESTRICTIONS"/>
+         <label data="5063" alias="REQUESTED_SERVICE_NOT_AUTHORIZED"/>
+         <label data="5064" alias="DUPLICATED_AF_SESSION"/>
+         <label data="5065" alias="IP-CAN_SESSION_NOT_AVAILABLE"/>
+      </single>
+   </avp>
+   <avp name="Inband-Security-Id" code="299" may-encrypt="no" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32">
+         <label data="0" alias="NO_INBAND_SECURITY"/>
+         <label data="1" alias="TLS"/>
+      </single>
+   </avp>
+   <avp name="E2E-Sequence-AVP" code="300" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="CC-Correlation-Id" code="411" may-encrypt="yes" v-bit="mustnot" m-bit="may" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="CC-Input-Octets" code="412" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned64"/>
+   </avp>
+   <avp name="CC-Money" code="413" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Unit-Value" type="Fixed"/>
+         <avprule id="Currency-Code" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="CC-Output-Octets" code="414" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned64"/>
+   </avp>
+   <avp name="CC-Request-Number" code="415" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="CC-Request-Type" code="416" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="1-4">
+         <label data="1" alias="INITIAL_REQUEST"/>
+         <label data="2" alias="UPDATE_REQUEST"/>
+         <label data="3" alias="TERMINATION_REQUEST"/>
+         <label data="4" alias="EVENT_REQUEST"/>
+      </single>
+   </avp>
+   <avp name="CC-Service-Specific-Units" code="417" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned64"/>
+   </avp>
+   <avp name="CC-Session-Failover" code="418" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="FAILOVER_NOT_SUPPORTED"/>
+         <label data="1" alias="FAILOVER_SUPPORTED"/>
+      </single>
+   </avp>
+   <avp name="CC-Sub-Session-Id" code="419" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned64"/>
+   </avp>
+   <avp name="CC-Time" code="420" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="CC-Total-Octets" code="421" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned64"/>
+   </avp>
+   <avp name="Check-Balance-Result" code="422" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="ENOUGH_CREDIT"/>
+         <label data="1" alias="NO_CREDIT"/>
+      </single>
+   </avp>
+   <avp name="Cost-Information" code="423" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Unit-Value" type="Mandatory"/>
+         <avprule id="Currency-Code" type="Mandatory"/>
+         <avprule id="Cost-Unit" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Cost-Unit" code="424" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Currency-Code" code="425" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Credit-Control" code="426" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="CREDIT_AUTHORIZATION"/>
+         <label data="1" alias="RE_AUTHORIZATION"/>
+      </single>
+   </avp>
+   <avp name="Credit-Control-Failure-Handling" code="427" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-2">
+         <label data="0" alias="TERMINATE"/>
+         <label data="1" alias="CONTINUE"/>
+         <label data="2" alias="RETRY_AND_TERMINATE"/>
+      </single>
+   </avp>
+   <avp name="Direct-Debiting-Failure-Handling" code="428" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="TERMINATE_OR_BUFFER"/>
+         <label data="1" alias="CONTINUE"/>
+      </single>
+   </avp>
+   <avp name="Exponent" code="429" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Integer32"/>
+   </avp>
+   <avp name="Final-Unit-Indication" code="430" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Final-Unit-Action" type="Fixed"/>
+         <avprule id="Restriction-Filter-Rule" type="Optional" qual="*"/>
+         <avprule id="Filter-Id" type="Optional" qual="*"/>
+         <avprule id="Redirect-Server" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Granted-Service-Unit" code="431" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Tariff-Time-Change" type="Optional"/>
+         <avprule id="CC-Time" type="Optional"/>
+         <avprule id="CC-Money" type="Optional"/>
+         <avprule id="CC-Total-Octets" type="Optional"/>
+         <avprule id="CC-Input-Octets" type="Optional"/>
+         <avprule id="CC-Output-Octets" type="Optional"/>
+         <avprule id="CC-Service-Specific-Units" type="Optional"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Rating-Group" code="432" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Redirect-Address-Type" code="433" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-3">
+         <label data="0" alias="IPv4_Address"/>
+         <label data="1" alias="IPv6_Address"/>
+         <label data="2" alias="URL"/>
+         <label data="3" alias="SIP_URL"/>
+      </single>
+   </avp>
+   <avp name="Redirect-Server" code="434" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Redirect-Address-Type" type="Fixed"/>
+         <avprule id="Redirect-Server-Address" type="Fixed"/>
+      </grouped>
+   </avp>
+   <avp name="Redirect-Server-Address" code="435" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Requested-Action" code="436" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-3">
+         <label data="0" alias="DIRECT_DEBITING"/>
+         <label data="1" alias="REFUND_ACCOUNT"/>
+         <label data="2" alias="CHECK_BALANCE"/>
+         <label data="3" alias="PRICE_ENQUIRY"/>
+      </single>
+   </avp>
+   <avp name="Requested-Service-Unit" code="437" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="CC-Time" type="Optional"/>
+         <avprule id="CC-Money" type="Optional"/>
+         <avprule id="CC-Total-Octets" type="Optional"/>
+         <avprule id="CC-Input-Octets" type="Optional"/>
+         <avprule id="CC-Output-Octets" type="Optional"/>
+         <avprule id="CC-Service-Specific-Units" type="Optional"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Restriction-Filter-Rule" code="438" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="IPFilterRule"/>
+   </avp>
+   <avp name="Service-Identifier" code="439" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Service-Parameter-Info" code="440" may-encrypt="yes" v-bit="mustnot" m-bit="may" p-bit="may">
+      <grouped>
+         <avprule id="Service-Parameter-Type" type="Mandatory"/>
+         <avprule id="Service-Parameter-Value" type="Mandatory"/>
+      </grouped>
+   </avp>
+   <avp name="Service-Parameter-Type" code="441" may-encrypt="yes" v-bit="mustnot" m-bit="may" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Service-Parameter-Value" code="442" may-encrypt="yes" v-bit="mustnot" m-bit="may" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Subscription-Id" code="443" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Subscription-Id-Type" type="Fixed"/>
+         <avprule id="Subscription-Id-Data" type="Fixed"/>
+      </grouped>
+   </avp>
+   <avp name="Subscription-Id-Data" code="444" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Unit-Value" code="445" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Value-Digits" type="Fixed"/>
+         <avprule id="Exponent" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Used-Service-Unit" code="446" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Tariff-Change-Usage" type="Optional"/>
+         <avprule id="CC-Time" type="Optional"/>
+         <avprule id="CC-Money" type="Optional"/>
+         <avprule id="CC-Total-Octets" type="Optional"/>
+         <avprule id="CC-Input-Octets" type="Optional"/>
+         <avprule id="CC-Output-Octets" type="Optional"/>
+         <avprule id="CC-Service-Specific-Units" type="Optional"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Value-Digits" code="447" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Integer64"/>
+   </avp>
+   <avp name="Validity-Time" code="448" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Final-Unit-Action" code="449" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-2">
+         <label data="0" alias="TERMINATE"/>
+         <label data="1" alias="REDIRECT"/>
+         <label data="2" alias="RESTRICT_ACCESS"/>
+      </single>
+   </avp>
+   <avp name="Subscription-Id-Type" code="450" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-4">
+         <label data="0" alias="END_USER_E164"/>
+         <label data="1" alias="END_USER_IMSI"/>
+         <label data="2" alias="END_USER_SIP_URL"/>
+         <label data="3" alias="END_USER_NAI"/>
+         <label data="4" alias="END_USER_PRIVATE"/>
+      </single>
+   </avp>
+   <avp name="Tariff-Time-Change" code="451" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Time"/>
+   </avp>
+   <avp name="Tariff-Change-Usage" code="452" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-2">
+         <label data="0" alias="UNIT_BEFORE_TARIFF_CHANGE"/>
+         <label data="1" alias="UNIT_AFTER_TARIFF_CHANGE"/>
+         <label data="2" alias="UNIT_INDETERMINATE"/>
+      </single>
+   </avp>
+   <avp name="G-S-U-Pool-Identifier" code="453" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="CC-Unit-Type" code="454" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-5">
+         <label data="0" alias="TIME"/>
+         <label data="1" alias="MONEY"/>
+         <label data="2" alias="TOTAL_OCTETS"/>
+         <label data="3" alias="INPUT_OCTETS"/>
+         <label data="4" alias="OUTPUT_OCTETS"/>
+         <label data="5" alias="SERVICE_SPECIFIC_UNITS"/>
+      </single>
+   </avp>
+   <avp name="Multiple-Services-Indicator" code="455" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="MULTIPLE_SERVICES_NOT_SUPPORTED"/>
+         <label data="1" alias="MULTIPLE_SERVICES_SUPPORTED"/>
+      </single>
+   </avp>
+   <avp name="Multiple-Services-Credit-Control" code="456" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Granted-Service-Unit" type="Optional"/>
+         <avprule id="Requested-Service-Unit" type="Optional"/>
+         <avprule id="Used-Service-Unit" type="Optional" qual="*"/>
+         <avprule id="Tariff-Change-Usage" type="Optional"/>
+         <avprule id="Service-Identifier" type="Optional" qual="*"/>
+         <avprule id="Rating-Group" type="Optional"/>
+         <avprule id="G-S-U-Pool-Reference" type="Optional" qual="*"/>
+         <avprule id="Validity-Time" type="Optional"/>
+         <avprule id="Result-Code" type="Optional"/>
+         <avprule id="Final-Unit-Indication" type="Optional"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="G-S-U-Pool-Reference" code="457" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="G-S-U-Pool-Identifier" type="Mandatory"/>
+         <avprule id="CC-Unit-Type" type="Mandatory"/>
+         <avprule id="Unit-Value" type="Mandatory"/>
+      </grouped>
+   </avp>
+   <avp name="User-Equipment-Info" code="458" may-encrypt="yes" v-bit="mustnot" m-bit="may" p-bit="may">
+      <grouped>
+         <avprule id="User-Equipment-Info-Type" type="Mandatory"/>
+         <avprule id="User-Equipment-Info-Value" type="Mandatory"/>
+      </grouped>
+   </avp>
+   <avp name="User-Equipment-Info-Type" code="459" may-encrypt="yes" v-bit="mustnot" m-bit="may" p-bit="may">
+      <single format-name="Enumerated" enum="0-3">
+         <label data="0" alias="IMEISV"/>
+         <label data="1" alias="MAC"/>
+         <label data="2" alias="EUI64"/>
+         <label data="3" alias="MODIFIED_EUI64"/>
+      </single>
+   </avp>
+   <avp name="User-Equipment-Info-Value" code="460" may-encrypt="yes" v-bit="mustnot" m-bit="may" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Service-Context-Id" code="461" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Accounting-Record-Type" code="480" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="1-4">
+         <label data="1" alias="EVENT_RECORD"/>
+         <label data="2" alias="START_RECORD"/>
+         <label data="3" alias="INTERIM_RECORD"/>
+         <label data="4" alias="STOP_RECORD"/>
+      </single>
+   </avp>
+   <avp name="Accounting-Interim-Interval" code="482" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Integer32"/>
+   </avp>
+   <avp name="Accounting-Realtime-Required" code="483" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="1-3">
+         <label data="1" alias="DELIVER_AND_GRANT"/>
+         <label data="2" alias="GRANT_AND_STORE"/>
+         <label data="3" alias="GRANT_AND_LOSE"/>
+      </single>
+   </avp>
+   <avp name="Accounting-Record-Number" code="485" may-encrypt="yes" v-bit="mustnot" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="3GPP-Charging-Id" code="2" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="3GPP-PDP-Type" code="3" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32">
+         <label data="0" alias="IPV4"/>
+         <label data="1" alias="PPP"/>
+         <label data="2" alias="IPV6"/>
+      </single>
+   </avp>
+   <avp name="3GPP-CG-Address" code="4" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="3GPP-GPRS-Neg-QoS-Profile" code="5" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="3GPP-SGSN-Address" code="6" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="3GPP-GGSN-Address" code="7" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="3GPP-IMSI-MCC-MNC" code="8" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="3GPP-GGSN-MCC-MNC" code="9" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="3GPP-NSAPI" code="10" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="3GPP-Session-Stop-Indicator" code="11" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="3GPP-Selection-Mode" code="12" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="3GPP-Charging-Characteristics" code="13" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="3GPP-SGSN-IPv6-Address" code="15" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="3GPP-GGSN-IPv6-Address" code="16" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="3GPP-SGSN-MCC-MNC" code="18" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="3GGP-IMEISV" code="20" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="3GPP-Rat-Type" code="21" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="3GPP-User-Location-Info" code="22" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="3GPP-MS-TimeZone" code="23" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="3GPP-CAMEL-Charging-Info" code="24" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Abort-Cause" code="500" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-4">
+         <label data="0" alias="BEARER_RELEASED"/>
+         <label data="1" alias="INSUFFICIENT_SERVER_RESOURCES"/>
+         <label data="2" alias="INSUFFICIENT_BEARER_RESOURCES"/>
+         <label data="3" alias="PS_TO_CS_HANDOVER"/>
+         <label data="4" alias="SPONSORED_DATA_CONNECTIVITY_DISALLOWED"/>
+      </single>
+   </avp>
+   <avp name="Access-Network-Charging-Address" code="501" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Address"/>
+   </avp>
+   <avp name="Access-Network-Charging-Identifier" code="502" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Access-Network-Charging-Identifier-Value" type="Mandatory"/>
+         <avprule id="Flows" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Access-Network-Charging-Identifier-Value" code="503" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="AF-Application-Identifier" code="504" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="AF-Charging-Identifier" code="505" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Flow-Description" code="507" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="IPFilterRule"/>
+   </avp>
+   <avp name="Flow-Number" code="509" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Flows" code="510" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Media-Component-Number" type="Mandatory"/>
+         <avprule id="Flow-Number" type="Optional" qual="*"/>
+         <avprule id="Final-Unit-Action" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Flow-Status" code="511" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-15">
+         <label data="0" alias="ENABLED-UPLINK"/>
+         <label data="1" alias="ENABLED-DOWNLINK"/>
+         <label data="2" alias="ENABLED"/>
+         <label data="3" alias="DISABLED"/>
+         <label data="4" alias="REMOVED"/>
+      </single>
+   </avp>
+   <avp name="Flow-Usage" code="512" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-15">
+         <label data="0" alias="NO_INFORMATION"/>
+         <label data="1" alias="RTCP"/>
+         <label data="2" alias="AF_SIGNALLING"/>
+      </single>
+   </avp>
+   <avp name="Specific-Action" code="513" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="1-4,6-11">
+         <label data="1" alias="CHARGING_CORRELATION_EXCHANGE"/>
+         <label data="2" alias="INDICATION_OF_LOSS_OF_BEARER"/>
+         <label data="3" alias="INDICATION_OF_RECOVERY_OF_BEARER"/>
+         <label data="4" alias="INDICATION_OF_RELEASE_OF_BEARER"/>
+         <label data="6" alias="IP-CAN_CHANGE"/>
+         <label data="7" alias="INDICATION_OF_OUT_OF_CREDIT"/>
+         <label data="8" alias="INDICATION_OF_SUCCESSFUL_RESOURCES_ALLOCATION"/>
+         <label data="9" alias="INDICATION_OF_FAILED_RESOURCES_ALLOCATION"/>
+         <label data="10" alias="INDICATION_OF_LIMITED_PCC_DEPLOYMENT"/>
+         <label data="11" alias="USAGE_REPORT"/>
+      </single>
+   </avp>
+   <avp name="Max-Requested-Bandwidth-DL" code="515" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Max-Requested-Bandwidth-UL" code="516" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Media-Component-Description" code="517" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Media-Component-Number" type="Mandatory"/>
+         <avprule id="Media-Sub-Component" type="Optional" qual="*"/>
+         <avprule id="AF-Application-Identifier" type="Optional"/>
+         <avprule id="Media-Type" type="Optional"/>
+         <avprule id="Max-Requested-Bandwidth-UL" type="Optional"/>
+         <avprule id="Max-Requested-Bandwidth-DL" type="Optional"/>
+         <avprule id="Flow-Status" type="Optional"/>
+         <avprule id="Reservation-Priority" type="Optional"/>
+         <avprule id="RS-Bandwidth" type="Optional"/>
+         <avprule id="RR-Bandwidth" type="Optional"/>
+         <avprule id="Codec-Data" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Media-Component-Number" code="518" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Media-Sub-Component" code="519" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Flow-Number" type="Mandatory"/>
+         <avprule id="Flow-Description" type="Optional" qual="0*2"/>
+         <avprule id="Flow-Status" type="Optional"/>
+         <avprule id="Flow-Usage" type="Optional"/>
+         <avprule id="Max-Requested-Bandwidth-UL" type="Optional"/>
+         <avprule id="Max-Requested-Bandwidth-DL" type="Optional"/>
+         <avprule id="AF-Signalling-Protocol" type="Optional"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Media-Type" code="520" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-6,4294967295">
+         <label data="4294967295" alias="OTHER"/>
+         <label data="0" alias="AUDIO"/>
+         <label data="1" alias="VIDEO"/>
+         <label data="2" alias="DATA"/>
+         <label data="3" alias="APPLICATION"/>
+         <label data="4" alias="CONTROL"/>
+         <label data="5" alias="TEXT"/>
+         <label data="6" alias="MESSAGE"/>
+      </single>
+   </avp>
+   <avp name="RR-Bandwidth" code="521" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="RS-Bandwidth" code="522" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="SIP-Forking-Indication" code="523" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="SINGLE_DIALOGUE"/>
+         <label data="1" alias="SEVERAL_DIALOGUES"/>
+      </single>
+   </avp>
+   <avp name="Codec-Data" code="524" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Service-URN" code="525" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Acceptable-Service-Info" code="526" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Media-Component-Description" type="Optional" qual="*"/>
+         <avprule id="Max-Requested-Bandwidth-DL" type="Optional"/>
+         <avprule id="Max-Requested-Bandwidth-UL" type="Optional"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Service-Info-Status" code="527" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="FINAL_SERVICE_INFORMATION"/>
+         <label data="1" alias="PRELIMINARY_SERVICE_INFORMATION"/>
+      </single>
+   </avp>
+   <avp name="MPS-Identifier" code="528" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="mustnot" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="AF-Signalling-Protocol" code="529" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="mustnot" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="NO_INFORMATION"/>
+         <label data="1" alias="SIP"/>
+      </single>
+   </avp>
+   <avp name="Sponsored-Connectivity-Data" code="530" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="mustnot" p-bit="may">
+      <grouped>
+         <avprule id="Sponsor-Identity" type="Optional"/>
+         <avprule id="Application-Service-Provider-Identity" type="Optional"/>
+         <avprule id="Granted-Service-Unit" type="Optional"/>
+         <avprule id="Used-Service-Unit" type="Optional"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Sponsor-Identity" code="531" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="mustnot" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Application-Service-Provider-Identity" code="532" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="mustnot" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Rx-Request-Type" code="533" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="mustnot" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="INITIAL_REQUEST"/>
+         <label data="1" alias="UPDATE_REQUEST"/>
+      </single>
+   </avp>
+   <avp name="Server-Name" code="602" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Server-Capabilities" code="603" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Mandatory-Capability" type="Optional" qual="*"/>
+         <avprule id="Optional-Capability" type="Optional" qual="*"/>
+         <avprule id="Server-Name" type="Optional" qual="*"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Mandatory-Capability" code="604" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Optional-Capability" code="605" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Supported-Features" code="628" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="may" p-bit="may">
+      <grouped>
+         <avprule id="Vendor-Id" type="Mandatory"/>
+         <avprule id="Feature-List-ID" type="Mandatory"/>
+         <avprule id="Feature-List" type="Mandatory"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Feature-List-ID" code="629" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="mustnot" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Feature-List" code="630" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="mustnot" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Session-Priority" code="650" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-4">
+         <label data="0" alias="PRIORITY-0"/>
+         <label data="1" alias="PRIORITY-1"/>
+         <label data="2" alias="PRIORITY-2"/>
+         <label data="3" alias="PRIORITY-3"/>
+         <label data="4" alias="PRIORITY-4"/>
+      </single>
+   </avp>
+   <avp name="Quota-Consumption-Time" code="811" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Event-Type" code="823" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="SIP-Method" type="Optional"/>
+         <avprule id="Event" type="Optional"/>
+         <avprule id="Expires" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="SIP-Method" code="824" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Event" code="825" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Content-Type" code="826" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Content-Length" code="827" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Content-Disposition" code="828" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Role-Of-Node" code="829" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-3">
+         <label data="0" alias="ORIGINATING_ROLE"/>
+         <label data="1" alias="TERMINATING_ROLE"/>
+         <label data="2" alias="PROXY_ROLE"/>
+         <label data="3" alias="B2BUA_ROLE"/>
+      </single>
+   </avp>
+   <avp name="User-Session-Id" code="830" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Calling-Party-Address" code="831" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Called-Party-Address" code="832" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Time-Stamps" code="833" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="SIP-Request-Timestamp" type="Optional"/>
+         <avprule id="SIP-Response-Timestamp" type="Optional"/>
+         <avprule id="SIP-Request-Timestamp-Fraction" type="Optional"/>
+         <avprule id="SIP-Response-Timestamp-Fraction" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="SIP-Request-Timestamp" code="834" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Time"/>
+   </avp>
+   <avp name="SIP-Response-Timestamp" code="835" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Time"/>
+   </avp>
+   <avp name="Application-Server" code="836" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Application-Provided-Called-Party-Address" code="837" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Inter-Operator-Identifier" code="838" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Originating-IOI" type="Optional"/>
+         <avprule id="Terminating-IOI" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Originating-IOI" code="839" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Terminating-IOI" code="840" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="IMS-Charging-Identifier" code="841" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="SDP-Session-Description" code="842" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="SDP-Media-Component" code="843" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="SDP-Media-Name" type="Optional"/>
+         <avprule id="SDP-Media-Description" type="Optional" qual="*"/>
+         <avprule id="Media-Initiator-Flag" type="Optional"/>
+         <avprule id="Media-Initiator-Party" type="Optional"/>
+         <avprule id="Authorized-QoS" type="Optional"/>
+         <avprule id="3GPP-Charging-Id" type="Optional"/>
+         <avprule id="Access-Network-Charging-Identifier-Value" type="Optional"/>
+         <avprule id="SDP-Type" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="SDP-Media-Name" code="844" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="SDP-Media-Description" code="845" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="CG-Address" code="846" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Address"/>
+   </avp>
+   <avp name="GGSN-Address" code="847" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Address"/>
+   </avp>
+   <avp name="Served-Party-IP-Address" code="848" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Address"/>
+   </avp>
+   <avp name="Authorized-QoS" code="849" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Application-Server-Information" code="850" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Application-Server" type="Optional"/>
+         <avprule id="Application-Provided-Called-Party-Address" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Trunk-Group-ID" code="851" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Incoming-Trunk-Group-ID" type="Optional"/>
+         <avprule id="Outgoing-Trunk-Group-ID" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Incoming-Trunk-Group-ID" code="852" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Outgoing-Trunk-Group-ID" code="853" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Bearer-Service" code="854" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Service-Id" code="855" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Associated-URI" code="856" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Cause-Code" code="861" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Integer32"/>
+   </avp>
+   <avp name="Node-Functionality" code="862" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-11">
+         <label data="0" alias="S-CSCF"/>
+         <label data="1" alias="P-CSCF"/>
+         <label data="2" alias="I-CSCF"/>
+         <label data="3" alias="MRFC"/>
+         <label data="4" alias="MGCF"/>
+         <label data="5" alias="BGCF"/>
+         <label data="6" alias="AS"/>
+         <label data="7" alias="IBCF"/>
+         <label data="8" alias="S-GW"/>
+         <label data="9" alias="P-GW"/>
+         <label data="10" alias="HSGW"/>
+         <label data="11" alias="E-CSCF"/>
+      </single>
+   </avp>
+   <avp name="Service-Specific-Data" code="863" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Originator" code="864" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="Calling Party"/>
+         <label data="1" alias="Called Party"/>
+      </single>
+   </avp>
+   <avp name="PS-Furnish-Charging-Information" code="865" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="3GPP-Charging-Id" type="Mandatory"/>
+         <avprule id="PS-Free-Format-Data" type="Mandatory"/>
+         <avprule id="PS-Append-Free-Format-Data" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="PS-Free-Format-Data" code="866" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="PS-Append-Free-Format-Data" code="867" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="APPEND"/>
+         <label data="1" alias="OVERWRITE"/>
+      </single>
+   </avp>
+   <avp name="Time-Quota-Threshold" code="868" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Volume-Quota-Threshold" code="869" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Trigger-Type" code="870" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="1-4,10-23,30-34,40,50">
+         <label data="1" alias="CHANGE_IN_SGSN_IP_ADDRESS"/>
+         <label data="2" alias="CHANGE_IN_QOS"/>
+         <label data="3" alias="CHANGE_IN_LOCATION"/>
+         <label data="4" alias="CHANGE_IN_RAT"/>
+         <label data="10" alias="CHANGEINQOS_TRAFFIC_CLASS"/>
+         <label data="11" alias="CHANGEINQOS_RELIABILITY_CLASS"/>
+         <label data="12" alias="CHANGEINQOS_DELAY_CLASS"/>
+         <label data="13" alias="CHANGEINQOS_PEAK_THROUGHPUT"/>
+         <label data="14" alias="CHANGEINQOS_PRECEDENCE_CLASS"/>
+         <label data="15" alias="CHANGEINQOS_MEAN_THROUGHPUT"/>
+         <label data="16" alias="CHANGEINQOS_MAXIMUM_BIT_RATE_FOR_UPLINK"/>
+         <label data="17" alias="CHANGEINQOS_MAXIMUM_BIT_RATE_FOR_DOWNLINK"/>
+         <label data="18" alias="CHANGEINQOS_RESIDUAL_BER"/>
+         <label data="19" alias="CHANGEINQOS_SDU_ERROR_RATIO"/>
+         <label data="20" alias="CHANGEINQOS_TRANSFER_DELAY"/>
+         <label data="21" alias="CHANGEINQOS_TRAFFIC_HANDLING_PRIORITY"/>
+         <label data="22" alias="CHANGEINQOS_GUARANTEED_BIT_RATE_FOR_UPLINK"/>
+         <label data="23" alias="CHANGEINQOS_GUARANTEED_BIT_RATE_FOR_DOWNLINK"/>
+         <label data="30" alias="CHANGEINLOCATION_MCC"/>
+         <label data="31" alias="CHANGEINLOCATION_MNC"/>
+         <label data="32" alias="CHANGEINLOCATION_RAC"/>
+         <label data="33" alias="CHANGEINLOCATION_LAC"/>
+         <label data="34" alias="CHANGEINLOCATION_CellId"/>
+         <label data="40" alias="CHANGE_IN_MEDIA_COMPOSITION"/>
+         <label data="50" alias="CHANGEINPARTICIPANTS_NMB"/>
+      </single>
+   </avp>
+   <avp name="Quota-Holding-Time" code="871" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Reporting-Reason" code="872" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-8">
+         <label data="0" alias="THRESHOLD"/>
+         <label data="1" alias="QHT"/>
+         <label data="2" alias="FINAL"/>
+         <label data="3" alias="QUOTA_EXHAUSTED"/>
+         <label data="4" alias="VALIDITY_TIME"/>
+         <label data="5" alias="OTHER_QUOTA_TYPE"/>
+         <label data="6" alias="RATING_CONDITION_CHANGE"/>
+         <label data="7" alias="FORCED_REAUTHORISATION"/>
+         <label data="8" alias="POOL_EXHAUSTED"/>
+      </single>
+   </avp>
+   <avp name="Service-Information" code="873" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="PS-Information" type="Optional"/>
+         <avprule id="IMS-Information" type="Optional"/>
+         <avprule id="MMS-Information" type="Optional"/>
+         <avprule id="SMS-Information" type="Optional"/>
+         <avprule id="Service-Generic-Information" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="PS-Information" code="874" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="3GPP-Charging-Id" type="Optional"/>
+         <avprule id="3GPP-PDP-Type" type="Optional"/>
+         <avprule id="3GPP-GPRS-Neg-QoS-Profile" type="Optional"/>
+         <avprule id="3GPP-IMSI-MCC-MNC" type="Optional"/>
+         <avprule id="3GPP-GGSN-MCC-MNC" type="Optional"/>
+         <avprule id="3GPP-NSAPI" type="Optional"/>
+         <avprule id="3GPP-Session-Stop-Indicator" type="Optional"/>
+         <avprule id="3GPP-Selection-Mode" type="Optional"/>
+         <avprule id="3GPP-Charging-Characteristics" type="Optional"/>
+         <avprule id="3GPP-SGSN-MCC-MNC" type="Optional"/>
+         <avprule id="3GPP-Rat-Type" type="Optional"/>
+         <avprule id="3GPP-User-Location-Info" type="Optional"/>
+         <avprule id="3GPP-MS-TimeZone" type="Optional"/>
+         <avprule id="3GPP-CAMEL-Charging-Info" type="Optional"/>
+         <avprule id="CG-Address" type="Optional"/>
+         <avprule id="GGSN-Address" type="Optional"/>
+         <avprule id="PS-Furnish-Charging-Information" type="Optional"/>
+         <avprule id="Charging-Rule-Base-Name" type="Optional"/>
+         <avprule id="PDP-Address" type="Optional"/>
+         <avprule id="SGSN-Address" type="Optional"/>
+         <avprule id="Called-Station-Id" type="Optional"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="IMS-Information" code="876" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Event-Type" type="Optional"/>
+         <avprule id="Role-Of-Node" type="Optional"/>
+         <avprule id="Node-Functionality" type="Mandatory"/>
+         <avprule id="User-Session-Id" type="Optional"/>
+         <avprule id="Outgoing-Session-Id" type="Optional"/>
+         <avprule id="Session-Priority" type="Optional"/>
+         <avprule id="Calling-Party-Address" type="Optional" qual="*"/>
+         <avprule id="Called-Party-Address" type="Optional"/>
+         <avprule id="Called-Asserted-Identity" type="Optional" qual="*"/>
+         <avprule id="Number-Portability-Routing-Information" type="Optional"/>
+         <avprule id="Carrier-Select-Routing-Information" type="Optional"/>
+         <avprule id="Alternate-Charged-Party-Address" type="Optional"/>
+         <avprule id="Requested-Party-Address" type="Optional"/>
+         <avprule id="Associated-URI" type="Optional" qual="*"/>
+         <avprule id="Time-Stamps" type="Optional"/>
+         <avprule id="Application-Server-Information" type="Optional" qual="*"/>
+         <avprule id="Inter-Operator-Identifier" type="Optional" qual="*"/>
+         <avprule id="IMS-Charging-Identifier" type="Optional"/>
+         <avprule id="SDP-Session-Description" type="Optional" qual="*"/>
+         <avprule id="SDP-Media-Component" type="Optional" qual="*"/>
+         <avprule id="Served-Party-IP-Address" type="Optional"/>
+         <avprule id="Server-Capabilities" type="Optional"/>
+         <avprule id="Trunk-Group-ID" type="Optional"/>
+         <avprule id="Bearer-Service" type="Optional"/>
+         <avprule id="Service-Id" type="Optional"/>
+         <avprule id="Service-Specific-Info" type="Optional" qual="*"/>
+         <avprule id="Message-Body" type="Optional" qual="*"/>
+         <avprule id="Cause-Code" type="Optional"/>
+         <avprule id="Access-Network-Information" type="Optional"/>
+         <avprule id="Early-Media-Description" type="Optional" qual="*"/>
+         <avprule id="IMS-Communication-Service-Identifier" type="Optional"/>
+         <avprule id="Online-Charging-Flag" type="Optional"/>
+         <avprule id="Real-Time-Tariff-Information" type="Optional"/>
+         <avprule id="Account-Expiration" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="MMS-Information" code="877" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Originator-Address" type="Optional"/>
+         <avprule id="Recipient-Address" type="Optional" qual="*"/>
+         <avprule id="Submission-Time" type="Optional"/>
+         <avprule id="MM-Content-Type" type="Optional"/>
+         <avprule id="Priority" type="Optional"/>
+         <avprule id="Message-ID" type="Optional"/>
+         <avprule id="Message-Type" type="Optional"/>
+         <avprule id="Message-Size" type="Optional"/>
+         <avprule id="Message-Class" type="Optional"/>
+         <avprule id="Delivery-Report-Requested" type="Optional"/>
+         <avprule id="Read-Reply-Report-Requested" type="Optional"/>
+         <avprule id="MMBox-Storage-Requested" type="Optional"/>
+         <avprule id="Applic-ID" type="Optional"/>
+         <avprule id="Reply-Applic-ID" type="Optional"/>
+         <avprule id="Aux-Applic-Info" type="Optional"/>
+         <avprule id="Content-Class" type="Optional"/>
+         <avprule id="DRM-Content" type="Optional"/>
+         <avprule id="Adaptations" type="Optional"/>
+         <avprule id="VASP-Id" type="Optional"/>
+         <avprule id="VAS-Id" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Media-Initiator-Flag" code="882" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-2">
+         <label data="0" alias="CALLING_PARTY"/>
+         <label data="1" alias="CALLED_PARTY"/>
+         <label data="2" alias="UNKNOWN"/>
+      </single>
+   </avp>
+   <avp name="Number-Of-Participants" code="885" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Originator-Address" code="886" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Address-Type" type="Optional"/>
+         <avprule id="Address-Data" type="Optional"/>
+         <avprule id="Address-Domain" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Expires" code="888" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Message-Body" code="889" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Content-Type" type="Mandatory"/>
+         <avprule id="Content-Length" type="Mandatory"/>
+         <avprule id="Content-Disposition" type="Optional"/>
+         <avprule id="Originator" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Address-Data" code="897" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Address-Domain" code="898" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Domain-Name" type="Optional"/>
+         <avprule id="3GPP-IMSI-MCC-MNC" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Address-Type" code="899" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-7">
+         <label data="0" alias="e-mail address"/>
+         <label data="1" alias="MSISDN"/>
+         <label data="2" alias="IPv4 Address"/>
+         <label data="3" alias="IPv6 Address"/>
+         <label data="4" alias="Numeric Shortcode"/>
+         <label data="5" alias="Alphanumeric Shortcode"/>
+         <label data="6" alias="Other"/>
+         <label data="7" alias="IMSI"/>
+      </single>
+   </avp>
+   <avp name="Charging-Rule-Base-Name" code="1004" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="IP-CAN-Type" code="1027" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-6">
+         <label data="0" alias="3GPP-GPRS"/>
+         <label data="1" alias="DOCSIS"/>
+         <label data="2" alias="xDSL"/>
+         <label data="3" alias="WiMAX"/>
+         <label data="4" alias="3GPP2"/>
+         <label data="5" alias="3GP-EPS"/>
+         <label data="6" alias="Non-3GPP-EPS"/>
+      </single>
+   </avp>
+   <avp name="RAT-Type" code="1032" vendor-name="3GPP" may-encrypt="yes" v-bit="must" m-bit="mustnot" p-bit="may">
+      <single format-name="Enumerated" enum="0-2,1000-1004,2000-2003">
+         <label data="0" alias="WLAN"/>
+         <label data="1" alias="VIRTUAL"/>
+         <label data="2" alias="BBF"/>
+         <label data="1000" alias="UTRAN"/>
+         <label data="1001" alias="GERAN"/>
+         <label data="1002" alias="GAN"/>
+         <label data="1003" alias="HSPA_EVOLUTION"/>
+         <label data="1004" alias="EUTRAN"/>
+         <label data="2000" alias="CDMA2000_1X"/>
+         <label data="2001" alias="HRPD"/>
+         <label data="2002" alias="UMB"/>
+         <label data="2003" alias="EHRPD"/>
+      </single>
+   </avp>
+   <avp name="VASP-Id" code="1101" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="VAS-Id" code="1102" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Domain-Name" code="1200" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Recipient-Address" code="1201" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Address-Type" type="Optional"/>
+         <avprule id="Address-Data" type="Optional"/>
+         <avprule id="Address-Domain" type="Optional"/>
+         <avprule id="Addressee-Type" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Submission-Time" code="1202" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Time"/>
+   </avp>
+   <avp name="MM-Content-Type" code="1203" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Type-Number" type="Optional"/>
+         <avprule id="Additional-Type-Information" type="Optional"/>
+         <avprule id="Content-Size" type="Optional"/>
+         <avprule id="Additional-Content-Information" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Type-Number" code="1204" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-88"/>
+   </avp>
+   <avp name="Additional-Type-Information" code="1205" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Content-Size" code="1206" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Additional-Content-Information" code="1207" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Type-Number" type="Optional"/>
+         <avprule id="Additional-Type-Information" type="Optional"/>
+         <avprule id="Content-Size" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Addressee-Type" code="1208" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-2">
+         <label data="0" alias="TO"/>
+         <label data="1" alias="CC"/>
+         <label data="2" alias="BCC"/>
+      </single>
+   </avp>
+   <avp name="Priority" code="1209" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-2">
+         <label data="0" alias="Low"/>
+         <label data="1" alias="Normal"/>
+         <label data="2" alias="High"/>
+      </single>
+   </avp>
+   <avp name="Message-ID" code="1210" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Message-Type" code="1211" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="1-15">
+         <label data="1" alias="m-send-req"/>
+         <label data="2" alias="m-send-conf"/>
+         <label data="3" alias="m-notification-ind"/>
+         <label data="4" alias="m-notifyresp-ind"/>
+         <label data="5" alias="m-retrieve-conf"/>
+         <label data="6" alias="m-acknowledge-ind"/>
+         <label data="7" alias="m-delivery-ind"/>
+         <label data="8" alias="m-read-rec-ind"/>
+         <label data="9" alias="m-read-orig-ind"/>
+         <label data="10" alias="m-forward-req"/>
+         <label data="11" alias="m-forward-conf"/>
+         <label data="12" alias="m-mbox-store-conf"/>
+         <label data="13" alias="m-mbox-view-conf"/>
+         <label data="14" alias="m-mbox-upload-conf"/>
+         <label data="15" alias="m-mbox-delete-conf"/>
+      </single>
+   </avp>
+   <avp name="Message-Size" code="1212" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Message-Class" code="1213" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Class-Identifier" type="Optional"/>
+         <avprule id="Token-Text" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Class-Identifier" code="1214" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-3">
+         <label data="0" alias="Personal"/>
+         <label data="1" alias="Advertisement"/>
+         <label data="2" alias="Informational"/>
+         <label data="3" alias="Auto"/>
+      </single>
+   </avp>
+   <avp name="Token-Text" code="1215" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Delivery-Report-Requested" code="1216" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="No"/>
+         <label data="1" alias="Yes"/>
+      </single>
+   </avp>
+   <avp name="Adaptations" code="1217" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="Yes"/>
+         <label data="1" alias="No"/>
+      </single>
+   </avp>
+   <avp name="Applic-ID" code="1218" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Aux-Applic-Info" code="1219" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Content-Class" code="1220" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-7">
+         <label data="0" alias="text"/>
+         <label data="1" alias="image-basic"/>
+         <label data="2" alias="image-rich"/>
+         <label data="3" alias="video-basic"/>
+         <label data="4" alias="video-rich"/>
+         <label data="5" alias="megapixel"/>
+         <label data="6" alias="content-basic"/>
+         <label data="7" alias="content-rich"/>
+      </single>
+   </avp>
+   <avp name="DRM-Content" code="1221" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="No"/>
+         <label data="1" alias="Yes"/>
+      </single>
+   </avp>
+   <avp name="Read-Reply-Report-Requested" code="1222" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="No"/>
+         <label data="1" alias="Yes"/>
+      </single>
+   </avp>
+   <avp name="Reply-Applic-ID" code="1223" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Unit-Quota-Threshold" code="1226" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="PDP-Address" code="1227" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Address"/>
+   </avp>
+   <avp name="SGSN-Address" code="1228" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Address"/>
+   </avp>
+   <avp name="PDP-Context-Type" code="1247" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="MMBox-Storage-Requested" code="1248" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="No"/>
+         <label data="1" alias="Yes"/>
+      </single>
+   </avp>
+   <avp name="Service-Specific-Info" code="1249" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Service-Specific-Type" type="Optional"/>
+         <avprule id="Service-Specific-Data" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Called-Asserted-Identity" code="1250" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Requested-Party-Address" code="1251" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Service-Generic-Information" code="1256" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Application-Server-ID" type="Optional"/>
+         <avprule id="Application-Service-Type" type="Optional"/>
+         <avprule id="Application-Session-ID" type="Optional"/>
+         <avprule id="Delivery-Status" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Service-Specific-Type" code="1257" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Access-Network-Information" code="1263" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Trigger" code="1264" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Trigger-Type" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Base-Time-Interval" code="1265" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Envelope" code="1266" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Envelope-Start-Time" type="Mandatory"/>
+         <avprule id="Envelope-End-Time" type="Optional"/>
+         <avprule id="CC-Total-Octets" type="Optional"/>
+         <avprule id="CC-Input-Octets" type="Optional"/>
+         <avprule id="CC-Output-Octets" type="Optional"/>
+         <avprule id="CC-Service-Specific-Units" type="Optional"/>
+         <avprule id="AVP" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Envelope-End-Time" code="1267" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Time"/>
+   </avp>
+   <avp name="Envelope-Reporting" code="1268" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-4">
+         <label data="0" alias="DO_NOT_REPORT_ENVELOPES"/>
+         <label data="1" alias="REPORT_ENVELOPES"/>
+         <label data="2" alias="REPORT_ENVELOPES_WITH_VOLUME"/>
+         <label data="3" alias="REPORT_ENVELOPES_WITH_EVENTS"/>
+         <label data="4" alias="REPORT_ENVELOPES_WITH_VOLUME_AND_EVENTS"/>
+      </single>
+   </avp>
+   <avp name="Envelope-Start-Time" code="1269" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Time"/>
+   </avp>
+   <avp name="Time-Quota-Mechanism" code="1270" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Time-Quota-Type" type="Mandatory"/>
+         <avprule id="Base-Time-Interval" type="Mandatory"/>
+      </grouped>
+   </avp>
+   <avp name="Time-Quota-Type" code="1271" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="DISCRETE_TIME_PERIOD"/>
+         <label data="1" alias="CONTINUOUS_TIME_PERIOD"/>
+      </single>
+   </avp>
+   <avp name="Early-Media-Description" code="1272" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="SDP-TimeStamps" type="Optional"/>
+         <avprule id="SDP-Media-Component" type="Optional" qual="*"/>
+         <avprule id="SDP-Session-Description" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="SDP-TimeStamps" code="1273" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="SDP-Offer-Timestamp" type="Optional"/>
+         <avprule id="SDP-Answer-Timestamp" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="SDP-Offer-Timestamp" code="1274" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Time"/>
+   </avp>
+   <avp name="SDP-Answer-Timestamp" code="1275" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Time"/>
+   </avp>
+   <avp name="AF-Correlation-Information" code="1276" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="AF-Charging-Identifier" type="Mandatory"/>
+         <avprule id="Flows" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Alternate-Charged-Party-Address" code="1280" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="IMS-Communication-Service-Identifier" code="1281" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Media-Initiator-Party" code="1288" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="SMS-Information" code="2000" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="SMS-Node" type="Optional"/>
+         <avprule id="Client-Address" type="Optional"/>
+         <avprule id="Originator-SCCP-Address" type="Optional"/>
+         <avprule id="SMSC-Address" type="Optional"/>
+         <avprule id="Data-Coding-Scheme" type="Optional"/>
+         <avprule id="SM-Discharge-Time" type="Optional"/>
+         <avprule id="SM-Message-Type" type="Optional"/>
+         <avprule id="Originator-Interface" type="Optional"/>
+         <avprule id="SM-Protocol-ID" type="Optional"/>
+         <avprule id="Reply-Path-Requested" type="Optional"/>
+         <avprule id="SM-Status" type="Optional"/>
+         <avprule id="SM-User-Data-Header" type="Optional"/>
+         <avprule id="Number-Of-Messages-Sent" type="Optional"/>
+         <avprule id="Recipient-Info" type="Optional" qual="*"/>
+         <avprule id="Originator-Received-Address" type="Optional"/>
+         <avprule id="SM-Service-Type" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Data-Coding-Scheme" code="2001" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Integer32"/>
+   </avp>
+   <avp name="Destination-Interface" code="2002" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Interface-Id" type="Optional"/>
+         <avprule id="Interface-Text" type="Optional"/>
+         <avprule id="Interface-Port" type="Optional"/>
+         <avprule id="Interface-Type" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Interface-Id" code="2003" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Interface-Port" code="2004" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Interface-Text" code="2005" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Interface-Type" code="2006" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-4">
+         <label data="0" alias="Unknown"/>
+         <label data="1" alias="MOBILE_ORIGINATING"/>
+         <label data="2" alias="MOBILE_TERMINATING"/>
+         <label data="3" alias="APPLICATION_ORIGINATING"/>
+         <label data="4" alias="APPLICATION_TERMINATION"/>
+      </single>
+   </avp>
+   <avp name="SM-Message-Type" code="2007" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-2">
+         <label data="0" alias="SUBMISSION"/>
+         <label data="1" alias="DELIVERY_REPORT"/>
+         <label data="2" alias="SM Service Request"/>
+      </single>
+   </avp>
+   <avp name="Originator-SCCP-Address" code="2008" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Address"/>
+   </avp>
+   <avp name="Originator-Interface" code="2009" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Interface-Id" type="Optional"/>
+         <avprule id="Interface-Text" type="Optional"/>
+         <avprule id="Interface-Port" type="Optional"/>
+         <avprule id="Interface-Type" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Recipient-SCCP-Address" code="2010" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Address"/>
+   </avp>
+   <avp name="Reply-Path-Requested" code="2011" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="No Reply Path Set"/>
+         <label data="1" alias="Reply path Set"/>
+      </single>
+   </avp>
+   <avp name="SM-Discharge-Time" code="2012" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Time"/>
+   </avp>
+   <avp name="SM-Protocol-ID" code="2013" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="SM-Status" code="2014" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="SM-User-Data-Header" code="2015" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="SMS-Node" code="2016" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-3">
+         <label data="0" alias="SMS Router"/>
+         <label data="1" alias="IP-SM-GW"/>
+         <label data="2" alias="SMS Router and IP-SM-GW"/>
+         <label data="3" alias="SMS-SC"/>
+      </single>
+   </avp>
+   <avp name="SMSC-Address" code="2017" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Address"/>
+   </avp>
+   <avp name="Client-Address" code="2018" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Address"/>
+   </avp>
+   <avp name="Number-Of-Messages-Sent" code="2019" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Low-Balance-Indication" code="2020" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="NOT_APPLICABLE"/>
+         <label data="1" alias="YES"/>
+      </single>
+   </avp>
+   <avp name="Remaining-Balance" code="2021" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Unit-Value" type="Mandatory"/>
+         <avprule id="Currency-Code" type="Mandatory"/>
+      </grouped>
+   </avp>
+   <avp name="Refund-Information" code="2022" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="OctetString"/>
+   </avp>
+   <avp name="Carrier-Select-Routing-Information" code="2023" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Number-Portability-Routing-Information" code="2024" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Recipient-Info" code="2026" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Destination-Interface" type="Optional"/>
+         <avprule id="Recipient-Address" type="Optional" qual="*"/>
+         <avprule id="Recipient-Received-Address" type="Optional" qual="*"/>
+         <avprule id="Recipient-SCCP-Address" type="Optional"/>
+         <avprule id="SM-Protocol-ID" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Originator-Received-Address" code="2027" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Address-Type" type="Optional"/>
+         <avprule id="Address-Data" type="Optional"/>
+         <avprule id="Address-Domain" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Recipient-Received-Address" code="2028" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Address-Type" type="Optional"/>
+         <avprule id="Address-Data" type="Optional"/>
+         <avprule id="Address-Domain" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="SM-Service-Type" code="2029" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-10">
+         <label data="0" alias="VAS4SMS Short Message content processing"/>
+         <label data="1" alias="VAS4SMS Short Message forwarding"/>
+         <label data="2" alias="VAS4SMS Short Message Forwarding multiple subscriptions"/>
+         <label data="3" alias="VAS4SMS Short Message filtering"/>
+         <label data="4" alias="VAS4SMS Short Message receipt"/>
+         <label data="5" alias="VAS4SMS Short Message Network Storage"/>
+         <label data="6" alias="VAS4SMS Short Message to multiple destinations"/>
+         <label data="7" alias="VAS4SMS Short Message Virtual Private Network (VPN)"/>
+         <label data="8" alias="VAS4SMS Short Message Auto Reply"/>
+         <label data="9" alias="VAS4SMS Short Message Personal Signature"/>
+         <label data="10" alias="VAS4SMS Short Message Deferred Delivery"/>
+      </single>
+   </avp>
+   <avp name="SDP-Type" code="2036" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="SDP Offer"/>
+         <label data="1" alias="SDP Answer"/>
+      </single>
+   </avp>
+   <avp name="Current-Tariff" code="2056" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Currency-Code" type="Optional"/>
+         <avprule id="Scale-Factor" type="Optional"/>
+         <avprule id="Rate-Element" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Next-Tariff" code="2057" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Currency-Code" type="Optional"/>
+         <avprule id="Scale-Factor" type="Optional"/>
+         <avprule id="Rate-Element" type="Optional" qual="*"/>
+      </grouped>
+   </avp>
+   <avp name="Rate-Element" code="2058" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="CC-Unit-Type" type="Mandatory"/>
+         <avprule id="Reason-Code" type="Optional"/>
+         <avprule id="Unit-Value" type="Optional"/>
+         <avprule id="Unit-Cost" type="Optional"/>
+         <avprule id="Unit-Quota-Threshold" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Scale-Factor" code="2059" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Value-Digits" type="Mandatory"/>
+         <avprule id="Exponent" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Tariff-Information" code="2060" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Current-Tariff" type="Mandatory"/>
+         <avprule id="Tariff-Time-Change" type="Optional"/>
+         <avprule id="Next-Tariff" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Unit-Cost" code="2061" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Value-Digits" type="Mandatory"/>
+         <avprule id="Exponent" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Application-Server-ID" code="2101" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Application-Service-Type" code="2102" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="100-105">
+         <label data="100" alias="SENDING"/>
+         <label data="101" alias="RECEIVING"/>
+         <label data="102" alias="RETRIEVAL"/>
+         <label data="103" alias="INVITING"/>
+         <label data="104" alias="LEAVING"/>
+         <label data="105" alias="JOINING"/>
+      </single>
+   </avp>
+   <avp name="Application-Session-ID" code="2103" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Delivery-Status" code="2104" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="SIP-Request-Timestamp-Fraction" code="2301" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="SIP-Response-Timestamp-Fraction" code="2302" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Unsigned32"/>
+   </avp>
+   <avp name="Online-Charging-Flag" code="2303" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-1">
+         <label data="0" alias="ECF address not provided"/>
+         <label data="1" alias="ECF address provided"/>
+      </single>
+   </avp>
+   <avp name="Real-Time-Tariff-Information" code="2305" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <grouped>
+         <avprule id="Tariff-Information" type="Optional"/>
+         <avprule id="Tariff-XML" type="Optional"/>
+      </grouped>
+   </avp>
+   <avp name="Tariff-XML" code="2306" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Account-Expiration" code="2309" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Time"/>
+   </avp>
+   <avp name="Reason-Code" code="2316" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="Enumerated" enum="0-4">
+         <label data="0" alias="UNKNOWN"/>
+         <label data="1" alias="USAGE"/>
+         <label data="2" alias="COMMUNICATION-ATTEMPT-CHARGE"/>
+         <label data="3" alias="SETUP-CHARGE"/>
+         <label data="4" alias="ADD-ON-CHARGE"/>
+      </single>
+   </avp>
+   <avp name="Outgoing-Session-Id" code="2320" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may">
+      <single format-name="UTF8String"/>
+   </avp>
+   <avp name="Reservation-Priority" code="458" vendor-name="ETSI" may-encrypt="yes" v-bit="must" m-bit="mustnot" p-bit="may">
+      <single format-name="Enumerated" enum="0-15">
+         <label data="0" alias="DEFAULT"/>
+         <label data="1" alias="PRIORITY-ONE"/>
+         <label data="2" alias="PRIORITY-TWO"/>
+         <label data="3" alias="PRIORITY-THREE"/>
+         <label data="4" alias="PRIORITY-FOUR"/>
+         <label data="5" alias="PRIORITY-FIVE"/>
+         <label data="6" alias="PRIORITY-SIX"/>
+         <label data="7" alias="PRIORITY-SEVEN"/>
+         <label data="8" alias="PRIORITY-EIGHT"/>
+         <label data="9" alias="PRIORITY-NINE"/>
+         <label data="10" alias="PRIORITY-TEN"/>
+         <label data="11" alias="PRIORITY-ELEVEN"/>
+         <label data="12" alias="PRIORITY-TWELVE"/>
+         <label data="13" alias="PRIORITY-THIRTEEN"/>
+         <label data="14" alias="PRIORITY-FOURTEEN"/>
+         <label data="15" alias="PRIORITY-FIFTEEN"/>
+      </single>
+   </avp>
+   <command name="Capabilities-Exchange-Request" code="257" type="Request">
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Host-IP-Address" type="Mandatory" qual="1*"/>
+      <avprule id="Vendor-Id" type="Mandatory"/>
+      <avprule id="Product-Name" type="Mandatory"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Supported-Vendor-Id" type="Optional" qual="*"/>
+      <avprule id="Auth-Application-Id" type="Optional" qual="*"/>
+      <avprule id="Inband-Security-Id" type="Optional" qual="*"/>
+      <avprule id="Acct-Application-Id" type="Optional" qual="*"/>
+      <avprule id="Vendor-Specific-Application-Id" type="Optional"/>
+      <avprule id="Firmware-Revision" type="Optional"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Capabilities-Exchange-Answer" code="257" type="Answer">
+      <avprule id="Result-Code" type="Mandatory"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Host-IP-Address" type="Mandatory" qual="1*"/>
+      <avprule id="Vendor-Id" type="Mandatory"/>
+      <avprule id="Product-Name" type="Mandatory"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Error-Message" type="Optional"/>
+      <avprule id="Failed-AVP" type="Optional" qual="*"/>
+      <avprule id="Supported-Vendor-Id" type="Optional" qual="*"/>
+      <avprule id="Auth-Application-Id" type="Optional" qual="*"/>
+      <avprule id="Inband-Security-Id" type="Optional" qual="*"/>
+      <avprule id="Acct-Application-Id" type="Optional" qual="*"/>
+      <avprule id="Vendor-Specific-Application-Id" type="Optional"/>
+      <avprule id="Firmware-Revision" type="Optional"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Re-Auth-Request" code="258" type="Request">
+      <avprule id="Session-Id" type="Fixed"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Destination-Realm" type="Mandatory"/>
+      <avprule id="Destination-Host" type="Mandatory"/>
+      <avprule id="Auth-Application-Id" type="Mandatory"/>
+      <avprule id="Specific-Action" type="Mandatory"/>
+      <avprule id="Access-Network-Charging-Identifier" type="Optional" qual="*"/>
+      <avprule id="Access-Network-Charging-Address" type="Optional"/>
+      <avprule id="Flows" type="Optional" qual="*"/>
+      <avprule id="Subscription-Id" type="Optional" qual="*"/>
+      <avprule id="Abort-Cause" type="Optional"/>
+      <avprule id="IP-CAN-Type" type="Optional"/>
+      <avprule id="RAT-Type" type="Optional"/>
+      <avprule id="Sponsored-Connectivity-Data" type="Optional"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Class" type="Optional" qual="*"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="Route-Record" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Re-Auth-Answer" code="258" type="Answer">
+      <avprule id="Session-Id" type="Fixed"/>
+      <avprule id="Result-Code" type="Mandatory"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Experimental-Result" type="Optional"/>
+      <avprule id="Media-Component-Description" type="Optional" qual="*"/>
+      <avprule id="Service-URN" type="Optional"/>
+      <avprule id="Class" type="Optional" qual="*"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Error-Message" type="Optional"/>
+      <avprule id="Error-Reporting-Host" type="Optional"/>
+      <avprule id="Failed-AVP" type="Optional" qual="*"/>
+      <avprule id="Redirect-Host" type="Optional" qual="*"/>
+      <avprule id="Redirect-Host-Usage" type="Optional"/>
+      <avprule id="Redirect-Max-Cache-Time" type="Optional"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="AA-Request" code="265" type="Request">
+      <avprule id="Session-Id" type="Fixed"/>
+      <avprule id="Auth-Application-Id" type="Mandatory"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Destination-Realm" type="Mandatory"/>
+      <avprule id="Destination-Host" type="Optional"/>
+      <avprule id="AF-Application-Identifier" type="Optional"/>
+      <avprule id="Media-Component-Description" type="Optional" qual="*"/>
+      <avprule id="Service-Info-Status" type="Optional"/>
+      <avprule id="AF-Charging-Identifier" type="Optional"/>
+      <avprule id="SIP-Forking-Indication" type="Optional"/>
+      <avprule id="Specific-Action" type="Optional" qual="*"/>
+      <avprule id="Subscription-Id" type="Optional" qual="*"/>
+      <avprule id="Supported-Features" type="Optional" qual="*"/>
+      <avprule id="Reservation-Priority" type="Optional"/>
+      <avprule id="Framed-IP-Address" type="Optional"/>
+      <avprule id="Framed-IPv6-Prefix" type="Optional"/>
+      <avprule id="Called-Station-Id" type="Optional"/>
+      <avprule id="Service-URN" type="Optional"/>
+      <avprule id="Sponsored-Connectivity-Data" type="Optional"/>
+      <avprule id="MPS-Identifier" type="Optional"/>
+      <avprule id="Rx-Request-Type" type="Optional"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="Route-Record" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="AA-Answer" code="265" type="Answer">
+      <!--<avprule id="Session-Id" type="Fixed"/> some providers must not respect this -->
+      <avprule id="Session-Id" type="Mandatory"/>
+      <avprule id="Auth-Application-Id" type="Mandatory"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Result-Code" type="Optional"/>
+      <avprule id="Experimental-Result" type="Optional"/>
+      <avprule id="Access-Network-Charging-Identifier" type="Optional" qual="*"/>
+      <avprule id="Access-Network-Charging-Address" type="Optional"/>
+      <avprule id="Acceptable-Service-Info" type="Optional"/>
+      <avprule id="IP-CAN-Type" type="Optional"/>
+      <avprule id="RAT-Type" type="Optional"/>
+      <avprule id="Flows" type="Optional" qual="*"/>
+      <avprule id="Supported-Features" type="Optional" qual="*"/>
+      <avprule id="Class" type="Optional" qual="*"/>
+      <avprule id="Error-Message" type="Optional"/>
+      <avprule id="Error-Reporting-Host" type="Optional"/>
+      <avprule id="Failed-AVP" type="Optional" qual="*"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Redirect-Host" type="Optional" qual="*"/>
+      <avprule id="Redirect-Host-Usage" type="Optional"/>
+      <avprule id="Redirect-Max-Cache-Time" type="Optional"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Accounting-Request" code="271" type="Request">
+      <avprule id="Session-Id" type="Fixed"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Destination-Realm" type="Mandatory"/>
+      <avprule id="Accounting-Record-Type" type="Mandatory"/>
+      <avprule id="Accounting-Record-Number" type="Mandatory"/>
+      <avprule id="Acct-Application-Id" type="Optional"/>
+      <avprule id="Vendor-Specific-Application-Id" type="Optional"/>
+      <avprule id="User-Name" type="Optional"/>
+      <avprule id="Accounting-Sub-Session-Id" type="Optional"/>
+      <avprule id="Accounting-Session-Id" type="Optional"/>
+      <avprule id="Acct-Multi-Session-Id" type="Optional"/>
+      <avprule id="Acct-Interim-Interval" type="Optional"/>
+      <avprule id="Accounting-Realtime-Required" type="Optional"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Event-Timestamp" type="Optional"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="Route-Record" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Accounting-Answer" code="271" type="Answer">
+      <avprule id="Session-Id" type="Fixed"/>
+      <avprule id="Result-Code" type="Mandatory"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Accounting-Record-Type" type="Mandatory"/>
+      <avprule id="Accounting-Record-Number" type="Mandatory"/>
+      <avprule id="Acct-Application-Id" type="Optional"/>
+      <avprule id="Vendor-Specific-Application-Id" type="Optional"/>
+      <avprule id="User-Name" type="Optional"/>
+      <avprule id="Accounting-Sub-Session-Id" type="Optional"/>
+      <avprule id="Accounting-Session-Id" type="Optional"/>
+      <avprule id="Acct-Multi-Session-Id" type="Optional"/>
+      <avprule id="Error-Reporting-Host" type="Optional"/>
+      <avprule id="Acct-Interim-Interval" type="Optional"/>
+      <avprule id="Accounting-Realtime-Required" type="Optional"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Event-Timestamp" type="Optional"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Credit-Control-Request" code="272" type="Request">
+      <avprule id="Session-Id" type="Fixed"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Destination-Realm" type="Mandatory"/>
+      <avprule id="Auth-Application-Id" type="Mandatory"/>
+      <avprule id="Service-Context-Id" type="Optional"/>
+      <avprule id="CC-Request-Type" type="Mandatory"/>
+      <avprule id="CC-Request-Number" type="Mandatory"/>
+      <avprule id="Destination-Host" type="Optional"/>
+      <avprule id="User-Name" type="Optional"/>
+      <avprule id="CC-Sub-Session-Id" type="Optional"/>
+      <avprule id="Acct-Multi-Session-Id" type="Optional"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Event-Timestamp" type="Optional"/>
+      <avprule id="Subscription-Id" type="Optional" qual="*"/>
+      <avprule id="Service-Identifier" type="Optional"/>
+      <avprule id="Termination-Cause" type="Optional"/>
+      <avprule id="Requested-Service-Unit" type="Optional"/>
+      <avprule id="Requested-Action" type="Optional"/>
+      <avprule id="Used-Service-Unit" type="Optional" qual="*"/>
+      <avprule id="Multiple-Services-Indicator" type="Optional"/>
+      <avprule id="Multiple-Services-Credit-Control" type="Optional" qual="*"/>
+      <avprule id="Service-Parameter-Info" type="Optional" qual="*"/>
+      <avprule id="CC-Correlation-Id" type="Optional"/>
+      <avprule id="User-Equipment-Info" type="Optional"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="Route-Record" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Credit-Control-Answer" code="272" type="Answer">
+      <!--<avprule id="Session-Id" type="Fixed"/> some providers must not respect this -->
+      <avprule id="Session-Id" type="Mandatory"/>
+      <avprule id="Result-Code" type="Mandatory"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Auth-Application-Id" type="Mandatory"/>
+      <avprule id="CC-Request-Type" type="Mandatory"/>
+      <avprule id="CC-Request-Number" type="Mandatory"/>
+      <avprule id="User-Name" type="Optional"/>
+      <avprule id="CC-Session-Failover" type="Optional"/>
+      <avprule id="CC-Sub-Session-Id" type="Optional"/>
+      <avprule id="Acct-Multi-Session-Id" type="Optional"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Event-Timestamp" type="Optional"/>
+      <avprule id="Granted-Service-Unit" type="Optional"/>
+      <avprule id="Multiple-Services-Credit-Control" type="Optional" qual="*"/>
+      <avprule id="Cost-Information" type="Optional"/>
+      <avprule id="Final-Unit-Indication" type="Optional"/>
+      <avprule id="Check-Balance-Result" type="Optional"/>
+      <avprule id="Credit-Control-Failure-Handling" type="Optional"/>
+      <avprule id="Direct-Debiting-Failure-Handling" type="Optional"/>
+      <avprule id="Validity-Time" type="Optional"/>
+      <avprule id="Redirect-Host" type="Optional" qual="*"/>
+      <avprule id="Redirect-Host-Usage" type="Optional"/>
+      <avprule id="Redirect-Max-Cache-Time" type="Optional"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="Route-Record" type="Optional" qual="*"/>
+      <avprule id="Failed-AVP" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Abort-Session-Request" code="274" type="Request">
+      <avprule id="Session-Id" type="Fixed"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Destination-Realm" type="Mandatory"/>
+      <avprule id="Destination-Host" type="Mandatory"/>
+      <avprule id="Auth-Application-Id" type="Mandatory"/>
+      <avprule id="Abort-Cause" type="Mandatory"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="Route-Record" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Abort-Session-Answer" code="274" type="Answer">
+      <avprule id="Session-Id" type="Fixed"/>
+      <avprule id="Result-Code" type="Mandatory"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Error-Message" type="Optional"/>
+      <avprule id="Error-Reporting-Host" type="Optional"/>
+      <avprule id="Failed-AVP" type="Optional" qual="*"/>
+      <avprule id="Redirect-Host" type="Optional" qual="*"/>
+      <avprule id="Redirect-Host-Usage" type="Optional"/>
+      <avprule id="Redirect-Max-Cache-Time" type="Optional"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Session-Termination-Request" code="275" type="Request">
+      <avprule id="Session-Id" type="Fixed"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Destination-Realm" type="Mandatory"/>
+      <avprule id="Auth-Application-Id" type="Mandatory"/>
+      <avprule id="Termination-Cause" type="Mandatory"/>
+      <avprule id="Destination-Host" type="Optional"/>
+      <avprule id="Class" type="Optional" qual="*"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="Route-Record" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Session-Termination-Answer" code="275" type="Answer">
+      <avprule id="Session-Id" type="Fixed"/>
+      <avprule id="Result-Code" type="Optional"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Class" type="Optional" qual="*"/>
+      <avprule id="Error-Message" type="Optional"/>
+      <avprule id="Error-Reporting-Host" type="Optional"/>
+      <avprule id="Failed-AVP" type="Optional" qual="*"/>
+      <avprule id="Sponsored-Connectivity-Data" type="Optional"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+      <avprule id="Redirect-Host" type="Optional" qual="*"/>
+      <avprule id="Redirect-Host-Usage" type="Optional"/>
+      <avprule id="Redirect-Max-Cache-Time" type="Optional"/>
+      <avprule id="Proxy-Info" type="Optional" qual="*"/>
+      <avprule id="AVP" type="Optional" qual="*"/>
+   </command>
+   <command name="Device-Watchdog-Request" code="280" type="Request">
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+   </command>
+   <command name="Device-Watchdog-Answer" code="280" type="Answer">
+      <avprule id="Result-Code" type="Mandatory"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Error-Message" type="Optional"/>
+      <avprule id="Failed-AVP" type="Optional" qual="*"/>
+      <avprule id="Origin-State-Id" type="Optional"/>
+   </command>
+   <command name="Disconnect-Peer-Request" code="282" type="Request">
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Disconnect-Cause" type="Mandatory"/>
+   </command>
+   <command name="Disconnect-Peer-Answer" code="282" type="Answer">
+      <avprule id="Result-Code" type="Mandatory"/>
+      <avprule id="Origin-Host" type="Mandatory"/>
+      <avprule id="Origin-Realm" type="Mandatory"/>
+      <avprule id="Error-Message" type="Optional"/>
+      <avprule id="Failed-AVP" type="Optional" qual="*"/>
+   </command>
+</dictionary>
diff --git a/example/diameter/pcapDecoder/main.cpp b/example/diameter/pcapDecoder/main.cpp
new file mode 100644 (file)
index 0000000..f3330b7
--- /dev/null
@@ -0,0 +1,438 @@
+// ANNA - Anna is Not Nothingness Anymore
+//
+// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
+//
+// http://redmine.teslayout.com/projects/anna-suite
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     *  Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Authors: eduardo.ramos.testillano@gmail.com
+//          cisco.tierra@gmail.com
+
+
+// Standard
+#include <pcap.h>
+#include <stdlib.h>
+#include <netinet/ip.h>
+#include <arpa/inet.h>
+#include <iostream>
+#include <fstream>
+
+// STL
+#include <string>
+#include <map>
+
+#include <anna/core/DataBlock.hpp>
+#include <anna/core/util/Tokenizer.hpp>
+#include <anna/core/functions.hpp>
+#include <anna/core/tracing/Logger.hpp>
+#include <anna/core/tracing/TraceWriter.hpp>
+#include <anna/core/RuntimeException.hpp>
+#include <anna/xml/xml.hpp>
+#include <anna/diameter/stack/Engine.hpp>
+#include <anna/diameter/codec/Engine.hpp>
+#include <anna/diameter/codec/Message.hpp>
+
+
+
+
+using namespace anna;
+using namespace anna::diameter;
+
+
+// Payload and frame metadata /////////////////////////////////////////////////////////////////////////////
+class Payload {
+
+  std::string _sourceIP;
+  std::string _destinationIP;
+  time_t _timestamp;
+  int _timestampU; // usecs
+  std::string _data;
+  size_t _diameterLength;
+
+public:
+  Payload() { reset(); }
+
+  void setDiameterLength(size_t dl) {
+       if (_diameterLength == -1) {
+         _diameterLength=dl;
+          LOGDEBUG (Logger::debug(anna::functions::asString("Diameter message length: %d bytes", dl), ANNA_FILE_LOCATION));
+       }
+  }
+
+  void setSourceIP(const std::string &srcIP) throw() { _sourceIP = srcIP; }
+  void setDestinationIP(const std::string &dstIP) throw() { _destinationIP = dstIP; }
+  void setTimestamp(time_t ts) throw() { _timestamp = ts; }
+  void setTimestampU(int tsu) throw() { _timestampU = tsu; }
+  // Returns true if completed:
+  bool appendData(const char *data, size_t size) throw(RuntimeException) {
+    LOGDEBUG (Logger::debug(anna::functions::asString("Appending %d bytes", size), ANNA_FILE_LOCATION));
+    _data.append(data, size);
+    if (_data.size() > _diameterLength) throw RuntimeException("Data overflow (unexpected offset exceed diameter message length)", ANNA_FILE_LOCATION);
+    if (_data.size() < _diameterLength) return false;
+    LOGDEBUG (anna::Logger::debug("Completed!", ANNA_FILE_LOCATION));
+    return true;
+  }
+
+  void reset() throw() {
+         _sourceIP = "";
+         _destinationIP = "";
+         _timestamp = 0;
+         _timestampU = 0;
+         _data = "";
+         _diameterLength = -1; // not calculated yet
+  }
+
+  const std::string &getSourceIP() const throw() { return _sourceIP; }
+  const std::string &getDestinationIP() const throw() { return _destinationIP; }
+  time_t getTimestamp() const throw() { return _timestamp; }
+  int getTimestampU() const throw() { return _timestampU; }
+  const std::string &getData() const throw() { return _data; }
+  std::string getDataAsHex() const throw() { return anna::functions::asHexString(anna::DataBlock(_data.c_str(), _data.size())); }
+};
+
+
+
+// Data maps //////////////////////////////////////////////////////////////////////////////////////////////
+typedef std::map <int /* frame */, Payload> payloads_t;
+typedef std::map <int /* frame */, Payload>::const_iterator payloads_it;
+payloads_t G_payloads;
+anna::diameter::codec::Message G_codecMsg;
+
+
+
+
+
+// Sniffing structures ////////////////////////////////////////////////////////////////////////////////////
+
+/* ethernet headers are always exactly 14 bytes */
+#define SIZE_ETHERNET 14
+/* Ethernet addresses are 6 bytes */
+#define ETHER_ADDR_LEN 6
+
+/* Ethernet header */
+struct sniff_ethernet {
+  u_char ether_dhost[ETHER_ADDR_LEN]; /* Destination host address */
+  u_char ether_shost[ETHER_ADDR_LEN]; /* Source host address */
+  u_short ether_type; /* IP? ARP? RARP? etc */
+};
+
+/* IP header */
+struct sniff_ip {
+  u_char ip_vhl;               /* version << 4 | header length >> 2 */
+  u_char ip_tos;               /* type of service */
+  u_short ip_len;              /* total length */
+  u_short ip_id;               /* identification */
+  u_short ip_off;              /* fragment offset field */
+#define IP_RF 0x8000           /* reserved fragment flag */
+#define IP_DF 0x4000           /* dont fragment flag */
+#define IP_MF 0x2000           /* more fragments flag */
+#define IP_OFFMASK 0x1fff      /* mask for fragmenting bits */
+  u_char ip_ttl;               /* time to live */
+  u_char ip_p;         /* protocol */
+  u_short ip_sum;              /* checksum */
+  struct in_addr ip_src,ip_dst; /* source and dest address */
+};
+#define IP_OFF(ip)              (((ip)->ip_off) & IP_OFFMASK)
+#define IP_DF_VAL(ip)           ((((ip)->ip_off) & IP_DF) >> 14)
+#define IP_MF_VAL(ip)           ((((ip)->ip_off) & IP_MF) >> 13)
+#define IP_HL(ip)              (((ip)->ip_vhl) & 0x0f)
+#define IP_V(ip)               (((ip)->ip_vhl) >> 4)
+
+/* TCP header */
+typedef u_int tcp_seq;
+
+struct sniff_tcp {
+  u_short th_sport;    /* source port */
+  u_short th_dport;    /* destination port */
+  tcp_seq th_seq;              /* sequence number */
+  tcp_seq th_ack;              /* acknowledgement number */
+  u_char th_offx2;     /* data offset, rsvd */
+#define TH_OFF(th)     (((th)->th_offx2 & 0xf0) >> 4)
+  u_char th_flags;
+#define TH_FIN 0x01
+#define TH_SYN 0x02
+#define TH_RST 0x04
+#define TH_PUSH 0x08
+#define TH_ACK 0x10
+#define TH_URG 0x20
+#define TH_ECE 0x40
+#define TH_CWR 0x80
+#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG|TH_ECE|TH_CWR)
+  u_short th_win;              /* window */
+  u_short th_sum;              /* checksum */
+  u_short th_urp;              /* urgent pointer */
+};
+
+// Payload extraction /////////////////////////////////////////////////////////////////////////////////////
+u_char *getPayload(const u_char* packet, int packetSize, int &payloadSize, std::string &srcIp, std::string &dstIp, int &fragmentId, bool &dfFlag, bool &mfFlag, int &fragmentOffset) {
+
+  const struct sniff_ethernet *ethernet; /* The ethernet header */
+  const struct sniff_ip *ip; /* The IP header */
+  const struct sniff_tcp *tcp; /* The TCP header */
+
+  u_int size_ip;
+  u_int size_tcp;
+
+  ethernet = (struct sniff_ethernet*)(packet);
+  ip = (struct sniff_ip*)(packet + SIZE_ETHERNET);
+  size_ip = IP_HL(ip)*4; // 4 bytes per 32 bits word
+  if (size_ip < 20) {
+    LOGDEBUG (Logger::debug(anna::functions::asString("Invalid IP header length: %d bytes", size_ip), ANNA_FILE_LOCATION));
+    return NULL;
+  }
+
+  static char str[INET_ADDRSTRLEN];
+  inet_ntop(AF_INET, &(ip->ip_src), str, INET_ADDRSTRLEN);
+  srcIp = str;
+  inet_ntop(AF_INET, &(ip->ip_dst), str, INET_ADDRSTRLEN);
+  dstIp = str;
+
+  LOGDEBUG (Logger::debug(anna::functions::asString("ip_id: %d | ip_off: %d", ip->ip_id, ip->ip_off), ANNA_FILE_LOCATION));
+  fragmentId = ip->ip_id;
+  dfFlag = IP_DF_VAL(ip);
+  mfFlag = IP_MF_VAL(ip);
+  fragmentOffset = IP_OFF(ip);
+
+
+  tcp = (struct sniff_tcp*)(packet + SIZE_ETHERNET + size_ip);
+  size_tcp = TH_OFF(tcp)*4;
+  if (size_tcp < 20) {
+    LOGDEBUG (Logger::debug(anna::functions::asString("Invalid TCP header length: %d bytes", size_tcp), ANNA_FILE_LOCATION));
+    return NULL;
+  }
+
+  int payloadOffset = SIZE_ETHERNET + size_ip + size_tcp;
+  LOGDEBUG (Logger::debug(anna::functions::asString("PayloadOffset=%d", payloadOffset), ANNA_FILE_LOCATION));
+  payloadSize = packetSize - payloadOffset;
+  return ((u_char *)(packet + payloadOffset));
+}
+
+// Sniffing callback //////////////////////////////////////////////////////////////////////////////////////
+void my_callback(u_char *useless,const struct pcap_pkthdr* pkthdr,const u_char* packet)
+{
+   static int count = 1;
+
+   static Payload auxPayload;
+
+   int packetSize = pkthdr->len;
+   int payloadSize;
+   std::string srcIp, dstIp;
+   int fragmentId, fragmentOffset;
+   bool dfFlag, mfFlag;
+   const u_char* payload = getPayload(packet, packetSize, payloadSize, srcIp, dstIp, fragmentId, dfFlag, mfFlag, fragmentOffset);
+   if (payload && (payloadSize > 0)) {
+     LOGDEBUG (
+       std::string msg;
+       msg += anna::functions::asString("\nFrame %d:", count);
+       msg += anna::functions::asHexString(anna::DataBlock((const char *)packet, pkthdr->len));
+       time_t time = pkthdr->ts.tv_sec;
+       msg += "\n";
+       msg += anna::functions::asString("\ntimestamp %d.%d", pkthdr->ts.tv_sec, pkthdr->ts.tv_usec);
+       msg += anna::functions::asString("\ndate %s", ctime(&time));
+       msg += anna::functions::asString("\ncaplen %d", pkthdr->caplen);
+       msg += anna::functions::asString("\npacketSize %d", packetSize);
+       msg += anna::functions::asString("\npayloadSize %d", payloadSize);
+       msg += "\nPayload:";
+       msg += anna::functions::asHexString(anna::DataBlock((const char *)payload, payloadSize));
+       msg += "\n";
+       msg += anna::functions::asString("\nsourceIP %s", srcIp.c_str());
+       msg += anna::functions::asString("\ndestinationIP %s", dstIp.c_str());
+       msg += "\n";
+       msg += anna::functions::asString("\nfragmentId %d:", fragmentId);
+       msg += anna::functions::asString("\nDF %s:", (dfFlag ? "1":"0"));
+       msg += anna::functions::asString("\nMF %s:", (mfFlag ? "1":"0"));
+       msg += anna::functions::asString("\nfragmentOffset %d:", fragmentOffset);
+
+       Logger::debug(msg, ANNA_FILE_LOCATION);
+     );
+
+     auxPayload.setDiameterLength((payload[1] << 16) + (payload[2] << 8) + payload[3]);
+     auxPayload.setSourceIP(srcIp);
+     auxPayload.setDestinationIP(dstIp);
+     auxPayload.setTimestamp(pkthdr->ts.tv_sec);
+     auxPayload.setTimestampU(pkthdr->ts.tv_usec);
+     bool completed = auxPayload.appendData((const char *)payload, payloadSize);
+     if (completed) {
+       G_payloads[count] = auxPayload;
+       auxPayload.reset();
+     }
+  }
+
+  count++;
+}
+
+
+
+//------------------------------------------------------------------- 
+int main(int argc, char **argv) 
+{ 
+   std::string exec = argv[0];
+
+   std::cout << std::endl;
+
+   //check command line arguments 
+   if (argc < 3) {
+     std::cout << "Usage: " << exec << " <list of comma-separated xml dictionaries> <pcap file> [--ignore-flags: non-strict validation]" << std::endl << std::endl;
+     return 1;
+   } 
+
+   // Command-line parameters:
+   std::string dictionaries = argv[1];
+   std::string pcapFile = argv[2];
+   std::string optional = argv[3];
+   bool ignoreFlags = ((argc == 4) && (optional == "--ignore-flags"));
+   std::cout << "Dictionary(ies) provided: " << dictionaries << std::endl;
+   std::cout << "Pcap file provided:       " << pcapFile << std::endl;
+   std::cout << "Validation kindness:      " << (ignoreFlags ? "non strict":"strict") << std::endl;
+
+   // Logger and engines:
+   Logger::setLevel(Logger::Debug);
+   Logger::initialize("pcapDecoder", new TraceWriter("file.trace", 2048000));
+   anna::diameter::codec::Engine *codecEngine = new anna::diameter::codec::Engine();
+   anna::diameter::stack::Engine &stackEngine = anna::diameter::stack::Engine::instantiate();
+
+   try {
+      anna::diameter::stack::Dictionary * d = stackEngine.createDictionary(0 /* stack id */);
+      // Analyze comma-separated list:
+      anna::Tokenizer lst;
+      lst.apply(dictionaries, ",");
+
+      if (lst.size() >= 1) { // always true (at least one, because -dictionary is mandatory)
+         anna::Tokenizer::const_iterator tok_min(lst.begin());
+         anna::Tokenizer::const_iterator tok_max(lst.end());
+         anna::Tokenizer::const_iterator tok_iter;
+         std::string pathFile;
+         d->allowUpdates();
+
+         for (tok_iter = tok_min; tok_iter != tok_max; tok_iter++) {
+            pathFile = anna::Tokenizer::data(tok_iter);
+            d->load(pathFile);
+         }
+      }
+
+      codecEngine->setDictionary(d);
+      //LOGDEBUG(anna::Logger::debug(codecEngine->asString(), ANNA_FILE_LOCATION));
+
+      if (lst.size() > 1) {
+        std::ofstream out("./dictionary.xml", std::ifstream::out);
+        std::string buffer = d->asXMLString();
+        out.write(buffer.c_str(), buffer.size());
+        out.close();
+        std::cout << "Written 'dictionary.xml' (provide it next time to be more comfortable)." << std::endl;
+      }
+
+   } catch (anna::RuntimeException &ex) {
+     std::cerr << ex.asString() << std::endl << std::endl;
+     return 1;
+   }
+
+   codecEngine->ignoreFlagsOnValidation(ignoreFlags);
+   // Tracing:
+   //if (cl.exists("trace"))
+   //   anna::Logger::setLevel(anna::Logger::asLevel(cl.getValue("trace")));
+
+
+
+   // SNIFFING //////////////////////////////////////////////////////////////////////////////////////////////7
+
+   //temporary packet buffers 
+   struct pcap_pkthdr header; // The header that pcap gives us 
+   const u_char *packet;      // The actual packet 
+
+   //------------------ 
+   //open the pcap file 
+   pcap_t *handle; 
+   char errbuf[PCAP_ERRBUF_SIZE];                    //not sure what to do with this, oh well
+   handle = pcap_open_offline(pcapFile.c_str(), errbuf);   //call pcap library function
+
+   if (handle == NULL) { 
+     std::cerr << errbuf << std::endl << std::endl;
+     return 2;
+   } 
+
+
+   //begin processing the packets in this particular file
+   int packets = -1;
+   try {
+     while (packets != 0)
+         packets = pcap_dispatch(handle, -1, (pcap_handler)my_callback, NULL);
+   }
+   catch (RuntimeException &ex) {
+     std::cerr << ex.asString() << std::endl << std::endl;
+     return 1;
+   }
+   pcap_close(handle);  //close the pcap file 
+
+   // Print payloads //////////////////////////////////////////////////////////////////////////////////////////////
+
+   // Open output file:
+   std::string output = pcapFile; output += ".report";
+   std::ofstream out(output, std::ifstream::out);
+   std::string xmlStr;
+   anna::DataBlock db_aux(true);
+
+   //out.write(str.c_str(), str.size());
+
+
+   for (payloads_it it = G_payloads.begin(); it != G_payloads.end(); it++) {
+        LOGDEBUG (Logger::debug(anna::functions::asString("Dumping frame %d", it->first), ANNA_FILE_LOCATION));
+       time_t ts = (it->second).getTimestamp();
+       int tsu = (it->second).getTimestampU();
+       std::string ts_str = ctime(&ts);
+       ts_str.erase (ts_str.find ("\n"));
+
+        out << std::endl;
+        out << "===================================================================================================" << std::endl;
+       out << "Date:           " << ts_str << std::endl;
+       out << "Timestamp:      " << std::to_string(ts) << "." << std::to_string(tsu) << std::endl;
+       out << "Origin IP:      " << (it->second).getSourceIP() << std::endl;
+       out << "Destination IP: " << (it->second).getDestinationIP() << std::endl;
+        out << std::endl;
+
+       // decode hex string:
+       anna::functions::fromHexString((it->second).getDataAsHex(), db_aux);
+        try {
+         G_codecMsg.decode(db_aux);
+        }
+        catch (RuntimeException &ex) {
+          std::cerr << ex.asString() << std::endl << std::endl;
+          return 1;
+        }
+       out << G_codecMsg.asXMLString();
+   }
+
+
+   // Close output file:
+   out.close();
+
+   std::cout << "Open 'file.trace' in order to see process traces." << std::endl;
+   std::cout << "Open '" << output << "' to see conversion results." << std::endl;
+   std::cout << std::endl;
+   return 0;
+}
+
diff --git a/example/diameter/pcapDecoder/my.pcap b/example/diameter/pcapDecoder/my.pcap
new file mode 100644 (file)
index 0000000..82180ae
Binary files /dev/null and b/example/diameter/pcapDecoder/my.pcap differ