picow-http 0.12.1-4-g9d4fd13
HTTP server for the Raspberry Pi PicoW
http.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Geoff Simmons <geoff@simmons.de>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 * See LICENSE
6 */
7
281#ifndef _PICOW_HTTP_H
282#define _PICOW_HTTP_H
283
284#include <string.h>
285
286#include "lwip/ip_addr.h"
287#include "lwip/prot/iana.h"
288#include "lwip/err.h"
289
290#ifdef __cplusplus
291extern "C" {
292#endif
293
294#include "assertion.h"
295#include "log.h"
296#include "ntp.h"
297#include "version.h"
298
299/*
300 * Declarations required *before* including http_priv.h.
301 */
302
318#ifndef HTTP_REQ_MAX_HDRS
319#define HTTP_REQ_MAX_HDRS (16)
320#endif
321
345struct http;
346
367typedef err_t (*hndlr_f)(struct http *http, void *priv);
368
389};
390
402#define HTTP_METHODS_GET_HEAD \
403 ((1U << HTTP_METHOD_GET) | (1U << HTTP_METHOD_HEAD))
404
420typedef void priv_fini_f(void *p);
421typedef err_t priv_cnt_f(struct http *http);
422
423#include "http_priv.h"
424
452static inline void
453http_cx_set_priv(struct http *http, void *priv, priv_fini_f *fini, priv_cnt_f *cnt)
454{
455 CHECK_OBJ_NOTNULL(http, HTTP_MAGIC);
456 http->cx_priv.priv = priv;
457 http->cx_priv.fini = fini;
458 http->cx_priv.cnt = cnt;
459}
460
478static inline void *
480{
481 CHECK_OBJ_NOTNULL(http, HTTP_MAGIC);
482 return http->cx_priv.priv;
483}
484
586};
587
600#ifndef HTTP_DEFAULT_IDLE_TMO_S
601#define HTTP_DEFAULT_IDLE_TMO_S (5)
602#endif
603
616#ifndef HTTP_DEFAULT_SEND_TMO_S
617#define HTTP_DEFAULT_SEND_TMO_S (5)
618#endif
619
633#ifndef HTTP_DEFAULT_LISTEN_BACKLOG
634#define HTTP_DEFAULT_LISTEN_BACKLOG (10)
635#endif
636
662#define STRLEN_LTRL(s) (sizeof(s) - 1)
663
689struct req;
690
724struct resp;
725
778 const ip_addr_t *ipaddr;
779 struct srv_data *srv_data;
781 unsigned idle_tmo_s;
783 unsigned send_tmo_s;
785 uint16_t port;
789 enum lwip_ip_addr_type ip_type;
791 bool tls;
792};
793
817struct server;
818
854err_t http_cfg(const char *name, struct server_cfg *cfg);
855
893static inline struct server_cfg
895{
896 err_t err;
897 struct server_cfg cfg;
898
899 err = http_cfg("default", &cfg);
900 PICOW_HTTP_ASSERT(err == ERR_OK);
901 return cfg;
902}
903
947err_t http_srv_init(struct server **server, struct server_cfg *cfg);
948
990
1044ip_addr_t * http_srv_ip(struct server *server);
1045
1079uint16_t http_srv_port(struct server *server);
1080
1120void http_srv_set_priv(struct server *server, void *priv, priv_fini_f *fini);
1121
1161static inline ip_addr_t *
1163{
1164 CHECK_OBJ_NOTNULL(http, HTTP_MAGIC);
1165 AN(http->pcb);
1166 return http_local_ip(http->pcb);
1167}
1168
1183static inline uint16_t
1185{
1186 CHECK_OBJ_NOTNULL(http, HTTP_MAGIC);
1187 AN(http->pcb);
1188 return http_local_port(http->pcb);
1189}
1190
1230static inline ip_addr_t *
1232{
1233 CHECK_OBJ_NOTNULL(http, HTTP_MAGIC);
1234 AN(http->pcb);
1235 return http_remote_ip(http->pcb);
1236}
1237
1251static inline uint16_t
1253{
1254 CHECK_OBJ_NOTNULL(http, HTTP_MAGIC);
1255 AN(http->pcb);
1256 return http_remote_port(http->pcb);
1257}
1258
1295static inline void *
1297{
1298 CHECK_OBJ_NOTNULL(http, HTTP_MAGIC);
1299 CHECK_OBJ_NOTNULL(http->srv_data, SRV_DATA_MAGIC);
1300 return http->srv_data->srv_priv;
1301}
1302
1329static inline struct req *
1331{
1332 CHECK_OBJ_NOTNULL(http, HTTP_MAGIC);
1333 CHECK_OBJ_NOTNULL(&http->req, REQ_MAGIC);
1334 return &http->req;
1335}
1336
1386const char * http_req_hdr(struct req *req, const char *name, size_t name_len,
1387 size_t *val_len);
1388
1431static inline const char *
1432http_req_hdr_str(struct req *req, const char *name, size_t *val_len)
1433{
1434 return http_req_hdr(req, name, strlen(name), val_len);
1435}
1436
1480#define http_req_hdr_ltrl(req, name, val_len) \
1481 http_req_hdr((req), (name), STRLEN_LTRL(name), (val_len))
1482
1522bool http_req_hdr_eq(struct req *req, const char *name, size_t name_len,
1523 const char *val, size_t val_len);
1524
1564bool http_req_hdr_contains(struct req *req, const char *name, size_t name_len,
1565 const char *substring, size_t substring_len);
1566
1602static inline bool
1603http_req_hdr_eq_str(struct req *req, const char *name, const char *val)
1604{
1605 return http_req_hdr_eq(req, name, strlen(name), val, strlen(val));
1606}
1607
1646static inline bool
1647http_req_hdr_contains_str(struct req *req, const char *name,
1648 const char *substring)
1649{
1650 return http_req_hdr_contains(req, name, strlen(name), substring,
1651 strlen(substring));
1652}
1653
1688#define http_req_hdr_eq_ltrl(req, name, val) \
1689 http_req_hdr_eq((req), (name), STRLEN_LTRL(name), (val), \
1690 STRLEN_LTRL(val))
1691
1729#define http_req_hdr_contains_ltrl(req, name, substring) \
1730 http_req_hdr_contains((req), (name), STRLEN_LTRL(name), (substring), \
1731 STRLEN_LTRL(substring))
1732
1779typedef err_t (*name_val_iter_f)(const char *name, size_t name_len,
1780 const char *val, size_t val_len, void *priv);
1781
1830err_t http_req_hdr_iter(struct req *req, name_val_iter_f iter_cb, void *priv);
1831
1902const uint8_t * http_req_cookie(struct req *req, const char *name,
1903 size_t name_len, size_t *val_len);
1904
1956static inline const uint8_t *
1957http_req_cookie_str(struct req *req, const char *name, size_t *val_len)
1958{
1959 return http_req_cookie(req, name, strlen(name), val_len);
1960}
1961
2012#define http_req_cookie_ltrl(req, name, val_len) \
2013 http_req_cookie((req), (name), STRLEN_LTRL(name), (val_len))
2014
2077 void *priv);
2078
2114static inline enum http_method_t
2116{
2117 CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
2118 return req->method;
2119}
2120
2162static inline const uint8_t *
2163http_req_path(struct req *req, size_t *len)
2164{
2165 CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
2166 AN(len);
2167
2168 *len = req->path.len;
2169 return ((uint8_t*)req->p->payload) + req->path.off;
2170}
2171
2215static inline const uint8_t *
2216http_req_query(struct req *req, size_t *len)
2217{
2218 CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
2219 AN(len);
2220
2221 *len = req->query.len;
2222 if (req->query.len == 0)
2223 return NULL;
2224 return ((uint8_t*)req->p->payload) + req->query.off;
2225}
2226
2288const uint8_t * http_req_query_val(const uint8_t *query, size_t query_len,
2289 const uint8_t *name, size_t name_len,
2290 size_t *val_len);
2291
2367err_t http_req_query_iter(const uint8_t *query, size_t len,
2368 name_val_iter_f iter_cb, void *priv);
2369
2406static inline size_t
2408{
2409 CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
2410 return req->clen;
2411}
2412
2517err_t http_req_body(struct http *http, uint8_t buf[], size_t *len, size_t off);
2518
2613err_t http_req_body_ptr(struct http *http, const uint8_t **buf, size_t *len,
2614 size_t off);
2615
2700err_t http_req_chunk(struct http *http, uint8_t *buf, size_t *len);
2701
2728static inline struct resp *
2730{
2731 CHECK_OBJ_NOTNULL(http, HTTP_MAGIC);
2732 CHECK_OBJ_NOTNULL(&http->resp, RESP_MAGIC);
2733 return &http->resp;
2734}
2735
2773static inline err_t
2774http_resp_set_status(struct resp *resp, uint16_t status)
2775{
2776 CHECK_OBJ_NOTNULL(resp, RESP_MAGIC);
2777 if (status < 100 || status >= 1000)
2778 return ERR_VAL;
2779 resp->status = status;
2780 return ERR_OK;
2781}
2782
2826static inline uint16_t
2828{
2829 CHECK_OBJ_NOTNULL(resp, RESP_MAGIC);
2830 return resp->status;
2831}
2832
2847#ifndef RESP_HDR_SMALL_BUF_SZ
2848#define RESP_HDR_SMALL_BUF_SZ (512)
2849#endif
2850
2868#ifndef RESP_HDR_LARGE_BUF_SZ
2869#define RESP_HDR_LARGE_BUF_SZ (TCP_MSS)
2870#endif
2871
2872#ifdef __DOXYGEN__
2895#define RESP_HDR_SMALL_POOL_SZ (MAX_CONCURRENT_CX_HINT)
2896#endif
2897
2898#ifndef RESP_HDR_SMALL_POOL_SZ
2899#define RESP_HDR_SMALL_POOL_SZ (HTTP_N * SRV_N)
2900#endif
2901
2916#ifndef RESP_HDR_LARGE_POOL_SZ
2917#define RESP_HDR_LARGE_POOL_SZ (RESP_HDR_SMALL_POOL_SZ / 2)
2918#endif
2919
2958err_t http_resp_set_hdr(struct resp *resp, const char *name, size_t name_len,
2959 const char *val, size_t val_len);
2960
3000static inline err_t
3001http_resp_set_hdr_str(struct resp *resp, const char *name, const char *val)
3002{
3003 return http_resp_set_hdr(resp, name, strlen(name), val, strlen(val));
3004}
3005
3045#define http_resp_set_hdr_ltrl(resp, name, val) \
3046 http_resp_set_hdr((resp), (name), STRLEN_LTRL(name), (val), \
3047 STRLEN_LTRL(val))
3048
3085static inline err_t
3086http_resp_set_type(struct resp *resp, const char *type, size_t type_len)
3087{
3088 return http_resp_set_hdr(resp, "Content-Type",
3089 STRLEN_LTRL("Content-Type"), type, type_len);
3090}
3091
3128static inline err_t
3129http_resp_set_type_str(struct resp *resp, const char *type)
3130{
3131 return http_resp_set_type(resp, type, strlen(type));
3132}
3133
3169#define http_resp_set_type_ltrl(resp, type) \
3170 http_resp_set_type((resp), (type), STRLEN_LTRL(type))
3171
3207err_t http_resp_set_len(struct resp *resp, size_t len);
3208
3245static inline err_t
3247{
3248 CHECK_OBJ_NOTNULL(resp, RESP_MAGIC);
3249 return http_resp_set_hdr_ltrl(resp, "Transfer-Encoding", "chunked");
3250}
3251
3292
3379err_t http_resp_send_buf(struct http *http, const uint8_t *buf, size_t len,
3380 bool durable);
3381
3480err_t http_resp_send_chunk(struct http *http, const uint8_t *buf, size_t len,
3481 bool durable);
3482
3483// if returned err_mem - make retry in tcp_sent
3484err_t http_resp_send_buf_chain(struct http *http, const uint8_t *buf, size_t len,
3485 bool durable, bool last);
3486
3539static inline err_t
3540http_resp_err(struct http *http, uint16_t status)
3541{
3542 CHECK_OBJ_NOTNULL(http, HTTP_MAGIC);
3543 CHECK_OBJ_NOTNULL(&http->resp, RESP_MAGIC);
3544
3545 http->resp.status = status;
3546 return http_hndlr_err(http, NULL);
3547}
3548
3647err_t register_hndlr_methods(struct server_cfg *cfg, const char *path,
3648 hndlr_f hndlr, uint8_t methods, void *priv);
3649
3802static inline err_t
3803register_hndlr(struct server_cfg *cfg, const char *path, hndlr_f hndlr,
3804 enum http_method_t method, void *priv)
3805{
3806 if (method < 0 || method >= __HTTP_METHOD_MAX)
3807 return ERR_VAL;
3808 return register_hndlr_methods(cfg, path, hndlr, (1U << method), priv);
3809}
3810
3892err_t register_default_hndlr(struct server_cfg *cfg, hndlr_f hndlr, void *priv,
3893 priv_fini_f fini);
3894
4010err_t register_error_hndlr(struct server_cfg *cfg, hndlr_f hndlr, void *priv,
4011 priv_fini_f fini);
4012
4052err_t format_decimal(char *s, size_t *len, int32_t n);
4053
4102err_t format_hex(char *s, size_t *len, uint32_t n, bool upper);
4103
4194err_t url_decode(char * const out, size_t *outlen,
4195 const char * const in, ssize_t inlen, bool plus);
4196
4233err_t hex_decode(const char * const buf, ssize_t len, uint64_t *n);
4234
4235#ifdef __cplusplus
4236}
4237#endif
4238
4239#endif /* _PICOW_HTTP_H */
#define CHECK_OBJ_NOTNULL(ptr, type_magic)
Assert that a pointer is not NULL, and points to an object that is valid for its type.
Definition: assertion.h:362
#define AN(x)
Assert that a value is not zero, or not NULL
Definition: assertion.h:141
#define PICOW_HTTP_ASSERT(c)
Assert that a condition is true.
Definition: assertion.h:91
const char * http_req_hdr(struct req *req, const char *name, size_t name_len, size_t *val_len)
Return the value of a request header.
static struct req * http_req(struct http *http)
Get the current request object.
Definition: http.h:1330
static const char * http_req_hdr_str(struct req *req, const char *name, size_t *val_len)
Return the value of a request header with a nul-terminated name.
Definition: http.h:1432
http_method_t
Request method.
Definition: http.h:379
bool http_req_hdr_eq(struct req *req, const char *name, size_t name_len, const char *val, size_t val_len)
Return true if a request header value is equal to a string.
static bool http_req_hdr_eq_str(struct req *req, const char *name, const char *val)
Return true if a request header value is equal to a nul-terminated string.
Definition: http.h:1603
err_t http_req_body_ptr(struct http *http, const uint8_t **buf, size_t *len, size_t off)
Get a pointer to request body contents with zero-copy.
err_t http_req_body(struct http *http, uint8_t buf[], size_t *len, size_t off)
Copy the request body to a buffer.
bool http_req_hdr_contains(struct req *req, const char *name, size_t name_len, const char *substring, size_t substring_len)
Return true if a request header contains a string.
err_t http_req_hdr_iter(struct req *req, name_val_iter_f iter_cb, void *priv)
Iterate over request headers.
err_t http_req_query_iter(const uint8_t *query, size_t len, name_val_iter_f iter_cb, void *priv)
Iterate over query string parameter names and values.
err_t http_req_chunk(struct http *http, uint8_t *buf, size_t *len)
Copy the next chunk in a request body sent with chunked encdoding.
static const uint8_t * http_req_cookie_str(struct req *req, const char *name, size_t *val_len)
Return the value of a cookie with a nul-terminated name.
Definition: http.h:1957
static bool http_req_hdr_contains_str(struct req *req, const char *name, const char *substring)
Return true if a request header contains a nul-terminated string.
Definition: http.h:1647
const uint8_t * http_req_cookie(struct req *req, const char *name, size_t name_len, size_t *val_len)
Return the value of a cookie.
err_t url_decode(char *const out, size_t *outlen, const char *const in, ssize_t inlen, bool plus)
Decode a "percent-encoded" string.
static enum http_method_t http_req_method(struct req *req)
Return the request method.
Definition: http.h:2115
const uint8_t * http_req_query_val(const uint8_t *query, size_t query_len, const uint8_t *name, size_t name_len, size_t *val_len)
Return the value of a query parameter.
err_t http_req_cookie_iter(struct req *req, name_val_iter_f iter_cb, void *priv)
Iterate over cooke name/value pairs.
static const uint8_t * http_req_query(struct req *req, size_t *len)
Return the request query string.
Definition: http.h:2216
static const uint8_t * http_req_path(struct req *req, size_t *len)
Return the path from the first request line.
Definition: http.h:2163
err_t(* name_val_iter_f)(const char *name, size_t name_len, const char *val, size_t val_len, void *priv)
Function type for name/value iterators.
Definition: http.h:1779
static size_t http_req_body_len(struct req *req)
Return the length of the request body.
Definition: http.h:2407
static struct resp * http_resp(struct http *http)
Get the current response object.
Definition: http.h:2729
err_t http_resp_send_chunk(struct http *http, const uint8_t *buf, size_t len, bool durable)
Send a chunk in a chunked-encoded response body.
err_t(* hndlr_f)(struct http *http, void *priv)
Function type for custom response handlers.
Definition: http.h:367
#define http_resp_set_hdr_ltrl(resp, name, val)
Set a response header to a literal string.
Definition: http.h:3045
static err_t http_resp_set_hdr_str(struct resp *resp, const char *name, const char *val)
Set a response header to a nul-terminated string.
Definition: http.h:3001
static err_t http_resp_set_type_str(struct resp *resp, const char *type)
Set the Content-Type response header to a nul-terminated string.
Definition: http.h:3129
err_t register_hndlr_methods(struct server_cfg *cfg, const char *path, hndlr_f hndlr, uint8_t methods, void *priv)
Register a response handler for request methods and a path.
err_t http_resp_set_len(struct resp *resp, size_t len)
Set the Content-Length response header.
err_t http_resp_send_hdr(struct http *http)
Send the response header.
static uint16_t http_resp_status(struct resp *resp)
Get the response status code.
Definition: http.h:2827
static err_t http_resp_set_type(struct resp *resp, const char *type, size_t type_len)
Set the Content-Type response header.
Definition: http.h:3086
err_t http_resp_send_buf(struct http *http, const uint8_t *buf, size_t len, bool durable)
Send the contents of a buffer as the response body.
static err_t http_resp_set_xfer_chunked(struct resp *resp)
Set the Transfer-Encdoing response header to "chunked".
Definition: http.h:3246
static err_t http_resp_set_status(struct resp *resp, uint16_t status)
Set the response status code.
Definition: http.h:2774
static err_t http_resp_err(struct http *http, uint16_t status)
Send an error response.
Definition: http.h:3540
err_t register_error_hndlr(struct server_cfg *cfg, hndlr_f hndlr, void *priv, priv_fini_f fini)
Register a custom error response handler.
err_t register_default_hndlr(struct server_cfg *cfg, hndlr_f hndlr, void *priv, priv_fini_f fini)
Register a default response handler.
err_t http_resp_set_hdr(struct resp *resp, const char *name, size_t name_len, const char *val, size_t val_len)
Set a response header.
static err_t register_hndlr(struct server_cfg *cfg, const char *path, hndlr_f hndlr, enum http_method_t method, void *priv)
Register a response handler for a request method and path.
Definition: http.h:3803
http_status_t
enum for HTTP response status codes
Definition: http.h:493
void http_srv_set_priv(struct server *server, void *priv, priv_fini_f *fini)
Set a server-wide private object.
static void http_cx_set_priv(struct http *http, void *priv, priv_fini_f *fini, priv_cnt_f *cnt)
Set a connection-scoped private object.
Definition: http.h:453
static struct server_cfg http_default_cfg(void)
Get the default HTTP server configuration.
Definition: http.h:894
ip_addr_t * http_srv_ip(struct server *server)
Return the server listener IP address.
static void * http_cx_priv(struct http *http)
Return the connection-scoped private object, if any.
Definition: http.h:479
static uint16_t http_cx_remote_port(struct http *http)
Return the remote port of the current HTTP connection.
Definition: http.h:1252
static uint16_t http_cx_local_port(struct http *http)
Return the local port of the current HTTP connection.
Definition: http.h:1184
static ip_addr_t * http_cx_remote_ip(struct http *http)
Return the remote IP address of the current HTTP connection.
Definition: http.h:1231
static ip_addr_t * http_cx_local_ip(struct http *http)
Return the local IP address of the current HTTP connection.
Definition: http.h:1162
err_t http_srv_fini(struct server *server)
Stop an HTTP server.
static void * http_srv_priv(struct http *http)
Return the server-wide private object, if any.
Definition: http.h:1296
void priv_fini_f(void *p)
Function type for private data finalizers.
Definition: http.h:420
uint16_t http_srv_port(struct server *server)
Return the server listener port number.
err_t http_cfg(const char *name, struct server_cfg *cfg)
Get the default confiuration for a server by name.
err_t http_srv_init(struct server **server, struct server_cfg *cfg)
Start an HTTP server.
err_t format_hex(char *s, size_t *len, uint32_t n, bool upper)
Format a hexadecimal number.
#define STRLEN_LTRL(s)
Length of a literal string.
Definition: http.h:662
err_t format_decimal(char *s, size_t *len, int32_t n)
Format a decimal number.
err_t hex_decode(const char *const buf, ssize_t len, uint64_t *n)
Decode a hexadecimal string.
@ HTTP_METHOD_POST
Definition: http.h:382
@ HTTP_METHOD_HEAD
Definition: http.h:381
@ __HTTP_METHOD_MAX
Definition: http.h:388
@ HTTP_METHOD_CONNECT
Definition: http.h:385
@ HTTP_METHOD_DELETE
Definition: http.h:384
@ HTTP_METHOD_GET
Definition: http.h:380
@ HTTP_METHOD_TRACE
Definition: http.h:387
@ HTTP_METHOD_OPTIONS
Definition: http.h:386
@ HTTP_METHOD_PUT
Definition: http.h:383
@ HTTP_STATUS_URI_TOO_LONG
Definition: http.h:557
@ HTTP_STATUS_IM_A_TEAPOT
Definition: http.h:565
@ HTTP_STATUS_EXPECTATION_FAILED
Definition: http.h:563
@ HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE
Definition: http.h:559
@ HTTP_STATUS_NOT_ACCEPTABLE
Definition: http.h:541
@ HTTP_STATUS_INTERNAL_SERVER_ERROR
Definition: http.h:575
@ HTTP_STATUS_REQUEST_TIMEOUT
Definition: http.h:545
@ HTTP_STATUS_MISDIRECTED_REQUEST
Definition: http.h:567
@ HTTP_STATUS_PROXY_AUTH_REQUIRED
Definition: http.h:543
@ HTTP_STATUS_FORBIDDEN
Definition: http.h:535
@ HTTP_STATUS_CONTENT_TOO_LARGE
Definition: http.h:555
@ HTTP_STATUS_BAD_REQUEST
Definition: http.h:529
@ HTTP_STATUS_RANGE_NOT_SATISFIABLE
Definition: http.h:561
@ HTTP_STATUS_FOUND
Definition: http.h:517
@ HTTP_STATUS_UPGRADE_REQUIRED
Definition: http.h:571
@ HTTP_STATUS_METHOD_NOT_ALLOWED
Definition: http.h:539
@ HTTP_STATUS_REQ_HDR_FIELDS_TOO_LARGE
Definition: http.h:573
@ HTTP_STATUS_GONE
Definition: http.h:549
@ HTTP_STATUS_NOT_MODIFIED
Definition: http.h:521
@ HTTP_STATUS_CONFLICT
Definition: http.h:547
@ HTTP_STATUS_TEMPORARY_REDIRECT
Definition: http.h:525
@ HTTP_STATUS_RESET_CONTENT
Definition: http.h:509
@ HTTP_STATUS_UNPROCESSABLE_CONTENT
Definition: http.h:569
@ HTTP_STATUS_ACCEPTED
Definition: http.h:503
@ HTTP_STATUS_MOVED_PERMANENTLY
Definition: http.h:515
@ HTTP_STATUS_NON_AUTHORITATIVE_INFO
Definition: http.h:505
@ HTTP_STATUS_PARTIAL_CONTENT
Definition: http.h:511
@ HTTP_STATUS_CREATED
Definition: http.h:501
@ HTTP_STATUS_USE_PROXY
Definition: http.h:523
@ HTTP_STATUS_SERVICE_UNAVAILABLE
Definition: http.h:581
@ HTTP_STATUS_LENGTH_REQUIRED
Definition: http.h:551
@ HTTP_STATUS_SWITCHING_PROTOCOLS
Definition: http.h:497
@ HTTP_STATUS_PERMANENT_REDIRECT
Definition: http.h:527
@ HTTP_STATUS_PRECONDITION_FAILED
Definition: http.h:553
@ HTTP_STATUS_BAD_GATEWAY
Definition: http.h:579
@ HTTP_STATUS_NOT_IMPLEMENTED
Definition: http.h:577
@ HTTP_STATUS_MULTIPLE_CHOICES
Definition: http.h:513
@ HTTP_STATUS_NO_CONTENT
Definition: http.h:507
@ HTTP_STATUS_OK
Definition: http.h:499
@ HTTP_STATUS_CONTINUE
Definition: http.h:495
@ HTTP_STATUS_UNAUTHORIZED
Definition: http.h:531
@ HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED
Definition: http.h:585
@ HTTP_STATUS_SEE_OTHER
Definition: http.h:519
@ HTTP_STATUS_GATEWAY_TIMEOUT
Definition: http.h:583
@ HTTP_STATUS_NOT_FOUND
Definition: http.h:537
@ HTTP_STATUS_PAYMENT_REQUIRED
Definition: http.h:533
Current HTTP connection, request and response.
NTP configuration.
Definition: ntp.h:174
HTTP request.
HTTP response.
HTTP server configuration.
Definition: http.h:774
unsigned idle_tmo_s
Definition: http.h:781
unsigned send_tmo_s
Definition: http.h:783
bool tls
Definition: http.h:791
uint8_t listen_backlog
Definition: http.h:787
const ip_addr_t * ipaddr
Definition: http.h:778
enum lwip_ip_addr_type ip_type
Definition: http.h:789
uint16_t port
Definition: http.h:785
HTTP server.