#ifndef CS_COMMON_PLATFORMS_LWIP_MG_NET_IF_LWIP_H_
#define CS_COMMON_PLATFORMS_LWIP_MG_NET_IF_LWIP_H_
#ifndef MG_ENABLE_NET_IF_LWIP_LOW_LEVEL
#define MG_ENABLE_NET_IF_LWIP_LOW_LEVEL MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL
#endif
#if MG_ENABLE_NET_IF_LWIP_LOW_LEVEL
#include <stdint.h>
extern const struct mg_iface_vtable mg_lwip_iface_vtable;
struct mg_lwip_conn_state {
struct mg_connection *nc;
struct mg_connection *lc;
union {
struct tcp_pcb *tcp;
struct udp_pcb *udp;
} pcb;
err_t err;
size_t num_sent;
struct pbuf *rx_chain;
size_t rx_offset;
int last_ssl_write_size;
int recv_pending;
int draining_rx_chain;
};
enum mg_sig_type {
MG_SIG_CONNECT_RESULT = 1,
MG_SIG_RECV = 2,
MG_SIG_CLOSE_CONN = 3,
MG_SIG_TOMBSTONE = 4,
MG_SIG_ACCEPT = 5,
};
void mg_lwip_post_signal(enum mg_sig_type sig, struct mg_connection *nc);
void mg_lwip_mgr_schedule_poll(struct mg_mgr *mgr);
#endif
#endif