summaryrefslogtreecommitdiffstats
path: root/src/plugins/builtinurl/builtins.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-01-26 16:28:58 -0800
committerDamjan Marion <dmarion@me.com>2022-01-27 20:01:18 +0000
commitae0e3e748f04a1fb9ad2393533a164611c417103 (patch)
treed3fcf457d7acc875871baeca63cb6d919427738a /src/plugins/builtinurl/builtins.c
parentaedcfaf80c8a7dd55dc2a7d85a0e9bd0d3d97569 (diff)
http_static: code cleanup
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic8838c8ef558d671740094a98b5a627a18c8c808
Diffstat (limited to 'src/plugins/builtinurl/builtins.c')
-rw-r--r--src/plugins/builtinurl/builtins.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/plugins/builtinurl/builtins.c b/src/plugins/builtinurl/builtins.c
index 04567c0f8c5..4ebcd64888f 100644
--- a/src/plugins/builtinurl/builtins.c
+++ b/src/plugins/builtinurl/builtins.c
@@ -19,8 +19,7 @@
#include <vpp/app/version.h>
int
-handle_get_version (http_builtin_method_type_t reqtype,
- u8 * request, http_session_t * hs)
+handle_get_version (http_req_method_t reqtype, u8 *request, hss_session_t *hs)
{
u8 *s = 0;
@@ -64,8 +63,8 @@ trim_path_from_request (u8 * s, char *path)
}
int
-handle_get_interface_stats (http_builtin_method_type_t reqtype,
- u8 * request, http_session_t * hs)
+handle_get_interface_stats (http_req_method_t reqtype, u8 *request,
+ hss_session_t *hs)
{
u8 *s = 0, *stats = 0;
uword *p;
@@ -81,7 +80,7 @@ handle_get_interface_stats (http_builtin_method_type_t reqtype,
vnet_interface_main_t *im = &vnm->interface_main;
/* Get stats for a single interface via http POST */
- if (reqtype == HTTP_BUILTIN_METHOD_POST)
+ if (reqtype == HTTP_REQ_POST)
{
trim_path_from_request (request, "interface_stats.json");
@@ -143,8 +142,8 @@ out:
}
int
-handle_get_interface_list (http_builtin_method_type_t reqtype,
- u8 * request, http_session_t * hs)
+handle_get_interface_list (http_req_method_t reqtype, u8 *request,
+ hss_session_t *hs)
{
u8 *s = 0;
int i;
@@ -188,14 +187,13 @@ void
builtinurl_handler_init (builtinurl_main_t * bm)
{
- bm->register_handler (handle_get_version, "version.json",
- HTTP_BUILTIN_METHOD_GET);
+ bm->register_handler (handle_get_version, "version.json", HTTP_REQ_GET);
bm->register_handler (handle_get_interface_list, "interface_list.json",
- HTTP_BUILTIN_METHOD_GET);
- bm->register_handler (handle_get_interface_stats,
- "interface_stats.json", HTTP_BUILTIN_METHOD_GET);
- bm->register_handler (handle_get_interface_stats,
- "interface_stats.json", HTTP_BUILTIN_METHOD_POST);
+ HTTP_REQ_GET);
+ bm->register_handler (handle_get_interface_stats, "interface_stats.json",
+ HTTP_REQ_GET);
+ bm->register_handler (handle_get_interface_stats, "interface_stats.json",
+ HTTP_REQ_POST);
}
/*