22#define NETIF_NAME_MAX 8
109#define SIOCGIFFLAGS 0x8913
110#define SIOCSIFFLAGS 0x8914
111#define SIOCGIFADDR 0x8915
112#define SIOCSIFADDR 0x8916
113#define SIOCGIFBRDADDR 0x8919
114#define SIOCGIFNETMASK 0x891B
115#define SIOCSIFNETMASK 0x891C
116#define SIOCGIFMTU 0x8921
117#define SIOCGIFHWADDR 0x8927
118#define SIOCGIFGATEWAY 0x89F0
119#define SIOCSIFGATEWAY 0x89F1
123#define IFF_BROADCAST 0x0002
124#define IFF_LOOPBACK 0x0008
125#define IFF_RUNNING 0x0040
143 unsigned long pad[3];
uint8_t flags
Definition idt.c:3
unsigned int uint32_t
Definition fb.h:17
unsigned char uint8_t
Definition fb.h:18
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
unsigned short uint16_t
Definition stdint.h:13
int int32_t
Definition stdint.h:14
short int16_t
Definition stdint.h:12
netif_t * netif_register(const char *prefix, const uint8_t mac[ETH_ADDR_LEN], uint32_t mtu, netif_send_fn send, void *driver)
add an interface.
Definition netif.c:105
netif_t * netif_find(const char *name)
the interface with this name, or NULL.
Definition netif.c:171
void net_init(void)
set up the network layer and the loopback interface (lo).
Definition netif.c:91
bool netif_send(netif_t *netif, const void *frame, uint32_t length)
send a frame on an interface and count it (net_lock held).
Definition netif.c:154
uint32_t net_lock(void)
take and release the network lock.
Definition netif.c:36
void netif_receive(netif_t *netif, const void *frame, uint32_t length)
a frame from the device (called with net_lock held, often from an interrupt).
Definition netif.c:140
void net_wait(wait_queue_t *wq)
sleep on a wait queue with net_lock held (interruptibly): the lock is let go while the process sleeps...
Definition netif.c:46
netif_t * netif_at(uint32_t index)
the interfaces, for /proc/net and the configuration calls.
Definition netif.c:166
int32_t netif_ioctl(uint32_t request, void *arg)
an interface ioctl (from a socket).
Definition netif.c:216
void net_unlock(uint32_t flags)
Definition netif.c:41
#define ETH_ADDR_LEN
Definition netif.h:23
#define NETIF_NAME_MAX
Definition netif.h:22
bool(*) netif_send_fn(struct netif *netif, const void *frame, uint32_t length)
send one frame (for Ethernet: from the destination address to the end of the payload,...
Definition netif.h:34
#define IFNAMSIZ
Definition netif.h:127
ssize_t send(int fd, const void *buf, size_t len, int flags)
#define bool
Definition stdbool.h:8
char name[IFNAMSIZ]
Definition netif.h:133
void * driver
Definition netif.h:43
bool loopback
Definition netif.h:41
uint32_t netmask
Definition netif.h:47
uint32_t mtu
Definition netif.h:40
uint32_t address
Definition netif.h:46
uint32_t tx_dropped
Definition netif.h:55
uint8_t mac[ETH_ADDR_LEN]
Definition netif.h:39
uint64_t rx_bytes
Definition netif.h:51
netif_send_fn send
Definition netif.h:42
char name[NETIF_NAME_MAX]
Definition netif.h:38
uint64_t rx_packets
Definition netif.h:50
uint32_t gateway
Definition netif.h:48
uint64_t tx_packets
Definition netif.h:53
uint64_t tx_bytes
Definition netif.h:54
uint32_t rx_dropped
Definition netif.h:52
a queue of blocked processes, linked through process_t::wait_next.
Definition wait_queue.h:35
struct kifreq_t::@013275246343256132214203350006272232306350211233::@036171060105106122243032352020117223361004264361 addr