diff options
author | Luigi Rizzo <luigi@FreeBSD.org> | 2004-04-15 19:45:59 +0000 |
---|---|---|
committer | Luigi Rizzo <luigi@FreeBSD.org> | 2004-04-15 19:45:59 +0000 |
commit | 621b79c4d51d496d8d2c2d4b6f54f2c53b390aa6 (patch) | |
tree | 079de2d7c5216872dc81320aec60a2f4b045794a /sys/net/if_var.h | |
parent | c75d8c9028e3990da8c87b6f11558ee0ee31d9b8 (diff) | |
download | src-621b79c4d51d496d8d2c2d4b6f54f2c53b390aa6.tar.gz src-621b79c4d51d496d8d2c2d4b6f54f2c53b390aa6.zip |
Document the way if_addrhead and struct ifaddr are used.
Remove a member from 'struct ifaddr' which has been in an
#ifdef notdef block since rev 1.1
No ABI changes -- no need to recompile anything.
Notes
Notes:
svn path=/head/; revision=128291
Diffstat (limited to 'sys/net/if_var.h')
-rw-r--r-- | sys/net/if_var.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 83abad6847cc..1d40470526cc 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -131,6 +131,13 @@ struct ifnet { const char *if_dname; /* driver name */ int if_dunit; /* unit or IF_DUNIT_NONE */ struct ifaddrhead if_addrhead; /* linked list of addresses per if */ + /* + * if_addrhead is the list of all addresses associated to + * an interface. The first element of the list must be + * of type AF_LINK, and contains sockaddr_dl addresses, + * which include the link-level address and the name + * of the interface. + */ struct klist if_klist; /* events attached to this if */ int if_pcount; /* number of promiscuous listeners */ struct bpf_if *if_bpf; /* packet filter structure */ @@ -338,6 +345,10 @@ if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp, int adjust) * of an interface. They are maintained by the different address families, * are allocated and attached when an address is set, and are linked * together so all addresses for an interface can be located. + * + * NOTE: a 'struct ifaddr' is always at the beginning of a larger + * chunk of malloc'ed memory, where we store the three addresses + * (ifa_addr, ifa_dstaddr and ifa_netmask) referenced here. */ struct ifaddr { struct sockaddr *ifa_addr; /* address of interface */ @@ -352,9 +363,6 @@ struct ifaddr { u_short ifa_flags; /* mostly rt_flags for cloning */ u_int ifa_refcnt; /* references to this structure */ int ifa_metric; /* cost of going out this interface */ -#ifdef notdef - struct rtentry *ifa_rt; /* XXXX for ROUTETOIF ????? */ -#endif int (*ifa_claim_addr) /* check if an addr goes to this if */ (struct ifaddr *, struct sockaddr *); struct mtx ifa_mtx; |