9 #include <gpxe/netdevice.h>
10 #include <gpxe/iobuf.h>
11 #include <gpxe/tcpip.h>
13 struct icmp6_net_protocol
;
16 #define NDP_STATE_INVALID 0
17 #define NDP_STATE_INCOMPLETE 1
18 #define NDP_STATE_REACHABLE 2
19 #define NDP_STATE_DELAY 3
20 #define NDP_STATE_PROBE 4
21 #define NDP_STATE_STALE 5
23 #define RSOLICIT_STATE_INVALID 0
24 #define RSOLICIT_STATE_PENDING 1
25 #define RSOLICIT_STATE_COMPLETE 2
26 #define RSOLICIT_STATE_ALMOST 3
28 #define RSOLICIT_CODE_NONE 0
29 #define RSOLICIT_CODE_MANAGED 1
30 #define RSOLICIT_CODE_OTHERCONF 2
32 #define NDP_OPTION_SOURCE_LL 1
33 #define NDP_OPTION_TARGET_LL 2
34 #define NDP_OPTION_PREFIX_INFO 3
35 #define NDP_OPTION_REDIRECT 4
36 #define NDP_OPTION_MTU 5
38 struct rsolicit_info
{
39 struct in6_addr router
;
40 struct in6_addr prefix
;
42 int no_address
; /* No address assignment takes place via this adv. */
45 struct neighbour_solicit
{
50 struct in6_addr target
;
53 struct neighbour_advert
{
59 struct in6_addr target
;
62 struct router_solicit
{
69 struct router_advert
{
76 uint32_t reachable_time
;
77 uint32_t retrans_time
;
100 uint32_t pref_lifetime
;
105 #define RADVERT_MANAGED ( 1 << 7 )
106 #define RADVERT_OTHERCONF ( 1 << 6 )
108 int ndp_resolve ( struct net_device
*netdev
, struct in6_addr
*src
,
109 struct in6_addr
*dest
, void *dest_ll_addr
);
111 int ndp_send_rsolicit ( struct net_device
*netdev
,
112 struct job_interface
*job
,
113 struct rsolicit_info
*meta
);
115 int ndp_process_radvert ( struct io_buffer
*iobuf
, struct sockaddr_tcpip
*st_src
,
116 struct sockaddr_tcpip
*st_dest
, struct net_device
*netdev
,
117 struct icmp6_net_protocol
*net_protocol
);
119 int ndp_process_nadvert ( struct io_buffer
*iobuf
, struct sockaddr_tcpip
*st_src
,
120 struct sockaddr_tcpip
*st_dest
,
121 struct icmp6_net_protocol
*net_protocol
);
123 int ndp_process_nsolicit ( struct io_buffer
*iobuf
, struct sockaddr_tcpip
*st_src
,
124 struct sockaddr_tcpip
*st_dest
, struct net_device
*netdev
,
125 struct icmp6_net_protocol
*net_protocol
);