The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
ethernet.c File Reference

Ethernet II frames (see ethernet.h). More...

#include "ethernet.h"
#include "arp.h"
#include "byteorder.h"
#include "common/memory.h"
#include "ipv4.h"

Functions

void eth_receive (netif_t *netif, const uint8_t *frame, uint32_t length)
 a received frame (net_lock held): checks the address and gives the payload to ARP or IPv4.
bool eth_send (netif_t *netif, const uint8_t dst[ETH_ADDR_LEN], uint16_t type, const void *payload, uint32_t length)
 send a payload in a frame to dst (net_lock held).

Variables

const uint8_t eth_broadcast [ETH_ADDR_LEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}

Detailed Description

Ethernet II frames (see ethernet.h).

Function Documentation

◆ eth_receive()

void eth_receive ( netif_t * netif,
const uint8_t * frame,
uint32_t length )

a received frame (net_lock held): checks the address and gives the payload to ARP or IPv4.

◆ eth_send()

bool eth_send ( netif_t * netif,
const uint8_t dst[ETH_ADDR_LEN],
uint16_t type,
const void * payload,
uint32_t length )

send a payload in a frame to dst (net_lock held).

short frames are padded to ETH_FRAME_MIN.

Variable Documentation

◆ eth_broadcast

const uint8_t eth_broadcast[ETH_ADDR_LEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}