2008-09-15 21:54:14 +00:00
|
|
|
// UIP "helper" for eLua
|
|
|
|
// Implements the eLua specific UIP application
|
|
|
|
|
|
|
|
#ifndef __ELUA_UIP_H__
|
|
|
|
#define __ELUA_UIP_H__
|
|
|
|
|
2008-09-18 20:22:15 +00:00
|
|
|
#include "type.h"
|
|
|
|
#include "elua_net.h"
|
|
|
|
|
|
|
|
// eLua UIP application states
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ELUA_UIP_STATE_IDLE = 0,
|
|
|
|
ELUA_UIP_STATE_SEND,
|
|
|
|
ELUA_UIP_STATE_RECV,
|
|
|
|
ELUA_UIP_STATE_RECV_2,
|
2008-09-22 21:17:44 +00:00
|
|
|
ELUA_UIP_STATE_CONNECT,
|
2008-09-20 15:14:05 +00:00
|
|
|
ELUA_UIP_STATE_CLOSE
|
2008-09-18 20:22:15 +00:00
|
|
|
};
|
|
|
|
|
2008-09-15 21:54:14 +00:00
|
|
|
// eLua UIP state
|
|
|
|
struct elua_uip_state
|
|
|
|
{
|
2008-09-18 20:22:15 +00:00
|
|
|
u8 state, res;
|
|
|
|
char* ptr;
|
|
|
|
elua_net_size len;
|
2008-09-22 21:17:44 +00:00
|
|
|
s16 readto;
|
2008-09-15 21:54:14 +00:00
|
|
|
};
|
|
|
|
|
2008-09-20 15:14:05 +00:00
|
|
|
struct uip_eth_addr;
|
2008-09-22 21:17:44 +00:00
|
|
|
|
2008-09-18 20:22:15 +00:00
|
|
|
// Helper functions
|
2008-09-15 21:54:14 +00:00
|
|
|
void elua_uip_appcall();
|
2008-09-20 15:14:05 +00:00
|
|
|
void elua_uip_init( const struct uip_eth_addr* paddr );
|
2008-09-18 20:22:15 +00:00
|
|
|
void elua_uip_mainloop();
|
2008-09-15 21:54:14 +00:00
|
|
|
|
|
|
|
#endif
|