Contiki also includes an optional protosocket library that provides an API similar to the BSD socket API.
Files | |
| file | tcpip.h |
| Header for the Contiki/uIP interface. | |
Defines | |
| #define | udp_bind(conn, port) uip_udp_bind(conn, port) |
| Bind a UDP connection to a local port. | |
Functions | |
| void | tcp_markconn (struct uip_conn *conn, void *appstate) |
| Mark a TCP connection with the current process. | |
| void | tcp_listen (u16_t port) |
| Open a TCP port. | |
| void | tcp_unlisten (u16_t port) |
| Close a listening TCP port. | |
| uip_conn * | tcp_connect (u16_t *ripaddr, u16_t port, void *appstate) |
| Open a TCP connection to the specified IP address and port. | |
| uip_udp_conn * | udp_new (u16_t *ripaddr, u16_t port, void *appstate) |
| Create a new UDP connection. | |
| uip_udp_conn * | udp_broadcast_new (u16_t port, void *appstate) |
| Create a new UDP broadcast connection. | |
| void | tcpip_poll_tcp (struct uip_conn *conn) |
| Cause a specified TCP connection to be polled. | |
| void | tcpip_poll_udp (struct uip_udp_conn *conn) |
| Cause a specified UDP connection to be polled. | |
Variables | |
| process_event_t | tcpip_event |
| The uIP event. | |
|
|
Bind a UDP connection to a local port. This function binds a UDP conncetion to a specified local port. When a connction is created with udp_new(), it gets a local port number assigned automatically. If the application needs to bind the connection to a specified local port, this function should be used.
|
|
||||||||||||||||
|
Open a TCP connection to the specified IP address and port. This function opens a TCP connection to the specified port at the host specified with an IP address. Additionally, an opaque pointer can be attached to the connection. This pointer will be sent together with uIP events to the process.
|
|
|
Open a TCP port. This function opens a TCP port for listening. When a TCP connection request occurs for the port, the process will be sent a tcpip_event with the new connection request.
|
|
||||||||||||
|
Mark a TCP connection with the current process. This function ties a TCP connection with the current process. Each TCP connection must be tied to a process in order for the process to be able to receive and send data. Additionally, this function can add a pointer with connection state to the connection.
|
|
|
Close a listening TCP port. This function closes a listening TCP port.
|
|
|
Cause a specified TCP connection to be polled. This function causes uIP to poll the specified TCP connection. The function is used when the application has data that is to be sent immediately and do not wish to wait for the periodic uIP polling mechanism.
|
|
|
Cause a specified UDP connection to be polled. This function causes uIP to poll the specified UDP connection. The function is used when the application has data that is to be sent immediately and do not wish to wait for the periodic uIP polling mechanism.
|
|
||||||||||||
|
Create a new UDP broadcast connection. This function creates a new (link-local) broadcast UDP connection to a specified port.
|
|
||||||||||||||||
|
Create a new UDP connection. This function creates a new UDP connection with the specified remote endpoint.
|
|
|
The uIP event. This event is posted to a process whenever a uIP event has occured. |
1.3.6