C 列出以太网usb适配器接口

C 列出以太网usb适配器接口,c,linux,networking,usb,ethernet,C,Linux,Networking,Usb,Ethernet,我需要一个C函数,列出以太网usb适配器接口。在互联网上进行了一些搜索之后,我在ubuntu 16.04中创建了以下小代码: #include <stdio.h> #include <stdlib.h> /* The following include files for the network interface. */ #include <sys/types.h> #include <sys/socket.h> #include <ifa

我需要一个C函数,列出以太网usb适配器接口。在互联网上进行了一些搜索之后,我在ubuntu 16.04中创建了以下小代码:

#include <stdio.h>
#include <stdlib.h>
/* The following include files for the network interface. */
#include <sys/types.h>
#include <sys/socket.h>
#include <ifaddrs.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if_types.h>
/* For "toupper". */
#include <ctype.h>
/* For "strerror". */
#include <string.h>
/* For "errno". */
#include <errno.h>

int main() {
        struct ifaddrs *addrs,*tmp;

        getifaddrs(&addrs);
        tmp = addrs;
        struct sockaddr_dl * sdl;

        while (tmp)
        {
            if (tmp->ifa_addr && tmp->ifa_addr->sa_family == AF_PACKET)
                printf("%s\n", tmp->ifa_name);

            tmp = tmp->ifa_next;
            sdl = (struct sockaddr_dl *) tmp->ifa_addr;
            if (sdl->sdl_type == IFT_USB) { //IFT_USB
    printf("%s is usb adapter\n", tmp->ifa_name);
            }
        }

        freeifaddrs(addrs);
}
我对
/#include
进行了注释,然后再次编译,得到了另一个错误:

fatal error: net/if_types.h: No such file or directory
然后我评论了我编译的
/#include
,因此我得到了这个错误:

