source: libpacketdump/ospf2_1005.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: 744 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
8DLLEXPORT void decode(int link_type UNUSED,const char *packet,unsigned len) {
9
10        libtrace_ospf_as_external_lsa_v2_t *as = (libtrace_ospf_as_external_lsa_v2_t *)packet;
11
12        if (len < 4)
13                return;
14       
15        printf (" OSPF AS External LSA: Netmask %s ", inet_ntoa(as->netmask));
16
17        if (len < 8) {
18                printf("\n");
19                return;
20        }
21       
22        printf( "Metric %u\n", trace_get_ospf_metric_from_as_external_lsa_v2(as));
23
24        if (len < 12)
25                return;
26       
27        printf(" OSPF AS External LSA: Forwarding %s ", inet_ntoa(as->forwarding));
28
29        if (len < 16) {
30                printf("\n");
31                return;
32        }
33       
34        printf("External Tag %u\n", ntohl(as->external_tag));
35
36}
37
Note: See TracBrowser for help on using the repository browser.