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.

Queue.h

Committer:
Benoit
Date:
2011-06-12
Revision:
1:f4040665bc61
Parent:
0:19f5f51584de

File content as of revision 1:f4040665bc61:

/*
 * $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 __QUEUE_H__
#define    __QUEUE_H__


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

struct Queue
{
    uint8_t            pushIndex, 
                    popIndex;
    void            *entries[QUEUE_MAX_ENTRY_COUNT + 1];
    int16_t            size;
};
typedef struct Queue Queue_t;


Queue_t    *Queue_Alloc(int16_t size);
int32_t     Queue_Push(Queue_t *queue, void *entry);
int32_t     Queue_Pop(Queue_t *queue, void **entry);
int32_t     Queue_Peek(Queue_t *queue, void **entry);
int32_t     Queue_Free(Queue_t *queue);
Bool_t      Queue_IsEmpty(const Queue_t *queue);
Bool_t      Queue_IsFull(const Queue_t *queue);


#endif /* __QUEUE_H__ */