xref: /illumos-gate/usr/src/uts/common/net/af.h (revision 2d6eb4a5e0a47d30189497241345dc5466bb68ab)
1 /*
2  * Copyright (c) 1997-1998 by Sun Microsystems, Inc.
3  * All rights reserved.
4  */
5 
6 /*
7  * Copyright (c) 1980, 1986 Regents of the University of California.
8  * All rights reserved.  The Berkeley software License Agreement
9  * specifies the terms and conditions for redistribution.
10  */
11 
12 #ifndef	_NET_AF_H
13 #define	_NET_AF_H
14 
15 /* af.h 1.10 88/08/19 SMI; from UCB 7.1	*/
16 
17 #ifdef	__cplusplus
18 extern "C" {
19 #endif
20 
21 /*
22  * Address family routines,
23  * used in handling generic sockaddr structures.
24  *
25  * Hash routine is called
26  *	af_hash(addr, h);
27  *	struct sockaddr *addr; struct afhash *h;
28  * producing an afhash structure for addr.
29  *
30  * Netmatch routine is called
31  *	af_netmatch(addr1, addr2);
32  * where addr1 and addr2 are sockaddr *.  Returns 1 if network
33  * values match, 0 otherwise.
34  */
35 struct afswitch {
36 	int	(*af_hash)();
37 	int	(*af_netmatch)();
38 };
39 
40 struct afhash {
41 	uint_t	afh_hosthash;
42 	uint_t	afh_nethash;
43 };
44 
45 #ifdef	__cplusplus
46 }
47 #endif
48 
49 #endif	/* _NET_AF_H */
50