lwIP
2.1.0
Lightweight IP stack
|
#include "lwip/opt.h"
#include "lwip/api.h"
#include "lwip/memp.h"
#include "lwip/ip.h"
#include "lwip/raw.h"
#include "lwip/udp.h"
#include "lwip/priv/api_msg.h"
#include "lwip/priv/tcp_priv.h"
#include "lwip/priv/tcpip_priv.h"
#include "path/to/my/lwip_hooks.h"
#include <string.h>
Functions | |
struct netconn * | netconn_new_with_proto_and_callback (enum netconn_type t, u8_t proto, netconn_callback callback) |
err_t | netconn_prepare_delete (struct netconn *conn) |
err_t | netconn_delete (struct netconn *conn) |
err_t | netconn_getaddr (struct netconn *conn, ip_addr_t *addr, u16_t *port, u8_t local) |
err_t | netconn_bind (struct netconn *conn, const ip_addr_t *addr, u16_t port) |
err_t | netconn_bind_if (struct netconn *conn, u8_t if_idx) |
err_t | netconn_connect (struct netconn *conn, const ip_addr_t *addr, u16_t port) |
err_t | netconn_disconnect (struct netconn *conn) |
err_t | netconn_listen_with_backlog (struct netconn *conn, u8_t backlog) |
err_t | netconn_accept (struct netconn *conn, struct netconn **new_conn) |
err_t | netconn_recv_tcp_pbuf (struct netconn *conn, struct pbuf **new_buf) |
err_t | netconn_recv_tcp_pbuf_flags (struct netconn *conn, struct pbuf **new_buf, u8_t apiflags) |
err_t | netconn_recv_udp_raw_netbuf (struct netconn *conn, struct netbuf **new_buf) |
err_t | netconn_recv_udp_raw_netbuf_flags (struct netconn *conn, struct netbuf **new_buf, u8_t apiflags) |
err_t | netconn_recv (struct netconn *conn, struct netbuf **new_buf) |
err_t | netconn_sendto (struct netconn *conn, struct netbuf *buf, const ip_addr_t *addr, u16_t port) |
err_t | netconn_send (struct netconn *conn, struct netbuf *buf) |
err_t | netconn_write_partly (struct netconn *conn, const void *dataptr, size_t size, u8_t apiflags, size_t *bytes_written) |
err_t | netconn_write_vectors_partly (struct netconn *conn, struct netvector *vectors, u16_t vectorcnt, u8_t apiflags, size_t *bytes_written) |
err_t | netconn_close (struct netconn *conn) |
err_t | netconn_err (struct netconn *conn) |
err_t | netconn_shutdown (struct netconn *conn, u8_t shut_rx, u8_t shut_tx) |
err_t | netconn_join_leave_group (struct netconn *conn, const ip_addr_t *multiaddr, const ip_addr_t *netif_addr, enum netconn_igmp join_or_leave) |
err_t | netconn_join_leave_group_netif (struct netconn *conn, const ip_addr_t *multiaddr, u8_t if_idx, enum netconn_igmp join_or_leave) |
err_t | netconn_gethostbyname_addrtype (const char *name, ip_addr_t *addr, u8_t dns_addrtype) |
Sequential API External module
Get the local or remote IP address and port of a netconn. For RAW netconns, this returns the protocol instead of a port!
conn | the netconn to query |
addr | a pointer to which to save the IP address |
port | a pointer to which to save the port (or protocol for RAW) |
local | 1 to get the local IP address, 0 to get the remote one |
struct netconn* netconn_new_with_proto_and_callback | ( | enum netconn_type | t, |
u8_t | proto, | ||
netconn_callback | callback | ||
) |
Create a new netconn (of a specific type) that has a callback function. The corresponding pcb is also created.
t | the type of 'connection' to create ( |
proto | the IP protocol for RAW IP pcbs |
callback | a function to call on status changes (RX available, TX'ed) |
Receive data (in form of a netbuf) from a UDP or RAW netconn
conn | the netconn from which to receive data |
new_buf | pointer where a new netbuf is stored when received data |
err_t netconn_recv_udp_raw_netbuf_flags | ( | struct netconn * | conn, |
struct netbuf ** | new_buf, | ||
u8_t | apiflags | ||
) |
Receive data (in form of a netbuf) from a UDP or RAW netconn
conn | the netconn from which to receive data |
new_buf | pointer where a new netbuf is stored when received data |
apiflags | flags that control function behaviour. For now only:
|
err_t netconn_write_vectors_partly | ( | struct netconn * | conn, |
struct netvector * | vectors, | ||
u16_t | vectorcnt, | ||
u8_t | apiflags, | ||
size_t * | bytes_written | ||
) |
Send vectorized data atomically over a TCP netconn.
conn | the TCP netconn over which to send data |
vectors | array of vectors containing data to send |
vectorcnt | number of vectors in the array |
apiflags | combination of following flags :
|
bytes_written | pointer to a location that receives the number of written bytes |