#!/usr/bin/perl # # Reads the display filter keyword dump produced by 'ethereal -G' and # formats it as an SGML bulleted list of protocols. # # 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: eproto2sgml,v 1.2 2001/04/19 23:17:30 guy Exp $ # Read all the data into memory while () { 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 (