1 #ifndef MINIX_NET_LWIP_IFADDR_H
2 #define MINIX_NET_LWIP_IFADDR_H
4 /* Possible values of ifdev_v6flags[] elements. */
5 #define IFADDR_V6F_AUTOCONF 0x01 /* autoconfigured address, no subnet */
6 #define IFADDR_V6F_TEMPORARY 0x02 /* temporary (privacy) address */
7 #define IFADDR_V6F_HWBASED 0x04 /* auto-derived from MAC address */
9 typedef int ifaddr_v4_num_t
; /* interface IPv4 address number */
10 typedef int ifaddr_v6_num_t
; /* interface IPv6 address number */
11 typedef int ifaddr_dl_num_t
; /* interface link address number */
13 extern int ifaddr_auto_linklocal
;
14 extern int ifaddr_accept_rtadv
;
16 void ifaddr_init(struct ifdev
* ifdev
);
18 int ifaddr_v4_find(struct ifdev
* ifdev
, const struct sockaddr_in
* addr
,
19 ifaddr_v4_num_t
* num
);
20 int ifaddr_v4_enum(struct ifdev
* ifdev
, ifaddr_v4_num_t
* num
);
21 int ifaddr_v4_get(struct ifdev
* ifdev
, ifaddr_v4_num_t num
,
22 struct sockaddr_in
* addr
, struct sockaddr_in
* mask
,
23 struct sockaddr_in
* bcast
, struct sockaddr_in
* dest
);
24 int ifaddr_v4_get_flags(struct ifdev
* ifdev
, ifaddr_v4_num_t num
);
25 int ifaddr_v4_add(struct ifdev
* ifdev
, const struct sockaddr_in
* addr
,
26 const struct sockaddr_in
* mask
, const struct sockaddr_in
* bcast
,
27 const struct sockaddr_in
* dest
, int flags
);
28 void ifaddr_v4_del(struct ifdev
* ifdev
, ifaddr_v4_num_t num
);
29 void ifaddr_v4_clear(struct ifdev
* ifdev
);
30 struct ifdev
*ifaddr_v4_map_by_addr(const ip4_addr_t
* ip4addr
);
32 int ifaddr_v6_find(struct ifdev
* ifdev
, const struct sockaddr_in6
* addr6
,
33 ifaddr_v6_num_t
* num
);
34 int ifaddr_v6_enum(struct ifdev
* ifdev
, ifaddr_v6_num_t
* num
);
35 void ifaddr_v6_get(struct ifdev
* ifdev
, ifaddr_v6_num_t num
,
36 struct sockaddr_in6
* addr6
, struct sockaddr_in6
* mask6
,
37 struct sockaddr_in6
* dest6
);
38 int ifaddr_v6_get_flags(struct ifdev
* ifdev
, ifaddr_v6_num_t num
);
39 void ifaddr_v6_get_lifetime(struct ifdev
* ifdev
, ifaddr_v6_num_t num
,
40 struct in6_addrlifetime
* lifetime
);
41 int ifaddr_v6_add(struct ifdev
* ifdev
, const struct sockaddr_in6
* addr6
,
42 const struct sockaddr_in6
* mask6
, const struct sockaddr_in6
* dest6
,
43 int flags
, const struct in6_addrlifetime
* lifetime
);
44 void ifaddr_v6_del(struct ifdev
* ifdev
, ifaddr_v6_num_t num
);
45 void ifaddr_v6_clear(struct ifdev
* ifdev
);
46 void ifaddr_v6_check(struct ifdev
* ifdev
);
47 void ifaddr_v6_set_up(struct ifdev
* ifdev
);
48 void ifaddr_v6_set_linklocal(struct ifdev
* ifdev
);
49 struct ifdev
*ifaddr_v6_map_by_addr(const ip6_addr_t
* ip6addr
);
51 struct ifdev
*ifaddr_map_by_addr(const ip_addr_t
* ipaddr
);
52 struct ifdev
*ifaddr_map_by_subnet(const ip_addr_t
* ipaddr
);
53 const ip_addr_t
*ifaddr_select(const ip_addr_t
* dst_addr
,
54 struct ifdev
* ifdev
, struct ifdev
** ifdevp
);
55 int ifaddr_is_zone_mismatch(const ip6_addr_t
* ipaddr
, struct ifdev
* ifdev
);
57 int ifaddr_dl_find(struct ifdev
* ifdev
, const struct sockaddr_dlx
* addr
,
58 socklen_t addr_len
, ifaddr_dl_num_t
* num
);
59 int ifaddr_dl_enum(struct ifdev
* ifdev
, ifaddr_dl_num_t
* num
);
60 void ifaddr_dl_get(struct ifdev
* ifdev
, ifaddr_dl_num_t num
,
61 struct sockaddr_dlx
* addr
);
62 int ifaddr_dl_get_flags(struct ifdev
* ifdev
, ifaddr_dl_num_t num
);
63 int ifaddr_dl_add(struct ifdev
* ifdev
, const struct sockaddr_dlx
* addr
,
64 socklen_t addr_len
, int flags
);
65 int ifaddr_dl_del(struct ifdev
* ifdev
, ifaddr_dl_num_t num
);
66 void ifaddr_dl_clear(struct ifdev
* ifdev
);
67 void ifaddr_dl_update(struct ifdev
* ifdev
, const uint8_t * hwaddr
,
70 #endif /* !MINIX_NET_LWIP_IFADDR_H */