ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
http.h File Reference

The HTTP root: the parts of the protocol that do not belong to one version. More...

Go to the source code of this file.

Classes

struct  HttpMethodArgs
 RFC 9110 sec 9: a method, held either as the enum or as its token. More...
 
struct  HttpRouteArgs
 RFC 9110 sec 7.1 request target: the route pattern, and the path tested against it. More...
 
struct  HttpAllowArgs
 RFC 9110 sec 10.2.1 Allow: the comma-separated list an append builds. More...
 
struct  HttpVars
 
struct  HttpNs
 The entries. More...
 

Typedefs

typedef void(* Handler) (uint8_t slot_id, HttpReq *request)
 A route's request handler.
 

Enumerations

enum  HttpMethod {
  HTTP_GET , HTTP_POST , HTTP_PUT , HTTP_DELETE ,
  HTTP_PATCH , HTTP_HEAD , HTTP_OPTIONS , HTTP_METHOD_UNKNOWN
}
 The request methods a route binds to. More...
 

Functions

void protocore_http_status_text (uint8_t *work)
 
void protocore_http_parse_method (uint8_t *work)
 
void protocore_http_method_name (uint8_t *work)
 
void protocore_http_path_matches (uint8_t *work)
 
void protocore_http_match_path_params (uint8_t *work)
 
void protocore_http_req_is_head (uint8_t *work)
 
void protocore_http_allow_append (uint8_t *work)
 
void protocore_http_match_and_execute (uint8_t *work)
 
void protocore_http_set_not_found (uint8_t *work)
 
void protocore_http_poll_slot (uint8_t *work)
 
void protocore_http_reset (uint8_t *work)
 
void protocore_http_set_edge_poll (uint8_t *work)
 
uint8_t * protocore_http_span (void)
 The PROTOCORE_HTTP_BORROW bytes this module's state lives in.
 

Variables

HttpVars HttpV
 The operands and the outcome.
 

Detailed Description

The HTTP root: the parts of the protocol that do not belong to one version.

A status code, a method token, a route path match and an Allow list read the same on HTTP/1.1, HTTP/2 and HTTP/3, so they sit here and each version module calls them.

The one symbol this module exports is Http.

Definition in file http.h.

Typedef Documentation

◆ Handler

typedef void(* Handler) (uint8_t slot_id, HttpReq *request)

A route's request handler.

Definition at line 35 of file http.h.

Enumeration Type Documentation

◆ HttpMethod

enum HttpMethod

The request methods a route binds to.

Enumerator
HTTP_GET 

Safe, idempotent read.

HTTP_POST 

Non-idempotent create / action.

HTTP_PUT 

Idempotent replace.

HTTP_DELETE 

Idempotent delete.

HTTP_PATCH 

Partial update.

HTTP_HEAD 

Same as GET but no response body.

HTTP_OPTIONS 

Capability query / CORS preflight.

HTTP_METHOD_UNKNOWN 

Unrecognized method token, answered 501.

Definition at line 22 of file http.h.

Function Documentation

◆ protocore_http_status_text()

void protocore_http_status_text ( uint8_t *  work)

◆ protocore_http_parse_method()

void protocore_http_parse_method ( uint8_t *  work)

◆ protocore_http_method_name()

void protocore_http_method_name ( uint8_t *  work)

◆ protocore_http_path_matches()

void protocore_http_path_matches ( uint8_t *  work)

◆ protocore_http_match_path_params()

void protocore_http_match_path_params ( uint8_t *  work)

◆ protocore_http_req_is_head()

void protocore_http_req_is_head ( uint8_t *  work)

◆ protocore_http_allow_append()

void protocore_http_allow_append ( uint8_t *  work)

◆ protocore_http_match_and_execute()

void protocore_http_match_and_execute ( uint8_t *  work)

◆ protocore_http_set_not_found()

void protocore_http_set_not_found ( uint8_t *  work)

◆ protocore_http_poll_slot()

void protocore_http_poll_slot ( uint8_t *  work)

◆ protocore_http_reset()

void protocore_http_reset ( uint8_t *  work)

◆ protocore_http_set_edge_poll()

void protocore_http_set_edge_poll ( uint8_t *  work)

◆ protocore_http_span()

uint8_t * protocore_http_span ( void  )

The PROTOCORE_HTTP_BORROW bytes this module's state lives in.

Stated beside the namespace rather than on it: an entry takes a borrow, and this is where that borrow comes from. Taken once from the end of the pool, which no mark and no release walks, so the state lasts the life of the program.

Returns
the span.

Variable Documentation

◆ HttpV

HttpVars HttpV
extern

The operands and the outcome.