source: libpacketdump/ospf2_5.c @ 2b0eae9

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 2b0eae9 was e224862, checked in by Shane Alcock <salcock@…>, 10 years ago
  • Added libpacketdump decoders for a large portion of OSPF v2
  • Property mode set to 100644
File size: 689 bytes
Line 
1#include <sys/types.h>
2#include <sys/socket.h>
3#include <netinet/in.h>
4#include <stdio.h>
5#include <arpa/inet.h>
6#include "libpacketdump.h"
7
8#include <assert.h>
9
10DLLEXPORT void decode(int link_type UNUSED,const char *packet,unsigned len) {
11
12        unsigned char *lsa_ptr = (unsigned char *)packet;
13        uint32_t rem = len;
14        uint16_t lsa_length = 0;
15        uint8_t lsa_type;
16        libtrace_ospf_lsa_v2_t *lsa_hdr;
17
18        while (trace_get_next_ospf_lsa_header_v2(&lsa_ptr, &lsa_hdr, 
19                        &rem, &lsa_type, &lsa_length) > 0) {
20
21                if (lsa_hdr) {
22                        decode_next((char *)lsa_hdr, lsa_length, "ospf2", 1000);
23                }
24
25                /* These packets contain LSA headers only so don't try to
26                 * decode the body */
27        }
28}
Note: See TracBrowser for help on using the repository browser.