summaryrefslogtreecommitdiff
path: root/dissector.c
diff options
context:
space:
mode:
Diffstat (limited to 'dissector.c')
-rw-r--r--dissector.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/dissector.c b/dissector.c
index 7c8ba39..ca98386 100644
--- a/dissector.c
+++ b/dissector.c
@@ -42,25 +42,26 @@ int dissector_set_print_type(void *ptr, int type)
static void dissector_main(struct pkt_buff *pkt, struct protocol *start,
struct protocol *end)
{
- struct protocol *proto;
+ struct protocol *handler;
if (!start)
return;
- for (pkt->proto = start; pkt->proto; ) {
- if (unlikely(!pkt->proto->process))
+ for (pkt->handler = start; pkt->handler; ) {
+ if (unlikely(!pkt->handler->process))
break;
- proto = pkt->proto;
- pkt->proto = NULL;
- proto->process(pkt);
+ handler = pkt->handler;
+ pkt->handler = NULL;
+ handler->process(pkt);
}
if (end && likely(end->process))
end->process(pkt);
}
-void dissector_entry_point(uint8_t *packet, size_t len, int linktype, int mode)
+void dissector_entry_point(uint8_t *packet, size_t len, int linktype, int mode,
+ uint16_t proto)
{
struct protocol *proto_start, *proto_end;
struct pkt_buff *pkt;
@@ -70,6 +71,7 @@ void dissector_entry_point(uint8_t *packet, size_t len, int linktype, int mode)
pkt = pkt_alloc(packet, len);
pkt->link_type = linktype;
+ pkt->proto = proto;
switch (linktype) {
case LINKTYPE_EN10MB: