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