mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-20 15:43:16 +00:00
ifnet/API: Move struct ifnet definition to a <net/if_private.h>
Hide the ifnet structure definition, no user serviceable parts inside, it's a netstack implementation detail. Include it temporarily in <net/if_var.h> until all drivers are updated to use the accessors exclusively. Reviewed by: glebius Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38046
This commit is contained in:
parent
fa25dbfd98
commit
2c2b37ad25
@ -47,6 +47,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <netpfil/pf/pf.h>
|
||||
|
@ -53,6 +53,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <netpfil/pf/pf.h>
|
||||
|
@ -104,6 +104,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <netpfil/pf/pf.h>
|
||||
|
@ -63,6 +63,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <netpfil/pf/pf.h>
|
||||
|
@ -49,6 +49,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <netpfil/pf/pf.h>
|
||||
|
@ -52,6 +52,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
|
||||
#include <net/altq/if_altq.h>
|
||||
#include <net/altq/altq.h>
|
||||
|
@ -46,6 +46,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/vnet.h>
|
||||
|
@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_vlan_var.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/bpf.h>
|
||||
|
@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/if_llc.h>
|
||||
|
@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/vnet.h>
|
||||
#include <net/route.h>
|
||||
#include <net/route/nhop.h>
|
||||
|
@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/in_systm.h>
|
||||
|
@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <net/infiniband.h>
|
||||
|
@ -86,6 +86,7 @@
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_media.h>
|
||||
#include <net/if_mib.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_vlan_var.h>
|
||||
#include <net/radix.h>
|
||||
#include <net/route.h>
|
||||
|
@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/pfil.h>
|
||||
#include <net/vnet.h>
|
||||
|
||||
|
@ -46,6 +46,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h>
|
||||
#include <net/radix.h>
|
||||
#include <net/route.h>
|
||||
|
@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
|
||||
static int
|
||||
ifdead_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa,
|
||||
|
@ -48,6 +48,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/route.h>
|
||||
|
@ -50,9 +50,9 @@
|
||||
#include <net/ethernet.h> /* Ethernet related constants and types */
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h> /* basic part of ifnet(9) */
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h> /* network interface cloning */
|
||||
#include <net/if_types.h> /* IFT_ETHER and friends */
|
||||
#include <net/if_var.h> /* kernel-only part of ifnet(9) */
|
||||
#include <net/vnet.h>
|
||||
|
||||
static const char edscname[] = "edsc";
|
||||
|
@ -50,6 +50,7 @@
|
||||
#include <net/if.h>
|
||||
#include <net/if_enc.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/pfil.h>
|
||||
|
@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_media.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/netisr.h>
|
||||
#ifdef RSS
|
||||
|
@ -60,6 +60,7 @@
|
||||
#include <net/ieee_oui.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <net/netisr.h>
|
||||
#include <net/route.h>
|
||||
|
@ -46,6 +46,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/netisr.h>
|
||||
#include <net/route.h>
|
||||
#include <net/if_llc.h>
|
||||
|
@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/netisr.h>
|
||||
|
@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/ethernet.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/netisr.h>
|
||||
|
@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/infiniband.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_media.h>
|
||||
#include <net/if_lagg.h>
|
||||
|
@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/bpf.h>
|
||||
|
@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/if_media.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/bpf.h>
|
||||
#include <net/route.h>
|
||||
#include <net/vnet.h>
|
||||
|
@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/if.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/route.h>
|
||||
#include <net/route/route_ctl.h>
|
||||
#include <net/route/route_debug.h>
|
||||
|
@ -53,6 +53,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/netisr.h>
|
||||
|
@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/ethernet.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/netisr.h>
|
||||
|
@ -75,6 +75,7 @@ static struct ifmedia_entry *ifmedia_match(struct ifmedia *ifm,
|
||||
|
||||
#ifdef IFMEDIA_DEBUG
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
int ifmedia_debug = 0;
|
||||
SYSCTL_INT(_debug, OID_AUTO, ifmedia, CTLFLAG_RW, &ifmedia_debug,
|
||||
0, "if_media debugging msgs");
|
||||
|
@ -38,6 +38,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_mib.h>
|
||||
#include <net/vnet.h>
|
||||
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/netisr.h>
|
||||
#include <net/route/nhop.h>
|
||||
|
||||
|
198
sys/net/if_private.h
Normal file
198
sys/net/if_private.h
Normal file
@ -0,0 +1,198 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* From: @(#)if.h 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
|
||||
#ifndef _NET_IF_PRIVATE_H_
|
||||
#define _NET_IF_PRIVATE_H_
|
||||
|
||||
#ifdef _KERNEL
|
||||
/*
|
||||
* Structure defining a network interface.
|
||||
*/
|
||||
struct ifnet {
|
||||
/* General book keeping of interface lists. */
|
||||
CK_STAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained (CK_) */
|
||||
LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */
|
||||
CK_STAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if (CK_) */
|
||||
/* protected by if_addr_lock */
|
||||
u_char if_alloctype; /* if_type at time of allocation */
|
||||
uint8_t if_numa_domain; /* NUMA domain of device */
|
||||
/* Driver and protocol specific information that remains stable. */
|
||||
void *if_softc; /* pointer to driver state */
|
||||
void *if_llsoftc; /* link layer softc */
|
||||
void *if_l2com; /* pointer to protocol bits */
|
||||
const char *if_dname; /* driver name */
|
||||
int if_dunit; /* unit or IF_DUNIT_NONE */
|
||||
u_short if_index; /* numeric abbreviation for this if */
|
||||
u_short if_idxgen; /* ... and its generation count */
|
||||
char if_xname[IFNAMSIZ]; /* external name (name + unit) */
|
||||
char *if_description; /* interface description */
|
||||
|
||||
/* Variable fields that are touched by the stack and drivers. */
|
||||
int if_flags; /* up/down, broadcast, etc. */
|
||||
int if_drv_flags; /* driver-managed status flags */
|
||||
int if_capabilities; /* interface features & capabilities */
|
||||
int if_capabilities2; /* part 2 */
|
||||
int if_capenable; /* enabled features & capabilities */
|
||||
int if_capenable2; /* part 2 */
|
||||
void *if_linkmib; /* link-type-specific MIB data */
|
||||
size_t if_linkmiblen; /* length of above data */
|
||||
u_int if_refcount; /* reference count */
|
||||
|
||||
/* These fields are shared with struct if_data. */
|
||||
uint8_t if_type; /* ethernet, tokenring, etc */
|
||||
uint8_t if_addrlen; /* media address length */
|
||||
uint8_t if_hdrlen; /* media header length */
|
||||
uint8_t if_link_state; /* current link state */
|
||||
uint32_t if_mtu; /* maximum transmission unit */
|
||||
uint32_t if_metric; /* routing metric (external only) */
|
||||
uint64_t if_baudrate; /* linespeed */
|
||||
uint64_t if_hwassist; /* HW offload capabilities, see IFCAP */
|
||||
time_t if_epoch; /* uptime at attach or stat reset */
|
||||
struct timeval if_lastchange; /* time of last administrative change */
|
||||
|
||||
struct ifaltq if_snd; /* output queue (includes altq) */
|
||||
struct task if_linktask; /* task for link change events */
|
||||
struct task if_addmultitask; /* task for SIOCADDMULTI */
|
||||
|
||||
/* Addresses of different protocol families assigned to this if. */
|
||||
struct mtx if_addr_lock; /* lock to protect address lists */
|
||||
/*
|
||||
* if_addrhead is the list of all addresses associated to
|
||||
* an interface.
|
||||
* Some code in the kernel assumes that first element
|
||||
* of the list has type AF_LINK, and contains sockaddr_dl
|
||||
* addresses which store the link-level address and the name
|
||||
* of the interface.
|
||||
* However, access to the AF_LINK address through this
|
||||
* field is deprecated. Use if_addr instead.
|
||||
*/
|
||||
struct ifaddrhead if_addrhead; /* linked list of addresses per if */
|
||||
struct ifmultihead if_multiaddrs; /* multicast addresses configured */
|
||||
int if_amcount; /* number of all-multicast requests */
|
||||
struct ifaddr *if_addr; /* pointer to link-level address */
|
||||
void *if_hw_addr; /* hardware link-level address */
|
||||
const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */
|
||||
struct mtx if_afdata_lock;
|
||||
void *if_afdata[AF_MAX];
|
||||
int if_afdata_initialized;
|
||||
|
||||
/* Additional features hung off the interface. */
|
||||
u_int if_fib; /* interface FIB */
|
||||
struct vnet *if_vnet; /* pointer to network stack instance */
|
||||
struct vnet *if_home_vnet; /* where this ifnet originates from */
|
||||
struct ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */
|
||||
struct bpf_if *if_bpf; /* packet filter structure */
|
||||
int if_pcount; /* number of promiscuous listeners */
|
||||
void *if_bridge; /* bridge glue */
|
||||
void *if_lagg; /* lagg glue */
|
||||
void *if_pf_kif; /* pf glue */
|
||||
struct carp_if *if_carp; /* carp interface structure */
|
||||
struct label *if_label; /* interface MAC label */
|
||||
struct netmap_adapter *if_netmap; /* netmap(4) softc */
|
||||
|
||||
/* Various procedures of the layer2 encapsulation and drivers. */
|
||||
if_output_fn_t if_output; /* output routine (enqueue) */
|
||||
if_input_fn_t if_input; /* input routine (from h/w driver) */
|
||||
struct mbuf *(*if_bridge_input)(struct ifnet *, struct mbuf *);
|
||||
int (*if_bridge_output)(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *);
|
||||
void (*if_bridge_linkstate)(struct ifnet *ifp);
|
||||
if_start_fn_t if_start; /* initiate output routine */
|
||||
if_ioctl_fn_t if_ioctl; /* ioctl routine */
|
||||
if_init_fn_t if_init; /* Init routine */
|
||||
int (*if_resolvemulti) /* validate/resolve multicast */
|
||||
(struct ifnet *, struct sockaddr **, struct sockaddr *);
|
||||
if_qflush_fn_t if_qflush; /* flush any queue */
|
||||
if_transmit_fn_t if_transmit; /* initiate output routine */
|
||||
|
||||
void (*if_reassign) /* reassign to vnet routine */
|
||||
(struct ifnet *, struct vnet *, char *);
|
||||
if_get_counter_t if_get_counter; /* get counter values */
|
||||
int (*if_requestencap) /* make link header from request */
|
||||
(struct ifnet *, struct if_encap_req *);
|
||||
|
||||
/* Statistics. */
|
||||
counter_u64_t if_counters[IFCOUNTERS];
|
||||
|
||||
/* Stuff that's only temporary and doesn't belong here. */
|
||||
|
||||
/*
|
||||
* Network adapter TSO limits:
|
||||
* ===========================
|
||||
*
|
||||
* If the "if_hw_tsomax" field is zero the maximum segment
|
||||
* length limit does not apply. If the "if_hw_tsomaxsegcount"
|
||||
* or the "if_hw_tsomaxsegsize" field is zero the TSO segment
|
||||
* count limit does not apply. If all three fields are zero,
|
||||
* there is no TSO limit.
|
||||
*
|
||||
* NOTE: The TSO limits should reflect the values used in the
|
||||
* BUSDMA tag a network adapter is using to load a mbuf chain
|
||||
* for transmission. The TCP/IP network stack will subtract
|
||||
* space for all linklevel and protocol level headers and
|
||||
* ensure that the full mbuf chain passed to the network
|
||||
* adapter fits within the given limits.
|
||||
*/
|
||||
u_int if_hw_tsomax; /* TSO maximum size in bytes */
|
||||
u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */
|
||||
u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */
|
||||
|
||||
/*
|
||||
* Network adapter send tag support:
|
||||
*/
|
||||
if_snd_tag_alloc_t *if_snd_tag_alloc;
|
||||
|
||||
/* Ratelimit (packet pacing) */
|
||||
if_ratelimit_query_t *if_ratelimit_query;
|
||||
if_ratelimit_setup_t *if_ratelimit_setup;
|
||||
|
||||
/* Ethernet PCP */
|
||||
uint8_t if_pcp;
|
||||
|
||||
/*
|
||||
* Debugnet (Netdump) hooks to be called while in db/panic.
|
||||
*/
|
||||
struct debugnet_methods *if_debugnet_methods;
|
||||
struct epoch_context if_epoch_ctx;
|
||||
|
||||
/*
|
||||
* Spare fields to be added before branching a stable branch, so
|
||||
* that structure can be enhanced without changing the kernel
|
||||
* binary interface.
|
||||
*/
|
||||
int if_ispare[4]; /* general use */
|
||||
};
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* _NET_IF_PRIVATE_H_ */
|
@ -100,6 +100,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h>
|
||||
#include <net/route.h>
|
||||
#include <net/route/nhop.h>
|
||||
|
@ -83,6 +83,7 @@
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_media.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/if_vlan_var.h>
|
||||
#include <net/netisr.h>
|
||||
|
160
sys/net/if_var.h
160
sys/net/if_var.h
@ -316,165 +316,6 @@ struct if_ratelimit_query_results {
|
||||
typedef void (if_ratelimit_query_t)(struct ifnet *,
|
||||
struct if_ratelimit_query_results *);
|
||||
typedef int (if_ratelimit_setup_t)(struct ifnet *, uint64_t, uint32_t);
|
||||
|
||||
/*
|
||||
* Structure defining a network interface.
|
||||
*/
|
||||
struct ifnet {
|
||||
/* General book keeping of interface lists. */
|
||||
CK_STAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained (CK_) */
|
||||
LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */
|
||||
CK_STAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if (CK_) */
|
||||
/* protected by if_addr_lock */
|
||||
u_char if_alloctype; /* if_type at time of allocation */
|
||||
uint8_t if_numa_domain; /* NUMA domain of device */
|
||||
/* Driver and protocol specific information that remains stable. */
|
||||
void *if_softc; /* pointer to driver state */
|
||||
void *if_llsoftc; /* link layer softc */
|
||||
void *if_l2com; /* pointer to protocol bits */
|
||||
const char *if_dname; /* driver name */
|
||||
int if_dunit; /* unit or IF_DUNIT_NONE */
|
||||
u_short if_index; /* numeric abbreviation for this if */
|
||||
u_short if_idxgen; /* ... and its generation count */
|
||||
char if_xname[IFNAMSIZ]; /* external name (name + unit) */
|
||||
char *if_description; /* interface description */
|
||||
|
||||
/* Variable fields that are touched by the stack and drivers. */
|
||||
int if_flags; /* up/down, broadcast, etc. */
|
||||
int if_drv_flags; /* driver-managed status flags */
|
||||
int if_capabilities; /* interface features & capabilities */
|
||||
int if_capabilities2; /* part 2 */
|
||||
int if_capenable; /* enabled features & capabilities */
|
||||
int if_capenable2; /* part 2 */
|
||||
void *if_linkmib; /* link-type-specific MIB data */
|
||||
size_t if_linkmiblen; /* length of above data */
|
||||
u_int if_refcount; /* reference count */
|
||||
|
||||
/* These fields are shared with struct if_data. */
|
||||
uint8_t if_type; /* ethernet, tokenring, etc */
|
||||
uint8_t if_addrlen; /* media address length */
|
||||
uint8_t if_hdrlen; /* media header length */
|
||||
uint8_t if_link_state; /* current link state */
|
||||
uint32_t if_mtu; /* maximum transmission unit */
|
||||
uint32_t if_metric; /* routing metric (external only) */
|
||||
uint64_t if_baudrate; /* linespeed */
|
||||
uint64_t if_hwassist; /* HW offload capabilities, see IFCAP */
|
||||
time_t if_epoch; /* uptime at attach or stat reset */
|
||||
struct timeval if_lastchange; /* time of last administrative change */
|
||||
|
||||
struct ifaltq if_snd; /* output queue (includes altq) */
|
||||
struct task if_linktask; /* task for link change events */
|
||||
struct task if_addmultitask; /* task for SIOCADDMULTI */
|
||||
|
||||
/* Addresses of different protocol families assigned to this if. */
|
||||
struct mtx if_addr_lock; /* lock to protect address lists */
|
||||
/*
|
||||
* if_addrhead is the list of all addresses associated to
|
||||
* an interface.
|
||||
* Some code in the kernel assumes that first element
|
||||
* of the list has type AF_LINK, and contains sockaddr_dl
|
||||
* addresses which store the link-level address and the name
|
||||
* of the interface.
|
||||
* However, access to the AF_LINK address through this
|
||||
* field is deprecated. Use if_addr instead.
|
||||
*/
|
||||
struct ifaddrhead if_addrhead; /* linked list of addresses per if */
|
||||
struct ifmultihead if_multiaddrs; /* multicast addresses configured */
|
||||
int if_amcount; /* number of all-multicast requests */
|
||||
struct ifaddr *if_addr; /* pointer to link-level address */
|
||||
void *if_hw_addr; /* hardware link-level address */
|
||||
const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */
|
||||
struct mtx if_afdata_lock;
|
||||
void *if_afdata[AF_MAX];
|
||||
int if_afdata_initialized;
|
||||
|
||||
/* Additional features hung off the interface. */
|
||||
u_int if_fib; /* interface FIB */
|
||||
struct vnet *if_vnet; /* pointer to network stack instance */
|
||||
struct vnet *if_home_vnet; /* where this ifnet originates from */
|
||||
struct ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */
|
||||
struct bpf_if *if_bpf; /* packet filter structure */
|
||||
int if_pcount; /* number of promiscuous listeners */
|
||||
void *if_bridge; /* bridge glue */
|
||||
void *if_lagg; /* lagg glue */
|
||||
void *if_pf_kif; /* pf glue */
|
||||
struct carp_if *if_carp; /* carp interface structure */
|
||||
struct label *if_label; /* interface MAC label */
|
||||
struct netmap_adapter *if_netmap; /* netmap(4) softc */
|
||||
|
||||
/* Various procedures of the layer2 encapsulation and drivers. */
|
||||
if_output_fn_t if_output; /* output routine (enqueue) */
|
||||
if_input_fn_t if_input; /* input routine (from h/w driver) */
|
||||
struct mbuf *(*if_bridge_input)(struct ifnet *, struct mbuf *);
|
||||
int (*if_bridge_output)(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *);
|
||||
void (*if_bridge_linkstate)(struct ifnet *ifp);
|
||||
if_start_fn_t if_start; /* initiate output routine */
|
||||
if_ioctl_fn_t if_ioctl; /* ioctl routine */
|
||||
if_init_fn_t if_init; /* Init routine */
|
||||
int (*if_resolvemulti) /* validate/resolve multicast */
|
||||
(struct ifnet *, struct sockaddr **, struct sockaddr *);
|
||||
if_qflush_fn_t if_qflush; /* flush any queue */
|
||||
if_transmit_fn_t if_transmit; /* initiate output routine */
|
||||
|
||||
void (*if_reassign) /* reassign to vnet routine */
|
||||
(struct ifnet *, struct vnet *, char *);
|
||||
if_get_counter_t if_get_counter; /* get counter values */
|
||||
int (*if_requestencap) /* make link header from request */
|
||||
(struct ifnet *, struct if_encap_req *);
|
||||
|
||||
/* Statistics. */
|
||||
counter_u64_t if_counters[IFCOUNTERS];
|
||||
|
||||
/* Stuff that's only temporary and doesn't belong here. */
|
||||
|
||||
/*
|
||||
* Network adapter TSO limits:
|
||||
* ===========================
|
||||
*
|
||||
* If the "if_hw_tsomax" field is zero the maximum segment
|
||||
* length limit does not apply. If the "if_hw_tsomaxsegcount"
|
||||
* or the "if_hw_tsomaxsegsize" field is zero the TSO segment
|
||||
* count limit does not apply. If all three fields are zero,
|
||||
* there is no TSO limit.
|
||||
*
|
||||
* NOTE: The TSO limits should reflect the values used in the
|
||||
* BUSDMA tag a network adapter is using to load a mbuf chain
|
||||
* for transmission. The TCP/IP network stack will subtract
|
||||
* space for all linklevel and protocol level headers and
|
||||
* ensure that the full mbuf chain passed to the network
|
||||
* adapter fits within the given limits.
|
||||
*/
|
||||
u_int if_hw_tsomax; /* TSO maximum size in bytes */
|
||||
u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */
|
||||
u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */
|
||||
|
||||
/*
|
||||
* Network adapter send tag support:
|
||||
*/
|
||||
if_snd_tag_alloc_t *if_snd_tag_alloc;
|
||||
|
||||
/* Ratelimit (packet pacing) */
|
||||
if_ratelimit_query_t *if_ratelimit_query;
|
||||
if_ratelimit_setup_t *if_ratelimit_setup;
|
||||
|
||||
/* Ethernet PCP */
|
||||
uint8_t if_pcp;
|
||||
|
||||
/*
|
||||
* Debugnet (Netdump) hooks to be called while in db/panic.
|
||||
*/
|
||||
struct debugnet_methods *if_debugnet_methods;
|
||||
struct epoch_context if_epoch_ctx;
|
||||
|
||||
/*
|
||||
* Spare fields to be added before branching a stable branch, so
|
||||
* that structure can be enhanced without changing the kernel
|
||||
* binary interface.
|
||||
*/
|
||||
int if_ispare[4]; /* general use */
|
||||
};
|
||||
|
||||
#define IF_NODOM 255
|
||||
/*
|
||||
* Locks for address lists on the network interface.
|
||||
@ -834,6 +675,7 @@ int ether_poll_deregister(if_t ifp);
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#include <net/if_private.h> /* XXX: temporary until drivers converted. */
|
||||
#include <net/ifq.h> /* XXXAO: temporary unconditional include */
|
||||
|
||||
#endif /* !_NET_IF_VAR_H_ */
|
||||
|
@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/ethernet.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_types.h>
|
||||
|
@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/ethernet.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_clone.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_media.h>
|
||||
|
@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/if_media.h>
|
||||
#include <net/bpf.h>
|
||||
|
@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/if_media.h>
|
||||
#include <net/if_clone.h>
|
||||
|
@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define _WANT_NETISR_INTERNAL /* Enable definitions from netisr_internal.h */
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/netisr.h>
|
||||
#include <net/netisr_internal.h>
|
||||
#include <net/vnet.h>
|
||||
|
@ -59,6 +59,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/route.h>
|
||||
#include <net/route/route_ctl.h>
|
||||
|
@ -44,6 +44,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/route.h>
|
||||
#include <net/route/route_ctl.h>
|
||||
#include <net/route/route_var.h>
|
||||
|
@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/route.h>
|
||||
#include <net/route/route_ctl.h>
|
||||
|
@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/vnet.h>
|
||||
#include <net/route.h>
|
||||
|
@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/route.h>
|
||||
#include <net/route/nhop.h>
|
||||
|
@ -46,6 +46,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/route.h>
|
||||
#include <net/route/route_ctl.h>
|
||||
|
@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/route/nhop.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet6/scope6_var.h>
|
||||
#include <netinet6/in6_var.h>
|
||||
|
||||
#include <vm/uma.h>
|
||||
|
||||
|
@ -57,6 +57,7 @@
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_private.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_llatbl.h>
|
||||
#include <net/if_types.h>
|
||||
|
Loading…
Reference in New Issue
Block a user