From 7560918629eb11aa7bdaee5f4856243b38c77f93 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 16 Jan 2023 20:18:23 +0000 Subject: feat: local-remote strategy Ticket: HICN-824 Change-Id: Iea285cb499b13c943a142fa39328ee36c91ae913 Signed-off-by: Mauro Sardara --- hicn-plugin/src/faces/face.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'hicn-plugin/src/faces/face.h') diff --git a/hicn-plugin/src/faces/face.h b/hicn-plugin/src/faces/face.h index e4b759bec..5ebec216c 100644 --- a/hicn-plugin/src/faces/face.h +++ b/hicn-plugin/src/faces/face.h @@ -692,6 +692,23 @@ hicn_face_ip6_add_and_lock (hicn_face_id_t *index, u8 *hicnb_flags, return ret; } +/** + * @brief Check if a face is an application face + * + * @param face_id: The id of the face + * @return 1 if application face, 0 otherwise + */ +always_inline int +hicn_face_is_local (hicn_face_id_t face_id) +{ + hicn_face_t *face; + face = hicn_dpoi_get_from_idx (face_id); + ASSERT (face != NULL); + + return face->flags & HICN_FACE_FLAGS_APPFACE_PROD || + face->flags & HICN_FACE_FLAGS_APPFACE_CONS; +} + #endif // __HICN_FACE_H__ /* -- cgit 1.2.3-korg