Rewrite from scratch a TCP/IP stack for mbed. So far the following parts are usable: Drivers: - EMAC driver (from CMSIS 2.0) Protocols: - Ethernet protocol - ARP over ethernet for IPv4 - IPv4 over Ethernet - ICMPv4 over IPv4 - UDPv4 over IPv4 APIs: - Sockets for UDPv4 The structure of this stack is designed to be very modular. Each protocol can register one or more protocol to handle its payload, and in each protocol, an API can be hooked (like Sockets for example). This is an early release.

Ethernet.h

Committer:
Benoit
Date:
2011-06-26
Revision:
7:8e12f7357b9f
Parent:
0:19f5f51584de

File content as of revision 7:8e12f7357b9f:

/*
 * $Id: Ethernet.h 23 2011-06-06 06:03:23Z benoit $
 * $Author: benoit $
 * $Date: 2011-06-06 08:03:23 +0200 (lun., 06 juin 2011) $
 * $Rev: 23 $
 * 
 * 
 * 
 * 
 * 
 */
 
#ifndef __ETHERNET_H__
#define    __ETHERNET_H__

#include <stdint.h>
#include "mbedNet.h"
#include "NetIF.h"


typedef uint16_t                Ethernet_Proto_t;


#define    ETHERNET_PROTO_IPV4        0x800
#define    ETHERNET_PROTO_ARP        0x806


#pragma push
#pragma pack(1)
struct Ethernet_Header
{
    Ethernet_Addr_t        destination,
                        source;
    Ethernet_Proto_t    protocol;
};
#pragma pop


typedef struct Ethernet_Header Ethernet_Header_t;


extern Protocol_Handler_t ethernet;


#endif /*  __ETHERNET_H__ */