Change dfilter_init() to check for empty-string abbreviations and for

duplicate abbreviations. All mods to packet-*.c files are fixes to remove
those cases.

svn path=/trunk/; revision=1733
This commit is contained in:
Gilbert Ramirez 2000-03-20 22:52:48 +00:00
parent a56b23acd8
commit e29f2705bf
10 changed files with 43 additions and 43 deletions

View File

@ -1,7 +1,7 @@
/* dfilter.c
* Routines for display filters
*
* $Id: dfilter.c,v 1.32 1999/11/15 06:32:13 gram Exp $
* $Id: dfilter.c,v 1.33 2000/03/20 22:52:41 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -114,10 +114,16 @@ dfilter_init(void)
num_symbols = proto_registrar_n();
for (i=0; i < num_symbols; i++) {
s = proto_registrar_get_abbrev(i);
if (s) {
symbol = DFILTER_LEX_ABBREV_OFFSET + i;
g_tree_insert(dfilter_tokens, s, GINT_TO_POINTER(symbol));
g_assert(s); /* Not Null */
g_assert(s[0] != 0); /* Not empty string */
/* Make sure we don't have duplicate abbreviation */
if (g_tree_lookup(dfilter_tokens, s)) {
g_message("Already have abbreviation \"%s\"", s);
g_assert(0);
}
/*g_message("Adding %s", s);*/
symbol = DFILTER_LEX_ABBREV_OFFSET + i;
g_tree_insert(dfilter_tokens, s, GINT_TO_POINTER(symbol));
}
}

View File

