ifc
struct ifconf ifc;
ifc.ifc_len = inlen;
ifc.ifc_buf = inbuf = ninbuf;
if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) < 0)
if (ifc.ifc_len + (int)sizeof(*ifr) < inlen)
ifr = ifc.ifc_req;
for (i = 0; i < ifc.ifc_len;
struct ifconf ifc;
ifc.ifc_len = sizeof(ibuf);
ifc.ifc_buf = (caddr_t) ibuf;
if (ioctl(fd, SIOCGIFCONF, (char *) &ifc) < 0 ||
ifc.ifc_len < sizeof(struct ifreq)) {
ifend = (struct ifreq *) ((char *) ibuf + ifc.ifc_len);
struct ifconf ifc;
ifc.ifc_len = sizeof ibuf;
ifc.ifc_buf = (caddr_t)ibuf;
if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) < 0 ||
ifc.ifc_len < sizeof(struct ifreq)) {
ifend = (struct ifreq *)((char *)ibuf + ifc.ifc_len);
usbpf_clone_create(struct if_clone *ifc, int unit, caddr_t params,
struct isp_fc_device *ifc = (struct isp_fc_device *) addr;
if (ifc->loopid >= MAX_FC_TARG) {
lp = &FCPARAM(isp, ifc->chan)->portdb[ifc->loopid];
ifc->role = lp->roles;
ifc->loopid = lp->handle;
ifc->portid = lp->portid;
ifc->node_wwn = lp->node_wwn;
ifc->port_wwn = lp->port_wwn;
u_int ifc, u_int code, u_int code2)
dpt_outb(dpt, HA_WIFC, ifc);
u_int ifc, u_int code,
u_int ifc, u_int code,
u_int ifc, u_int code, u_int code2)
EATA_CMD_IMMEDIATE, retries, ifc,
bridge_clone_create(struct if_clone *ifc, int unit,
if_initname(ifp, ifc->ifc_name, unit);
gif_clone_create(struct if_clone *ifc, int unit,
gre_clone_create(struct if_clone *ifc, int unit,
struct ifconf *ifc = (struct ifconf *)data;
int space = ifc->ifc_len, error = 0;
ifrp = ifc->ifc_req;
ifc->ifc_len -= space;
struct if_clone *ifc;
if ((ifc = if_clone_lookup(ifp->if_dname)) == NULL)
if (unit < ifc->ifc_minifs)
if (ifc->ifc_destroy == NULL)
if_clone_free_unit(ifc, unit);
error = ifc->ifc_destroy(ifp);
if_clone_alloc_unit(ifc, &unit);
if_clone_attach(struct if_clone *ifc)
if (strcmp(ifct->ifc_name, ifc->ifc_name) == 0)
KASSERT(ifc->ifc_minifs - 1 <= ifc->ifc_maxunit,
__func__, ifc->ifc_name, ifc->ifc_minifs,
ifc->ifc_maxunit + 1));
maxclone = ifc->ifc_maxunit + 1;
ifc->ifc_units = kmalloc(len, M_CLONE, M_WAITOK | M_ZERO);
ifc->ifc_bmlen = len;
LIST_INSERT_HEAD(&if_cloners, ifc, ifc_list);
for (unit = 0; unit < ifc->ifc_minifs; unit++) {
if_clone_alloc_unit(ifc, &unit);
if (if_clone_createif(ifc, unit, NULL, NULL) != 0) {
__func__, ifc->ifc_name, unit);
EVENTHANDLER_INVOKE(if_clone_event, ifc);
if_clone_detach(struct if_clone *ifc)
LIST_REMOVE(ifc, ifc_list);
kfree(ifc->ifc_units, M_CLONE);
struct if_clone *ifc;
for (ifc = LIST_FIRST(&if_cloners);
ifc != NULL && count != 0;
ifc = LIST_NEXT(ifc, ifc_list), count--, dst += IFNAMSIZ) {
strlcpy(outbuf, ifc->ifc_name, IFNAMSIZ);
if_clone_match(struct if_clone *ifc, const char *name)
for (cp = name, i = 0; i < strlen(ifc->ifc_name); i++, cp++) {
if (ifc->ifc_name[i] != *cp)
struct if_clone *ifc;
LIST_FOREACH(ifc, &if_cloners, ifc_list) {
if (if_clone_match(ifc, name))
return ifc;
if_clone_alloc_unit(struct if_clone *ifc, int *unit)
while (bytoff < ifc->ifc_bmlen &&
ifc->ifc_units[bytoff] == 0xff)
if (bytoff >= ifc->ifc_bmlen)
while ((ifc->ifc_units[bytoff] & (1 << bitoff)) != 0)
if (*unit > ifc->ifc_maxunit)
KASSERT((ifc->ifc_units[bytoff] & (1 << bitoff)) == 0,
if (ifc->ifc_units[bytoff] & (1 << bitoff))
ifc->ifc_units[bytoff] |= (1 << bitoff);
if_clone_free_unit(struct if_clone *ifc, int unit)
KASSERT((ifc->ifc_units[bytoff] & (1 << bitoff)) != 0,
ifc->ifc_units[bytoff] &= ~(1 << bitoff);
if_clone_createif(struct if_clone *ifc, int unit, caddr_t params, caddr_t data)
ksnprintf(ifname, IFNAMSIZ, "%s%d", ifc->ifc_name, unit);
err = (*ifc->ifc_create)(ifc, unit, params, data);
err = if_addgroup(ifp, ifc->ifc_name);
struct if_clone *ifc;
if ((ifc = if_clone_lookup(name)) == NULL)
if ((err = if_clone_alloc_unit(ifc, &unit)) != 0) {
ksnprintf(ifname, IFNAMSIZ, "%s%d", ifc->ifc_name, unit);
if_clone_free_unit(ifc, unit);
err = if_clone_createif(ifc, unit, params, data);
if_clone_free_unit(ifc, unit);
int if_clone_attach(struct if_clone *ifc);
void if_clone_detach(struct if_clone *ifc);
lo_clone_create(struct if_clone *ifc, int unit,
if_initname(ifp, ifc->ifc_name, unit);
ip_fw3_log_clone_create(struct if_clone *ifc, int unit,
lagg_clone_create(struct if_clone *ifc, int unit,
pflog_clone_create(struct if_clone *ifc, int unit,
if_initname(ifp, ifc->ifc_name, unit);
pfsync_clone_create(struct if_clone *ifc, int unit,
if_initname(ifp, ifc->ifc_name, unit);
tap_clone_create(struct if_clone *ifc __unused, int unit,
tun_clone_create(struct if_clone *ifc __unused, int unit,
vlan_clone_create(struct if_clone *ifc, int unit,
wg_clone_create(struct if_clone *ifc __unused, int unit,
carp_clone_create(struct if_clone *ifc, int unit,
vap = ic->ic_vap_create(ic, ifc->ifc_name, unit,
wlan_clone_create(struct if_clone *ifc, int unit, caddr_t params,
ifc.ifc_len -= len;
if (ifc.ifc_len != 0)
printf("ifc_len left %d\n", ifc.ifc_len);
struct ifconf ifc;
memset(&ifc, 0, sizeof(ifc));
ifc.ifc_len = sizeof(struct sockaddr_storage) * naddrs;
ifc.ifc_buf = malloc(ifc.ifc_len);
if (ifc.ifc_buf == NULL)
if (ioctl(s, SIOCGIFCONF, &ifc, sizeof(ifc)) < 0)
pos = ifc.ifc_buf;
while (ifc.ifc_len >= (int)sizeof(*ifr)) {
if (ifc.ifc_len < len)
struct ifconf ifc;
ifc.ifc_len = sizeof(ifs);
ifc.ifc_req = ifs;
if (ioctl(sock, SIOCGIFCONF, &ifc) < 0) {
ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
for (ifr = ifc.ifc_req; ifr < ifend; ) {
for (ifr = ifc.ifc_req; ifr < ifend; ) {
struct ifc *ifa_conf; /* back pointer */
static struct ifc *ifc;
static struct ifc **index2ifc;
for (ic = ifc; ic; ic = ic->ifc_next) {
static struct ifc *loopifcp = NULL; /* pointing to loopback */
sendrequest(struct ifc *ifcp)
riprequest(struct ifc *ifcp, struct netinfo6 *np, int nn,
struct ifc *ifcp;
if ((ifcp = MALLOC(struct ifc)) == NULL) {
ifcp->ifc_next = ifc;
ifc = ifcp;
ifconfig1(const char *name, const struct sockaddr *sa, struct ifc *ifcp, int s)
struct ifc *ifcp, *ic;
for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next)
for (ic = ifc; ic; ic = ic->ifc_next) {
rt_deladdr(struct ifc *ifcp, const struct sockaddr_in6 *sifa,
ifrt(struct ifc *ifcp, int again)
static void ripsend(struct ifc *, struct sockaddr_in6 *, int);
ifrt_p2p(struct ifc *ifcp, int again)
static int out_filter(struct riprt *, struct ifc *);
static void ifconfig1(const char *, const struct sockaddr *, struct ifc *, int);
static int rt_deladdr(struct ifc *, const struct sockaddr_in6 *,
static int ifrt(struct ifc *, int);
static void ifrt_p2p(struct ifc *, int);
static void ifdump0(FILE *, const struct ifc *);
static void riprequest(struct ifc *, struct netinfo6 *, int,
static void ripflush(struct ifc *, struct sockaddr_in6 *);
static void sendrequest(struct ifc *);
static int addroute(struct riprt *, const struct in6_addr *, struct ifc *);
static int tobeadv(struct riprt *, struct ifc *);
static struct ifac *ifa_match(const struct ifc *, const struct in6_addr *, int);
static struct ifc *ifc_find(char *);
static struct iff *iff_find(struct ifc *, int);
static void setindex2ifc(int, struct ifc *);
addroute(struct riprt *rrt, const struct in6_addr *gw, struct ifc *ifcp)
struct ifc *ifcp;
struct ifc *ifcp;
for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) {
ifdump0(FILE *dump, const struct ifc *ifcp)
struct ifc *ifcp;
ifa_match(const struct ifc *ifcp, const struct in6_addr *ia, int plen)
static struct ifc *
struct ifc *ifcp;
for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) {
iff_find(struct ifc *ifcp, int type)
setindex2ifc(int idx, struct ifc *ifcp)
struct ifc **p;
index2ifc = (struct ifc **)
p = (struct ifc **)realloc(index2ifc,
for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) {
for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next)
for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) {
struct ifc *ifcp;
for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) {
ifc = NULL;
ripflush(struct ifc *ifcp, struct sockaddr_in6 *sin)
ripsend(struct ifc *ifcp, struct sockaddr_in6 *sin, int flag)
out_filter(struct riprt *rrt, struct ifc *ifcp)
tobeadv(struct riprt *rrt, struct ifc *ifcp)
struct ifc *ifc_next;
struct ifc *ifcp, *ic;