summaryrefslogtreecommitdiffstats
path: root/src/plugins/http_static/http_static.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-01-24 18:46:03 -0800
committerDamjan Marion <dmarion@me.com>2022-01-26 16:54:46 +0000
commit6a4a11f4793781e47baa00c900f78386471a15c1 (patch)
tree210d199b73e3675cb5312fd10761632ec1e243ac /src/plugins/http_static/http_static.h
parent1d88fb97bef7dbe998830ea1eb2f8519c6cc9e97 (diff)
http_static: refactor to use http transport
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I66396a1879eb3c87ef64783eab82a22896413cd0
Diffstat (limited to 'src/plugins/http_static/http_static.h')
-rw-r--r--src/plugins/http_static/http_static.h48
1 files changed, 11 insertions, 37 deletions
diff --git a/src/plugins/http_static/http_static.h b/src/plugins/http_static/http_static.h
index 8ee0f92cd44..bc0d937d21a 100644
--- a/src/plugins/http_static/http_static.h
+++ b/src/plugins/http_static/http_static.h
@@ -66,18 +66,10 @@ typedef enum
typedef enum
{
- CALLED_FROM_RX,
- CALLED_FROM_TX,
- CALLED_FROM_TIMER,
-} http_state_machine_called_from_t;
-
-typedef enum
-{
HTTP_BUILTIN_METHOD_GET = 0,
HTTP_BUILTIN_METHOD_POST,
} http_builtin_method_type_t;
-
/** \brief Application session
*/
typedef struct
@@ -107,8 +99,6 @@ typedef struct
/** File cache pool index */
u32 cache_pool_index;
- /** state machine called from... */
- http_state_machine_called_from_t called_from;
} http_session_t;
/** \brief In-memory file data cache entry
@@ -136,16 +126,11 @@ typedef struct
/** Per thread vector of session pools */
http_session_t **sessions;
/** Session pool reader writer lock */
- clib_rwlock_t sessions_lock;
- /** vpp session to http session index map */
- u32 **session_to_http_session;
+ clib_spinlock_t cache_lock;
/** Enable debug messages */
int debug_level;
- /** vpp message/event queue */
- svm_msg_q_t **vpp_queue;
-
/** Unified file data cache pool */
file_data_cache_t *cache_pool;
/** Hash table which maps file name to file data */
@@ -169,27 +154,17 @@ typedef struct
/** root path to be served */
u8 *www_root;
- /** Server's event queue */
- svm_queue_t *vl_input_queue;
-
- /** API client handle */
- u32 my_client_index;
-
/** Application index */
u32 app_index;
- /** Process node index for event scheduling */
- u32 node_index;
-
/** Cert and key pair for tls */
u32 ckpair_index;
- /** Session cleanup timer wheel */
- tw_timer_wheel_2t_1w_2048sl_t tw;
- clib_spinlock_t tw_lock;
+ vlib_main_t *vlib_main;
- /** Time base, so we can generate browser cache control http spew */
- clib_timebase_t timebase;
+ /*
+ * Config
+ */
/** Number of preallocated fifos, usually 0 */
u32 prealloc_fifos;
@@ -199,15 +174,14 @@ typedef struct
u32 fifo_size;
/** The bind URI, defaults to tcp://0.0.0.0/80 */
u8 *uri;
- vlib_main_t *vlib_main;
-} http_static_server_main_t;
+ /** Threshold for switching to ptr data in http msgs */
+ u32 use_ptr_thresh;
+} hss_main_t;
-extern http_static_server_main_t http_static_server_main;
+extern hss_main_t hss_main;
-int http_static_server_enable_api (u32 fifo_size, u32 cache_limit,
- u32 prealloc_fifos,
- u32 private_segment_size,
- u8 * www_root, u8 * uri);
+int hss_enable_api (u32 fifo_size, u32 cache_limit, u32 prealloc_fifos,
+ u32 private_segment_size, u8 *www_root, u8 *uri);
void http_static_server_register_builtin_handler
(void *fp, char *url, int type);