2003-08-17 11:11:32 +00:00
|
|
|
/* $KAME: rtsold.h,v 1.19 2003/04/16 09:48:15 itojun Exp $ */
|
2000-10-06 23:46:52 +00:00
|
|
|
|
1999-12-28 02:37:14 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
|
|
|
* All rights reserved.
|
2000-07-05 10:14:11 +00:00
|
|
|
*
|
1999-12-28 02:37:14 +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.
|
2000-07-05 10:14:11 +00:00
|
|
|
*
|
1999-12-28 02:37:14 +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.
|
|
|
|
*
|
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct ifinfo {
|
|
|
|
struct ifinfo *next; /* pointer to the next interface */
|
|
|
|
|
|
|
|
struct sockaddr_dl *sdl; /* link-layer address */
|
2000-07-05 10:14:11 +00:00
|
|
|
char ifname[IF_NAMESIZE]; /* interface name */
|
2003-08-17 11:11:32 +00:00
|
|
|
u_int32_t linkid; /* link ID of this interface */
|
1999-12-28 02:37:14 +00:00
|
|
|
int active; /* interface status */
|
2003-08-08 16:56:01 +00:00
|
|
|
int probeinterval; /* interval of probe timer (if necessary) */
|
1999-12-28 02:37:14 +00:00
|
|
|
int probetimer; /* rest of probe timer */
|
|
|
|
int mediareqok; /* wheter the IF supports SIOCGIFMEDIA */
|
2003-08-08 16:42:37 +00:00
|
|
|
int otherconfig; /* need a separate protocol for the "other"
|
|
|
|
* configuration */
|
1999-12-28 02:37:14 +00:00
|
|
|
int state;
|
|
|
|
int probes;
|
|
|
|
int dadcount;
|
|
|
|
struct timeval timer;
|
|
|
|
struct timeval expire;
|
2000-07-05 10:14:11 +00:00
|
|
|
int errors; /* # of errors we've got - detect wedge */
|
1999-12-28 02:37:14 +00:00
|
|
|
|
|
|
|
int racnt; /* total # of valid RAs it have got */
|
|
|
|
|
|
|
|
size_t rs_datalen;
|
|
|
|
u_char *rs_data;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* per interface status */
|
2000-07-05 10:14:11 +00:00
|
|
|
#define IFS_IDLE 0
|
|
|
|
#define IFS_DELAY 1
|
|
|
|
#define IFS_PROBE 2
|
|
|
|
#define IFS_DOWN 3
|
|
|
|
#define IFS_TENTATIVE 4
|
1999-12-28 02:37:14 +00:00
|
|
|
|
|
|
|
/* rtsold.c */
|
|
|
|
extern struct timeval tm_max;
|
|
|
|
extern int dflag;
|
2003-08-17 11:11:32 +00:00
|
|
|
extern int aflag;
|
2009-09-12 22:14:58 +00:00
|
|
|
extern int Fflag;
|
2003-08-08 16:42:37 +00:00
|
|
|
extern char *otherconf_script;
|
2007-11-07 10:53:41 +00:00
|
|
|
extern int ifconfig(char *);
|
|
|
|
extern void iflist_init(void);
|
|
|
|
struct ifinfo *find_ifinfo(int);
|
|
|
|
void rtsol_timer_update(struct ifinfo *);
|
|
|
|
extern void warnmsg(int, const char *, const char *, ...)
|
2000-10-06 23:46:52 +00:00
|
|
|
__attribute__((__format__(__printf__, 3, 4)));
|
2007-11-07 10:53:41 +00:00
|
|
|
extern char **autoifprobe(void);
|
1999-12-28 02:37:14 +00:00
|
|
|
|
|
|
|
/* if.c */
|
2007-11-07 10:53:41 +00:00
|
|
|
extern int ifinit(void);
|
|
|
|
extern int interface_up(char *);
|
|
|
|
extern int interface_status(struct ifinfo *);
|
|
|
|
extern int lladdropt_length(struct sockaddr_dl *);
|
|
|
|
extern void lladdropt_fill(struct sockaddr_dl *, struct nd_opt_hdr *);
|
|
|
|
extern struct sockaddr_dl *if_nametosdl(char *);
|
|
|
|
extern int getinet6sysctl(int);
|
|
|
|
extern int setinet6sysctl(int, int);
|
1999-12-28 02:37:14 +00:00
|
|
|
|
|
|
|
/* rtsol.c */
|
2007-11-07 10:53:41 +00:00
|
|
|
extern int sockopen(void);
|
|
|
|
extern void sendpacket(struct ifinfo *);
|
|
|
|
extern void rtsol_input(int);
|
1999-12-28 02:37:14 +00:00
|
|
|
|
|
|
|
/* probe.c */
|
2007-11-07 10:53:41 +00:00
|
|
|
extern int probe_init(void);
|
|
|
|
extern void defrouter_probe(struct ifinfo *);
|
1999-12-28 02:37:14 +00:00
|
|
|
|
|
|
|
/* dump.c */
|
2010-02-27 10:19:39 +00:00
|
|
|
extern void rtsold_dump_file(const char *);
|
2001-06-11 12:39:29 +00:00
|
|
|
|
|
|
|
/* rtsock.c */
|
2007-11-07 10:53:41 +00:00
|
|
|
extern int rtsock_open(void);
|
|
|
|
extern int rtsock_input(int);
|