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.
TCPv4.h
00001 /* 00002 * $Id: TCPv4.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 __TCPV4_H__ 00014 #define __TCPV4_H__ 00015 00016 #include "NetIF.h" 00017 #include "IPv4.h" 00018 00019 #pragma push 00020 #pragma pack(1) 00021 struct TCPv4_Header 00022 { 00023 uint16_t sourcePort, 00024 destPort; 00025 uint32_t sequence, 00026 ack; 00027 00028 uint8_t offset:4; 00029 uint8_t reserved1:4; 00030 00031 uint8_t FIN:1, 00032 SYN:1, 00033 RST:1, 00034 PSH:1, 00035 ACK:1, 00036 URG:1, 00037 reserved2:2; 00038 uint16_t window, 00039 crc, 00040 pointer; 00041 00042 }; 00043 #pragma pop 00044 typedef struct TCPv4_Header TCPv4_Header_t; 00045 00046 00047 extern Protocol_Handler_t tcpv4; 00048 00049 00050 void TCPv4_DumpHeader(const char *prefix, IPv4_Header_t *ipv4Header); 00051 00052 00053 #endif /* __UDPV4_H__ */ 00054
Generated on Wed Jul 13 2022 06:09:33 by 1.7.2