Home | History | Annotate | Line # | Download | only in netinet6
scope6_var.h revision 1.1.48.1
      1       1.1  rpaulo /*	$FreeBSD: src/sys/netinet6/scope6_var.h,v 1.4 2005/01/07 02:30:35 imp Exp $	*/
      2       1.1  rpaulo /*	$KAME: scope6_var.h,v 1.4 2000/05/18 15:03:27 jinmei Exp $	*/
      3       1.1  rpaulo 
      4       1.1  rpaulo /*-
      5       1.1  rpaulo  * Copyright (C) 2000 WIDE Project.
      6       1.1  rpaulo  * All rights reserved.
      7       1.1  rpaulo  *
      8       1.1  rpaulo  * Redistribution and use in source and binary forms, with or without
      9       1.1  rpaulo  * modification, are permitted provided that the following conditions
     10       1.1  rpaulo  * are met:
     11       1.1  rpaulo  * 1. Redistributions of source code must retain the above copyright
     12       1.1  rpaulo  *    notice, this list of conditions and the following disclaimer.
     13       1.1  rpaulo  * 2. Redistributions in binary form must reproduce the above copyright
     14       1.1  rpaulo  *    notice, this list of conditions and the following disclaimer in the
     15       1.1  rpaulo  *    documentation and/or other materials provided with the distribution.
     16       1.1  rpaulo  * 3. Neither the name of the project nor the names of its contributors
     17       1.1  rpaulo  *    may be used to endorse or promote products derived from this software
     18       1.1  rpaulo  *    without specific prior written permission.
     19       1.1  rpaulo  *
     20       1.1  rpaulo  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
     21       1.1  rpaulo  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     22       1.1  rpaulo  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     23       1.1  rpaulo  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
     24       1.1  rpaulo  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     25       1.1  rpaulo  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     26       1.1  rpaulo  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     27       1.1  rpaulo  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     28       1.1  rpaulo  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     29       1.1  rpaulo  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     30       1.1  rpaulo  * SUCH DAMAGE.
     31       1.1  rpaulo  */
     32       1.1  rpaulo 
     33       1.1  rpaulo #ifndef _NETINET6_SCOPE6_VAR_H_
     34       1.1  rpaulo #define _NETINET6_SCOPE6_VAR_H_
     35       1.1  rpaulo 
     36       1.1  rpaulo #ifdef _KERNEL
     37       1.1  rpaulo struct scope6_id {
     38       1.1  rpaulo 	/*
     39       1.1  rpaulo 	 * 16 is correspondent to 4bit multicast scope field.
     40       1.1  rpaulo 	 * i.e. from interface-local to global with some
     41       1.1  rpaulo 	 * reserved/unassigned types.
     42       1.1  rpaulo 	 */
     43       1.1  rpaulo 	uint32_t s6id_list[16];
     44       1.1  rpaulo };
     45       1.1  rpaulo 
     46       1.1  rpaulo void	scope6_init(void);
     47       1.1  rpaulo struct scope6_id *scope6_ifattach(struct ifnet *);
     48       1.1  rpaulo void	scope6_ifdetach(struct scope6_id *);
     49  1.1.48.1    matt int	scope6_set(struct ifnet *, const struct scope6_id *);
     50  1.1.48.1    matt int	scope6_get(const struct ifnet *, struct scope6_id *);
     51       1.1  rpaulo void	scope6_setdefault(struct ifnet *);
     52       1.1  rpaulo int	scope6_get_default(struct scope6_id *);
     53       1.1  rpaulo uint32_t scope6_in6_addrscope(struct in6_addr *);
     54  1.1.48.1    matt uint32_t scope6_addr2default(const struct in6_addr *);
     55       1.1  rpaulo int	sa6_embedscope(struct sockaddr_in6 *, int);
     56       1.1  rpaulo int	sa6_recoverscope(struct sockaddr_in6 *);
     57  1.1.48.1    matt int	in6_setzoneid(struct in6_addr *, uint32_t);
     58  1.1.48.1    matt int	in6_setscope(struct in6_addr *, const struct ifnet *, u_int32_t *);
     59       1.1  rpaulo int	in6_clearscope(struct in6_addr *);
     60       1.1  rpaulo #endif /* _KERNEL */
     61       1.1  rpaulo 
     62       1.1  rpaulo #endif /* _NETINET6_SCOPE6_VAR_H_ */
     63