aboutsummaryrefslogtreecommitdiffstats
path: root/lib/includes/hicn/ops.h
diff options
context:
space:
mode:
authorLuca Muscariello <lumuscar@cisco.com>2022-06-09 21:34:09 +0200
committerLuca Muscariello <muscariello@ieee.org>2022-06-30 10:47:50 +0200
commit6b94663b2455e212009a544ae23bb6a8c55407f8 (patch)
tree0af780ce5eeb1009fd24b8af8af08e8368eda3bd /lib/includes/hicn/ops.h
parenta1ac96f497719b897793ac14b287cb8d840651c1 (diff)
refactor(lib, hicn-light, vpp, hiperf): HICN-723
- move infra data structure into the shared lib - new packet cache using double hashing and lookup on prefix suffix - testing updates - authenticated requests using interest manifests Co-authored-by: Mauro Sardara <msardara@cisco.com> Co-authored-by: Jordan Augé <jordan.auge+fdio@cisco.com> Co-authored-by: Michele Papalini <micpapal@cisco.com> Co-authored-by: Olivier Roques <oroques+fdio@cisco.com> Co-authored-by: Enrico Loparco <eloparco@cisco.com> Change-Id: Iaddebfe6aa5279ea8553433b0f519578f6b9ccd9 Signed-off-by: Luca Muscariello <muscariello@ieee.org>
Diffstat (limited to 'lib/includes/hicn/ops.h')
-rw-r--r--lib/includes/hicn/ops.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/lib/includes/hicn/ops.h b/lib/includes/hicn/ops.h
index e9eebc76c..4efef6523 100644
--- a/lib/includes/hicn/ops.h
+++ b/lib/includes/hicn/ops.h
@@ -257,6 +257,45 @@ typedef struct hicn_ops_s
const hicn_lifetime_t lifetime);
/**
+ * @brief Get the source port of the hicn packet.
+ * @param [in] type - hICN packet type
+ * @param [in] h - Buffer holding the Interest or Data packet
+ * @param [out] source_port - Retrieved source port
+ * @return hICN error code
+ */
+ int (*get_source_port) (hicn_type_t type, const hicn_protocol_t *h,
+ u16 *source_port);
+
+ /**
+ * @brief Get the destination port of the hicn packet.
+ * @param [in] type - hICN packet type
+ * @param [in] h - Buffer holding the Interest or Data packet
+ * @param [out] source_port - Retrieved destination port
+ * @return hICN error code
+ */
+ int (*get_dest_port) (hicn_type_t type, const hicn_protocol_t *h,
+ u16 *dest_port);
+
+ /**
+ * @brief Set the source port of the hicn packet.
+ * @param [in] type - hICN packet type
+ * @param [in] h - Buffer holding the Interest or Data packet
+ * @param [out] source_port - Source port to set
+ * @return hICN error code
+ */
+ int (*set_source_port) (hicn_type_t type, hicn_protocol_t *h,
+ u16 source_port);
+
+ /**
+ * @brief Set the destination port of the hicn packet.
+ * @param [in] type - hICN packet type
+ * @param [in] h - Buffer holding the Interest or Data packet
+ * @param [out] source_port - Destination port to set
+ * @return hICN error code
+ */
+ int (*set_dest_port) (hicn_type_t type, hicn_protocol_t *h, u16 dest_port);
+
+ /**
* @brief Update all checksums in packet headers
* @param [in] type - hICN packet type
* @param [in,out] h - Buffer holding the packet
@@ -540,6 +579,10 @@ typedef struct hicn_ops_s
ATTR_INIT (reset_data_for_hash, protocol##_reset_data_for_hash), \
ATTR_INIT (get_lifetime, protocol##_get_lifetime), \
ATTR_INIT (set_lifetime, protocol##_set_lifetime), \
+ ATTR_INIT (get_source_port, protocol##_get_source_port), \
+ ATTR_INIT (get_dest_port, protocol##_get_dest_port), \
+ ATTR_INIT (set_source_port, protocol##_set_source_port), \
+ ATTR_INIT (set_dest_port, protocol##_set_dest_port), \
ATTR_INIT (update_checksums, protocol##_update_checksums), \
ATTR_INIT (verify_checksums, protocol##_verify_checksums), \
ATTR_INIT (rewrite_interest, protocol##_rewrite_interest), \
@@ -775,6 +818,34 @@ PAYLOAD (hicn_type_t type, const hicn_protocol_t *h)
return HICN_LIB_ERROR_##error; \
}
+#define DECLARE_get_source_port(protocol, error) \
+ int protocol##_get_source_port (hicn_type_t type, const hicn_protocol_t *h, \
+ u16 *source_port) \
+ { \
+ return HICN_LIB_ERROR_##error; \
+ }
+
+#define DECLARE_get_dest_port(protocol, error) \
+ int protocol##_get_dest_port (hicn_type_t type, const hicn_protocol_t *h, \
+ u16 *dest_port) \
+ { \
+ return HICN_LIB_ERROR_##error; \
+ }
+
+#define DECLARE_set_source_port(protocol, error) \
+ int protocol##_set_source_port (hicn_type_t type, hicn_protocol_t *h, \
+ u16 source_port) \
+ { \
+ return HICN_LIB_ERROR_##error; \
+ }
+
+#define DECLARE_set_dest_port(protocol, error) \
+ int protocol##_set_dest_port (hicn_type_t type, hicn_protocol_t *h, \
+ u16 dest_port) \
+ { \
+ return HICN_LIB_ERROR_##error; \
+ }
+
#define DECLARE_update_checksums(protocol, error) \
int protocol##_update_checksums (hicn_type_t type, hicn_protocol_t *h, \
u16 partial_csum, size_t payload_length) \