diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-04-08 07:07:42 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-04-08 07:07:42 +0000 |
commit | 42107e86146c473a06a11769ef2f5a8bedc1ef88 (patch) | |
tree | 8c2187183a707d04b8678a4cbfddb5577187c015 /packet-ntp.c | |
parent | 160928a318385aa2fb59af968ab1cd85847ad963 (diff) |
Move calls to "dissector_add()" out of the register routines for TCP and
UDP and into the handoff registration routines for the protocols in
question.
Make the dissectors for those protocols static if they're not called
outside the dissector's source file.
Get rid of header files if all they did was declare dissectors that are
now static; remove declarations of now-static dissectors from header
files that do more than just declare the dissector.
svn path=/trunk/; revision=1823
Diffstat (limited to 'packet-ntp.c')
-rw-r--r-- | packet-ntp.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/packet-ntp.c b/packet-ntp.c index 9865987449..463d2a6a9c 100644 --- a/packet-ntp.c +++ b/packet-ntp.c @@ -2,7 +2,7 @@ * Routines for NTP packet dissection * Copyright 1999, Nathan Neulinger <nneul@umr.edu> * - * $Id: packet-ntp.c,v 1.10 2000/03/12 04:47:44 gram Exp $ + * $Id: packet-ntp.c,v 1.11 2000/04/08 07:07:32 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -97,6 +97,9 @@ * first 32 bits and the fraction part in the last 32 bits. */ +#define UDP_PORT_NTP 123 +#define TCP_PORT_NTP 123 + /* Leap indicator, 2bit field is used to warn of a inserted/deleted * second, or to alarm loosed synchronization. */ @@ -199,7 +202,7 @@ static gint ett_ntp_flags = -1; * buff - string buffer for result (OUT) * returns pointer to filled buffer. */ -char * +static char * ntp_fmt_ts(unsigned char * reftime, char* buff) { guint32 tempstmp, tempfrac; @@ -229,7 +232,7 @@ ntp_fmt_ts(unsigned char * reftime, char* buff) * fd - frame data * proto_tree - resolved protocol tree */ -void +static void dissect_ntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_tree *ntp_tree, *flags_tree; @@ -434,3 +437,10 @@ proto_register_ntp(void) proto_register_field_array(proto_ntp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } + +void +proto_reg_handoff_ntp(void) +{ + dissector_add("udp.port", UDP_PORT_NTP, dissect_ntp); + dissector_add("tcp.port", TCP_PORT_NTP, dissect_ntp); +} |