Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
netbuff.c File Reference
#include "netbuff.h"
#include "init/init.h"
#include "ioforge/ioforge.h"
#include "memory/slab.h"
#include <str.h>

Go to the source code of this file.

Macros

#define NETBUFF_MAX_TEMP   32
 

Functions

 INIT (Netbuff)
 
struct netbuffcreate_netbuff ()
 
void * netbuff_put (struct netbuff *nb, size_t len)
 
void * netbuff_push (struct netbuff *nb, size_t len)
 
void free_netbuff (struct netbuff *netbuff)
 

Variables

static struct slab_cachenetbuff_cache = 0
 
static struct netbuffnetbuff_temp [32] = {0}
 
static size_t netbuff_temp_count = 0
 

Macro Definition Documentation

◆ NETBUFF_MAX_TEMP

#define NETBUFF_MAX_TEMP   32

Definition at line 7 of file netbuff.c.

Referenced by free_netbuff().

Function Documentation

◆ create_netbuff()

◆ free_netbuff()

◆ INIT()

INIT ( Netbuff )

Definition at line 14 of file netbuff.c.

References netbuff_cache, and vxCreateSlabCache().

◆ netbuff_push()

void * netbuff_push ( struct netbuff * nb,
size_t len )

Definition at line 50 of file netbuff.c.

References netbuff::data, len, and netbuff::length.

Referenced by ethernet_send_frame(), ipv4_send(), send_command(), and send_tcp_data().

◆ netbuff_put()

void * netbuff_put ( struct netbuff * nb,
size_t len )

Definition at line 42 of file netbuff.c.

References len, netbuff::length, and netbuff::tail.

Referenced by arp_reply(), ethernet_send_frame(), handle_icmp(), ipv4_send(), and send_tcp_data().

Variable Documentation

◆ netbuff_cache

struct slab_cache* netbuff_cache = 0
static

Definition at line 9 of file netbuff.c.

Referenced by create_netbuff(), free_netbuff(), and INIT().

◆ netbuff_temp

struct netbuff* netbuff_temp[32] = {0}
static

Definition at line 11 of file netbuff.c.

Referenced by create_netbuff(), and free_netbuff().

◆ netbuff_temp_count

size_t netbuff_temp_count = 0
static

Definition at line 12 of file netbuff.c.

Referenced by create_netbuff(), and free_netbuff().