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 
34 #ifndef _MONITORING_NA_
35 #define _MONITORING_NA_ 1
36 
37 /* Setting headers according to OSTYPE */
38 #ifdef _FREEBSD_
39 #include <sys/types.h>
40 #include <netinet/in.h>
41 #include <net/ethernet.h>
42 #endif
43 
44 #ifdef _OPENBSD_
45 #include <sys/types.h>
46 #include <sys/socket.h>
47 #include <netinet/in.h>
48 #include <net/if.h>
49 #include <netinet/if_ether.h>
50 #endif
51 
52 #ifdef _LINUX_
53 #include <netinet/ether.h>
54 #endif
55 
56 #include <netinet/ip6.h>
57 #include <netinet/icmp6.h>
58 
59 #include <libxml/parser.h>
60 #include <libxml/tree.h>
61 #include <libxml/xpath.h>
62 /*
63 #include "config.h"
64 #include "neighborhood.h"
65 */
66 #include "membounds.h"
67 #include "ndpmon_defs.h"
68 #include "print_packet_info.h"
69 #include "alarm.h"
70 #include "monitoring_ns.h"
71 
72 /*Test if the NA enable the router flag and if true
73  *test if this neighbor is an official router
74  */
75 int watch_R_flag(char* message, struct ether_header* eptr, struct ip6_hdr* ipptr, struct nd_neighbor_advert* naptr);
76 
77 
78 /*Test if the NA is doing Duplicate Address Detection DOS
79  */
80 int watch_dad_dos(char* message, struct ether_header* eptr, struct ip6_hdr* ipptr, struct nd_neighbor_advert* naptr, int new_eth);
81 
82 
83 #endif
84