@ -2,7 +2,7 @@
* Routines for NetWare's IPX
* Gilbert Ramirez <gram@xiexie.org>
*
* $Id: packet-ipx.c,v 1.50 2000/03/12 04:47:40 gram Exp $
* $Id: packet-ipx.c,v 1.51 2000/03/20 22:52:41 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -918,12 +918,12 @@ proto_register_ipx(void)
static hf_register_info hf_sap[] = {
{ &hf_sap_request,
{ "Request", "sap.request",
{ "Request", "ipxsap.request",
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"TRUE if SAP request" }},
{ &hf_sap_response,
{ "Response", "sap.response",
{ "Response", "ipxsap.response",
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"TRUE if SAP response" }}
};
@ -961,7 +961,7 @@ proto_register_ipx(void)
proto_ipxmsg = proto_register_protocol ("IPX Message", "ipxmsg");
proto_register_field_array(proto_ipxmsg, hf_ipxmsg, array_length(hf_ipxmsg));
proto_sap = proto_register_protocol ("Service Advertisement Protocol", "sap");
proto_sap = proto_register_protocol ("Service Advertisement Protocol", "ipxsap");
proto_register_field_array(proto_sap, hf_sap, array_length(hf_sap));
proto_register_subtree_array(ett, array_length(ett));

View File

@ -1,7 +1,7 @@
/* packet-isis-hello.c
* Routines for decoding isis hello packets and their CLVs
*
* $Id: packet-isis-hello.c,v 1.3 2000/03/12 04:47:41 gram Exp $
* $Id: packet-isis-hello.c,v 1.4 2000/03/20 22:52:42 gram Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -531,34 +531,34 @@ void
proto_register_isis_hello(void) {
static hf_register_info hf[] = {
{ &hf_isis_hello_circuit_reserved,
{ "Circuit type", "", FT_UINT8, BASE_HEX, NULL,
0x0, "" }},
{ "Circuit type", "isis_hello.circuite_type",
FT_UINT8, BASE_HEX, NULL, 0x0, "" }},
{ &hf_isis_hello_source_id,
{ "Source ID", "isis_hello.source_id", FT_ETHER,
BASE_HEX, NULL, 0x0, "" }},
{ "Source ID", "isis_hello.source_id",
FT_ETHER, BASE_HEX, NULL, 0x0, "" }},
{ &hf_isis_hello_holding_timer,
{ "Holding timer", "isis_hello.holding_timer",
FT_UINT16, BASE_DEC, NULL, 0x0, "" }},
FT_UINT16, BASE_DEC, NULL, 0x0, "" }},
{ &hf_isis_hello_pdu_length,
{ "PDU length", "isis_hello.pdu_length", FT_UINT16,
BASE_DEC, NULL, 0x0, "" }},
{ "PDU length", "isis_hello.pdu_length",
FT_UINT16, BASE_DEC, NULL, 0x0, "" }},
{ &hf_isis_hello_priority_reserved,
{ "Priority", "",FT_UINT8, BASE_DEC, NULL,
{ "Priority", "isis_hello.priority",FT_UINT8, BASE_DEC, NULL,
ISIS_HELLO_P_RESERVED_MASK, "" }},
{ &hf_isis_hello_lan_id,
{ "LAN ID", "", FT_STRING, BASE_DEC, NULL, 0x0, "" }},
{ "LAN ID", "isis_hello.lan_id", FT_STRING, BASE_DEC, NULL, 0x0, "" }},
{ &hf_isis_hello_local_circuit_id,
{ "Local circuit ID", "isis_hello.local_circuit_id", FT_UINT8,
BASE_DEC, NULL, 0x0, "" }},
{ &hf_isis_hello_clv_ipv4_int_addr,
{ "IPv4 interface address", "", FT_IPv4,
{ "IPv4 interface address", "isis_hello.clv_ipv4_int_addr", FT_IPv4,
BASE_NONE, NULL, 0x0, "" }},
};
@ -573,7 +573,7 @@ proto_register_isis_hello(void) {
&ett_isis_hello_clv_ipv4_int_addr,
};
proto_isis_hello = proto_register_protocol("ISIS hello", "ISIS-hello");
proto_isis_hello = proto_register_protocol("ISIS hello", "isis_hello");
proto_register_field_array(proto_isis_hello, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}

View File

@ -1,7 +1,7 @@
/* packet-isis-lsp.c
* Routines for decoding isis lsp packets and their CLVs
*
* $Id: packet-isis-lsp.c,v 1.3 2000/01/24 03:33:32 guy Exp $
* $Id: packet-isis-lsp.c,v 1.4 2000/03/20 22:52:42 gram Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -907,7 +907,7 @@ proto_register_isis_lsp(void) {
BASE_HEX, NULL, 0x0, "" }},
{ &hf_isis_lsp_clv_ipv4_int_addr,
{ "IPv4 interface address: ", "", FT_IPv4,
{ "IPv4 interface address: ", "isis_lsp.clv_ipv4_int_addr", FT_IPv4,
BASE_NONE, NULL, 0x0, "" }},
};
static gint *ett[] = {

View File

@ -2,7 +2,7 @@
* Routines for ISO/OSI network and transport protocol packet disassembly, core
* bits.
*
* $Id: packet-isis.c,v 1.4 2000/03/12 04:47:41 gram Exp $
* $Id: packet-isis.c,v 1.5 2000/03/20 22:52:43 gram Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
@ -343,7 +343,7 @@ proto_register_isis(void) {
&ett_isis,
};
proto_isis = proto_register_protocol("clnp ISIS", "ISIS");
proto_isis = proto_register_protocol("clnp ISIS", "isis");
proto_register_field_array(proto_isis, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}

View File

@ -1,7 +1,7 @@
/* packet-mount.c
* Routines for mount dissection
*
* $Id: packet-mount.c,v 1.11 2000/03/09 12:13:20 girlich Exp $
* $Id: packet-mount.c,v 1.12 2000/03/20 22:52:43 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -628,7 +628,7 @@ proto_register_mount(void)
FT_UINT16, BASE_DEC,
NULL, 0, "Maximum amount of data that can be written atomically to a pipe" }},
{ &hf_mount_pathconf_vdisable, {
"VDISABLE character", "mount.pathconf.pipe_buf",
"VDISABLE character", "mount.pathconf.vdisable_char",
FT_UINT8, BASE_HEX,
NULL, 0, "Character value to disable a terminal special character" }},
{ &hf_mount_pathconf_mask, {

View File

@ -3,7 +3,7 @@
*
* (c) Copyright Ashok Narayanan <ashokn@cisco.com>
*
* $Id: packet-mpls.c,v 1.2 2000/03/13 16:36:31 gram Exp $
* $Id: packet-mpls.c,v 1.3 2000/03/20 22:52:44 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -73,7 +73,7 @@ static const value_string special_labels[] = {
enum mpls_filter_keys {
/* Is the packet MPLS-encapsulated? */
MPLSF_PACKET,
/* MPLSF_PACKET,*/
/* MPLS encap properties */
MPLSF_LABEL,
@ -87,9 +87,9 @@ enum mpls_filter_keys {
static int mpls_filter[MPLSF_MAX];
static hf_register_info mplsf_info[] = {
{&mpls_filter[MPLSF_PACKET],
/* {&mpls_filter[MPLSF_PACKET],
{"MPLS Label Switched Packet", "mpls", FT_UINT8, BASE_NONE, NULL, 0x0,
"" }},
"" }},*/
{&mpls_filter[MPLSF_LABEL],
{"MPLS Label", "mpls.label", FT_UINT32, BASE_DEC, VALS(special_labels), 0x0,

View File

@ -2,7 +2,7 @@
* Routines for nfs dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
* $Id: packet-nfs.c,v 1.23 2000/03/12 04:47:43 gram Exp $
* $Id: packet-nfs.c,v 1.24 2000/03/20 22:52:44 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -3063,13 +3063,13 @@ proto_register_nfs(void)
"rtmult", "nfs.fsinfo.rtmult", FT_UINT32, BASE_DEC,
NULL, 0, "suggested READ multiple" }},
{ &hf_nfs_fsinfo_wtmax, {
"wtmax", "nfs.fsinfo.rtmax", FT_UINT32, BASE_DEC,
"wtmax", "nfs.fsinfo.wtmax", FT_UINT32, BASE_DEC,
NULL, 0, "maximum WRITE request" }},
{ &hf_nfs_fsinfo_wtpref, {
"wtpref", "nfs.fsinfo.rtpref", FT_UINT32, BASE_DEC,
"wtpref", "nfs.fsinfo.wtpref", FT_UINT32, BASE_DEC,
NULL, 0, "preferred WRITE request" }},
{ &hf_nfs_fsinfo_wtmult, {
"wtmult", "nfs.fsinfo.rtmult", FT_UINT32, BASE_DEC,
"wtmult", "nfs.fsinfo.wtmult", FT_UINT32, BASE_DEC,
NULL, 0, "suggested WRITE multiple" }},
{ &hf_nfs_fsinfo_dtpref, {
"dtpref", "nfs.fsinfo.dtpref", FT_UINT32, BASE_DEC,

View File

@ -2,7 +2,7 @@
* Routines for smb packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
* $Id: packet-smb.c,v 1.62 2000/03/06 19:59:09 guy Exp $
* $Id: packet-smb.c,v 1.63 2000/03/20 22:52:45 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -10195,10 +10195,6 @@ extern void register_proto_smb_mailslot( void);
void
proto_register_smb(void)
{
/* static hf_register_info hf[] = {
{ &variable,
{ "Name", "smb.abbreviation", TYPE, VALS_POINTER }},
};*/
static gint *ett[] = {
&ett_smb,
&ett_smb_fileattributes,
@ -10224,12 +10220,10 @@ proto_register_smb(void)
proto_register_subtree_array(ett, array_length(ett));
register_init_routine(&smb_init_protocol);
register_proto_smb_browse();
register_proto_smb_logon( );
register_proto_smb_mailslot();
register_proto_smb_pipe();
register_proto_smb_mailslot();
}

View File

@ -5,7 +5,7 @@
* Craig Newell <CraigN@cheque.uq.edu.au>
* RFC2347 TIME Option Extension
*
* $Id: packet-time.c,v 1.2 2000/03/06 20:04:53 guy Exp $
* $Id: packet-time.c,v 1.3 2000/03/20 22:52:48 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -74,7 +74,7 @@ proto_register_time(void)
static hf_register_info hf[] = {
{ &hf_time_time,
{ "Time", "time",
{ "Time", "time.time",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Seconds since 00:00 (midnight) 1 January 1900 GMT" }}
};