NwMiniUdpEntity.h 1.44 KB
Newer Older
Cedric Roux's avatar
 
Cedric Roux committed
1 2 3 4 5 6 7 8 9
/*----------------------------------------------------------------------------*
 *                                                                            *
 *            M I N I M A L I S T I C     U D P     E N T I T Y               *
 *                                                                            *
 *                    Copyright (C) 2010 Amit Chawre.                         *
 *                                                                            *
 *----------------------------------------------------------------------------*/


10
/**
Cedric Roux's avatar
 
Cedric Roux committed
11 12 13 14 15 16 17 18 19
 * @file NwMiniUdpEntity.h
 * @brief This file contains example of a minimalistic ULP entity.
*/

#include <stdio.h>
#include <assert.h>
#include "NwEvt.h"
#include "NwLog.h"

20 21 22
#ifndef __NW_MINI_UDP_ENTITY_H__
#define __NW_MINI_UDP_ENTITY_H__

Cedric Roux's avatar
 
Cedric Roux committed
23 24
#ifndef NW_ASSERT
#define NW_ASSERT assert
25
#endif
Cedric Roux's avatar
 
Cedric Roux committed
26

27
typedef struct {
28
  uint32_t        hSocket;
Cedric Roux's avatar
 
Cedric Roux committed
29 30 31 32 33 34 35 36
  NwEventT      ev;
  NwGtpv1uStackHandleT hGtpv1uStack;
} NwMiniUdpEntityT;

#ifdef __cplusplus
extern "C" {
#endif

37
NwGtpv1uRcT nwMiniUdpInit(NwMiniUdpEntityT* thiz, NwGtpv1uStackHandleT hGtpv1uStack, uint8_t* ipAddr);
Cedric Roux's avatar
 
Cedric Roux committed
38 39 40 41

NwGtpv1uRcT nwMiniUdpDestroy(NwMiniUdpEntityT* thiz);

NwGtpv1uRcT nwMiniUdpDataReq(NwGtpv1uUdpHandleT udpHandle,
42 43 44 45
                             uint8_t* dataBuf,
                             uint32_t dataSize,
                             uint32_t peerAddr,
                             uint32_t peerPort);
Cedric Roux's avatar
 
Cedric Roux committed
46 47 48 49 50 51

#ifdef __cplusplus
}
#endif

#endif