aboutsummaryrefslogtreecommitdiffstats
path: root/packet-snmp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-10-27 02:05:09 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-10-27 02:05:09 +0000
commitb2f5862a7190acc266459723339873827bfa1afa (patch)
treefebf3cf76e9b82c20b21ee659e179b5acf1e12c4 /packet-snmp.c
parent1c3dcca3fc714d1f49e01e0ab040767b284a9d2e (diff)
Arrange that "proto_register_snmp()" be defined regardless of whether
SNMP dissection is enabled or not, so that if "register.c" was generated by scanning a list of files that include "packet-snmp.c" even though SNMP dissection isn't enabled (the standard "Makefile.in" and "configure" script won't cause that to happen, but source distributions such as BSD ports may be set up to do that), and thus includes a call to "proto_register_snmp()", that won't cause the link to fail. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@931 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-snmp.c')
-rw-r--r--packet-snmp.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/packet-snmp.c b/packet-snmp.c
index 6f3c0d1717..008179331b 100644
--- a/packet-snmp.c
+++ b/packet-snmp.c
@@ -2,7 +2,7 @@
* Routines for SNMP (simple network management protocol)
* D.Jorand (c) 1998
*
- * $Id: packet-snmp.c,v 1.11 1999/10/25 20:50:19 guy Exp $
+ * $Id: packet-snmp.c,v 1.12 1999/10/27 02:05:09 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -858,9 +858,19 @@ dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
}
}
+#endif /* WITH_SNMP: CMU or UCD */
+
+/*
+ * Allow the stuff that builds "register.c" to scan "packet-snmp.c" even
+ * if we're not enabling SNMP decoding (for "canned" source distributions
+ * such as BSD ports, it may be a pain to arrange that it be scanned only
+ * if SNMP is being used), by having "proto_register_snmp()" always be
+ * defined, but not do anything if SNMP decoding isn't enabled.
+ */
void
proto_register_snmp(void)
{
+#if defined(WITH_SNMP_CMU) || defined(WITH_SNMP_UCD)
/* static hf_register_info hf[] = {
{ &variable,
{ "Name", "snmp.abbreviation", TYPE, VALS_POINTER }},
@@ -869,6 +879,5 @@ proto_register_snmp(void)
init_mib();
proto_snmp = proto_register_protocol("Simple Network Management Protocol", "snmp");
/* proto_register_field_array(proto_snmp, hf, array_length(hf));*/
-}
-
#endif /* WITH_SNMP: CMU or UCD */
+}