2001-01-21 15:25:46 +00:00
|
|
|
/* $FreeBSD$ */
|
- supported a string notation for xxflags.
- deprecate routes#N, as it is hard to keep consistency with
rtprefixN. accept any number of "rtprefix", "rtrefix0",
..., "rtprefix99".
- deprecate "addrs#N", as it is difficult for users to keep
consistency with "addrN".
accept 100 prefix info in maximum - like "addr", "addr0"
... "addr99". WARNS=2 clean on netbsd.
old configuration file should work just fine.
behavior change:
previously, we rejected "addrN" if there's "addr", and we rejected
"addr" if there is "addrN". now we accept both without problem.
- when an advertised prefix configured from the kernel has been added
or invalidated, notice the change in a short delay.
- when invalidating a prefix, do not bark even if there is
inconsistency about prefix lifetimes.
- wrap more specific route info code into ROUTEINFO.
Obtained from: KAME
MFC after: 1 week
2003-08-15 19:13:53 +00:00
|
|
|
/* $KAME: rtadvd.h,v 1.26 2003/08/05 12:34:23 itojun Exp $ */
|
2000-07-05 22:09:50 +00:00
|
|
|
|
2000-01-06 12:40:54 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 1998 WIDE Project.
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
* Copyright (C) 2011 Hiroki Sato <hrs@FreeBSD.org>
|
2000-01-06 12:40:54 +00:00
|
|
|
* All rights reserved.
|
2011-06-06 03:06:43 +00:00
|
|
|
*
|
2000-01-06 12:40:54 +00:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of the project nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
2011-06-06 03:06:43 +00:00
|
|
|
*
|
2000-01-06 12:40:54 +00:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
#define ELM_MALLOC(p,error_action) \
|
|
|
|
do { \
|
|
|
|
p = malloc(sizeof(*p)); \
|
|
|
|
if (p == NULL) { \
|
|
|
|
syslog(LOG_ERR, "<%s> malloc failed: %s", \
|
|
|
|
__func__, strerror(errno)); \
|
|
|
|
error_action; \
|
|
|
|
} \
|
|
|
|
memset(p, 0, sizeof(*p)); \
|
|
|
|
} while(0)
|
|
|
|
|
2011-06-06 03:06:43 +00:00
|
|
|
#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
|
|
|
|
{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
|
|
|
|
|
|
|
|
#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
|
|
|
|
{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
|
|
|
|
|
|
|
|
#define IN6ADDR_SITELOCAL_ALLROUTERS_INIT \
|
|
|
|
{{{ 0xff, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
|
|
|
|
|
|
|
|
extern struct sockaddr_in6 sin6_linklocal_allnodes;
|
|
|
|
extern struct sockaddr_in6 sin6_linklocal_allrouters;
|
|
|
|
extern struct sockaddr_in6 sin6_sitelocal_allrouters;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* RFC 3542 API deprecates IPV6_PKTINFO in favor of
|
|
|
|
* IPV6_RECVPKTINFO
|
|
|
|
*/
|
|
|
|
#ifndef IPV6_RECVPKTINFO
|
|
|
|
#ifdef IPV6_PKTINFO
|
|
|
|
#define IPV6_RECVPKTINFO IPV6_PKTINFO
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* RFC 3542 API deprecates IPV6_HOPLIMIT in favor of
|
|
|
|
* IPV6_RECVHOPLIMIT
|
|
|
|
*/
|
|
|
|
#ifndef IPV6_RECVHOPLIMIT
|
|
|
|
#ifdef IPV6_HOPLIMIT
|
|
|
|
#define IPV6_RECVHOPLIMIT IPV6_HOPLIMIT
|
|
|
|
#endif
|
|
|
|
#endif
|
2000-01-06 12:40:54 +00:00
|
|
|
|
|
|
|
/* protocol constants and default values */
|
2000-07-05 22:09:50 +00:00
|
|
|
#define DEF_MAXRTRADVINTERVAL 600
|
|
|
|
#define DEF_ADVLINKMTU 0
|
|
|
|
#define DEF_ADVREACHABLETIME 0
|
|
|
|
#define DEF_ADVRETRANSTIMER 0
|
|
|
|
#define DEF_ADVCURHOPLIMIT 64
|
|
|
|
#define DEF_ADVVALIDLIFETIME 2592000
|
|
|
|
#define DEF_ADVPREFERREDLIFETIME 604800
|
|
|
|
|
|
|
|
#define MAXROUTERLIFETIME 9000
|
- supported a string notation for xxflags.
- deprecate routes#N, as it is hard to keep consistency with
rtprefixN. accept any number of "rtprefix", "rtrefix0",
..., "rtprefix99".
- deprecate "addrs#N", as it is difficult for users to keep
consistency with "addrN".
accept 100 prefix info in maximum - like "addr", "addr0"
... "addr99". WARNS=2 clean on netbsd.
old configuration file should work just fine.
behavior change:
previously, we rejected "addrN" if there's "addr", and we rejected
"addr" if there is "addrN". now we accept both without problem.
- when an advertised prefix configured from the kernel has been added
or invalidated, notice the change in a short delay.
- when invalidating a prefix, do not bark even if there is
inconsistency about prefix lifetimes.
- wrap more specific route info code into ROUTEINFO.
Obtained from: KAME
MFC after: 1 week
2003-08-15 19:13:53 +00:00
|
|
|
#define MIN_MAXINTERVAL 4
|
2000-07-05 22:09:50 +00:00
|
|
|
#define MAX_MAXINTERVAL 1800
|
2003-08-08 20:14:28 +00:00
|
|
|
#define MIN_MININTERVAL 3
|
2000-07-05 22:09:50 +00:00
|
|
|
#define MAXREACHABLETIME 3600000
|
|
|
|
|
|
|
|
#define MAX_INITIAL_RTR_ADVERT_INTERVAL 16
|
|
|
|
#define MAX_INITIAL_RTR_ADVERTISEMENTS 3
|
|
|
|
#define MAX_FINAL_RTR_ADVERTISEMENTS 3
|
|
|
|
#define MIN_DELAY_BETWEEN_RAS 3
|
|
|
|
#define MAX_RA_DELAY_TIME 500000 /* usec */
|
|
|
|
|
|
|
|
#define PREFIX_FROM_KERNEL 1
|
|
|
|
#define PREFIX_FROM_CONFIG 2
|
|
|
|
#define PREFIX_FROM_DYNAMIC 3
|
2000-01-06 12:40:54 +00:00
|
|
|
|
|
|
|
struct prefix {
|
2011-06-06 03:06:43 +00:00
|
|
|
TAILQ_ENTRY(prefix) pfx_next;
|
|
|
|
|
|
|
|
struct rainfo *pfx_rainfo; /* back pointer to the interface */
|
|
|
|
/*
|
|
|
|
* Expiration timer. This is used when a prefix derived from
|
|
|
|
* the kernel is deleted.
|
|
|
|
*/
|
|
|
|
struct rtadvd_timer *pfx_timer;
|
|
|
|
|
2011-07-17 19:24:54 +00:00
|
|
|
uint32_t pfx_validlifetime; /* AdvValidLifetime */
|
|
|
|
uint32_t pfx_vltimeexpire; /* Expiration of vltime */
|
|
|
|
uint32_t pfx_preflifetime; /* AdvPreferredLifetime */
|
|
|
|
uint32_t pfx_pltimeexpire; /* Expiration of pltime */
|
|
|
|
int pfx_onlinkflg; /* bool: AdvOnLinkFlag */
|
|
|
|
int pfx_autoconfflg; /* bool: AdvAutonomousFlag */
|
2011-06-06 03:06:43 +00:00
|
|
|
int pfx_prefixlen;
|
|
|
|
int pfx_origin; /* From kernel or config */
|
|
|
|
|
|
|
|
struct in6_addr pfx_prefix;
|
2000-07-05 22:09:50 +00:00
|
|
|
};
|
|
|
|
|
2001-06-11 12:39:29 +00:00
|
|
|
struct rtinfo {
|
2011-06-06 03:06:43 +00:00
|
|
|
TAILQ_ENTRY(rtinfo) rti_next;
|
2001-06-11 12:39:29 +00:00
|
|
|
|
2011-07-17 19:24:54 +00:00
|
|
|
uint32_t rti_ltime; /* route lifetime */
|
|
|
|
int rti_rtpref; /* route preference */
|
2011-06-06 03:06:43 +00:00
|
|
|
int rti_prefixlen;
|
|
|
|
struct in6_addr rti_prefix;
|
2001-06-11 12:39:29 +00:00
|
|
|
};
|
|
|
|
|
2011-06-06 03:06:43 +00:00
|
|
|
struct rdnss_addr {
|
|
|
|
TAILQ_ENTRY(rdnss_addr) ra_next;
|
|
|
|
|
|
|
|
struct in6_addr ra_dns; /* DNS server entry */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rdnss {
|
|
|
|
TAILQ_ENTRY(rdnss) rd_next;
|
|
|
|
|
|
|
|
TAILQ_HEAD(, rdnss_addr) rd_list; /* list of DNS servers */
|
2011-07-17 19:24:54 +00:00
|
|
|
uint32_t rd_ltime; /* number of seconds valid */
|
2011-06-06 03:06:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The maximum length of a domain name in a DNS search list is calculated
|
|
|
|
* by a domain name + length fields per 63 octets + a zero octet at
|
|
|
|
* the tail and adding 8 octet boundary padding.
|
|
|
|
*/
|
|
|
|
#define _DNAME_LABELENC_MAXLEN \
|
|
|
|
(NI_MAXHOST + (NI_MAXHOST / 64 + 1) + 1)
|
|
|
|
|
|
|
|
#define DNAME_LABELENC_MAXLEN \
|
|
|
|
(_DNAME_LABELENC_MAXLEN + 8 - _DNAME_LABELENC_MAXLEN % 8)
|
|
|
|
|
|
|
|
struct dnssl_addr {
|
|
|
|
TAILQ_ENTRY(dnssl_addr) da_next;
|
|
|
|
|
|
|
|
int da_len; /* length of entry */
|
|
|
|
char da_dom[DNAME_LABELENC_MAXLEN]; /* search domain name entry */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dnssl {
|
|
|
|
TAILQ_ENTRY(dnssl) dn_next;
|
|
|
|
|
|
|
|
TAILQ_HEAD(, dnssl_addr) dn_list; /* list of search domains */
|
2011-07-17 19:24:54 +00:00
|
|
|
uint32_t dn_ltime; /* number of seconds valid */
|
2011-06-06 03:06:43 +00:00
|
|
|
};
|
|
|
|
|
2000-07-05 22:09:50 +00:00
|
|
|
struct soliciter {
|
2011-06-06 03:06:43 +00:00
|
|
|
TAILQ_ENTRY(soliciter) sol_next;
|
|
|
|
|
|
|
|
struct sockaddr_in6 sol_addr;
|
2000-01-06 12:40:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct rainfo {
|
|
|
|
/* pointer for list */
|
2011-06-06 03:06:43 +00:00
|
|
|
TAILQ_ENTRY(rainfo) rai_next;
|
2000-01-06 12:40:54 +00:00
|
|
|
|
|
|
|
/* interface information */
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
struct ifinfo *rai_ifinfo;
|
|
|
|
|
2011-07-17 19:24:54 +00:00
|
|
|
int rai_advlinkopt; /* bool: whether include link-layer addr opt */
|
2011-06-06 03:06:43 +00:00
|
|
|
int rai_advifprefix; /* bool: gather IF prefixes? */
|
2000-01-06 12:40:54 +00:00
|
|
|
|
|
|
|
/* Router configuration variables */
|
2011-07-17 19:24:54 +00:00
|
|
|
uint16_t rai_lifetime; /* AdvDefaultLifetime */
|
|
|
|
uint16_t rai_maxinterval; /* MaxRtrAdvInterval */
|
|
|
|
uint16_t rai_mininterval; /* MinRtrAdvInterval */
|
2011-06-06 03:06:43 +00:00
|
|
|
int rai_managedflg; /* AdvManagedFlag */
|
|
|
|
int rai_otherflg; /* AdvOtherConfigFlag */
|
2000-01-06 12:40:54 +00:00
|
|
|
|
2011-06-06 03:06:43 +00:00
|
|
|
int rai_rtpref; /* router preference */
|
2011-07-17 19:24:54 +00:00
|
|
|
uint32_t rai_linkmtu; /* AdvLinkMTU */
|
|
|
|
uint32_t rai_reachabletime; /* AdvReachableTime */
|
|
|
|
uint32_t rai_retranstimer; /* AdvRetransTimer */
|
|
|
|
uint8_t rai_hoplimit; /* AdvCurHopLimit */
|
2011-06-06 03:06:43 +00:00
|
|
|
|
|
|
|
TAILQ_HEAD(, prefix) rai_prefix;/* AdvPrefixList(link head) */
|
|
|
|
int rai_pfxs; /* number of prefixes */
|
|
|
|
|
2011-07-17 19:24:54 +00:00
|
|
|
uint16_t rai_clockskew; /* used for consisitency check of lifetimes */
|
2011-06-06 03:06:43 +00:00
|
|
|
|
|
|
|
TAILQ_HEAD(, rdnss) rai_rdnss; /* DNS server list */
|
|
|
|
TAILQ_HEAD(, dnssl) rai_dnssl; /* search domain list */
|
|
|
|
TAILQ_HEAD(, rtinfo) rai_route; /* route information option (link head) */
|
|
|
|
int rai_routes; /* number of route information options */
|
2000-01-06 12:40:54 +00:00
|
|
|
/* actual RA packet data and its length */
|
2011-06-06 03:06:43 +00:00
|
|
|
size_t rai_ra_datalen;
|
2011-07-17 19:24:54 +00:00
|
|
|
char *rai_ra_data;
|
2000-07-05 22:09:50 +00:00
|
|
|
|
|
|
|
/* info about soliciter */
|
2011-06-06 03:06:43 +00:00
|
|
|
TAILQ_HEAD(, soliciter) rai_soliciter; /* recent solication source */
|
2000-01-06 12:40:54 +00:00
|
|
|
};
|
|
|
|
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
/* RA information list */
|
2011-06-06 03:06:43 +00:00
|
|
|
extern TAILQ_HEAD(railist_head_t, rainfo) railist;
|
2000-07-05 22:09:50 +00:00
|
|
|
|
2011-07-17 19:24:54 +00:00
|
|
|
/*
|
|
|
|
* ifi_state:
|
|
|
|
*
|
|
|
|
* (INIT)
|
|
|
|
* |
|
|
|
|
* | update_ifinfo()
|
|
|
|
* | update_persist_ifinfo()
|
|
|
|
* v
|
|
|
|
* UNCONFIGURED
|
|
|
|
* | ^
|
|
|
|
* loadconfig()| |rm_ifinfo(), ra_output()
|
|
|
|
* (MC join)| |(MC leave)
|
|
|
|
* | |
|
|
|
|
* | |
|
|
|
|
* v |
|
|
|
|
* TRANSITIVE
|
|
|
|
* | ^
|
|
|
|
* ra_output()| |getconfig()
|
|
|
|
* | |
|
|
|
|
* | |
|
|
|
|
* | |
|
|
|
|
* v |
|
|
|
|
* CONFIGURED
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
#define IFI_STATE_UNCONFIGURED 0
|
|
|
|
#define IFI_STATE_CONFIGURED 1
|
2011-07-17 19:24:54 +00:00
|
|
|
#define IFI_STATE_TRANSITIVE 2
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
|
|
|
|
struct ifinfo {
|
|
|
|
TAILQ_ENTRY(ifinfo) ifi_next;
|
|
|
|
|
2011-07-17 19:24:54 +00:00
|
|
|
uint16_t ifi_state;
|
|
|
|
uint16_t ifi_persist;
|
|
|
|
uint16_t ifi_ifindex;
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
char ifi_ifname[IFNAMSIZ];
|
2011-07-17 19:24:54 +00:00
|
|
|
uint8_t ifi_type;
|
|
|
|
uint16_t ifi_flags;
|
|
|
|
uint32_t ifi_nd_flags;
|
|
|
|
uint32_t ifi_phymtu;
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
struct sockaddr_dl ifi_sdl;
|
|
|
|
|
|
|
|
struct rainfo *ifi_rainfo;
|
2011-07-17 19:24:54 +00:00
|
|
|
struct rainfo *ifi_rainfo_trans;
|
|
|
|
uint16_t ifi_burstcount;
|
|
|
|
uint32_t ifi_burstinterval;
|
|
|
|
struct rtadvd_timer *ifi_ra_timer;
|
|
|
|
/* timestamp when the latest RA was sent */
|
|
|
|
struct timeval ifi_ra_lastsent;
|
|
|
|
uint16_t ifi_rs_waitcount;
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
|
|
|
|
/* statistics */
|
2011-07-17 19:24:54 +00:00
|
|
|
uint64_t ifi_raoutput; /* # of RAs sent */
|
|
|
|
uint64_t ifi_rainput; /* # of RAs received */
|
|
|
|
uint64_t ifi_rainconsistent; /* # of inconsistent recv'd RAs */
|
|
|
|
uint64_t ifi_rsinput; /* # of RSs received */
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Interface list */
|
|
|
|
extern TAILQ_HEAD(ifilist_head_t, ifinfo) ifilist;
|
|
|
|
|
|
|
|
extern char *mcastif;
|
|
|
|
|
2011-06-06 03:06:43 +00:00
|
|
|
struct rtadvd_timer *ra_timeout(void *);
|
|
|
|
void ra_timer_update(void *, struct timeval *);
|
2011-07-17 19:24:54 +00:00
|
|
|
void ra_output(struct ifinfo *);
|
2001-06-11 12:39:29 +00:00
|
|
|
|
2011-06-06 03:06:43 +00:00
|
|
|
int prefix_match(struct in6_addr *, int,
|
|
|
|
struct in6_addr *, int);
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
struct ifinfo *if_indextoifinfo(int);
|
2011-06-06 03:06:43 +00:00
|
|
|
struct prefix *find_prefix(struct rainfo *,
|
|
|
|
struct in6_addr *, int);
|
- Refactoring the interface list. It now supports dynamically
added/removed interfaces in a more consistent manner and reloading
the configuration file.
- Add initial support for control socket. RA information in the
daemon can be obtained by rtadvctl(8) instead of SIGUSR1 in a similar
manner to ifconfig(8). The information dump has been removed in favor of it.
(reload the configuration file)
# rtadvctl reload
(show RA messages being sent on each interfaces)
# rtadvctl show
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
(show RA messages being sent only on em0)
# rtadvctl show em0
(rtadvctl -v show provides additional information)
# rtadvctl -v show em0
em0: flags=<UP,CONFIGURED,PERSIST> status=<RA_SEND> mtu 1280
DefaultLifetime: 30m
MinAdvInterval/MaxAdvInterval: 3m20s/3m20s
AdvLinkMTU: <none>, Flags: O, Preference: medium
ReachableTime: 0s, RetransTimer: 0s, CurHopLimit: 64
AdvIfPrefixes: yes
Prefixes (1):
2001:db8:1::/64 (CONFIG, vltime=30d, pltime=7d, flags=LA)
RDNSS entries:
2001:db8:1::128 (ltime=2m40s)
(stop rtadvd)
# rtadvctl shutdown
A remaining issue when reloading the configuration file is that
during that period rtadvd cannot communicate with rtadvctl due to some
additional RA sending for graceful shutdown. This will be fixed later.
2011-07-14 10:09:58 +00:00
|
|
|
void rtadvd_set_reload(int);
|
2011-07-17 19:24:54 +00:00
|
|
|
void rtadvd_set_shutdown(int);
|