VSF Documented
if.h
Go to the documentation of this file.
1#ifndef __VSF_LINUX_NET_IF_H__
2#define __VSF_LINUX_NET_IF_H__
3
5#include <linux/sockios.h>
6
7#define IFNAMSIZ 16
8#define IFALIASZ 256
9
10struct ifmap {
11 unsigned long mem_start;
12 unsigned long mem_end;
13 unsigned short base_addr;
14 unsigned char irq;
15 unsigned char dma;
16 unsigned char port;
17};
18
19struct ifreq {
20 union {
23
24 union {
36 char *ifru_data;
38};
39#define ifr_name ifr_ifrn.ifrn_name
40#define ifr_hwaddr ifr_ifru.ifru_hwaddr
41#define ifr_addr ifr_ifru.ifru_addr
42#define ifr_dstaddr ifr_ifru.ifru_dstaddr
43#define ifr_broadaddr ifr_ifru.ifru_broadaddr
44#define ifr_netmask ifr_ifru.ifru_netmask
45#define ifr_flags ifr_ifru.ifru_flags
46#define ifr_metric ifr_ifru.ifru_ivalue
47#define ifr_mtu ifr_ifru.ifru_mtu
48#define ifr_map ifr_ifru.ifru_map
49#define ifr_slave ifr_ifru.ifru_slave
50#define ifr_data ifr_ifru.ifru_data
51#define ifr_ifindex ifr_ifru.ifru_ivalue
52#define ifr_bandwidth ifr_ifru.ifru_ivalue
53#define ifr_qlen ifr_ifru.ifru_ivalue
54#define ifr_newname ifr_ifru.ifru_newname
55#define ifr_settings ifr_ifru.ifru_settings
56
57struct ifconf {
59 union {
60 char *ifc_buf;
61 struct ifreq *ifc_req;
62 };
63};
64
65#if VSF_LINUX_APPLET_USE_NET_IF == ENABLED
68
72# ifndef __VSF_APPLET__
74# endif
75#endif
76
77#if defined(__VSF_APPLET__) && (defined(__VSF_APPLET_LIB__) || defined(__VSF_APPLET_LINUX_NET_IF_LIB__))\
78 && VSF_APPLET_CFG_ABI_PATCH != ENABLED && VSF_LINUX_APPLET_USE_NET_IF == ENABLED
79
80#ifndef VSF_LINUX_APPLET_NET_IF_VPLT
81# if VSF_LINUX_USE_APPLET == ENABLED
82# define VSF_LINUX_APPLET_NET_IF_VPLT \
83 ((vsf_linux_net_if_vplt_t *)(VSF_LINUX_APPLET_VPLT->net_if_vplt))
84# else
85# define VSF_LINUX_APPLET_NET_IF_VPLT \
86 ((vsf_linux_net_if_vplt_t *)vsf_vplt((void *)0))
87# endif
88#endif
89
90#define VSF_LINUX_APPLET_NET_IF_ENTRY(__NAME) \
91 VSF_APPLET_VPLT_ENTRY_FUNC_ENTRY(VSF_LINUX_APPLET_NET_IF_VPLT, __NAME)
92#define VSF_LINUX_APPLET_NET_IF_IMP(...) \
93 VSF_APPLET_VPLT_ENTRY_FUNC_IMP(VSF_LINUX_APPLET_NET_IF_VPLT, __VA_ARGS__)
94
95VSF_LINUX_APPLET_NET_IF_IMP(if_nametoindex, unsigned int, const char *ifname) {
97 return VSF_LINUX_APPLET_NET_IF_ENTRY(if_nametoindex)(ifname);
98}
99VSF_LINUX_APPLET_NET_IF_IMP(if_indextoname, char *, unsigned int ifindex, char *ifname) {
101 return VSF_LINUX_APPLET_NET_IF_ENTRY(if_indextoname)(ifindex, ifname);
102}
103
104#else // __VSF_APPLET__ && VSF_LINUX_APPLET_USE_NET_IF
105
106unsigned int if_nametoindex(const char *ifname);
107char * if_indextoname(unsigned int ifindex, char *ifname);
108
109#endif
110
111#endif // __VSF_LINUX_NET_IF_H__
__VSF_VPLT_DECORATOR__ vsf_linux_net_if_vplt_t vsf_linux_net_if_vplt
Definition vsf_linux_socket.c:782
char * if_indextoname(unsigned int ifindex, char *ifname)
Definition vsf_linux_socket.c:728
unsigned int if_nametoindex(const char *ifname)
Definition vsf_linux_socket.c:723
#define IFNAMSIZ
Definition if.h:7
Definition if.h:57
struct ifreq * ifc_req
Definition if.h:61
char * ifc_buf
Definition if.h:60
int ifc_len
Definition if.h:58
Definition if.h:10
unsigned char port
Definition if.h:16
unsigned long mem_start
Definition if.h:11
unsigned char dma
Definition if.h:15
unsigned char irq
Definition if.h:14
unsigned short base_addr
Definition if.h:13
unsigned long mem_end
Definition if.h:12
Definition if.h:19
struct sockaddr ifru_broadaddr
Definition if.h:27
char ifrn_name[IFNAMSIZ]
Definition if.h:21
char ifru_slave[IFNAMSIZ]
Definition if.h:34
struct sockaddr ifru_netmask
Definition if.h:28
short ifru_flags
Definition if.h:30
struct sockaddr ifru_hwaddr
Definition if.h:29
union ifreq::@925 ifr_ifru
struct sockaddr ifru_dstaddr
Definition if.h:26
struct ifmap ifru_map
Definition if.h:33
struct sockaddr ifru_addr
Definition if.h:25
int ifru_mtu
Definition if.h:32
char ifru_newname[IFNAMSIZ]
Definition if.h:35
int ifru_ivalue
Definition if.h:31
union ifreq::@924 ifr_ifrn
char * ifru_data
Definition if.h:36
Definition socket.h:74
Definition if.h:66
vsf_vplt_info_t info
Definition if.h:67
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(if_nametoindex)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(if_indextoname)
Definition vsf_cfg.h:95
#define __VSF_VPLT_DECORATOR__
Definition vsf_cfg.h:93
#define VSF_APPLET_VPLT_ENTRY_FUNC_TRACE()
Definition vsf_cfg.h:165