aboutsummaryrefslogtreecommitdiffstats
path: root/make-reg-dotc
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-04-04 06:17:30 +0000
committerGuy Harris <guy@alum.mit.edu>2000-04-04 06:17:30 +0000
commit1ffa3cfa2b664a4920805cb40dd9fe85bf3ca1fe (patch)
treecb4e40fa15b5c560beef61457ce5fa239ac6db66 /make-reg-dotc
parente6d47076b8f8c64f34b9f169a117836b2719da89 (diff)
Make "make-reg-dotc" generate a "register_all_protocol_handoffs()"
routine, which calls all routines found in the dissector source files with names that match " proto_reg_handoff_[a-z_0-9A-Z]*". Call "register_all_protocol_handoffs()" after calling "register_all_protocols()" - "register_all_protocols()" needs to be called first, so that all protocols can register their fields, because registering a dissector as being called if field "proto.port" is equal to N requires that "proto.port" be a registered field. Give DNS a handoff registration routine, and register its dissector to be called if "udp.port" is UDP_PORT_DNS; remove the registration of DNS from "packet-udp.c", and make "dissect_dns()" static (as nobody else need know that it exists). svn path=/trunk/; revision=1788
Diffstat (limited to 'make-reg-dotc')
-rwxr-xr-xmake-reg-dotc18
1 files changed, 18 insertions, 0 deletions
diff --git a/make-reg-dotc b/make-reg-dotc
index 40730eaa33..11d7e63590 100755
--- a/make-reg-dotc
+++ b/make-reg-dotc
@@ -13,6 +13,10 @@ rm -f register.c-tmp
echo '/* Do not modify this file. */' >register.c-tmp
echo '/* It is created automatically by the Makefile. */'>>register.c-tmp
echo '#include "register.h"' >>register.c-tmp
+
+#
+# Build code to call all the protocol registration routines.
+#
echo 'void register_all_protocols(void) {' >>register.c-tmp
for f in "$@"
do
@@ -23,4 +27,18 @@ do
grep '^void proto_register_[a-z_0-9A-Z]* *(' $srcdir/$f 2>/dev/null
done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>register.c-tmp
echo '}' >>register.c-tmp
+
+#
+# Build code to call all the protocol handoff registration routines.
+#
+echo 'void register_all_protocol_handoffs(void) {' >>register.c-tmp
+for f in "$@"
+do
+ grep '^proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcdir/$f 2>/dev/null
+done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>register.c-tmp
+for f in "$@"
+do
+ grep '^void proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcdir/$f 2>/dev/null
+done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>register.c-tmp
+echo '}' >>register.c-tmp
mv register.c-tmp register.c