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.

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers UDPv4.h Source File

UDPv4.h

00001 /*
00002  * $Id: UDPv4.h 23 2011-06-06 06:03:23Z benoit $
00003  * $Author: benoit $
00004  * $Date: 2011-06-06 08:03:23 +0200 (lun., 06 juin 2011) $
00005  * $Rev: 23 $
00006  * 
00007  * 
00008  * 
00009  * 
00010  * 
00011  */
00012  
00013 #ifndef __UDPV4_H__
00014 #define    __UDPV4_H__
00015 
00016 
00017 #include "NetIF.h"
00018 #include "IPv4.h"
00019 
00020 
00021 #pragma push
00022 #pragma pack(1)
00023 struct UDPv4_Header
00024 {
00025     uint16_t    sourcePort,
00026                 destPort,
00027                 length,
00028                 crc;
00029 };
00030 #pragma pop
00031 typedef struct UDPv4_Header UDPv4_Header_t;
00032 
00033 
00034 extern Protocol_Handler_t udpv4;
00035 
00036 
00037 void UDPv4_DumpHeader(const char *prefix, IPv4_Header_t *ipv4Header);
00038 
00039 
00040 #endif /* __UDPV4_H__ */
00041