source: libpacketdump/ip_0.c @ 756b8f9

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 756b8f9 was 29b93a5, checked in by Shane Alcock <salcock@…>, 10 years ago
  • Added libpacketdump decoders for some IPv6 extension headers (Hop by Hop Options, Routing and Destination Options) - not very detailed, but that's mainly because I don't have access to any decent examples to test against
  • Property mode set to 100644
File size: 451 bytes
RevLine 
[29b93a5]1#include <stdio.h>
2#include <inttypes.h>
3#include <dlfcn.h>
4#include "libpacketdump.h"
5
6DLLEXPORT void decode(int link_type UNUSED, const char *packet, unsigned len) {
7
8        uint16_t hbh_len = 0;
9        libtrace_ip6_ext_t* hdr = (libtrace_ip6_ext_t*)packet;
10
11        hbh_len = (hdr->len + 1) * 8;
12
13        printf(" IPv6 Hop-by-Hop: Next Header %u Header Ext Len %u",
14                        hdr->nxt, hdr->len);
15
16        printf("\n");
17
18        decode_next(packet + hbh_len, len - hbh_len, "ip", hdr->nxt);
19
20
21}
Note: See TracBrowser for help on using the repository browser.