aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-llc.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-05-05 03:50:06 +0000
committerGuy Harris <guy@alum.mit.edu>2009-05-05 03:50:06 +0000
commitb4d3b4244bd299d281d383154a69e2b420f48f2b (patch)
treec72b97063d83ecec989b091ce16a2347f000ba1e /epan/dissectors/packet-llc.c
parent33ab68265521f60cd96c56d749a0f61199514040 (diff)
Get rid of some other uses of ethertype() for protocols that don't have
a trailer. Clean up the NHRP dissector's handling of the protocol ID to fully implement RFC 2332 (and mention that 2332 is the RFC for NHRP). Don't compute the checksum unless we have all the packet data, and don't use the captured length as the actual packet length. Check for an invalid extension offset value. Get rid of some unneeded tvb_ensure_bytes_exist() calls. Dissect - and set the columns - regardless of whether we're building the protocol tree. Mark the packet in error reports as an error packet. svn path=/trunk/; revision=28273
Diffstat (limited to 'epan/dissectors/packet-llc.c')
-rw-r--r--epan/dissectors/packet-llc.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c
index 2d1a6b30b7..f68ff333f1 100644
--- a/epan/dissectors/packet-llc.c
+++ b/epan/dissectors/packet-llc.c
@@ -244,15 +244,8 @@ const value_string type_vals[] = {
};
/*
- * Hash table for translating OUIs to a dissector table/field info pair;
- * the dissector table maps PID values to dissectors, and the field
- * corresponds to the PID for that OUI.
+ * Hash table for translating OUIs to an oui_info_t.
*/
-typedef struct {
- dissector_table_t table;
- hf_register_info *field_info;
-} oui_info_t;
-
static GHashTable *oui_info_table = NULL;
/*
@@ -747,10 +740,8 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
/*
* Do we have information for this OUI?
*/
- if (oui_info_table != NULL &&
- (oui_info =
- g_hash_table_lookup(oui_info_table,
- GUINT_TO_POINTER(oui))) != NULL) {
+ oui_info = get_snap_oui_info(oui);
+ if (oui_info != NULL) {
/*
* Yes - use it.
*/
@@ -782,6 +773,20 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
}
}
+/*
+ * Return the oui_info_t for the PID for a particular OUI value, or NULL
+ * if there isn't one.
+ */
+oui_info_t *
+get_snap_oui_info(guint32 oui)
+{
+ if (oui_info_table != NULL) {
+ return g_hash_table_lookup(oui_info_table,
+ GUINT_TO_POINTER(oui));
+ } else
+ return NULL;
+}
+
void
proto_register_llc(void)
{