source: libpacketdump/ip_43.c @ bd119b3

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since bd119b3 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: 552 bytes
Line 
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 Routing Header: Next Header %u Header Ext Len %u",
14                        hdr->nxt, hdr->len);
15        printf("\n IPv6 Routing Header: Routing Type %u Segments Left %u",
16                        *packet, *(packet + 1));               
17        printf("\n");
18
19        decode_next(packet + hbh_len, len - hbh_len, "ip", hdr->nxt);
20
21
22}
Note: See TracBrowser for help on using the repository browser.