summaryrefslogtreecommitdiff
path: root/epan/diam_dict.l
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2015-04-20 13:17:01 -0400
committerJeff Morriss <jeff.morriss.ws@gmail.com>2015-04-21 01:55:50 +0000
commit847e5179dcbfb4f36137cae98502749f254fbab2 (patch)
treef70b5b94709a7e01cdcece82cee8b69f1183fab8 /epan/diam_dict.l
parent8b720910d2ae04aab24709cf30363e9f064e2c63 (diff)
downloadwireshark-847e5179dcbfb4f36137cae98502749f254fbab2.tar.gz
Allow the definition of AVPs within vendor IDs.
This allows for a more natural organization of AVP definitions: they can now be grouped by application (including the base application) or vendor ID. This means we can stop using the "workaround" (for those vendors who define AVPs but don't have their own application ID) of finding some random application ID to put in a vendor-specific xml file just to satisfy the parser. Rework a couple of Vendor-specific xml files as an example. Note: this does mean that vendor IDs can no longer be defined inside of the base or other application. If that's a problem the parser could be made (through some duplication of code) to understand the old format too. Change-Id: I5119f0dc7f8e3bbf59e2207046a8bb0f42ab0ca1 Reviewed-on: https://code.wireshark.org/review/8141 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Diffstat (limited to 'epan/diam_dict.l')
-rw-r--r--epan/diam_dict.l25
1 files changed, 16 insertions, 9 deletions
diff --git a/epan/diam_dict.l b/epan/diam_dict.l
index c89a02dd21..3cf67859a1 100644
--- a/epan/diam_dict.l
+++ b/epan/diam_dict.l
@@ -178,6 +178,8 @@ grouped_start <grouped>
grouped_end <\/grouped>
vendor_start <vendor
+vendor_end<\/vendor>
+
gavp_start <gavp
ignored_attr [a-z0-9-]+=
@@ -395,12 +397,12 @@ description_attr description=\042
}
<COMMAND_ATTRS>{name_attr} { ATTR_STR(cmd->name); }
-<COMMAND_ATTRS>{vendor_attr} { ATTR_STR(cmd->vendor); }
+<COMMAND_ATTRS>{vendor_attr} { ATTR_STR(cmd->vendor); }
<COMMAND_ATTRS>{code_attr} { ATTR_UINT(cmd->code); }
<COMMAND_ATTRS>{stop} |
<COMMAND_ATTRS>{stop_end} { BEGIN IN_APPL; }
-<IN_APPL>{vendor_start} {
+<IN_DICT>{vendor_start} {
D(("vendor_start\n"));
vnd = g_new(ddict_vendor_t,1);
@@ -417,8 +419,8 @@ description_attr description=\042
<VENDOR_ATTRS>{name_attr} { ATTR_STR(vnd->desc); }
<VENDOR_ATTRS>{vendor_attr} { ATTR_STR(vnd->name); }
<VENDOR_ATTRS>{code_attr} { ATTR_UINT(vnd->code); }
-<VENDOR_ATTRS>{stop} |
-<VENDOR_ATTRS>{stop_end} { BEGIN IN_APPL; }
+<VENDOR_ATTRS>{stop} { BEGIN IN_APPL; }
+<VENDOR_ATTRS>{stop_end} { BEGIN IN_DICT; }
<IN_APPL>{typedefn_start} {
D(("typedefn_start\n"));
@@ -460,10 +462,10 @@ description_attr description=\042
}
<AVP_ATTRS>{name_attr} { ATTR_STR(avp->name); }
-<AVP_ATTRS>{description_attr} { ATTR_STR(avp->description); }
+<AVP_ATTRS>{description_attr} { ATTR_STR(avp->description); }
<AVP_ATTRS>{vendor_attr} { ATTR_STR(avp->vendor); }
<AVP_ATTRS>{code_attr} { ATTR_UINT(avp->code); }
-<AVP_ATTRS>{stop} { BEGIN IN_AVP; }
+<AVP_ATTRS>{stop} { BEGIN IN_AVP; }
<AVP_ATTRS>{stop_end} { BEGIN IN_APPL; }
@@ -509,15 +511,20 @@ description_attr description=\042
<ENUM_ATTRS>{name_attr} { ATTR_STR(enumitem->name); }
<ENUM_ATTRS>{code_attr} { ATTR_UINT(enumitem->code); }
-<TYPE_ATTRS,GAVP_ATTRS,ENUM_ATTRS>{stop} { BEGIN IN_AVP; }
+<TYPE_ATTRS,GAVP_ATTRS,ENUM_ATTRS>{stop} { BEGIN IN_AVP; }
<TYPE_ATTRS,GAVP_ATTRS,ENUM_ATTRS>{stop_end} { BEGIN IN_AVP; }
<IN_AVP>{avp_end} { D(("avp_end\n")); BEGIN IN_APPL; }
-<IN_APPL>{application_end} |
-<IN_APPL>{base_end} {
+<IN_APPL>{application_end} {
D(("application_end\n")); BEGIN IN_DICT;
}
+<IN_APPL>{vendor_end} {
+ D(("vendor_end\n")); BEGIN IN_DICT;
+}
+<IN_APPL>{base_end} {
+ D(("base_end\n")); BEGIN IN_DICT;
+}
<IN_DICT>{dictionary_end} {
yyterminate();