Files
kernel/include/net/if.h
T
2020-03-20 12:52:30 +02:00

35 lines
650 B
C

#pragma once
#include "sys/types.h"
#define IF_F_HASIP (1 << 0)
#define IF_T_ETH 1
struct netdev;
struct arp_ent;
typedef int (*netdev_send_func_t) (struct netdev *, const void *, size_t);
struct netdev {
char name[32];
uint8_t hwaddr[6];
// Only one inaddr now
uint32_t inaddr;
uint32_t flags;
int type;
// ARP entry list
struct arp_ent *arp_ent_head;
netdev_send_func_t send;
// Physical device
void *device;
struct netdev *next;
};
struct netdev *netdev_create(int type);
struct netdev *netdev_by_name(const char *name);
int netctl(struct netdev *dev, uint32_t op, void *arg);