34 #include "contiki-net.h"
39 #define NULL (void *)0
46 telnet_send(
struct telnet_state *s,
char *text, uint16_t len)
58 telnet_close(
struct telnet_state *s)
60 s->flags = FLAG_CLOSE;
68 telnet_abort(
struct telnet_state *s)
70 s->flags = FLAG_ABORT;
78 acked(
struct telnet_state *s)
80 s->textlen -= s->sentlen;
85 s->text += s->sentlen;
91 senddata(
struct telnet_state *s)
100 s->sentlen = s->textlen;
105 struct telnet_state *
106 telnet_connect(
struct telnet_state *s, uip_ipaddr_t *addr, uint16_t port)
120 struct telnet_state *s = (
struct telnet_state *)ts;
140 if(s->flags & FLAG_CLOSE) {
144 if(s->flags & FLAG_ABORT) {
Representation of a uIP TCP connection.
CCIF struct uip_conn * tcp_connect(uip_ipaddr_t *ripaddr, uint16_t port, void *appstate)
Open a TCP connection to the specified IP address and port.
#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?
#define uip_mss()
Get the current maximum segment size that can be sent on the current connection.
#define NULL
The null pointer.
#define uip_poll()
Is the connection being polled by uIP?
#define uip_acked()
Has previously sent data been acknowledged?
#define uip_connected()
Has the connection just been connected?
#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 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 uip_timedout()
Has the connection timed out?
#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?