38 #include "loader/elfloader_compat.h"
48 PROCESS(tcp_loader_process,
"TCP loader");
51 struct codeprop_state {
54 struct pt tcpthread_pt;
66 if(
uip_datalen() <
sizeof(
struct codeprop_tcphdr)) {
67 PRINTF((
"codeprop: header not found in first tcp segment\n"));
75 uip_len -=
sizeof(
struct codeprop_tcphdr);
77 xmem_erase(XMEM_ERASE_UNIT_SIZE, EEPROMFS_ADDR_CODEPROP);
88 }
while(s.addr < s.len);
95 static char msg[30 + 10];
131 PRINTF((
"codeprop: uip_connected() and data != NULL\n"));
135 recv_tcpthread(&s.tcpthread_pt);
138 PRINTF((
"codeprop: connection down\n"));
uip_len
The length of the packet in the uip_buf buffer.
void process_poll(struct process *p)
Request a process to be polled.
#define PROCESS_BEGIN()
Define the beginning of a process.
Representation of a uIP TCP connection.
Header file for the uIP TCP/IP stack.
#define uip_aborted()
Has the connection been aborted by the other end?
CCIF void uip_send(const void *data, int len)
Send data on the current connection.
#define uip_newdata()
Is new incoming data available?
uint16_t lport
The local TCP port, in network byte order.
int elfloader_load(int fd)
Load and relocate an ELF file.
#define NULL
The null pointer.
#define PT_INIT(pt)
Initialize a protothread.
#define UIP_HTONS(n)
Convert 16-bit quantity from host byte order to network byte order.
#define PT_THREAD(name_args)
Declaration of a protothread.
#define uip_acked()
Has previously sent data been acknowledged?
#define uip_connected()
Has the connection just been connected?
#define PT_WAIT_UNTIL(pt, condition)
Block and wait until condition is true.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
cle_scratch elfloader_unknown
If elfloader_load() could not find a specific symbol, it is copied into this array.
#define PROCESS_END()
Define the end of a process.
#define uip_abort()
Abort the current connection.
CCIF uint16_t uip_htons(uint16_t val)
Convert a 16-bit quantity from host byte order to network byte order.
#define PT_BEGIN(pt)
Declare the start of a protothread inside the C function implementing the protothread.
#define PROCESS(name, strname)
Declare a process.
#define uip_close()
Close the current connection.
#define uip_datalen()
The length of any incoming data that is currently available (if available) in the uip_appdata buffer...
#define PT_YIELD_UNTIL(pt, cond)
Yield from the protothread until a condition occurs.
process_event_t tcpip_event
The uIP event.
#define uip_timedout()
Has the connection timed out?
#define PT_END(pt)
Declare the end of a protothread.
#define PROCESS_YIELD()
Yield the currently running process.
CCIF void tcp_listen(uint16_t port)
Open a TCP port.
#define ELFLOADER_OK
Return value from elfloader_load() indicating that loading worked.
#define uip_closed()
Has the connection been closed by the other end?
uip_appdata
Pointer to the application data in the packet buffer.
#define uip_rexmit()
Do we need to retransmit previously data?