xref: /original-bsd/sbin/XNSrouted/af.h (revision 44811ff2)
1 /*
2  * Copyright (c) 1983 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that the above copyright notice and this paragraph are
7  * duplicated in all such forms and that any documentation,
8  * advertising materials, and other materials related to such
9  * distribution and use acknowledge that the software was developed
10  * by the University of California, Berkeley.  The name of the
11  * University may not be used to endorse or promote products derived
12  * from this software without specific prior written permission.
13  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  *	@(#)af.h	5.1 (Berkeley) 6/4/85 (routed/af.h)
18  *
19  *	@(#)af.h	5.1 (Berkeley) 09/20/88
20  */
21 
22 /*
23  * Routing table management daemon.
24  */
25 
26 /*
27  * Per address family routines.
28  */
29 struct afswitch {
30 	int	(*af_hash)();		/* returns keys based on address */
31 	int	(*af_netmatch)();	/* verifies net # matching */
32 	int	(*af_output)();		/* interprets address for sending */
33 	int	(*af_portmatch)();	/* packet from some other router? */
34 	int	(*af_portcheck)();	/* packet from privileged peer? */
35 	int	(*af_checkhost)();	/* tells if address for host or net */
36 	int	(*af_ishost)();		/* tells if address is valid */
37 	int	(*af_canon)();		/* canonicalize address for compares */
38 };
39 
40 /*
41  * Structure returned by af_hash routines.
42  */
43 struct afhash {
44 	u_int	afh_hosthash;		/* host based hash */
45 	u_int	afh_nethash;		/* network based hash */
46 };
47 
48 struct	afswitch afswitch[AF_MAX];	/* table proper */
49