summaryrefslogtreecommitdiffstats
path: root/lib/includes
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-04-17 13:41:08 +0200
committerMauro Sardara <msardara@cisco.com>2020-04-17 15:06:05 +0200
commit43acd37f52812a152e4ebda9e30598fa226c1d09 (patch)
treebd4dd2a500d4b679224983641515c3ba87c3767b /lib/includes
parent512aa3a8c6f6a370e1b3968af26077e0cd5210e9 (diff)
[HICN-597] Add API to mark packet as interest/data.
Change-Id: I1106211d3cac63d0817d4908bd03d6a0ccd2b8e0 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'lib/includes')
-rw-r--r--lib/includes/hicn/ops.h24
-rw-r--r--lib/includes/hicn/protocol/tcp.h6
2 files changed, 27 insertions, 3 deletions
diff --git a/lib/includes/hicn/ops.h b/lib/includes/hicn/ops.h
index 47795efd5..e8feff92d 100644
--- a/lib/includes/hicn/ops.h
+++ b/lib/includes/hicn/ops.h
@@ -106,6 +106,22 @@ typedef struct hicn_ops_s
const hicn_name_suffix_t * suffix);
/**
+ * @brief Set flag to mark current packet as interest
+ * @param [in] type - hICN packet type
+ * @param [in,out] h - Buffer holding the Interest packet
+ * @return hICN error code
+ */
+ int (*mark_packet_as_interest) (hicn_type_t type, hicn_protocol_t * h);
+
+ /**
+ * @brief Set flag to mark current packet as data
+ * @param [in] type - hICN packet type
+ * @param [in,out] h - Buffer holding the Interest packet
+ * @return hICN error code
+ */
+ int (*mark_packet_as_data) (hicn_type_t type, hicn_protocol_t * h);
+
+ /**
* @brief Clear the necessary Interest fields in order to hash it
* @param [in] type - hICN packet type
* @param [in,out] h - Buffer holding the Interest packet
@@ -438,6 +454,8 @@ typedef struct hicn_ops_s
ATTR_INIT(set_interest_name, protocol ## _set_interest_name), \
ATTR_INIT(get_interest_name_suffix, protocol ## _get_interest_name_suffix), \
ATTR_INIT(set_interest_name_suffix, protocol ## _set_interest_name_suffix), \
+ ATTR_INIT(mark_packet_as_interest, protocol ## _mark_packet_as_interest), \
+ ATTR_INIT(mark_packet_as_data, protocol ## _mark_packet_as_data), \
ATTR_INIT(reset_interest_for_hash, protocol ## _reset_interest_for_hash), \
ATTR_INIT(get_data_locator, protocol ## _get_data_locator), \
ATTR_INIT(set_data_locator, protocol ## _set_data_locator), \
@@ -537,6 +555,12 @@ PAYLOAD (hicn_type_t type, const hicn_protocol_t * h)
#define DECLARE_set_interest_name_suffix(protocol, error) \
int protocol ## _set_interest_name_suffix(hicn_type_t type, hicn_protocol_t * h, const hicn_name_suffix_t * suffix) { return HICN_LIB_ERROR_ ## error ; }
+#define DECLARE_mark_packet_as_interest(protocol, error) \
+ int protocol ## _mark_packet_as_interest(hicn_type_t type, hicn_protocol_t * h) { return HICN_LIB_ERROR_ ## error ; }
+
+#define DECLARE_mark_packet_as_data(protocol, error) \
+ int protocol ## _mark_packet_as_data(hicn_type_t type, hicn_protocol_t * h) { return HICN_LIB_ERROR_ ## error ; }
+
#define DECLARE_reset_interest_for_hash(protocol, error) \
int protocol ## _reset_interest_for_hash(hicn_type_t type, hicn_protocol_t * h) { return HICN_LIB_ERROR_ ## error ; }
diff --git a/lib/includes/hicn/protocol/tcp.h b/lib/includes/hicn/protocol/tcp.h
index ded9a06b2..3a15a93b3 100644
--- a/lib/includes/hicn/protocol/tcp.h
+++ b/lib/includes/hicn/protocol/tcp.h
@@ -143,15 +143,15 @@ static_assert (EXPECTED_TCP_HDRLEN == TCP_HDRLEN,
enum
{
-#define _(f) HICN_TCP_FLAG_BIT_##f,
+#define _(f) TCP_FLAG_BIT_##f,
foreach_tcp_flag
#undef _
- HICN_TCP_N_FLAG_BITS,
+ TCP_N_FLAG_BITS,
};
enum
{
-#define _(f) HICN_TCP_FLAG_##f = 1 << HICN_TCP_FLAG_BIT_##f,
+#define _(f) TCP_FLAG_##f = 1 << TCP_FLAG_BIT_##f,
foreach_tcp_flag
#undef _
};