source: libpacketdump/ospf2_1003.c @ e224862

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since e224862 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: 495 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
9DLLEXPORT void decode(int link_type UNUSED,const char *packet,unsigned len) {
10       
11        libtrace_ospf_summary_lsa_v2_t *sum = (libtrace_ospf_summary_lsa_v2_t *)packet;
12
13        if (len >= 4) {
14                printf(" OSPF Summary LSA: Netmask %s ", inet_ntoa(sum->netmask));
15        }
16
17        if (len < 8) 
18                return;
19       
20        printf("Metric %u\n", trace_get_ospf_metric_from_summary_lsa_v2(sum));
21}
Note: See TracBrowser for help on using the repository browser.