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.
13 #include <netinet/in.h> /* for ntohs() */
15 #include "proto_struct.h"
16 #include "dissector_eth.h"
37 static inline void icmp(struct pkt_buff
*pkt
)
39 struct icmphdr
*icmp
= (struct icmphdr
*) pkt_pull(pkt
, sizeof(*icmp
));
45 tprintf("Type (%u), ", icmp
->type
);
46 tprintf("Code (%u), ", icmp
->code
);
47 tprintf("CSum (0x%.4x)", ntohs(icmp
->checksum
));
51 static inline void icmp_less(struct pkt_buff
*pkt
)
53 struct icmphdr
*icmp
= (struct icmphdr
*) pkt_pull(pkt
, sizeof(*icmp
));
58 tprintf(" Type %u Code %u", icmp
->type
, icmp
->code
);
61 struct protocol icmp_ops
= {
64 .print_less
= icmp_less
,
67 #endif /* PROTO_ICMP_H */