18 #ifndef __included_http_static_h__ 19 #define __included_http_static_h__ 86 #define _(type, name) type name; 94 u32 vpp_session_index;
95 u64 vpp_session_handle;
151 BVT (clib_bihash) name_to_data;
184 tw_timer_wheel_2t_1w_2048sl_t
tw;
205 u32 private_segment_size,
206 u8 * www_root,
u8 * uri);
209 (
void *fp,
char *url,
int type);
#define foreach_app_session_field
flag for dgram mode
u8 * filename
Name of the file.
u32 node_index
Process node index for event scheduling.
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
http_static_main_t http_static_main
u32 fifo_size
Size of the allocated rx, tx fifos, roughly 8K or so.
u32 data_offset
Current data send offset.
u32 private_segment_size
Private segment size, usually 0.
int debug_level
Enable debug messages.
clib_timebase_t timebase
Time base, so we can generate browser cache control http spew.
u8 * path
Fully-resolved file path.
u32 prealloc_fifos
Number of preallocated fifos, usually 0.
svm_msg_q_t ** vpp_queue
vpp message/event queue
http_static_server_main_t http_static_server_main
u64 cache_size
Current cache size.
int free_data
Need to free data in detach_cache_entry.
vl_api_fib_path_type_t type
u8 * data
Contents of the file, as a u8 * vector.
file_data_cache_t * cache_pool
Unified file data cache pool.
u8 * data
File data, a vector.
http_state_machine_called_from_t
uword * get_url_handlers
Hash tables for built-in GET and POST handlers.
http_session_state_t
Session States.
int http_static_server_enable_api(u32 fifo_size, u32 cache_limit, u32 prealloc_fifos, u32 private_segment_size, u8 *www_root, u8 *uri)
API helper function for vl_api_http_static_enable_t messages.
f64 last_used
Last time the cache entry was used.
u32 ** session_to_http_session
vpp session to http session index map
http_session_t ** sessions
Per thread vector of session pools.
clib_rwlock_t sessions_lock
Session pool reader writer lock.
u32 cache_pool_index
File cache pool index.
u32 app_index
Application index.
u32 my_client_index
API client handle.
Session has sent an HTML response.
void http_static_server_register_builtin_handler(void *fp, char *url, int type)
Register a builtin GET or POST handler.
http_state_machine_called_from_t called_from
state machine called from...
u32 first_index
Cache LRU listheads.
http_builtin_method_type_t
svm_queue_t * vl_input_queue
Server's event queue.
tw_timer_wheel_2t_1w_2048sl_t tw
Session cleanup timer wheel.
u32 next_index
Cache LRU links.
Session has sent an OK response.
int inuse
Reference count, so we don't recycle while referenced.
u8 * uri
The bind URI, defaults to tcp://0.0.0.0/80.
struct _svm_queue svm_queue_t
u64 cache_evictions
Number of cache evictions.
uword * post_url_handlers
In-memory file data cache entry.
u8 * www_root
root path to be served
u64 cache_limit
Max cache size in bytes.