From ab38321508d886f0acd535f0f5f07a3d44e29591 Mon Sep 17 00:00:00 2001 From: "Enrico Loparco (eloparco)" Date: Wed, 14 Sep 2022 08:58:55 +0000 Subject: feat(hicn-ping): allow usage of random prefixes/suffixes in hicn-ping Ref: HICN-783 Signed-off-by: Enrico Loparco (eloparco) Change-Id: I41c804dd639ee15aee9619732f55e39a3baf1385 --- lib/includes/hicn/name.h | 3 +++ lib/src/name.c | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'lib') diff --git a/lib/includes/hicn/name.h b/lib/includes/hicn/name.h index 895b86341..a1b8e1fc1 100644 --- a/lib/includes/hicn/name.h +++ b/lib/includes/hicn/name.h @@ -270,6 +270,9 @@ bool hicn_name_is_v4 (const hicn_name_t *name); int hicn_name_snprintf (char *s, size_t size, const hicn_name_t *name); +int hicn_name_no_suffix_snprintf (char *s, size_t size, + const hicn_name_t *name); + int hicn_name_cmp (const hicn_name_t *n1, const hicn_name_t *n2); bool hicn_name_equals (const hicn_name_t *n1, const hicn_name_t *n2); diff --git a/lib/src/name.c b/lib/src/name.c index 04c48cb4d..1c933d466 100644 --- a/lib/src/name.c +++ b/lib/src/name.c @@ -241,6 +241,12 @@ hicn_name_snprintf (char *s, size_t size, const hicn_name_t *name) return rc + n; } +int +hicn_name_no_suffix_snprintf (char *s, size_t size, const hicn_name_t *name) +{ + return hicn_ip_address_snprintf (s, size, &name->prefix); +} + int hicn_prefix_create_from_ip_prefix (const hicn_ip_prefix_t *hicn_ip_prefix, hicn_prefix_t *prefix) -- cgit 1.2.3-korg