Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
netdev.h File Reference
#include <type.h>
#include "net/netbuff.h"
#include <ioforge/ioforge_nic.h>

Go to the source code of this file.

Data Structures

struct  netdev_ops
 
struct  netdev
 

Macros

#define NETDEV_NAME_MAX_LEN   64
 

Typedefs

typedef struct netdev netdev_t
 

Enumerations

enum  netdev_type_t {
  NETDEV_TYPE_ETHERNET = 0 , NETDEV_TYPE_LOOPBACK , NETDEV_TYPE_BRIDGE , NETDEV_TYPE_TUN ,
  NETDEV_TYPE_TAP
}
 

Functions

int create_netdev (char *name, netdev_type_t type)
 
netdev_tlookup_netdev (char *name)
 
uint16_t get_next_ip_id (netdev_t *dev)
 

Macro Definition Documentation

◆ NETDEV_NAME_MAX_LEN

#define NETDEV_NAME_MAX_LEN   64

Definition at line 6 of file netdev.h.

Typedef Documentation

◆ netdev_t

typedef struct netdev netdev_t

Definition at line 19 of file netdev.h.

Enumeration Type Documentation

◆ netdev_type_t

Enumerator
NETDEV_TYPE_ETHERNET 
NETDEV_TYPE_LOOPBACK 
NETDEV_TYPE_BRIDGE 
NETDEV_TYPE_TUN 
NETDEV_TYPE_TAP 

Definition at line 11 of file netdev.h.

Function Documentation

◆ create_netdev()

◆ get_next_ip_id()

uint16_t get_next_ip_id ( netdev_t * dev)

Definition at line 100 of file netdev.c.

References netdev::ip_id_counter.

Referenced by ipv4_send().

◆ lookup_netdev()

netdev_t * lookup_netdev ( char * name)

Definition at line 70 of file netdev.c.

References bucket, hash, LOG2_DEBUG, name, NETDEV_HASHMAP_MAX_ENTRY, and netdev_lists.

Referenced by socket_set_sockopt().