af.h revision 21673
118397Snate/*
22893Sdfr * Copyright (c) 1983, 1993
32893Sdfr *	The Regents of the University of California.  All rights reserved.
42893Sdfr *
52893Sdfr * Copyright (c) 1995 John Hay.  All rights reserved.
68876Srgrimes *
72893Sdfr * Redistribution and use in source and binary forms, with or without
82893Sdfr * modification, are permitted provided that the following conditions
98876Srgrimes * are met:
102893Sdfr * 1. Redistributions of source code must retain the above copyright
118876Srgrimes *    notice, this list of conditions and the following disclaimer.
122893Sdfr * 2. Redistributions in binary form must reproduce the above copyright
132893Sdfr *    notice, this list of conditions and the following disclaimer in the
142893Sdfr *    documentation and/or other materials provided with the distribution.
152893Sdfr * 3. All advertising materials mentioning features or use of this software
168876Srgrimes *    must display the following acknowledgement:
172893Sdfr *	This product includes software developed by the University of
182893Sdfr *	California, Berkeley and its contributors.
192893Sdfr * 4. Neither the name of the University nor the names of its contributors
202893Sdfr *    may be used to endorse or promote products derived from this software
212893Sdfr *    without specific prior written permission.
222893Sdfr *
232893Sdfr * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
242893Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
252893Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
263152Sphk * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
277465Sache * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
282893Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
292893Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
302893Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
312893Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
322893Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
332893Sdfr * SUCH DAMAGE.
342893Sdfr *
357465Sache *	@(#)af.h	5.1 (Berkeley) 6/4/85 (routed/af.h)
362893Sdfr *
3712144Sphk *	@(#)af.h	8.1 (Berkeley) 6/5/93
387465Sache *
397465Sache *	$FreeBSD: head/usr.sbin/IPXrouted/af.h 21673 1997-01-14 07:20:47Z jkh $
402893Sdfr */
412893Sdfr
422893Sdfr/*
437465Sache * Routing table management daemon.
442893Sdfr */
4512144Sphk
467465Sache/*
477465Sache * Structure returned by af_hash routines.
482893Sdfr */
492893Sdfrstruct afhash {
502893Sdfr	u_int	afh_hosthash;		/* host based hash */
512893Sdfr	u_int	afh_nethash;		/* network based hash */
522893Sdfr};
532893Sdfr
542893Sdfr/*
552893Sdfr * Per address family routines.
562893Sdfr */
572893Sdfrtypedef void af_hash_t(struct sockaddr *, struct afhash *);
582893Sdfrtypedef int  af_netmatch_t(struct sockaddr *, struct sockaddr *);
592893Sdfrtypedef void af_output_t(int, int, struct sockaddr *, int);
602893Sdfrtypedef int  af_portmatch_t(struct sockaddr *);
612893Sdfrtypedef int  af_portcheck_t(struct sockaddr *);
622893Sdfrtypedef int  af_checkhost_t(struct sockaddr *);
632893Sdfrtypedef int  af_ishost_t(struct sockaddr *);
642893Sdfrtypedef void af_canon_t(struct sockaddr *);
652893Sdfr
662893Sdfrstruct afswitch {
672893Sdfr	af_hash_t	*af_hash;	/* returns keys based on address */
682893Sdfr	af_netmatch_t	*af_netmatch;	/* verifies net # matching */
692893Sdfr	af_output_t	*af_output;	/* interprets address for sending */
702893Sdfr	af_portmatch_t	*af_portmatch;	/* packet from some other router? */
712893Sdfr	af_portcheck_t	*af_portcheck;	/* packet from privileged peer? */
722893Sdfr	af_checkhost_t	*af_checkhost;	/* tells if address for host or net */
732893Sdfr	af_ishost_t	*af_ishost;	/* tells if address is valid */
742893Sdfr	af_canon_t	*af_canon;	/* canonicalize address for compares */
752893Sdfr};
762893Sdfr
772893Sdfrstruct	afswitch afswitch[AF_MAX];	/* table proper */
782893Sdfr