38#ifndef LWIP_HDR_APPS_HTTP_CLIENT_H
39#define LWIP_HDR_APPS_HTTP_CLIENT_H
48#if LWIP_TCP && LWIP_CALLBACK_API
60#ifndef LWIP_HTTPC_HAVE_FILE_IO
61#define LWIP_HTTPC_HAVE_FILE_IO 0
68#define HTTP_DEFAULT_PORT LWIP_IANA_PORT_HTTP
74typedef enum ehttpc_result {
78 HTTPC_RESULT_ERR_UNKNOWN = 1,
80 HTTPC_RESULT_ERR_CONNECT = 2,
82 HTTPC_RESULT_ERR_HOSTNAME = 3,
84 HTTPC_RESULT_ERR_CLOSED = 4,
86 HTTPC_RESULT_ERR_TIMEOUT = 5,
88 HTTPC_RESULT_ERR_SVR_RESP = 6,
90 HTTPC_RESULT_ERR_MEM = 7,
92 HTTPC_RESULT_LOCAL_ABORT = 8,
94 HTTPC_RESULT_ERR_CONTENT_LEN = 9
97typedef struct _httpc_state httpc_state_t;
123typedef err_t (*httpc_headers_done_fn)(httpc_state_t *connection,
void *
arg,
struct pbuf *
hdr,
u16_t hdr_len,
u32_t content_len);
125typedef struct _httpc_connection {
132 altcp_allocator_t *altcp_allocator;
136 httpc_result_fn result_fn;
139 httpc_headers_done_fn headers_done_fn;
143 altcp_recv_fn recv_fn,
void* callback_arg, httpc_state_t **connection);
145 altcp_recv_fn recv_fn,
void* callback_arg, httpc_state_t **connection);
147#if LWIP_HTTPC_HAVE_FILE_IO
149 void* callback_arg,
const char* local_file_name, httpc_state_t **connection);
151 void* callback_arg,
const char* local_file_name, httpc_state_t **connection);
struct mke2fs_defaults settings[]