technology: return already enabled when tethering is enabled
[framework/connectivity/connman.git] / gdhcp / ipv4ll.h
1 /*
2  *
3  *  IPV4 Local Link library with GLib integration
4  *
5  *  Copyright (C) 2009-2010  Aldebaran Robotics. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #ifndef __G_IPV4LL_H
23 #define __G_IPV4LL_H
24
25 #include <glib.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /* 169.254.0.0 */
32 #define LINKLOCAL_ADDR 0xa9fe0000
33
34 /* See RFC 3927 */
35 #define PROBE_WAIT           1
36 #define PROBE_NUM            3
37 #define PROBE_MIN            1
38 #define PROBE_MAX            2
39 #define ANNOUNCE_WAIT        2
40 #define ANNOUNCE_NUM         2
41 #define ANNOUNCE_INTERVAL    2
42 #define MAX_CONFLICTS       10
43 #define RATE_LIMIT_INTERVAL 60
44 #define DEFEND_INTERVAL     10
45
46 uint32_t ipv4ll_random_ip(int seed);
47 guint ipv4ll_random_delay_ms(guint secs);
48 int ipv4ll_send_arp_packet(uint8_t* source_eth, uint32_t source_ip,
49                     uint32_t target_ip, int ifindex);
50 int ipv4ll_arp_socket(int ifindex);
51
52 #ifdef __cplusplus
53 }
54 #endif
55 #endif      /* !IPV4LL_H_ */