1 /********************************************************************************
2 NDPMon - Neighbor Discovery Protocol Monitor
3 Copyright (C) 2006 MADYNES Project, LORIA - INRIA Lorraine (France)
4 
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9 
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 Lesser General Public License for more details.
14 
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18 
19 Author Info:
20   Name: Thibault Cholez
21   Mail: thibault.cholez@esial.uhp-nancy.fr
22 
23 Maintainer:
24   Name: Frederic Beck
25   Mail: frederic.beck@loria.fr
26 
27 MADYNES Project, LORIA-INRIA Lorraine, hereby disclaims all copyright interest in
28 the tool 'NDPMon' (Neighbor Discovery Protocol Monitor) written by Thibault Cholez.
29 
30 Olivier Festor, Scientific Leader of the MADYNEs Project, 20 August 2006
31 ***********************************************************************************/
32 
33 #ifndef _PRINT_PACK_INF_
34 #define _PRINT_PACK_INF_ 1
35 
36 #include <stdio.h>
37 #include <stdlib.h>
38 
39 /* Setting headers according to OSTYPE */
40 #ifdef _FREEBSD_
41 #include <sys/types.h>
42 #include <net/ethernet.h>
43 #include <netinet/in.h>
44 #endif
45 
46 #ifdef _OPENBSD_
47 #include <sys/types.h>
48 #include <sys/socket.h>
49 #include <netinet/in.h>
50 #include <net/if.h>
51 #include <netinet/if_ether.h>
52 #endif
53 
54 #ifdef _LINUX_
55 #include <netinet/ether.h>
56 #endif
57 
58 #include "neighbors.h"
59 #include "routers.h"
60 #include "ndpmon_defs.h"
61 #include "utils.h"
62 
63 
64 /*Print the ipv6 addr in a readable form*/
65 void ipv6_ntoa(char* buffer,struct in6_addr addr);
66 
67 /*Print the ipv6 prefix in a readable form*/
68 void ipv6pre_ntoa(char* buffer,struct in6_addr addr);
69 
70 
71 /*Print eth header information*/
72 void print_eth(struct ether_header eptr);
73 
74 /*Print ip6 header information*/
75 void print_ip6hdr(struct ip6_hdr ipptr);
76 
77 /*Print information of the Neighbor Discovery message*/
78 void print_ra(struct nd_router_advert raptr);
79 
80 void print_rs(struct nd_router_solicit rsptr);
81 
82 void print_na(struct nd_neighbor_advert naptr);
83 
84 void print_ns(struct nd_neighbor_solicit nsptr);
85 
86 void print_rd(struct nd_redirect rdptr);
87 
88 
89 void print_opt(struct nd_opt_hdr);
90 
91 /*Print the neightbor cache*/
92 void print_cache();
93 
94 
95 #endif
96 
97