diff options
author | Richard Sharpe <sharpe@ns.aus.com> | 2000-07-29 03:20:51 +0000 |
---|---|---|
committer | Richard Sharpe <sharpe@ns.aus.com> | 2000-07-29 03:20:51 +0000 |
commit | a194f2b07a02c6e0cb4e614b49b19b67449b1de6 (patch) | |
tree | 76e00fbbdbb62ab4bd349cd0cc60c26bac4417f8 /doc | |
parent | 8ceb7d40f9a603d4d792ce7ed904aff69b468456 (diff) |
Added changes so Edit->Filters...->Apply works as I think
it should.
Also added the two files I need to generate an sgml list of fields
that the UserGuide etc needs.
svn path=/trunk/; revision=2174
Diffstat (limited to 'doc')
-rw-r--r-- | doc/dfilter2sgml | 134 | ||||
-rw-r--r-- | doc/sgml.doc.template | 1 |
2 files changed, 135 insertions, 0 deletions
diff --git a/doc/dfilter2sgml b/doc/dfilter2sgml new file mode 100644 index 0000000000..753dffc8c3 --- /dev/null +++ b/doc/dfilter2sgml @@ -0,0 +1,134 @@ +#!/usr/bin/perl +# +# Reads the display filter keyword dump produced by 'ethereal -G' and +# formats it for a pod document. The pod document is then used to +# make a manpage +# +# STDIN is the ethereal glossary +# arg1 is the pod template file. The =insert_dfilter_table token +# will be replaced by the pod-formatted glossary +# STDOUT is the output +# +# $Id: dfilter2sgml,v 1.1 2000/07/29 03:20:43 sharpe Exp $ + +%ftenum_names = ( + 'FT_NONE', 'No value', + 'FT_BOOLEAN', 'Boolean', + 'FT_UINT8', 'Unsigned 8-bit integer', + 'FT_UINT16', 'Unsigned 16-bit integer', + 'FT_UINT24', 'Unsigned 24-bit integer', + 'FT_UINT32', 'Unsigned 32-bit integer', + 'FT_INT8', 'Signed 8-bit integer', + 'FT_INT16', 'Signed 16-bit integer', + 'FT_INT24', 'Signed 24-bit integer', + 'FT_INT32', 'Signed 32-bit integer', + 'FT_ABSOLUTE_TIME', 'Date/Time stamp', + 'FT_RELATIVE_TIME', 'Time duration', + 'FT_STRING', 'String', + 'FT_DOUBLE', 'Double-precision floating point', + 'FT_ETHER', '6-byte Hardware (MAC) Address', + 'FT_BYTES', 'Byte array', + 'FT_IPv4', 'IPv4 address', + 'FT_IPv6', 'IPv6 address', + 'FT_IPXNET', 'IPX network or server name', + 'FT_TEXT_ONLY', 'Text-only. Not filterable' +); + +# Read all the data into memory +while (<STDIN>) { + next unless (/^([PF])/); + + $record_type = $1; + chomp($_); + + # Store protocol information + if ($record_type eq 'P') { + ($junk, $name, $abbrev) = split(/\t+/, $_); + $proto_abbrev{$name} = $abbrev; + } + # Store header field information + else { + ($junk, $name, $abbrev, $type, $parent) = + split(/\t+/, $_); + push(@{$field_abbrev{$parent}}, $abbrev); + $field_info{$abbrev} = [ $name, $type ]; + } +} + +# if there was no input on stdin, bail out +if ($record_type ne 'P' and $record_type ne 'F') { + exit; +} + +$template = shift(@ARGV); + +open(TEMPLATE, $template) || die "Can't open $template for reading: $!\n"; + +while (<TEMPLATE>) { + if (/=insert_dfilter_table/) { + &create_dfilter_table; + } + else { + print; + } +} + +close(TEMPLATE) || die "Can't close $template: $!\n"; + +sub create_dfilter_table { + + print "<appendix id=\"AppFiltFields\"><title>Ethereal Display Filter Fields</>\n"; + + # Print each protocol + for $proto_name (sort keys %proto_abbrev) { + + if ($proto_name eq 'Text' && $proto_abbrev{$proto_name} eq 'text') { + next; + } + + $ns_proto_name = $proto_name; + $ns_proto_name =~ s/\s//g; + $ns_proto_name =~ s/\)//g; + $ns_proto_name =~ s/\(//g; + $ns_proto_name =~ s/_//g; + + print "<section id=\"SID$ns_proto_name\"><title>$proto_name ($proto_abbrev{$proto_name})</>\n\n"; + + print "<table id=\"TID$ns_proto_name\"><title>$proto_name ($proto_abbrev{$proto_name})</>\n"; + print "<tgroup cols=\"3\">\n"; +# print "<colspec colnum=\"1\" colwidth=\"80pt\">\n"; +# print "<colspec colnum=\"2\" colwidth=\"80pt\"\n>"; + print "<thead>\n <row>\n "; + print "<entry>Field</>\n <entry>Field Name</>\n <entry>Type</>\n\n"; + + print " </row>\n</thead>\n<tbody>\n"; + + # If this proto has children fields, print those + if ($field_abbrev{$proto_abbrev{$proto_name}}) { + + for $field_abbrev (sort @{$field_abbrev{$proto_abbrev{$proto_name}}}) { + + print " <row>\n"; + print " <entry>$field_abbrev</>\n"; + print " <entry>", $field_info{$field_abbrev}[0], "</>\n"; + print " <entry>", $ftenum_names{$field_info{$field_abbrev}[1]}, "</>\n"; + print " </row>\n\n"; + + } + + } + else { + + print " <row>\n <entry></>\n <entry></>\n <entry></>\n"; + print " </row>\n"; + + } + + print "</tbody></tgroup></table>\n"; + print "</section>\n\n"; + + } + + print "</appendix>\n"; + +} diff --git a/doc/sgml.doc.template b/doc/sgml.doc.template new file mode 100644 index 0000000000..03347b0483 --- /dev/null +++ b/doc/sgml.doc.template @@ -0,0 +1 @@ +=insert_dfilter_table
\ No newline at end of file |