Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/rtsold/rtsold.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
struct rainfo { | struct rainfo { | ||||
TAILQ_ENTRY(rainfo) rai_next; | TAILQ_ENTRY(rainfo) rai_next; | ||||
struct ifinfo *rai_ifinfo; | struct ifinfo *rai_ifinfo; | ||||
struct sockaddr_in6 rai_saddr; | struct sockaddr_in6 rai_saddr; | ||||
TAILQ_HEAD(, ra_opt) rai_ra_opt; | TAILQ_HEAD(, ra_opt) rai_ra_opt; | ||||
}; | }; | ||||
/* Per-interface tracking info. */ | |||||
struct ifinfo { | struct ifinfo { | ||||
TAILQ_ENTRY(ifinfo) ifi_next; /* pointer to the next interface */ | TAILQ_ENTRY(ifinfo) ifi_next; /* pointer to the next interface */ | ||||
struct sockaddr_dl *sdl; /* link-layer address */ | struct sockaddr_dl *sdl; /* link-layer address */ | ||||
char ifname[IFNAMSIZ]; /* interface name */ | char ifname[IFNAMSIZ]; /* interface name */ | ||||
u_int32_t linkid; /* link ID of this interface */ | uint32_t linkid; /* link ID of this interface */ | ||||
int ifi_sock; /* socket for sending RS messages */ | |||||
int active; /* interface status */ | int active; /* interface status */ | ||||
int probeinterval; /* interval of probe timer (if necessary) */ | int probeinterval; /* interval of probe timer (if necessary) */ | ||||
int probetimer; /* rest of probe timer */ | int probetimer; /* rest of probe timer */ | ||||
int mediareqok; /* whether the IF supports SIOCGIFMEDIA */ | int mediareqok; /* whether the IF supports SIOCGIFMEDIA */ | ||||
int otherconfig; /* need a separate protocol for the "other" | int otherconfig; /* need a separate protocol for the "other" | ||||
* configuration */ | * configuration */ | ||||
int state; | int state; | ||||
int probes; | int probes; | ||||
int dadcount; | int dadcount; | ||||
struct timespec timer; | struct timespec timer; | ||||
struct timespec expire; | struct timespec expire; | ||||
int errors; /* # of errors we've got - detect wedge */ | |||||
#define IFI_DNSOPT_STATE_NOINFO 0 | #define IFI_DNSOPT_STATE_NOINFO 0 | ||||
#define IFI_DNSOPT_STATE_RECEIVED 1 | #define IFI_DNSOPT_STATE_RECEIVED 1 | ||||
int ifi_rdnss; /* RDNSS option state */ | int ifi_rdnss; /* RDNSS option state */ | ||||
int ifi_dnssl; /* DNSSL option state */ | int ifi_dnssl; /* DNSSL option state */ | ||||
int racnt; /* total # of valid RAs it have got */ | int racnt; /* total # of valid RAs it have got */ | ||||
TAILQ_HEAD(, rainfo) ifi_rainfo; | TAILQ_HEAD(, rainfo) ifi_rainfo; | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | do { \ | ||||
(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ | (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ | ||||
if ((vsp)->tv_nsec < 0) { \ | if ((vsp)->tv_nsec < 0) { \ | ||||
(vsp)->tv_sec--; \ | (vsp)->tv_sec--; \ | ||||
(vsp)->tv_nsec += 1000000000L; \ | (vsp)->tv_nsec += 1000000000L; \ | ||||
} \ | } \ | ||||
} while (0) | } while (0) | ||||
/* rtsold.c */ | /* rtsold.c */ | ||||
struct cap_channel; | |||||
extern struct timespec tm_max; | extern struct timespec tm_max; | ||||
extern int dflag; | extern int dflag; | ||||
extern int aflag; | extern int aflag; | ||||
extern int Fflag; | extern int Fflag; | ||||
extern int uflag; | extern int uflag; | ||||
extern const char *otherconf_script; | extern const char *otherconf_script; | ||||
extern const char *resolvconf_script; | extern const char *resolvconf_script; | ||||
extern struct cap_channel *capprobe, *capscript; | |||||
struct ifinfo *find_ifinfo(int); | struct ifinfo *find_ifinfo(int); | ||||
struct rainfo *find_rainfo(struct ifinfo *, struct sockaddr_in6 *); | struct rainfo *find_rainfo(struct ifinfo *, struct sockaddr_in6 *); | ||||
void rtsol_timer_update(struct ifinfo *); | void rtsol_timer_update(struct ifinfo *); | ||||
extern void warnmsg(int, const char *, const char *, ...) | extern void warnmsg(int, const char *, const char *, ...) | ||||
__attribute__((__format__(__printf__, 3, 4))); | __attribute__((__format__(__printf__, 3, 4))); | ||||
extern int ra_opt_handler(struct ifinfo *); | extern int ra_opt_handler(struct ifinfo *); | ||||
/* if.c */ | /* if.c */ | ||||
struct nd_opt_hdr; | |||||
extern int ifinit(void); | extern int ifinit(void); | ||||
extern int interface_up(char *); | extern int interface_up(char *); | ||||
extern int interface_status(struct ifinfo *); | extern int interface_status(struct ifinfo *); | ||||
extern int lladdropt_length(struct sockaddr_dl *); | extern int lladdropt_length(struct sockaddr_dl *); | ||||
extern void lladdropt_fill(struct sockaddr_dl *, struct nd_opt_hdr *); | extern void lladdropt_fill(struct sockaddr_dl *, struct nd_opt_hdr *); | ||||
extern struct sockaddr_dl *if_nametosdl(char *); | extern struct sockaddr_dl *if_nametosdl(char *); | ||||
/* rtsol.c */ | /* rtsol.c */ | ||||
extern int rssock; | extern int recvsockopen(void); | ||||
extern int sockopen(void); | extern int sendsockopen(uint32_t); | ||||
extern void sendpacket(struct ifinfo *); | extern void sendpacket(struct ifinfo *); | ||||
extern void rtsol_input(int); | extern void rtsol_input(int); | ||||
/* probe.c */ | /* cap_probe.c */ | ||||
extern int probe_init(void); | extern int cap_probe_defrouters(struct cap_channel *, struct ifinfo *); | ||||
extern void defrouter_probe(struct ifinfo *); | |||||
/* cap_script.c */ | |||||
extern int cap_script_run(struct cap_channel *, const char *const *); | |||||
extern int cap_script_wait(struct cap_channel *, int *); | |||||
/* dump.c */ | /* dump.c */ | ||||
extern void rtsold_dump_file(const char *); | extern FILE *rtsold_init_dumpfile(const char *); | ||||
extern void rtsold_dump(FILE *); | |||||
extern const char *sec2str(const struct timespec *); | extern const char *sec2str(const struct timespec *); | ||||
/* rtsock.c */ | /* rtsock.c */ | ||||
extern int rtsock_open(void); | extern int rtsock_open(void); | ||||
extern int rtsock_input(int); | extern int rtsock_input(int); |