/*-
* 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
* 4. 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.
*
* @(#)if.h 8.1 (Berkeley) 6/10/93
* $FreeBSD$
*/
#ifndef _NET_IF_H_
#define _NET_IF_H_
#if __BSD_VISIBLE
/*
* helps userland compatibility. (struct timeval ifi_lastchange)
*/
#ifndef _KERNEL
#endif
#endif
/*
* Length of interface external name, including terminating '\0'.
* Note: this is the same size as a generic device's external name.
*/
#if __BSD_VISIBLE
#endif
#if __BSD_VISIBLE
/*
* Structure used to query names of interface cloners.
*/
struct if_clonereq {
};
/*
* Structure describing information about an interface
* which may be of interest to management entities.
*/
struct if_data {
/* generic interface information */
/* volatile statistics */
/* Unions are here to make sizes MI. */
union { /* uptime at attach or stat reset */
} __ifi_epoch;
union { /* time of last administrative change */
struct {
} ph;
};
/*-
* Interface flags are of two types: network stack owned flags, and driver
* owned flags. Historically, these values were stored in the same ifnet
* flags field, but with the advent of fine-grained locking, they have been
* broken out such that the network stack is responsible for synchronizing
* the stack-owned fields, and the device driver the device-owned fields.
* Both halves can perform lockless reads of the other half's field, subject
* to accepting the involved races.
*
* Both sets of flags come from the same number space, and should not be
* permitted to conflict, as they are exposed to user space via a single
* field.
*
* The following symbols identify read and write requirements for fields:
*
* (i) if_flags field set by device driver before attach, read-only there
* after.
* (n) if_flags field written only by the network stack, read by either the
* stack or driver.
* (d) if_drv_flags field written only by the device driver, read by either
* the stack or driver.
*/
/* 0x20 was IFF_SMART */
/*
* Old names for driver flags so that user space tools can continue to use
* the old (portable) names.
*/
#ifndef _KERNEL
#endif
/* flags set internally only: */
#define IFF_CANTCHANGE \
/*
* Values for if_link_state.
*/
/*
* Some convenience macros used for setting ifi_baudrate.
* XXX 1000 vs. 1024? --thorpej@netbsd.org
*/
/*
* Capabilities that interfaces can advertise.
*
* struct ifnet.if_capabilities
* contains the optional features & capabilities a particular interface
* supports (not only the driver but also the detected hw revision).
* Capabilities are defined by IFCAP_* below.
* struct ifnet.if_capenable
* contains the enabled (either by default or through ifconfig) optional
* features & capabilities on this interface.
* Capabilities are defined by IFCAP_* below.
* struct if_data.ifi_hwassist in mbuf CSUM_ flag form, controlled by above
* contains the enabled optional feature & capabilites that can be used
* individually per packet and are specified in the mbuf pkthdr.csum_flags
* field. IFCAP_* and CSUM_* do not match one to one and CSUM_* may be
* more detailed or differenciated than IFCAP_*.
*
* are listed in IFCAP_CANTCHANGE, similar to IFF_CANTCHANGE.
* This is not strictly necessary because the common code never
* changes capabilities, and it is left to the individual driver
* to do the right thing. However, having the filter here
* avoids replication of the same code in all individual drivers.
*/
/*
* Message format for use in obtaining information about interfaces
* from getkerninfo and the routing socket
* For the new, extensible interface see struct if_msghdrl below.
*/
struct if_msghdr {
};
/*
* The 'l' version shall be used by new interfaces, like NET_RT_IFLISTL. It is
* extensible after ifm_data_off or within ifm_data. Both the if_msghdr and
* if_data now have a member field detailing the struct length in addition to
* the routing message length. Macros are provided to find the start of
* ifm_data and the start of the socket address strucutres immediately following
* struct if_msghdrl given a pointer to struct if_msghdrl.
*/
struct if_msghdrl {
};
/*
* Message format for use in obtaining information about interface addresses
* from getkerninfo and the routing socket
* For the new, extensible interface see struct ifa_msghdrl below.
*/
struct ifa_msghdr {
};
/*
* The 'l' version shall be used by new interfaces, like NET_RT_IFLISTL. It is
* extensible after ifam_metric or within ifam_data. Both the ifa_msghdrl and
* if_data now have a member field detailing the struct length in addition to
* the routing message length. Macros are provided to find the start of
* ifm_data and the start of the socket address strucutres immediately following
* struct ifa_msghdrl given a pointer to struct ifa_msghdrl.
*/
struct ifa_msghdrl {
* address */
};
/*
* Message format for use in obtaining information about multicast addresses
* from the routing socket
*/
struct ifma_msghdr {
};
/*
* Message format announcing the arrival or departure of a network interface.
*/
struct if_announcemsghdr {
};
/*
* Buffer with length to be used in SIOCGIFDESCR/SIOCSIFDESCR requests
*/
struct ifreq_buffer {
void *buffer;
};
/*
* Interface request structure used for socket
* ioctl's. All interface ioctl's must have parameter
* definitions which begin with ifr_name. The
* remainder may be interface specific.
*/
struct ifreq {
union {
short ifru_index;
int ifru_jid;
int ifru_metric;
int ifru_mtu;
int ifru_phys;
int ifru_media;
} ifr_ifru;
};
struct ifaliasreq {
int ifra_vhid;
};
/* 9.x compat */
struct oifaliasreq {
};
struct ifmediareq {
};
struct ifdrv {
unsigned long ifd_cmd;
void *ifd_data;
};
/*
* Structure used to retrieve aux status data from interfaces.
* Kernel suppliers to this interface should respect the formatting
* needed by ifconfig(8): each line starts with a TAB and ends with
* a newline. The canonical example to copy and paste is in if_tun.c.
*/
struct ifstat {
};
/*
* Structure used in SIOCGIFCONF request.
* Used to retrieve interface configuration
* for machine (useful for programs which
* must know all networks accessible).
*/
struct ifconf {
union {
} ifc_ifcu;
};
/*
* interface groups
*/
/* XXX: will we implement this? */
struct ifg_req {
union {
} ifgrq_ifgrqu;
};
/*
* Used to lookup groups for an interface
*/
struct ifgroupreq {
union {
} ifgr_ifgru;
};
/*
* Structure used to request i2c data
* from interface transceivers.
*/
struct ifi2creq {
};
#endif /* __BSD_VISIBLE */
#ifdef _KERNEL
#ifdef MALLOC_DECLARE
#endif
#endif
#ifndef _KERNEL
struct if_nameindex {
};
void if_freenameindex(struct if_nameindex *);
char *if_indextoname(unsigned int, char *);
struct if_nameindex *if_nameindex(void);
unsigned int if_nametoindex(const char *);
#endif
#endif /* !_NET_IF_H_ */