2 * netsniff-ng - the packet sniffing beast
3 * By Daniel Borkmann <daniel@netsniff-ng.org>
4 * Copyright 2009, 2010 Daniel Borkmann.
5 * Subject to the GPL, version 2.
10 #include <netinet/in.h> /* for ntohs() */
14 #include "dissector_eth.h"
35 static void icmp(struct pkt_buff
*pkt
)
37 struct icmphdr
*icmp
= (struct icmphdr
*) pkt_pull(pkt
, sizeof(*icmp
));
43 tprintf("Type (%u), ", icmp
->type
);
44 tprintf("Code (%u), ", icmp
->code
);
45 tprintf("CSum (0x%.4x)", ntohs(icmp
->checksum
));
49 static void icmp_less(struct pkt_buff
*pkt
)
51 struct icmphdr
*icmp
= (struct icmphdr
*) pkt_pull(pkt
, sizeof(*icmp
));
56 tprintf(" Type %u Code %u", icmp
->type
, icmp
->code
);
59 struct protocol icmpv4_ops
= {
62 .print_less
= icmp_less
,
65 EXPORT_SYMBOL(icmp_ops
);