diff options
author | Michele Papalini <micpapal@cisco.com> | 2023-02-10 09:18:29 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2023-02-10 09:18:29 +0000 |
commit | f0c5b3f6a6ba79eacb29552522e30cfaa2b125c3 (patch) | |
tree | c178c342ae1a6f344eb56871ccdc72e6dfd300d4 /hicn-plugin/src/faces/face.h | |
parent | e831c121d672b9d15cdf0eaa86ce1dd5a8ce86d8 (diff) | |
parent | bdb0e36e9b740c80dfdd39c0d144e66699de8a14 (diff) |
Merge "feat(hicn-plugin): specify the dpo_proto when creating a new face" into stable/2210
Diffstat (limited to 'hicn-plugin/src/faces/face.h')
-rw-r--r-- | hicn-plugin/src/faces/face.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/hicn-plugin/src/faces/face.h b/hicn-plugin/src/faces/face.h index b23cb9b12..2c0a09a28 100644 --- a/hicn-plugin/src/faces/face.h +++ b/hicn-plugin/src/faces/face.h @@ -453,7 +453,7 @@ hicn_face_get_with_dpo (const ip46_address_t *addr, u32 sw_if, * reachable ip address, otherwise HICN_ERROR_NONE */ int hicn_face_add (const dpo_id_t *dpo_nh, ip46_address_t *nat_address, - int sw_if, hicn_face_id_t *pfaceid); + int sw_if, hicn_face_id_t *pfaceid, dpo_proto_t dpo_proto); /** * @brief Create a new incomplete face ip. (Meant to be used by the data plane) @@ -524,6 +524,7 @@ hicn_face_ip4_find (hicn_face_id_t *index, u8 *hicnb_flags, u32 node_index) { int ret = HICN_ERROR_FACE_NOT_FOUND; + hicn_face_id_t face_id; /*All (complete) faces are indexed by remote addess as well */ /* if the face exists, it adds a lock */ @@ -533,11 +534,13 @@ hicn_face_ip4_find (hicn_face_id_t *index, u8 *hicnb_flags, if (face != NULL) { /* unlock the face. We don't take a lock on each interest we receive */ - hicn_face_id_t face_id = hicn_dpoi_get_index (face); + face_id = hicn_dpoi_get_index (face); hicn_face_unlock_with_id (face_id); - ret = HICN_ERROR_FACE_ALREADY_CREATED; + *hicnb_flags = HICN_BUFFER_FLAGS_DEFAULT; - *index = hicn_dpoi_get_index (face); + *index = face_id; + + ret = HICN_ERROR_FACE_ALREADY_CREATED; } return ret; @@ -621,6 +624,7 @@ hicn_face_ip6_find (hicn_face_id_t *index, u8 *hicnb_flags, u32 node_index) { int ret = HICN_ERROR_FACE_NOT_FOUND; + hicn_face_id_t face_id; hicn_face_t *face = hicn_face_get ((const ip46_address_t *) nat_addr, sw_if, &hicn_face_hashtb, adj_index); @@ -628,11 +632,12 @@ hicn_face_ip6_find (hicn_face_id_t *index, u8 *hicnb_flags, if (face != NULL) { /* unlock the face. We don't take a lock on each interest we receive */ - hicn_face_id_t face_id = hicn_dpoi_get_index (face); + face_id = hicn_dpoi_get_index (face); hicn_face_unlock_with_id (face_id); - ret = HICN_ERROR_FACE_ALREADY_CREATED; *hicnb_flags = HICN_BUFFER_FLAGS_DEFAULT; - *index = hicn_dpoi_get_index (face); + *index = face_id; + + ret = HICN_ERROR_FACE_ALREADY_CREATED; } return ret; |