aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/punt.h
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2021-02-05 15:40:00 +0100
committerNeale Ranns <neale@graphiant.com>2021-03-14 14:37:01 +0000
commit45723b8d305c7c6d034e16fcbf1904fd72dd6bb2 (patch)
treebb010ccd464efcfb90ccfabddded7b63b8223e6a /src/vlib/punt.h
parent4e3f7b2869925b0812a58d04c4bf6371e6773630 (diff)
ip: extend punt CLI for exception packets
Change-Id: I20e48a5ac8068eccb8d998346d35227c4802bb68 Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: feature
Diffstat (limited to 'src/vlib/punt.h')
-rw-r--r--src/vlib/punt.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/vlib/punt.h b/src/vlib/punt.h
index d93b5eac599..ce949421dad 100644
--- a/src/vlib/punt.h
+++ b/src/vlib/punt.h
@@ -31,8 +31,8 @@ typedef enum vlib_punt_reason_t_
/**
* Walk each punt reason
*/
-typedef int (*punt_reason_walk_cb_t) (vlib_punt_reason_t id,
- const u8 * name, void *ctx);
+typedef int (*punt_reason_walk_cb_t) (vlib_punt_reason_t id, const u8 *name,
+ void *ctx);
extern void punt_reason_walk (punt_reason_walk_cb_t cb, void *cxt);
@@ -42,6 +42,11 @@ extern void punt_reason_walk (punt_reason_walk_cb_t cb, void *cxt);
extern u8 *format_vlib_punt_reason (u8 * s, va_list * args);
/**
+ * @brief Unformat a punt reason
+ */
+extern uword unformat_punt_reason (unformat_input_t *input, va_list *args);
+
+/**
* Typedef for a client handle
*/
typedef int vlib_punt_hdl_t;
@@ -61,14 +66,18 @@ typedef void (*punt_interested_listener_t) (vlib_enable_or_disable_t i,
/**
* Allocate a new punt reason
- * @param fn - A callback to invoke when an entity becomes [un]interested
- * in the punt code.
- * @param data - To be passed in the callback function.
+ * @param fn - A callback to invoke when an entity becomes
+ * [un]interested in the punt code.
+ * @param data - To be passed in the callback function.
+ * @param flags - flags associated with the punt reason
+ * @param flags_format - formatting function to display those flags (may be
+ * NULL)
*/
extern int vlib_punt_reason_alloc (vlib_punt_hdl_t client,
const char *reason_name,
- punt_interested_listener_t fn,
- void *data, vlib_punt_reason_t * reason);
+ punt_interested_listener_t fn, void *data,
+ vlib_punt_reason_t *reason, u32 flags,
+ format_function_t *flags_format);
/**
* Validate that a punt reason is assigned
@@ -87,6 +96,8 @@ extern int vlib_punt_register (vlib_punt_hdl_t client,
extern int vlib_punt_unregister (vlib_punt_hdl_t client,
vlib_punt_reason_t pr, const char *node);
+extern u32 vlib_punt_reason_get_flags (vlib_punt_reason_t pr);
+
/**
* FOR USE IN THE DP ONLY
*
er */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Minimal makefile for Sphinx documentation
#
# We support MacOS for docs generation
ifeq ($(shell uname),Darwin)
OS_ID = darwin
endif

# Work out the OS if we haven't already
OS_ID ?= $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')

DOC_DEB_DEPENDS = enchant libenchant-dev
DOC_RPM_DEPENDS = enchant libenchant-dev


# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
SPHINXPROJ    = fdio-vpp
SOURCEDIR     = .
BUILDDIR      = _build

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
	@echo "Checking whether dependencies for Docs are installed..."
ifeq ($(OS_ID),ubuntu)
	@set -e; inst=; \
		for i in $(DOC_DEB_DEPENDS); do \
			dpkg-query --show $$i >/dev/null 2>&1 || inst="$$inst $$i"; \
		done; \
		if [ "$$inst" ]; then \
			sudo apt-get update; \
			sudo apt-get $(CONFIRM) $(FORCE) install $$inst; \
		fi
else ifneq ("$(wildcard /etc/redhat-release)","")
	@sudo yum install $(CONFIRM) $(DOC_RPM_DEPENDS)
endif
# Disable spell checking for now
#	@python3 -m pip install sphinxcontrib-spelling
#	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" -W -b spelling  $(O)
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)