xref: /csrg-svn/sys/netinet/in_var.h (revision 23180)
1 /*
2  * Copyright (c) 1982 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  *
6  *	@(#)in_var.h	6.2 (Berkeley) 06/08/85
7  */
8 
9 /*
10  * Interface address, internet version.  One of these structures
11  * is allocated for each interface with an internet address.
12  * The ifaddr structure contains the protocol-independent part
13  * of the structure and is assumed to be first.
14  */
15 struct in_ifaddr {
16 	struct	ifaddr ia_ifa;		/* protocol-independent info */
17 #define	ia_addr	ia_ifa.ifa_addr
18 #define	ia_broadaddr	ia_ifa.ifa_broadaddr
19 #define	ia_dstaddr	ia_ifa.ifa_dstaddr
20 #define	ia_ifp		ia_ifa.ifa_ifp
21 	u_long	ia_net;			/* network number of interface */
22 	u_long	ia_netmask;		/* mask of net part */
23 	u_long	ia_subnet;		/* subnet number, including net */
24 	u_long	ia_subnetmask;		/* mask of net + subnet */
25 	int	ia_flags;
26 	struct	in_ifaddr *ia_next;	/* next in list of internet addresses */
27 };
28 /*
29  * Given a pointer to an in_ifaddr (ifaddr),
30  * return a pointer to the addr as a sockadd_in.
31  */
32 #define	IA_SIN(ia) ((struct sockaddr_in *)(&((struct in_ifaddr *)ia)->ia_addr))
33 /*
34  * ia_flags
35  */
36 #define	IFA_ROUTE	0x01		/* routing entry installed */
37 
38 #ifdef	KERNEL
39 extern	struct in_ifaddr *in_ifaddr;
40 extern	struct in_ifaddr *in_iaonnetof();
41 #endif
42