xref: /illumos-gate/usr/src/uts/common/netinet/in_var.h (revision 9164a50bf932130cbb5097a16f6986873ce0e6e5)
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 /* in_var.h 1.3 88/08/19 SMI; from UCB 7.1 6/5/86	*/
23 
24 #ifdef	__cplusplus
25 extern "C" {
26 #endif
27 
28 struct in_ifaddr {
29 	struct	ifaddr ia_ifa;		/* protocol-independent info */
30 #define	ia_addr	ia_ifa.ifa_addr
31 #define	ia_broadaddr	ia_ifa.ifa_broadaddr
32 #define	ia_dstaddr	ia_ifa.ifa_dstaddr
33 #define	ia_ifp		ia_ifa.ifa_ifp
34 	ulong_t	ia_net;			/* network number of interface */
35 	ulong_t	ia_netmask;		/* mask of net part */
36 	ulong_t	ia_subnet;		/* subnet number, including net */
37 	ulong_t	ia_subnetmask;		/* mask of net + subnet */
38 	struct	in_addr ia_netbroadcast; /* broadcast addr for (logical) net */
39 	int	ia_flags;
40 	struct	in_ifaddr *ia_next;	/* next in list of internet addresses */
41 };
42 /*
43  * Given a pointer to an in_ifaddr (ifaddr),
44  * return a pointer to the addr as a sockadd_in.
45  */
46 #define	IA_SIN(ia) ((struct sockaddr_in *)(&((struct in_ifaddr *)ia)->ia_addr))
47 /*
48  * ia_flags
49  */
50 #define	IFA_ROUTE	0x01		/* routing entry installed */
51 
52 #ifdef	__cplusplus
53 }
54 #endif
55 
56 #endif	/* _NETINET_IN_VAR_H */
57