ethernetifaces.c: In function ‘main’:
ethernetifaces.c:48:13: error: dereferencing pointer to incomplete type ‘struct sockaddr_dl’
      if (sdl->sdl_type == IFT_USB) { //IFT_USB
             ^
ethernetifaces.c:48:27: error: ‘IFT_USB’ undeclared (first use in this function)
      if (sdl->sdl_type == IFT_USB) { //IFT_USB
           ^
ethernetifaces.c:48:27: note: each undeclared identifier is reported only once for each function it appears in
似乎是因为应该包含“struct sockaddr_dl”和“IFT_USB”的头文件被注释了

有人知道什么是新的头文件吗?或者是否有gcc选项命令可以在编译中查看头文件


内核版本:4.15.0-54-generic

我在安装
freebsd glue
sudo-apt-get-install-freebsd glue
)并解决了部分问题

  • 第一个是创建文件,如果从internet搜索并将其插入目录
    /usr/include/freebsd/net.

  • 第二个是将行
    #include_next
    注释到文件
    if_dl.h
    /usr/include/freebsd/net/if_dl.h

  • 第三种方法是在代码中插入结构声明
    sockaddr\u dl

以下是您的代码和一些解决方法:

#include <stdio.h>
#include <stdlib.h>

/*The following include files for the network interface. */
#include <sys/types.h>
#include <sys/socket.h>
#include <ifaddrs.h>
#include <net/if.h>
#include <freebsd/net/if_dl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <freebsd/net/if_types.h>
/* For "toupper". */
#include <ctype.h>
/* For "strerror". */
#include <string.h>
/* For "errno". */
#include <errno.h>

/*
 * Structure of a Link-Level sockaddr:
 */
struct sockaddr_dl {
    unsigned char   sdl_len;    /* Total length of sockaddr */
    unsigned char   sdl_family; /* AF_LINK */
    unsigned short  sdl_index;  /* if != 0, system given index for interface */
    unsigned char   sdl_type;   /* interface type */
    unsigned char   sdl_nlen;   /* interface name length, no trailing 0 reqd. */
    unsigned char   sdl_alen;   /* link level address length */
    unsigned char   sdl_slen;   /* link layer selector length */
    char    sdl_data[46];   /* minimum work area, can be larger;
                   contains both if name and ll address */
};

    int main() {
            struct ifaddrs *addrs,*tmp;

            getifaddrs(&addrs);
            tmp = addrs;
            struct sockaddr_dl * sdl;

            while (tmp)
            {
                if (tmp->ifa_addr && tmp->ifa_addr->sa_family == AF_PACKET) {
                    sdl = (struct sockaddr_dl *) tmp->ifa_addr;
                    printf("%s %d - ", tmp->ifa_name, sdl->sdl_type);
                    if (sdl->sdl_type == IFT_USB) { //IFT_USB
                        printf("%s is usb adapter", tmp->ifa_name);
                    }
                    puts("");
                }

                tmp = tmp->ifa_next;
            }

            freeifaddrs(addrs);
    }
#包括
#包括
/*以下包括网络接口的文件*/
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
/*为了“图珀”*/
#包括
/*对于“strerror”*/
#包括
/*对于“errno”*/
#包括
/*
*链路级sockaddr的结构:
*/
结构sockaddr\u dl{
无符号字符sdl_len;/*sockaddr的总长度*/
无符号字符sdl_族;/*AF_链接*/
无符号短sdl_索引;/*如果!=0,系统为接口指定索引*/
无符号字符sdl_类型;/*接口类型*/
无符号字符sdl_nlen;/*接口名称长度,不需要尾随0*/
无符号字符sdl_alen;/*链路级地址长度*/
无符号字符sdl_slen;/*链路层选择器长度*/
字符sdl_数据[46];/*最小工作区域,可以更大;
包含if名称和ll地址*/
};
int main(){
结构ifaddrs*addrs,*tmp;
getifaddrs(和addrs);
tmp=地址;
结构sockaddr_dl*sdl;
while(tmp)
{
如果(tmp->ifa\U地址(&tmp->ifa\U地址->sa\U系列==AF\U数据包){
sdl=(结构sockaddr\u dl*)tmp->ifa\u addr;
printf(“%s%d-”,tmp->ifa\u名称,sdl->sdl\u类型);
如果(sdl->sdl_类型==IFT_USB){//IFT_USB
printf(“%s是usb适配器”,tmp->ifa\u名称);
}
认沽权(“”);
}
tmp=tmp->ifa\U下一步;
}
freeifaddrs(addrs);
}
以下是文件if_types.h:

/*
 * Copyright (c) 2000-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
/*
 * Copyright (c) 1989, 1993, 1994
 *  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. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *  This product includes software developed by the University of
 *  California, Berkeley and its contributors.
 * 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_types.h  8.2 (Berkeley) 4/20/94
 * $FreeBSD: src/sys/net/if_types.h,v 1.8.2.3 2001/07/03 11:01:41 ume Exp $
 */
#ifndef _NET_IF_TYPES_H_
#define _NET_IF_TYPES_H_
// #include <sys/appleapiopts.h>
/*
 * Interface types for benefit of parsing media address headers.
 * This list is derived from the SNMP list of ifTypes, currently
 * documented in RFC1573.
 * The current list of assignments is maintained at:
 *  http://www.iana.org/assignments/smi-numbers
 */
#define IFT_OTHER   0x1     /* none of the following */
#define IFT_1822    0x2     /* old-style arpanet imp */
#define IFT_HDH1822 0x3     /* HDH arpanet imp */
#define IFT_X25DDN  0x4     /* x25 to imp */
#define IFT_X25     0x5     /* PDN X25 interface (RFC877) */
#define IFT_ETHER   0x6     /* Ethernet CSMACD */
#define IFT_ISO88023    0x7     /* CMSA CD */
#define IFT_ISO88024    0x8     /* Token Bus */
#define IFT_ISO88025    0x9     /* Token Ring */
#define IFT_ISO88026    0xa     /* MAN */
#define IFT_STARLAN 0xb
#define IFT_P10     0xc     /* Proteon 10MBit ring */
#define IFT_P80     0xd     /* Proteon 80MBit ring */
#define IFT_HY      0xe     /* Hyperchannel */
#define IFT_FDDI    0xf
#define IFT_LAPB    0x10
#define IFT_SDLC    0x11
#define IFT_T1      0x12
#define IFT_CEPT    0x13        /* E1 - european T1 */
#define IFT_ISDNBASIC   0x14
#define IFT_ISDNPRIMARY 0x15
#define IFT_PTPSERIAL   0x16        /* Proprietary PTP serial */
#define IFT_PPP     0x17        /* RFC 1331 */
#define IFT_LOOP    0x18        /* loopback */
#define IFT_EON     0x19        /* ISO over IP */
#define IFT_XETHER  0x1a        /* obsolete 3MB experimental ethernet */
#define IFT_NSIP    0x1b        /* XNS over IP */
#define IFT_SLIP    0x1c        /* IP over generic TTY */
#define IFT_ULTRA   0x1d        /* Ultra Technologies */
#define IFT_DS3     0x1e        /* Generic T3 */
#define IFT_SIP     0x1f        /* SMDS */
#define IFT_FRELAY  0x20        /* Frame Relay DTE only */
#define IFT_RS232   0x21
#define IFT_PARA    0x22        /* parallel-port */
#define IFT_ARCNET  0x23
#define IFT_ARCNETPLUS  0x24
#define IFT_ATM     0x25        /* ATM cells */
#define IFT_MIOX25  0x26
#define IFT_SONET   0x27        /* SONET or SDH */
#define IFT_X25PLE  0x28
#define IFT_ISO88022LLC 0x29
#define IFT_LOCALTALK   0x2a
#define IFT_SMDSDXI 0x2b
#define IFT_FRELAYDCE   0x2c        /* Frame Relay DCE */
#define IFT_V35     0x2d
#define IFT_HSSI    0x2e
#define IFT_HIPPI   0x2f
#define IFT_MODEM   0x30        /* Generic Modem */
#define IFT_AAL5    0x31        /* AAL5 over ATM */
#define IFT_SONETPATH   0x32
#define IFT_SONETVT 0x33
#define IFT_SMDSICIP    0x34        /* SMDS InterCarrier Interface */
#define IFT_PROPVIRTUAL 0x35        /* Proprietary Virtual/internal */
#define IFT_PROPMUX 0x36        /* Proprietary Multiplexing */
/*
 * IFT_GIF, IFT_FAITH and IFT_FAITH are not based on IANA assignments.
 * Note: IFT_STF has a defined ifType: 0xd7 (215), but we use 0x39.
 */
#define IFT_GIF     0x37        /*0xf0*/
#define IFT_FAITH   0x38        /*0xf2*/
#define IFT_STF     0x39        /*0xf3*/
#define IFT_L2VLAN  0x87        /* Layer 2 Virtual LAN using 802.1Q */
#define IFT_IEEE8023ADLAG 0x88      /* IEEE802.3ad Link Aggregate */
#define IFT_IEEE1394    0x90        /* IEEE1394 High Performance SerialBus*/
#define IFT_USB     0xa0        /* USB net*/
#define IFT_BRIDGE  0xd1        /* Transparent bridge interface */
#define IFT_ENC     0xf4        /* Encapsulation */
#define IFT_PFLOG   0xf5        /* Packet filter logging */
#define IFT_PFSYNC  0xf6        /* Packet filter state syncing */
#define IFT_CARP    0xf8        /* Common Address Redundancy Protocol */
#define IFT_PKTAP   0xfe        /* Packet tap pseudo interface */
#define IFT_CELLULAR    0xff        /* Packet Data over Cellular */
#define IFT_PDP     IFT_CELLULAR    /* deprecated; use IFT_CELLULAR */
#endif
/*
*版权所有(c)2000-2012苹果公司。保留所有权利。
*
*@APPLE\u OSREFERENCE\u LICENSE\u HEADER\u START@
* 
*此文件包含原始代码和/或原始代码的修改
*如和中所定义,受苹果公共资源许可证的约束
*2.0版(“许可证”)。除非在中,否则不能使用此文件
*遵守许可证。许可证授予您的权利
*不得用于创建或启用创建或重新分发,
*非法或未经许可的苹果操作系统副本,或
*规避、违反或促成规避或违反任何
*苹果操作系统软件许可协议的条款。
* 
*请通过以下地址获取许可证副本:
* http://www.opensource.apple.com/apsl/ 并在使用此文件之前读取它。
* 
*原始代码和许可证下分发的所有软件
*按“原样”分发,也不提供任何形式的担保
*明示或默示,苹果特此否认所有此类保证,
*包括但不限于任何适销性保证,
*适合特定用途、安静享受或不侵权。
*请参阅许可证,了解特定语言的管辖权和权限
*许可证下的限制。
* 
*@APPLE\u OSREFERENCE\u LICENSE\u HEADER\u END@
*/
/*
*版权所有(c)1989、1993、1994
*加利福尼亚大学的摄政王。版权所有。
*
*以源代码和二进制形式重新分发和使用,带或不带
*如果满足以下条件,则允许进行修改
*满足以下条件:
* 1. 源代码的重新分发必须保留上述版权
*请注意,此条件列表和以下免责声明。
* 2. 以二进制形式重新分发必须复制上述版权
*请注意,此条件列表和中的以下免责声明
*随分发提供的文件和/或其他材料。
* 3. 所有提及本软件功能或使用的广告材料
*必须显示以下确认信息:
*该产品包括大学开发的软件。
*加利福尼亚、伯克利及其贡献者。
* 4. 既不是大学的名称,也不是贡献者的名称
*可用于认可或推广源自本软件的产品
*未经事先书面许可。
*
*此软件由摄政者和贡献者“按原样”和
*任何明示或暗示的保证,包括但不限于
*对适销性和特定用途适用性的默示保证
*拒绝承认。在任何情况下,摄政者或贡献者概不负责
*对于任何直接、间接、附带、特殊、示范或后果
*损害赔偿(包括但不限于采购替代货物
*或服务;使用、数据或利润损失;或业务中断)
*然而,无论是在合同中,还是在任何责任理论上,都是严格的
*责任或侵权(包括疏忽或其他)
/*
 * Copyright (c) 2000-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
/*
 * Copyright (c) 1989, 1993, 1994
 *  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. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *  This product includes software developed by the University of
 *  California, Berkeley and its contributors.
 * 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_types.h  8.2 (Berkeley) 4/20/94
 * $FreeBSD: src/sys/net/if_types.h,v 1.8.2.3 2001/07/03 11:01:41 ume Exp $
 */
#ifndef _NET_IF_TYPES_H_
#define _NET_IF_TYPES_H_
// #include <sys/appleapiopts.h>
/*
 * Interface types for benefit of parsing media address headers.
 * This list is derived from the SNMP list of ifTypes, currently
 * documented in RFC1573.
 * The current list of assignments is maintained at:
 *  http://www.iana.org/assignments/smi-numbers
 */
#define IFT_OTHER   0x1     /* none of the following */
#define IFT_1822    0x2     /* old-style arpanet imp */
#define IFT_HDH1822 0x3     /* HDH arpanet imp */
#define IFT_X25DDN  0x4     /* x25 to imp */
#define IFT_X25     0x5     /* PDN X25 interface (RFC877) */
#define IFT_ETHER   0x6     /* Ethernet CSMACD */
#define IFT_ISO88023    0x7     /* CMSA CD */
#define IFT_ISO88024    0x8     /* Token Bus */
#define IFT_ISO88025    0x9     /* Token Ring */
#define IFT_ISO88026    0xa     /* MAN */
#define IFT_STARLAN 0xb
#define IFT_P10     0xc     /* Proteon 10MBit ring */
#define IFT_P80     0xd     /* Proteon 80MBit ring */
#define IFT_HY      0xe     /* Hyperchannel */
#define IFT_FDDI    0xf
#define IFT_LAPB    0x10
#define IFT_SDLC    0x11
#define IFT_T1      0x12
#define IFT_CEPT    0x13        /* E1 - european T1 */
#define IFT_ISDNBASIC   0x14
#define IFT_ISDNPRIMARY 0x15
#define IFT_PTPSERIAL   0x16        /* Proprietary PTP serial */
#define IFT_PPP     0x17        /* RFC 1331 */
#define IFT_LOOP    0x18        /* loopback */
#define IFT_EON     0x19        /* ISO over IP */
#define IFT_XETHER  0x1a        /* obsolete 3MB experimental ethernet */
#define IFT_NSIP    0x1b        /* XNS over IP */
#define IFT_SLIP    0x1c        /* IP over generic TTY */
#define IFT_ULTRA   0x1d        /* Ultra Technologies */
#define IFT_DS3     0x1e        /* Generic T3 */
#define IFT_SIP     0x1f        /* SMDS */
#define IFT_FRELAY  0x20        /* Frame Relay DTE only */
#define IFT_RS232   0x21
#define IFT_PARA    0x22        /* parallel-port */
#define IFT_ARCNET  0x23
#define IFT_ARCNETPLUS  0x24
#define IFT_ATM     0x25        /* ATM cells */
#define IFT_MIOX25  0x26
#define IFT_SONET   0x27        /* SONET or SDH */
#define IFT_X25PLE  0x28
#define IFT_ISO88022LLC 0x29
#define IFT_LOCALTALK   0x2a
#define IFT_SMDSDXI 0x2b
#define IFT_FRELAYDCE   0x2c        /* Frame Relay DCE */
#define IFT_V35     0x2d
#define IFT_HSSI    0x2e
#define IFT_HIPPI   0x2f
#define IFT_MODEM   0x30        /* Generic Modem */
#define IFT_AAL5    0x31        /* AAL5 over ATM */
#define IFT_SONETPATH   0x32
#define IFT_SONETVT 0x33
#define IFT_SMDSICIP    0x34        /* SMDS InterCarrier Interface */
#define IFT_PROPVIRTUAL 0x35        /* Proprietary Virtual/internal */
#define IFT_PROPMUX 0x36        /* Proprietary Multiplexing */
/*
 * IFT_GIF, IFT_FAITH and IFT_FAITH are not based on IANA assignments.
 * Note: IFT_STF has a defined ifType: 0xd7 (215), but we use 0x39.
 */
#define IFT_GIF     0x37        /*0xf0*/
#define IFT_FAITH   0x38        /*0xf2*/
#define IFT_STF     0x39        /*0xf3*/
#define IFT_L2VLAN  0x87        /* Layer 2 Virtual LAN using 802.1Q */
#define IFT_IEEE8023ADLAG 0x88      /* IEEE802.3ad Link Aggregate */
#define IFT_IEEE1394    0x90        /* IEEE1394 High Performance SerialBus*/
#define IFT_USB     0xa0        /* USB net*/
#define IFT_BRIDGE  0xd1        /* Transparent bridge interface */
#define IFT_ENC     0xf4        /* Encapsulation */
#define IFT_PFLOG   0xf5        /* Packet filter logging */
#define IFT_PFSYNC  0xf6        /* Packet filter state syncing */
#define IFT_CARP    0xf8        /* Common Address Redundancy Protocol */
#define IFT_PKTAP   0xfe        /* Packet tap pseudo interface */
#define IFT_CELLULAR    0xff        /* Packet Data over Cellular */
#define IFT_PDP     IFT_CELLULAR    /* deprecated; use IFT_CELLULAR */
#endif
//#include_next <net/if_dl.h>

#ifndef _FREEBSD_NET_IF_DL_H_
#define _FREEBSD_NET_IF_DL_H_

__BEGIN_DECLS
void    link_addr(const char *, struct sockaddr_dl *);
char    *link_ntoa(const struct sockaddr_dl *);
__END_DECLS

#endif