/*
* Copyright (C) 1998 WIDE Project.
* All rights reserved.
*
* 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.
*
* 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.
*/
struct rainfo *rainfo; /* back pointer to the interface */
struct rtadvd_timer *timer; /* expiration timer. used when a prefix
* derived from the kernel is deleted.
*/
uint32_t validlifetime; /* AdvValidLifetime */
long vltimeexpire; /* expiration of vltime; decrement case only */
uint32_t preflifetime; /* AdvPreferredLifetime */
long pltimeexpire; /* expiration of pltime; decrement case only */
uint16_t onlinkflg; /* bool: AdvOnLinkFlag */
uint16_t autoconfflg; /* bool: AdvAutonomousFlag */
int prefixlen;
int origin; /* from kernel or config */
struct in6_addr prefix;
};
/* timer related parameters */
struct rtadvd_timer *timer; /* unsolicited RA timer */
struct rtadvd_timer *timer_sol; /* solicited RA timer */
int initcounter; /* counter for the first few advertisements */
struct timespec lastsent; /* timestamp when the latest RA was sent */
int waiting; /* number of RS waiting for RA */
struct rainfo *leaving; /* the config which is leaving */
struct rainfo *leaving_for; /* the new config to activate */
int leaving_adv; /* number of RA left to send */
/* interface information */
uint16_t ifindex;
int ifflags;
int advlinkopt; /* bool: whether include link-layer addr opt */
struct sockaddr_dl *sdl;
char ifname[16];
uint32_t phymtu; /* mtu of the physical interface */
int rtpref; /* router preference */
uint32_t linkmtu; /* AdvLinkMTU */
uint32_t reachabletime; /* AdvReachableTime */
uint32_t retranstimer; /* AdvRetransTimer */
uint16_t hoplimit; /* AdvCurHopLimit */
TAILQ_HEAD(, prefix) prefix; /* AdvPrefixList(link head) */
int pfxs;
uint16_t clockskew;/* used for consisitency check of lifetimes */
TAILQ_HEAD(, rtinfo) route;
TAILQ_HEAD(, rdnss) rdnss; /* RDNSS list */
TAILQ_HEAD(, dnssl) dnssl; /* DNS Search List */
/* actual RA packet data and its length */
size_t ra_datalen;
char *ra_data;
/* statistics */
uint64_t raoutput; /* number of RAs sent */
uint64_t rainput; /* number of RAs received */
uint64_t rainconsistent; /* number of RAs inconsistent with ours */
uint64_t rsinput; /* number of RSs received */
/* info about soliciter */
TAILQ_HEAD(, soliciter) soliciter; /* recent solication source */
};