checkpoint at first working tp4 connection; & before gnodes
[unix-history] / usr / src / sys / netinet / in_var.h
CommitLineData
8ae0e4b4 1/*
0880b18e 2 * Copyright (c) 1985, 1986 Regents of the University of California.
2b6b6284 3 * All rights reserved.
8ae0e4b4 4 *
2b6b6284 5 * Redistribution and use in source and binary forms are permitted
616d42db
KB
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.
2b6b6284 16 *
b4dc7708 17 * @(#)in_var.h 7.4 (Berkeley) %G%
8ae0e4b4 18 */
c1c25466
MK
19
20/*
58bca61d
MK
21 * Interface address, Internet version. One of these structures
22 * is allocated for each interface with an Internet address.
c1c25466
MK
23 * The ifaddr structure contains the protocol-independent part
24 * of the structure and is assumed to be first.
25 */
26struct in_ifaddr {
27 struct ifaddr ia_ifa; /* protocol-independent info */
c1c25466 28#define ia_ifp ia_ifa.ifa_ifp
b4dc7708 29 /* ia_{,sub}net{,mask} in host order */
c1c25466
MK
30 u_long ia_net; /* network number of interface */
31 u_long ia_netmask; /* mask of net part */
32 u_long ia_subnet; /* subnet number, including net */
b4dc7708 33 u_long ia_subnetmask; /* mask of subnet part */
c1c25466 34 int ia_flags;
b4dc7708 35 struct in_addr ia_netbroadcast; /* to recognize net broadcasts */
c1c25466 36 struct in_ifaddr *ia_next; /* next in list of internet addresses */
b4dc7708
KS
37 struct sockaddr_in ia_addr; /* reserve space for interface name */
38 struct sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */
39#define ia_broadaddr ia_dstaddr
40 struct sockaddr_in ia_sockmask; /* reserve space for general netmask */
41};
42
43struct in_aliasreq {
44 char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
45 struct sockaddr_in ifra_addr;
46 struct sockaddr_in ifra_broadaddr;
47#define ifra_dstaddr ifra_broadaddr
48 struct sockaddr_in ifra_mask;
c1c25466
MK
49};
50/*
51 * Given a pointer to an in_ifaddr (ifaddr),
52 * return a pointer to the addr as a sockadd_in.
53 */
b4dc7708 54#define IA_SIN(ia) (&(((struct in_ifaddr *)(ia))->ia_addr))
c1c25466
MK
55/*
56 * ia_flags
57 */
58#define IFA_ROUTE 0x01 /* routing entry installed */
59
60#ifdef KERNEL
58bca61d
MK
61struct in_ifaddr *in_ifaddr;
62struct in_ifaddr *in_iaonnetof();
63struct ifqueue ipintrq; /* ip packet input queue */
c1c25466 64#endif