source: libpacketdump/ip_89.c @ 1de522d

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivendag_formatrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 1de522d was ee6e802, checked in by Shane Alcock <salcock@…>, 5 years ago

Updated copyright blurb on all source files

In some cases, this meant adding copyright blurbs to files that
had never had them before.

  • Property mode set to 100644
File size: 2.4 KB
RevLine 
[ee6e802]1/*
2 *
3 * Copyright (c) 2007-2016 The University of Waikato, Hamilton, New Zealand.
4 * All rights reserved.
5 *
6 * This file is part of libtrace.
7 *
8 * This code has been developed by the University of Waikato WAND
9 * research group. For further information please see http://www.wand.net.nz/
10 *
11 * libtrace is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * libtrace is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 *
24 *
25 */
[e224862]26#include <stdio.h>
27#include <inttypes.h>
28#include <dlfcn.h>
29#include <sys/socket.h>
30#include <netinet/in.h>
31#include <arpa/inet.h>
32
33#include "libpacketdump.h"
34
35static void dump_ospf_v2_header(libtrace_ospf_v2_t *hdr, unsigned len) {
36
[387d299]37        DISPLAY(hdr, ospf_v, " OSPF Header: Version %u");
38        DISPLAY(hdr, type, " Type %u ");
[e224862]39        switch(hdr->type) {
40                case TRACE_OSPF_HELLO:
41                        printf("(Hello)");
42                        break;
43                case TRACE_OSPF_DATADESC:
44                        printf("(Database Desc)");
45                        break;
46                case TRACE_OSPF_LSREQ:
47                        printf("(Link State Request)");
48                        break;
49                case TRACE_OSPF_LSUPDATE:
50                        printf("(Link State Update)");
51                        break;
52                case TRACE_OSPF_LSACK:
53                        printf("(Link State Ack.)");
54                        break;
55        }
[387d299]56        printf("\n");
57
58        DISPLAYS(hdr, ospf_len, "OSPF Header: Length %u \n");
59        DISPLAYIP(hdr, router, " OSPF Header: Router Id %s ");
60        DISPLAYIP(hdr, area, "Area Id %s\n");
61        DISPLAYS(hdr, sum, " OSPF Header: Checksum %u ");
62        DISPLAYS(hdr, au_type, "Auth Type %u\n");
63        DISPLAY(hdr, au_key_id, " OSPF Header: Auth Key ID %u ");
64        DISPLAY(hdr, au_data_len, "Auth Data Len %u\n");
65        DISPLAYL(hdr, au_seq_num, " OSPF Header: Auth Crypto Seq %u\n");
[e224862]66
67}
68
69DLLEXPORT void decode(int link_type UNUSED, const char *packet, unsigned len) {
70
71        libtrace_ospf_v2_t *hdr = (libtrace_ospf_v2_t *)packet;
72
73        if (hdr->ospf_v == 2) {
74                dump_ospf_v2_header(hdr, len);
75                decode_next(packet + sizeof(libtrace_ospf_v2_t), 
76                        len - sizeof(libtrace_ospf_v2_t), "ospf2", 
77                        hdr->type);
78        }
79
80        return;
81
82}
Note: See TracBrowser for help on using the repository browser.