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 
decode(int link_type UNUSED,const char * packet,unsigned len)9 DLLEXPORT 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 }
22