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.
Diff: CQueue.h
- Revision:
- 5:3cd83fcb1467
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CQueue.h Mon Jun 13 13:13:59 2011 +0000 @@ -0,0 +1,40 @@ +/* + * $Id: Queue.h 26 2011-06-09 10:24:02Z benoit $ + * $Author: benoit $ + * $Date: 2011-06-09 12:24:02 +0200 (jeu., 09 juin 2011) $ + * $Rev: 26 $ + * + * + * + * + * + */ + +#ifndef __CQUEUE_H__ +#define __CQUEUE_H__ + + +#include <stdint.h> +#include "mbedNet.h" + +struct CQueue +{ + uint8_t pushIndex, + popIndex; + void *entries[QUEUE_MAX_ENTRY_COUNT + 1]; + int16_t size; +}; +typedef struct CQueue CQueue_t; + + +CQueue_t *CQueue_Alloc(int16_t size); +int32_t CQueue_Push(CQueue_t *queue, void *entry); +int32_t CQueue_Pop(CQueue_t *queue, void **entry); +int32_t CQueue_Peek(CQueue_t *queue, void **entry); +int32_t CQueue_Free(CQueue_t *queue); +Bool_t CQueue_IsEmpty(const CQueue_t *queue); +Bool_t CQueue_IsFull(const CQueue_t *queue); + + +#endif /* __QUEUE_H__ */ +