]>
Commit | Line | Data |
---|---|---|
660e16f5 MW |
1 | /* |
2 | * Copyright (C) 2010 Martin Willi | |
19ef2aec TB |
3 | * |
4 | * Copyright (C) secunet Security Networks AG | |
660e16f5 MW |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License as published by the | |
8 | * Free Software Foundation; either version 2 of the License, or (at your | |
9 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | * for more details. | |
15 | */ | |
16 | ||
17 | /** | |
18 | * @defgroup farp_listener farp_listener | |
19 | * @{ @ingroup farp | |
20 | */ | |
21 | ||
22 | #ifndef FARP_LISTENER_H_ | |
23 | #define FARP_LISTENER_H_ | |
24 | ||
2e7cc07e | 25 | #include <networking/host.h> |
660e16f5 MW |
26 | #include <bus/listeners/listener.h> |
27 | ||
28 | typedef struct farp_listener_t farp_listener_t; | |
29 | ||
30 | /** | |
31 | * Listener to register the set of IPs we spoof ARP responses for. | |
32 | */ | |
33 | struct farp_listener_t { | |
34 | ||
35 | /** | |
36 | * Implements listener_t interface. | |
37 | */ | |
38 | listener_t listener; | |
39 | ||
40 | /** | |
45f20f8a | 41 | * Check if we have a tunnel between two IP addresses. |
660e16f5 | 42 | * |
45f20f8a MW |
43 | * @param local local IP |
44 | * @param remote remote IP | |
45 | * @return TRUE if a tunnel is active | |
660e16f5 | 46 | */ |
45f20f8a | 47 | bool (*has_tunnel)(farp_listener_t *this, host_t *local, host_t *remote); |
660e16f5 MW |
48 | |
49 | /** | |
50 | * Destroy a farp_listener_t. | |
51 | */ | |
52 | void (*destroy)(farp_listener_t *this); | |
53 | }; | |
54 | ||
55 | /** | |
56 | * Create a farp_listener instance. | |
57 | */ | |
58 | farp_listener_t *farp_listener_create(); | |
59 | ||
60 | #endif /** FARP_LISTENER_H_ @}*/ |