xref: /titanic_52/usr/src/uts/common/netinet/in_var.h (revision c7158ae983f5a04c4a998f468ecefba6d23ba721)
1 /*
2  * Copyright (c) 1997-1998 by Sun Microsystems, Inc.
3  * All rights reserved.
4  */
5 
6 /*
7  * Copyright (c) 1985, 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 /*
13  * Interface address, Internet version.  One of these structures
14  * is allocated for each interface with an Internet address.
15  * The ifaddr structure contains the protocol-independent part
16  * of the structure and is assumed to be first.
17  */
18 
19 #ifndef	_NETINET_IN_VAR_H
20 #define	_NETINET_IN_VAR_H
21 
22 #pragma ident	"%Z%%M%	%I%	%E% SMI"
23 /* in_var.h 1.3 88/08/19 SMI; from UCB 7.1 6/5/86	*/
24 
25 #ifdef	__cplusplus
26 extern "C" {
27 #endif
28 
29 struct in_ifaddr {
30 	struct	ifaddr ia_ifa;		/* protocol-independent info */
31 #define	ia_addr	ia_ifa.ifa_addr
32 #define	ia_broadaddr	ia_ifa.ifa_broadaddr
33 #define	ia_dstaddr	ia_ifa.ifa_dstaddr
34 #define	ia_ifp		ia_ifa.ifa_ifp
35 	ulong_t	ia_net;			/* network number of interface */
36 	ulong_t	ia_netmask;		/* mask of net part */
37 	ulong_t	ia_subnet;		/* subnet number, including net */
38 	ulong_t	ia_subnetmask;		/* mask of net + subnet */
39 	struct	in_addr ia_netbroadcast; /* broadcast addr for (logical) net */
40 	int	ia_flags;
41 	struct	in_ifaddr *ia_next;	/* next in list of internet addresses */
42 };
43 /*
44  * Given a pointer to an in_ifaddr (ifaddr),
45  * return a pointer to the addr as a sockadd_in.
46  */
47 #define	IA_SIN(ia) ((struct sockaddr_in *)(&((struct in_ifaddr *)ia)->ia_addr))
48 /*
49  * ia_flags
50  */
51 #define	IFA_ROUTE	0x01		/* routing entry installed */
52 
53 #ifdef	__cplusplus
54 }
55 #endif
56 
57 #endif	/* _NETINET_IN_VAR_H */
58