FD.io VPP  v18.07.1-19-g511ce25
Vector Packet Processing
http_server.c File Reference
+ Include dependency graph for http_server.c:

Go to the source code of this file.

Data Structures

struct  http_server_args
 
struct  http_server_main_t
 

Enumerations

enum  http_process_event_t { EVENT_WAKEUP = 1 }
 

Functions

static void free_http_process (http_server_args *args)
 
static void http_cli_output (uword arg, u8 *buffer, uword buffer_bytes)
 
void send_data (stream_session_t *s, u8 *data)
 
static void send_error (stream_session_t *s, char *str)
 
static uword http_cli_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 
static void alloc_http_process (http_server_args *args)
 
static void alloc_http_process_callback (void *cb_args)
 
static int session_rx_request (stream_session_t *s)
 
static int http_server_rx_callback (stream_session_t *s)
 
static int http_server_rx_callback_static (stream_session_t *s)
 
static int http_server_session_accept_callback (stream_session_t *s)
 
static void http_server_session_disconnect_callback (stream_session_t *s)
 
static void http_server_session_reset_callback (stream_session_t *s)
 
static int http_server_session_connected_callback (u32 app_index, u32 api_context, stream_session_t *s, u8 is_fail)
 
static int http_server_add_segment_callback (u32 client_index, const ssvm_private_t *sp)
 
static int create_api_loopback (vlib_main_t *vm)
 
static int server_attach ()
 
static int http_server_listen ()
 
static int http_server_create (vlib_main_t *vm)
 
static clib_error_thttp_server_create_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_thttp_server_main_init (vlib_main_t *vm)
 

Variables

http_server_main_t http_server_main
 
static const char * http_response
 
static const char * http_error_template
 
static const char * html_header_template
 
static const char * html_footer
 
static const char * html_header_static
 
static u8static_http
 
static session_cb_vft_t http_server_session_cb_vft
 
static vlib_cli_command_t http_server_create_command
 (constructor) VLIB_CLI_COMMAND (http_server_create_command) More...
 

Enumeration Type Documentation

Enumerator
EVENT_WAKEUP 

Definition at line 20 of file http_server.c.

Function Documentation

static void alloc_http_process ( http_server_args args)
static

Definition at line 292 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void alloc_http_process_callback ( void *  cb_args)
static

Definition at line 335 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int create_api_loopback ( vlib_main_t vm)
static

Definition at line 493 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void free_http_process ( http_server_args args)
static

Definition at line 63 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void http_cli_output ( uword  arg,
u8 buffer,
uword  buffer_bytes 
)
static

Definition at line 125 of file http_server.c.

+ Here is the caller graph for this function:

static uword http_cli_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 205 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int http_server_add_segment_callback ( u32  client_index,
const ssvm_private_t sp 
)
static

Definition at line 476 of file http_server.c.

static int http_server_create ( vlib_main_t vm)
static

Definition at line 569 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* http_server_create_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 596 of file http_server.c.

+ Here is the call graph for this function:

static int http_server_listen ( )
static

Definition at line 556 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* http_server_main_init ( vlib_main_t vm)
static

Definition at line 666 of file http_server.c.

+ Here is the call graph for this function:

static int http_server_rx_callback ( stream_session_t s)
static

Definition at line 365 of file http_server.c.

+ Here is the call graph for this function:

static int http_server_rx_callback_static ( stream_session_t s)
static

Definition at line 397 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int http_server_session_accept_callback ( stream_session_t s)
static

Definition at line 438 of file http_server.c.

+ Here is the call graph for this function:

static int http_server_session_connected_callback ( u32  app_index,
u32  api_context,
stream_session_t s,
u8  is_fail 
)
static

Definition at line 468 of file http_server.c.

static void http_server_session_disconnect_callback ( stream_session_t s)
static

Definition at line 450 of file http_server.c.

+ Here is the call graph for this function:

static void http_server_session_reset_callback ( stream_session_t s)
static

Definition at line 461 of file http_server.c.

+ Here is the call graph for this function:

void send_data ( stream_session_t s,
u8 data 
)

Definition at line 141 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void send_error ( stream_session_t s,
char *  str 
)
static

Definition at line 195 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int server_attach ( )
static

Definition at line 507 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int session_rx_request ( stream_session_t s)
static

Definition at line 341 of file http_server.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const char* html_footer
static
Initial value:
=
"</pre></body></html>\r\n"

Definition at line 113 of file http_server.c.

const char* html_header_static
static
Initial value:
=
"<html><head><title>static reply</title></head>"
"<link rel=\"icon\" href=\"data:,\">"
"<body><pre>hello</pre></body></html>\r\n"

Definition at line 116 of file http_server.c.

const char* html_header_template
static
Initial value:
=
"<html><head><title>%v</title></head>"
"<link rel=\"icon\" href=\"data:,\">"
"<body><pre>"

Definition at line 108 of file http_server.c.

const char* http_error_template
static
Initial value:
=
"HTTP/1.1 %s\r\n"
"Content-Type: text/html\r\n"
"Expires: Mon, 11 Jan 1970 10:10:10 GMT\r\n"
"Connection: close\r\n"
"Pragma: no-cache\r\n"
"Content-Length: 0\r\n\r\n"

Definition at line 99 of file http_server.c.

const char* http_response
static
Initial value:
=
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/html\r\n"
"Expires: Mon, 11 Jan 1970 10:10:10 GMT\r\n"
"Connection: keep-alive \r\n"
"Pragma: no-cache\r\n"
"Content-Length: %d\r\n\r\n%s"

Definition at line 91 of file http_server.c.

vlib_cli_command_t http_server_create_command
static
Initial value:
=
{
.path = "test http server",
.short_help = "test http server",
}
static clib_error_t * http_server_create_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: http_server.c:596

(constructor) VLIB_CLI_COMMAND (http_server_create_command)

Definition at line 657 of file http_server.c.

http_server_main_t http_server_main

Definition at line 60 of file http_server.c.

session_cb_vft_t http_server_session_cb_vft
static
Initial value:
= {
.session_accept_callback = http_server_session_accept_callback,
.session_disconnect_callback = http_server_session_disconnect_callback,
.session_connected_callback = http_server_session_connected_callback,
.add_segment_callback = http_server_add_segment_callback,
.builtin_app_rx_callback = http_server_rx_callback,
.session_reset_callback = http_server_session_reset_callback
}
static void http_server_session_disconnect_callback(stream_session_t *s)
Definition: http_server.c:450
static int http_server_session_accept_callback(stream_session_t *s)
Definition: http_server.c:438
static void http_server_session_reset_callback(stream_session_t *s)
Definition: http_server.c:461
static int http_server_add_segment_callback(u32 client_index, const ssvm_private_t *sp)
Definition: http_server.c:476
static int http_server_session_connected_callback(u32 app_index, u32 api_context, stream_session_t *s, u8 is_fail)
Definition: http_server.c:468
static int http_server_rx_callback(stream_session_t *s)
Definition: http_server.c:365

Definition at line 482 of file http_server.c.

u8* static_http
static

Definition at line 122 of file http_server.c.