3 # Reads the display filter keyword dump produced by 'wireshark -G' and
4 # formats it as an SGML bulleted list of protocols.
6 # STDIN is the wireshark glossary
7 # arg1 is the pod template file. The =insert_dfilter_table token
8 # will be replaced by the pod-formatted glossary
13 # Read all the data into memory
15 next unless (/^([PF])/);
20 # Store protocol information
21 if ($record_type eq 'P') {
22 ($junk, $name, $abbrev) = split(/\t+/, $_);
23 $proto_abbrev{$name} = $abbrev;
25 # Store header field information
27 ($junk, $name, $abbrev, $type, $parent) =
29 push(@
{$field_abbrev{$parent}}, $abbrev);
30 $field_info{$abbrev} = [ $name, $type ];
34 # if there was no input on stdin, bail out
35 if ($record_type ne 'P' and $record_type ne 'F') {
39 $template = shift(@ARGV);
41 open(TEMPLATE
, $template) || die "Can't open $template for reading: $!\n";
44 if (/=insert_dfilter_table/) {
45 &create_dfilter_table
;
52 close(TEMPLATE
) || die "Can't close $template: $!\n";
54 sub create_dfilter_table
{
56 print "<itemizedlist id=\"WiresharkListOfProtos\">\n";
59 for $proto_name (sort keys %proto_abbrev) {
61 print " <listitem><para>$proto_name</></>\n";
66 print "</itemizedlist>\n";