aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/format.h
diff options
context:
space:
mode:
authorKlement Sekera <klement.sekera@gmail.com>2024-04-02 12:51:10 +0200
committerMatthew Smith <mgsmith@netgate.com>2024-04-05 14:03:40 +0000
commite8fb3cfe892ca1c562d63eb8854386180a297d80 (patch)
treed98966ff14eaf33cbc4166a303ff40121597700a /src/vppinfra/format.h
parent37d8c185b8902d9c69859160aee6e34ec72062fd (diff)
api: fix [un]formatting in vpp/api/types.c
vl_api_prefix_t.len is 1 byte only, but unformat %d writes 4 bytes add helper functions unformat_u(8|16) which don't write more than appropriate amount of bytes fix other similar errors in vpp/api/types.c Type: fix Change-Id: I74a61a377147c373f8c25ed083052b2287763c39 Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Diffstat (limited to 'src/vppinfra/format.h')
-rw-r--r--src/vppinfra/format.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vppinfra/format.h b/src/vppinfra/format.h
index 24511735a53..a1a70a2d64f 100644
--- a/src/vppinfra/format.h
+++ b/src/vppinfra/format.h
@@ -276,6 +276,12 @@ unformat_init_cstring (unformat_input_t * input, char *string)
/* Setup for unformat of given vector string; vector will be freed by unformat_string. */
void unformat_init_vector (unformat_input_t * input, u8 * vector_string);
+/* Unformat u8 */
+unformat_function_t unformat_u8;
+
+/* Unformat u16 */
+unformat_function_t unformat_u16;
+
/* Format function for unformat input usable when an unformat error
has occurred. */
u8 *format_unformat_error (u8 * s, va_list * va);