version 1.1.1.6, 2018/06/04 09:55:15 |
version 1.1.1.6.2.3, 2020/04/21 18:41:55 |
|
|
|
/* SPDX-License-Identifier: BSD-2-Clause */ |
/* |
/* |
* dhcpcd - IPv6 ND handling |
* dhcpcd - IPv6 ND handling |
* Copyright (c) 2006-2018 Roy Marples <roy@marples.name> |
* Copyright (c) 2006-2020 Roy Marples <roy@marples.name> |
* All rights reserved |
* All rights reserved |
|
|
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
|
|
#ifndef IPV6ND_H |
#ifndef IPV6ND_H |
#define IPV6ND_H |
#define IPV6ND_H |
|
|
|
#ifdef INET6 |
|
|
#include <time.h> |
#include <time.h> |
|
|
#include "config.h" |
#include "config.h" |
|
|
uint32_t reachable; |
uint32_t reachable; |
uint32_t retrans; |
uint32_t retrans; |
uint32_t mtu; |
uint32_t mtu; |
|
uint8_t hoplimit; |
struct ipv6_addrhead addrs; |
struct ipv6_addrhead addrs; |
uint8_t hasdns; |
bool hasdns; |
uint8_t expired; |
bool expired; |
|
bool willexpire; |
|
bool doexpire; |
|
bool isreachable; |
}; |
}; |
|
|
TAILQ_HEAD(ra_head, ra); |
TAILQ_HEAD(ra_head, ra); |
Line 58 struct rs_state { |
|
Line 65 struct rs_state { |
|
struct nd_router_solicit *rs; |
struct nd_router_solicit *rs; |
size_t rslen; |
size_t rslen; |
int rsprobes; |
int rsprobes; |
|
uint32_t retrans; |
|
#ifdef __sun |
|
int nd_fd; |
|
#endif |
}; |
}; |
|
|
#define RS_STATE(a) ((struct rs_state *)(ifp)->if_data[IF_DATA_IPV6ND]) |
#define RS_STATE(a) ((struct rs_state *)(ifp)->if_data[IF_DATA_IPV6ND]) |
|
#define RS_CSTATE(a) ((const struct rs_state *)(ifp)->if_data[IF_DATA_IPV6ND]) |
#define RS_STATE_RUNNING(a) (ipv6nd_hasra((a)) && ipv6nd_dadcompleted((a))) |
#define RS_STATE_RUNNING(a) (ipv6nd_hasra((a)) && ipv6nd_dadcompleted((a))) |
|
|
#ifndef MAX_RTR_SOLICITATION_DELAY |
#ifndef MAX_RTR_SOLICITATION_DELAY |
Line 68 struct rs_state { |
|
Line 80 struct rs_state { |
|
#define MAX_UNICAST_SOLICIT 3 /* 3 transmissions */ |
#define MAX_UNICAST_SOLICIT 3 /* 3 transmissions */ |
#define RTR_SOLICITATION_INTERVAL 4 /* seconds */ |
#define RTR_SOLICITATION_INTERVAL 4 /* seconds */ |
#define MAX_RTR_SOLICITATIONS 3 /* times */ |
#define MAX_RTR_SOLICITATIONS 3 /* times */ |
|
#define MAX_NEIGHBOR_ADVERTISEMENT 3 /* 3 transmissions */ |
|
|
|
#ifndef IPV6_DEFHLIM |
|
#define IPV6_DEFHLIM 64 |
|
#endif |
#endif |
#endif |
|
|
/* On carrier up, expire known routers after RTR_CARRIER_EXPIRE seconds. */ |
/* On carrier up, expire known routers after RTR_CARRIER_EXPIRE seconds. */ |
Line 81 struct rs_state { |
|
Line 98 struct rs_state { |
|
#define RETRANS_TIMER 1000 /* milliseconds */ |
#define RETRANS_TIMER 1000 /* milliseconds */ |
#define DELAY_FIRST_PROBE_TIME 5 /* seconds */ |
#define DELAY_FIRST_PROBE_TIME 5 /* seconds */ |
|
|
#define IPV6ND_REACHABLE (1 << 0) |
#ifdef __sun |
#define IPV6ND_ROUTER (1 << 1) |
int ipv6nd_open(struct interface *); |
|
#else |
#ifdef INET6 |
int ipv6nd_open(struct dhcpcd_ctx *); |
|
#endif |
|
void ipv6nd_recvmsg(struct dhcpcd_ctx *, struct msghdr *); |
|
int ipv6nd_rtpref(struct ra *); |
void ipv6nd_printoptions(const struct dhcpcd_ctx *, |
void ipv6nd_printoptions(const struct dhcpcd_ctx *, |
const struct dhcp_opt *, size_t); |
const struct dhcp_opt *, size_t); |
void ipv6nd_startrs(struct interface *); |
void ipv6nd_startrs(struct interface *); |
ssize_t ipv6nd_env(char **, const char *, const struct interface *); |
ssize_t ipv6nd_env(FILE *, const struct interface *); |
const struct ipv6_addr *ipv6nd_iffindaddr(const struct interface *ifp, |
const struct ipv6_addr *ipv6nd_iffindaddr(const struct interface *ifp, |
const struct in6_addr *addr, unsigned int flags); |
const struct in6_addr *addr, unsigned int flags); |
struct ipv6_addr *ipv6nd_findaddr(struct dhcpcd_ctx *, |
struct ipv6_addr *ipv6nd_findaddr(struct dhcpcd_ctx *, |
const struct in6_addr *, unsigned int); |
const struct in6_addr *, unsigned int); |
|
struct ipv6_addr *ipv6nd_iffindprefix(struct interface *, |
|
const struct in6_addr *, uint8_t); |
ssize_t ipv6nd_free(struct interface *); |
ssize_t ipv6nd_free(struct interface *); |
void ipv6nd_expirera(void *arg); |
void ipv6nd_expirera(void *arg); |
int ipv6nd_hasra(const struct interface *); |
bool ipv6nd_hasralifetime(const struct interface *, bool); |
int ipv6nd_hasradhcp(const struct interface *); |
#define ipv6nd_hasra(i) ipv6nd_hasralifetime((i), false) |
|
bool ipv6nd_hasradhcp(const struct interface *, bool); |
void ipv6nd_handleifa(int, struct ipv6_addr *, pid_t); |
void ipv6nd_handleifa(int, struct ipv6_addr *, pid_t); |
int ipv6nd_dadcompleted(const struct interface *); |
int ipv6nd_dadcompleted(const struct interface *); |
void ipv6nd_expire(struct interface *, uint32_t); |
void ipv6nd_advertise(struct ipv6_addr *); |
|
void ipv6nd_startexpire(struct interface *); |
void ipv6nd_drop(struct interface *); |
void ipv6nd_drop(struct interface *); |
void ipv6nd_neighbour(struct dhcpcd_ctx *, struct in6_addr *, int); |
void ipv6nd_neighbour(struct dhcpcd_ctx *, struct in6_addr *, bool); |
#else |
#endif /* INET6 */ |
#define ipv6nd_startrs(a) {} |
|
#define ipv6nd_free(a) {} |
|
#define ipv6nd_hasra(a) (0) |
|
#define ipv6nd_dadcompleted(a) (0) |
|
#define ipv6nd_expire(a, b) {} |
|
#endif |
|
|
|
#endif |
#endif /* IPV6ND_H */ |