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