171333Sitojun/*	$FreeBSD$	*/
2118787Sume/*	$KAME: if.h,v 1.10 2003/02/24 11:29:10 ono Exp $	*/
362656Skris
455505Sshin/*
555505Sshin * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
655505Sshin * All rights reserved.
7222732Shrs *
855505Sshin * Redistribution and use in source and binary forms, with or without
955505Sshin * modification, are permitted provided that the following conditions
1055505Sshin * are met:
1155505Sshin * 1. Redistributions of source code must retain the above copyright
1255505Sshin *    notice, this list of conditions and the following disclaimer.
1355505Sshin * 2. Redistributions in binary form must reproduce the above copyright
1455505Sshin *    notice, this list of conditions and the following disclaimer in the
1555505Sshin *    documentation and/or other materials provided with the distribution.
1655505Sshin * 3. Neither the name of the project nor the names of its contributors
1755505Sshin *    may be used to endorse or promote products derived from this software
1855505Sshin *    without specific prior written permission.
19222732Shrs *
2055505Sshin * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
2155505Sshin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2255505Sshin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2355505Sshin * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2455505Sshin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2555505Sshin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2655505Sshin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2755505Sshin * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2855505Sshin * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2955505Sshin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3055505Sshin * SUCH DAMAGE.
3155505Sshin */
3255505Sshin
33224144Shrs#define	UPDATE_IFINFO_ALL	0
3455505Sshin
35224144Shrsstruct sockinfo {
36224144Shrs	int		si_fd;
37224144Shrs	const char	*si_name;
38224144Shrs};
3955505Sshin
40224144Shrsextern struct sockinfo sock;
41224144Shrsextern struct sockinfo rtsock;
42224144Shrsextern struct sockinfo ctrlsock;
43224144Shrs
44173412Skevloint lladdropt_length(struct sockaddr_dl *);
45173412Skevlovoid lladdropt_fill(struct sockaddr_dl *, struct nd_opt_hdr *);
46173412Skevloint rtbuf_len(void);
47173412Skevlochar *get_next_msg(char *, char *, int, size_t *, int);
48173412Skevlostruct in6_addr *get_addr(char *);
49173412Skevloint get_rtm_ifindex(char *);
50173412Skevloint get_prefixlen(char *);
51224144Shrsint prefixlen(unsigned char *, unsigned char *);
52224144Shrs
53224144Shrsstruct ifinfo	*update_ifinfo(struct ifilist_head_t *, int);
54224144Shrsint		update_ifinfo_nd_flags(struct ifinfo *);
55224144Shrsstruct ifinfo	*update_persist_ifinfo(struct ifilist_head_t *,
56224144Shrs			const char *);
57224144Shrs
58224144Shrsint		sock_mc_join(struct sockinfo *, int);
59224144Shrsint		sock_mc_leave(struct sockinfo *, int);
60224144Shrsint		sock_mc_rr_update(struct sockinfo *, char *);
61224144Shrsint		getinet6sysctl(int);
62