diff options
author | Florin Coras <fcoras@cisco.com> | 2022-01-28 15:26:39 -0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2022-01-30 14:44:40 +0000 |
commit | fdb5a5a0e4aad887add68985191be114dcc99e38 (patch) | |
tree | 38c0284819e8967d2e1a3d173b2884faa5e9c2ab /src/plugins/http_static/http_static.h | |
parent | ffd7a9876e5038ad96af1d5dbbb0283c5fe6ab27 (diff) |
http_static: incorporate builtinurl plugin
External handlers can still be registered via hss_register_url_handler
but url handlers must be enabled when server is created.
builtinurl plugin to be removed in a future patch
Type: refactor
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I94e103d908b9e118c7927b997a21ce3f67809889
Diffstat (limited to 'src/plugins/http_static/http_static.h')
-rw-r--r-- | src/plugins/http_static/http_static.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/http_static/http_static.h b/src/plugins/http_static/http_static.h index a1eaa6e1144..05d6ee05a4c 100644 --- a/src/plugins/http_static/http_static.h +++ b/src/plugins/http_static/http_static.h @@ -67,9 +67,10 @@ typedef struct int inuse; } hss_cache_entry_t; +typedef int (*hss_url_handler_t) (http_req_method_t, u8 *, hss_session_t *); + /** \brief Main data structure */ - typedef struct { /** Per thread vector of session pools */ @@ -127,14 +128,20 @@ typedef struct u8 *uri; /** Threshold for switching to ptr data in http msgs */ u32 use_ptr_thresh; + /** Enable the use of builtinurls */ + u8 enable_url_handlers; } hss_main_t; extern hss_main_t hss_main; int hss_create (vlib_main_t *vm); -void http_static_server_register_builtin_handler (void *fp, char *url, - http_req_method_t type); +/** + * Register a GET or POST URL handler + */ +void hss_register_url_handler (hss_url_handler_t fp, const char *url, + http_req_method_t type); +void hss_builtinurl_json_handlers_init (void); #endif /* __included_http_static_h__ */ |