1139826Simp/*-
262587Sitojun * Copyright (C) 2000 WIDE Project.
362587Sitojun * All rights reserved.
4120941Sume *
562587Sitojun * Redistribution and use in source and binary forms, with or without
662587Sitojun * modification, are permitted provided that the following conditions
762587Sitojun * are met:
862587Sitojun * 1. Redistributions of source code must retain the above copyright
962587Sitojun *    notice, this list of conditions and the following disclaimer.
1062587Sitojun * 2. Redistributions in binary form must reproduce the above copyright
1162587Sitojun *    notice, this list of conditions and the following disclaimer in the
1262587Sitojun *    documentation and/or other materials provided with the distribution.
1362587Sitojun * 3. Neither the name of the project nor the names of its contributors
1462587Sitojun *    may be used to endorse or promote products derived from this software
1562587Sitojun *    without specific prior written permission.
16120941Sume *
1762587Sitojun * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
1862587Sitojun * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1962587Sitojun * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2062587Sitojun * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2162587Sitojun * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2262587Sitojun * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2362587Sitojun * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2462587Sitojun * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2562587Sitojun * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2662587Sitojun * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2762587Sitojun * SUCH DAMAGE.
28174510Sobrien *
29174510Sobrien *	$KAME: scope6_var.h,v 1.4 2000/05/18 15:03:27 jinmei Exp $
30174510Sobrien * $FreeBSD$
3162587Sitojun */
3262587Sitojun
3362587Sitojun#ifndef _NETINET6_SCOPE6_VAR_H_
3462587Sitojun#define _NETINET6_SCOPE6_VAR_H_
3562587Sitojun
3662587Sitojun#ifdef _KERNEL
37243903Shrs#include <net/vnet.h>
38243903Shrs
39121161Sumestruct scope6_id {
40121161Sume	/*
41121161Sume	 * 16 is correspondent to 4bit multicast scope field.
42121161Sume	 * i.e. from node-local to global with some reserved/unassigned types.
43121161Sume	 */
44121161Sume	u_int32_t s6id_list[16];
45121161Sume};
46121161Sume
47243903ShrsVNET_DECLARE(int, deembed_scopeid);
48243903Shrs#define V_deembed_scopeid       VNET(deembed_scopeid)
49243903Shrs
50241916Sdelphijvoid	scope6_init(void);
51241916Sdelphijstruct scope6_id *scope6_ifattach(struct ifnet *);
52241916Sdelphijvoid	scope6_ifdetach(struct scope6_id *);
53241916Sdelphijint	scope6_set(struct ifnet *, struct scope6_id *);
54241916Sdelphijint	scope6_get(struct ifnet *, struct scope6_id *);
55241916Sdelphijvoid	scope6_setdefault(struct ifnet *);
56241916Sdelphijint	scope6_get_default(struct scope6_id *);
57241916Sdelphiju_int32_t scope6_addr2default(struct in6_addr *);
58241916Sdelphijint	sa6_embedscope(struct sockaddr_in6 *, int);
59241916Sdelphijint	sa6_recoverscope(struct sockaddr_in6 *);
60241916Sdelphijint	in6_setscope(struct in6_addr *, struct ifnet *, u_int32_t *);
61241916Sdelphijint	in6_clearscope(struct in6_addr *);
62235916Sbzuint16_t in6_getscope(struct in6_addr *);
6362587Sitojun#endif /* _KERNEL */
6462587Sitojun
6562587Sitojun#endif /* _NETINET6_SCOPE6_VAR_H_ */
66