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.

CQueue.h

Committer:
Benoit
Date:
2011-06-26
Revision:
7:8e12f7357b9f
Parent:
5:3cd83fcb1467

File content as of revision 7:8e12f7357b9f:

/*
 * $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__ */