xref: /original-bsd/sys/netinet/in_var.h (revision 7211505a)
1 /*
2  * Copyright (c) 1985, 1986 Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that the above copyright notice and this paragraph are
7  * duplicated in all such forms and that any documentation,
8  * advertising materials, and other materials related to such
9  * distribution and use acknowledge that the software was developed
10  * by the University of California, Berkeley.  The name of the
11  * University may not be used to endorse or promote products derived
12  * from this software without specific prior written permission.
13  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  *	@(#)in_var.h	7.3 (Berkeley) 06/29/88
18  */
19 
20 /*
21  * Interface address, Internet version.  One of these structures
22  * is allocated for each interface with an Internet address.
23  * The ifaddr structure contains the protocol-independent part
24  * of the structure and is assumed to be first.
25  */
26 struct in_ifaddr {
27 	struct	ifaddr ia_ifa;		/* protocol-independent info */
28 #define	ia_addr	ia_ifa.ifa_addr
29 #define	ia_broadaddr	ia_ifa.ifa_broadaddr
30 #define	ia_dstaddr	ia_ifa.ifa_dstaddr
31 #define	ia_ifp		ia_ifa.ifa_ifp
32 	u_long	ia_net;			/* network number of interface */
33 	u_long	ia_netmask;		/* mask of net part */
34 	u_long	ia_subnet;		/* subnet number, including net */
35 	u_long	ia_subnetmask;		/* mask of net + subnet */
36 	struct	in_addr ia_netbroadcast; /* broadcast addr for (logical) net */
37 	int	ia_flags;
38 	struct	in_ifaddr *ia_next;	/* next in list of internet addresses */
39 };
40 /*
41  * Given a pointer to an in_ifaddr (ifaddr),
42  * return a pointer to the addr as a sockadd_in.
43  */
44 #define	IA_SIN(ia) ((struct sockaddr_in *)(&((struct in_ifaddr *)ia)->ia_addr))
45 /*
46  * ia_flags
47  */
48 #define	IFA_ROUTE	0x01		/* routing entry installed */
49 
50 #ifdef	KERNEL
51 struct	in_ifaddr *in_ifaddr;
52 struct	in_ifaddr *in_iaonnetof();
53 struct	ifqueue	ipintrq;		/* ip packet input queue */
54 #endif
55