Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

eth.h File Reference

Ethernet driver header. More...

#include <kernel/semaphore.h>

Go to the source code of this file.

Data Structures

struct  eth_buf
 An ethernet buffer structure. More...

struct  ethernet
 An ethernet packet structure. More...

struct  phys_packet
 Physical packet structure. More...


Defines

#define ETH_FRAME_IP   0x0800
 IP packet type.

#define ETH_FRAME_ARP   0x0806
 ARP packet type.

#define ETH_ADDR_LEN   6
 Size of an ethernet address (a.k.a. MAC).

#define ETH_HEAD_LEN   14
 Size of the ethernet header.

#define ETH_MIN_LEN   60
 Minimum ethernet packet size.

#define ETH_FRAME_LEN   1514
 Maximum ethernet packet size.

#define ETH_MTU   (ETH_FRAME_LEN - ETH_HEAD_LEN)
 Ethernet MTU (Maximum transfer unit).

#define ETH_RECV_BUF_DIM   10
 Send and receive buffers size.


Typedefs

typedef phys_packet phys_packet_t
 Physical packet structure.

typedef eth_buf eth_buf_t
 An ethernet buffer structure.

typedef ethernet ethernet_t
 An ethernet packet structure.


Functions

void to_eth_layer (ethernet_t *packet, size_t len)
 Process an ethernet packet received from the physical layer.
Parameters:
packet  The ethernet packet received.
len  The size of the packet.


int send_eth_packet (const uint8_t *to, const void *data, size_t len, uint16_t type)
 Send an ethernet packet to the physiscal layer.
Parameters:
to  The destination ethernet address (MAC).
data  The buffer of data to be sent.
len  The size of the buffer of data to be sent.
type  The packet type.
Returns:
  • The number of bytes sent in case of success.
  • -ENOMEM cannot allocate the packet structure.
  • -ENXIO no ethernet device found.


bool is_eth_promisc ()
 Check if the ethernet device has been configured in promiscuous mode.
Returns:
  • TRUE the ethernet card is in promiscuous mode;
  • FALSE the ethernet card is not in promiscuous mode.


void ifconfig (char *cmd)
 This is the "ifconfig" command for the shell.
Parameters:
cmd  A string of command parameters.



Detailed Description

Ethernet driver header.

Author:
Andrea Righi <drizzt@inwind.it>
Date:
Last update: 2003-11-09
Note:
Copyright (©) 2003 Andrea Righi

Definition in file eth.h.


Define Documentation

#define ETH_ADDR_LEN   6
 

Size of an ethernet address (a.k.a. MAC).

Definition at line 18 of file eth.h.

#define ETH_FRAME_ARP   0x0806
 

ARP packet type.

Definition at line 16 of file eth.h.

#define ETH_FRAME_IP   0x0800
 

IP packet type.

Definition at line 14 of file eth.h.

#define ETH_FRAME_LEN   1514
 

Maximum ethernet packet size.

Definition at line 24 of file eth.h.

#define ETH_HEAD_LEN   14
 

Size of the ethernet header.

Definition at line 20 of file eth.h.

#define ETH_MIN_LEN   60
 

Minimum ethernet packet size.

Definition at line 22 of file eth.h.

#define ETH_MTU   (ETH_FRAME_LEN - ETH_HEAD_LEN)
 

Ethernet MTU (Maximum transfer unit).

Definition at line 26 of file eth.h.

#define ETH_RECV_BUF_DIM   10
 

Send and receive buffers size.

Definition at line 29 of file eth.h.


Typedef Documentation

typedef struct eth_buf eth_buf_t
 

An ethernet buffer structure.

typedef struct phys_packet phys_packet_t
 

Physical packet structure.


Generated on Fri Feb 20 15:32:17 2004 for Minirighi by doxygen1.2.18