aboutsummaryrefslogtreecommitdiffstats
path: root/lib/includes/hicn/compat.h
diff options
context:
space:
mode:
authorLuca Muscariello <muscariello@ieee.org>2021-04-15 09:05:46 +0200
committerMauro Sardara <msardara@cisco.com>2021-04-15 16:36:16 +0200
commite92e9e839ca2cf42b56322b2489ccc0d8bf767af (patch)
tree9f1647c83a87fbf982ae329e800af25dbfb226b5 /lib/includes/hicn/compat.h
parent3e541d7c947cc2f9db145f26c9274efd29a6fb56 (diff)
[HICN-690] Transport Library Major Refactory
The current patch provides a major refactory of the transportlibrary. A summary of the different components that underwent major modifications is reported below. - Transport protocol updates The hierarchy of classes has been optimized to have common transport services across different transport protocols. This can allow to customize a transport protocol with new features. - A new real-time communication protocol The RTC protocol has been optimized in terms of algorithms to reduce consumer-producer synchronization latency. - A novel socket API The API has been reworked to be easier to consumer but also to have a more efficient integration in L4 proxies. - Several performance improvements A large number of performance improvements have been included in particular to make the entire stack zero-copy and optimize cache miss. - New memory buffer framework Memory management has been reworked entirely to provide a more efficient infra with a richer API. Buffers are now allocated in blocks and a single buffer holds the memory for (1) the shared_ptr control block, (2) the metadata of the packet (e.g. name, pointer to other buffers if buffer is chained and relevant offsets), and (3) the packet itself, as it is sent/received over the network. - A new slab allocator Dynamic memory allocation is now managed by a novel slab allocator that is optimised for packet processing and connection management. Memory is organized in pools of blocks all of the same size which are used during the processing of outgoing/incoming packets. When a memory block Is allocated is always taken from a global pool and when it is deallocated is returned to the pool, thus avoiding the cost of any heap allocation in the data path. - New transport connectors Consumer and producer end-points can communication either using an hicn packet forwarder or with direct connector based on shared memories or sockets. The usage of transport connectors typically for unit and funcitonal testing but may have additional usage. - Support for FEC/ECC for transport services FEC/ECC via reed solomon is supported by default and made available to transport services as a modular component. Reed solomon block codes is a default FEC model that can be replaced in a modular way by many other codes including RLNC not avaiable in this distribution. The current FEC framework support variable size padding and efficiently makes use of the infra memory buffers to avoid additiona copies. - Secure transport framework for signature computation and verification Crypto support is nativelty used in hICN for integrity and authenticity. Novel support that includes RTC has been implemented and made modular and reusable acrosso different transport protocols. - TLS - Transport layer security over hicn Point to point confidentiality is provided by integrating TLS on top of hICN reliable and non-reliable transport. The integration is common and makes a different use of the TLS record. - MLS - Messaging layer security over hicn MLS integration on top of hICN is made by using the MLSPP implemetation open sourced by Cisco. We have included instrumentation tools to deploy performance and functional tests of groups of end-points. - Android support The overall code has been heavily tested in Android environments and has received heavy lifting to better run natively in recent Android OS. Co-authored-by: Mauro Sardara <msardara@cisco.com> Co-authored-by: Michele Papalini <micpapal@cisco.com> Co-authored-by: Olivier Roques <oroques+fdio@cisco.com> Co-authored-by: Giulio Grassi <gigrassi@cisco.com> Change-Id: If477ba2fa686e6f47bdf96307ac60938766aef69 Signed-off-by: Luca Muscariello <muscariello@ieee.org>
Diffstat (limited to 'lib/includes/hicn/compat.h')
-rw-r--r--lib/includes/hicn/compat.h299
1 files changed, 152 insertions, 147 deletions
diff --git a/lib/includes/hicn/compat.h b/lib/includes/hicn/compat.h
index 2796983c6..35b6e6fc5 100644
--- a/lib/includes/hicn/compat.h
+++ b/lib/includes/hicn/compat.h
@@ -34,15 +34,15 @@
/* HICN format options */
#define HFO_INET 1 << 0
#define HFO_INET6 1 << 1
-#define HFO_TCP 1 << 2
+#define HFO_TCP 1 << 2
#define HFO_ICMP 1 << 3
-#define HFO_AH 1 << 4
+#define HFO_AH 1 << 4
#define _is_ipv4(format) ((format & HFO_INET))
#define _is_ipv6(format) ((format & HFO_INET6) >> 1)
-#define _is_tcp(format) ((format & HFO_TCP) >> 2)
-#define _is_icmp(format) ((format & HFO_ICMP) >> 3)
-#define _is_ah(format) ((format & HFO_AH) >> 4)
+#define _is_tcp(format) ((format & HFO_TCP) >> 2)
+#define _is_icmp(format) ((format & HFO_ICMP) >> 3)
+#define _is_ah(format) ((format & HFO_AH) >> 4)
typedef enum
{
@@ -54,28 +54,30 @@ typedef enum
HF_INET_TCP_AH = HFO_INET | HFO_TCP | HFO_AH,
HF_INET6_TCP_AH = HFO_INET6 | HFO_TCP | HFO_AH,
HF_INET_ICMP_AH = HFO_INET | HFO_ICMP | HFO_AH,
- HF_INET6_ICMP_AH = HFO_INET6 | HFO_ICMP | HFO_AH
+ HF_INET6_ICMP_AH = HFO_INET6 | HFO_ICMP | HFO_AH,
} hicn_format_t;
/**
- * Minimum required header length to determine the type and length of a supposed
- * hICN packet.
- * This should be equal to the maximum value over all possible hICN packet
- * formats, and less than the minimum possible IP packet size.
+ * Minimum required header length to determine the type and length of a
+ * supposed hICN packet. This should be equal to the maximum value over all
+ * possible hICN packet formats, and less than the minimum possible IP packet
+ * size.
*/
-#define HICN_V6_MIN_HDR_LEN 6 /* bytes */
-#define HICN_V4_MIN_HDR_LEN 4 /* bytes */
+#define HICN_V6_MIN_HDR_LEN 6 /* bytes */
+#define HICN_V4_MIN_HDR_LEN 4 /* bytes */
-// #define HICN_MIN_HDR_LEN ((HICN_V6_MIN_HDR_LEN > HICN_V4_MIN_HDR_LEN) ? HICN_V6_MIN_HDR_LEN : HICN_V4_MIN_HDR_LEN)
+// #define HICN_MIN_HDR_LEN ((HICN_V6_MIN_HDR_LEN > HICN_V4_MIN_HDR_LEN) ?
+// HICN_V6_MIN_HDR_LEN : HICN_V4_MIN_HDR_LEN)
#define HICN_MIN_HDR_LEN HICN_V6_MIN_HDR_LEN
/**
* @brief Parse packet headers and return hICN format
* @param [in] format - hICN Format
- * @param [in, out] packet - Buffer containing the hICN header to be initialized
+ * @param [in, out] packet - Buffer containing the hICN header to be
+ * initialized
* @return hICN error code
*/
-int hicn_packet_init_header (hicn_format_t format, hicn_header_t * packet);
+int hicn_packet_init_header (hicn_format_t format, hicn_header_t *packet);
/**
* @brief Parse packet headers and return hICN format
@@ -83,8 +85,8 @@ int hicn_packet_init_header (hicn_format_t format, hicn_header_t * packet);
* @param [out] format - hICN format
* @return hICN error code
*/
-int hicn_packet_get_format (const hicn_header_t * packet,
- hicn_format_t * format);
+int hicn_packet_get_format (const hicn_header_t *packet,
+ hicn_format_t *format);
/**
* @brief Update checksums in packet headers
@@ -92,19 +94,18 @@ int hicn_packet_get_format (const hicn_header_t * packet,
* @param [in,out] packet - packet header
* @return hICN error code
*/
-int hicn_packet_compute_checksum (hicn_format_t format,
- hicn_header_t * packet);
+int hicn_packet_compute_checksum (hicn_format_t format, hicn_header_t *packet);
/**
- * @brief compute the checksum of the packet header, adding init_sum to the final value
+ * @brief compute the checksum of the packet header, adding init_sum to the
+ * final value
* @param [in] format - hICN format
* @param [in,out] packet - packet header
* @param [in] init_sum - value to add to the final checksum
* @return hICN error code
*/
int hicn_packet_compute_header_checksum (hicn_format_t format,
- hicn_header_t * packet,
- u16 init_sum);
+ hicn_header_t *packet, u16 init_sum);
/**
* @brief Verify checksums in packet headers
@@ -112,8 +113,9 @@ int hicn_packet_compute_header_checksum (hicn_format_t format,
* @param [in,out] packet - packet header
* @return hICN error code
*/
-int hicn_packet_check_integrity (hicn_format_t format,
- hicn_header_t * packet);
+int hicn_packet_check_integrity_no_payload (hicn_format_t format,
+ hicn_header_t *packet,
+ u16 init_sum);
// this is not accounted here
/**
@@ -123,7 +125,7 @@ int hicn_packet_check_integrity (hicn_format_t format,
* @return hICN error code
*/
int hicn_packet_get_header_length_from_format (hicn_format_t format,
- size_t * header_length);
+ size_t *header_length);
/**
* @brief Return total length of hicn headers (before payload)
@@ -133,8 +135,8 @@ int hicn_packet_get_header_length_from_format (hicn_format_t format,
* @return hICN error code
*/
int hicn_packet_get_header_length (hicn_format_t format,
- const hicn_header_t * packet,
- size_t * header_length);
+ const hicn_header_t *packet,
+ size_t *header_length);
/**
* @brief Return payload length
@@ -144,8 +146,8 @@ int hicn_packet_get_header_length (hicn_format_t format,
* @return hICN error code
*/
int hicn_packet_get_payload_length (hicn_format_t format,
- const hicn_header_t * packet,
- size_t * payload_length);
+ const hicn_header_t *packet,
+ size_t *payload_length);
/**
* @brief Sets payload length
@@ -155,7 +157,7 @@ int hicn_packet_get_payload_length (hicn_format_t format,
* @return hICN error code
*/
int hicn_packet_set_payload_length (hicn_format_t format,
- hicn_header_t * packet,
+ hicn_header_t *packet,
const size_t payload_length);
/**
@@ -164,8 +166,8 @@ int hicn_packet_set_payload_length (hicn_format_t format,
* @param [in] packet_2 - Second packet
* @return 0 if both packets are considered equal, any other value otherwise.
*/
-int hicn_packet_compare (const hicn_header_t * packet1,
- const hicn_header_t * packet2);
+int hicn_packet_compare (const hicn_header_t *packet1,
+ const hicn_header_t *packet2);
/**
* @brief Retrieve the name of an interest/data packet
@@ -176,8 +178,8 @@ int hicn_packet_compare (const hicn_header_t * packet1,
* data packet (0)
* @return hICN error code
*/
-int hicn_packet_get_name (hicn_format_t format, const hicn_header_t * packet,
- hicn_name_t * name, u8 is_interest);
+int hicn_packet_get_name (hicn_format_t format, const hicn_header_t *packet,
+ hicn_name_t *name, u8 is_interest);
/**
* @brief Sets the name of an interest/data packet
@@ -188,8 +190,8 @@ int hicn_packet_get_name (hicn_format_t format, const hicn_header_t * packet,
* data packet (0)
* @return hICN error code
*/
-int hicn_packet_set_name (hicn_format_t format, hicn_header_t * packet,
- const hicn_name_t * name, u8 is_interest);
+int hicn_packet_set_name (hicn_format_t format, hicn_header_t *packet,
+ const hicn_name_t *name, u8 is_interest);
/**
* @brief Sets the payload of a packet
@@ -203,8 +205,8 @@ int hicn_packet_set_name (hicn_format_t format, hicn_header_t * packet,
* - The buffer holding payload is assumed sufficiently large
* - This function updates header fields with the new length, but no checksum.
*/
-int hicn_packet_set_payload (hicn_format_t format, hicn_header_t * packet,
- const u8 * payload, u16 payload_length);
+int hicn_packet_set_payload (hicn_format_t format, hicn_header_t *packet,
+ const u8 *payload, u16 payload_length);
/**
* @brief Retrieves the payload of a packet
@@ -212,16 +214,17 @@ int hicn_packet_set_payload (hicn_format_t format, hicn_header_t * packet,
* @param [in] packet - packet header
* @param [out] payload - pointer to buffer for storing the result
* @param [out] payload_length - size of the retreived payload
- * @param [in] hard_copy - Flag : if true (eg. 1), a copy of the payload is made
- * into the payload buffer, otherwise (0) the pointer is changed to point to the payload offset in the packet.
+ * @param [in] hard_copy - Flag : if true (eg. 1), a copy of the payload is
+ * made into the payload buffer, otherwise (0) the pointer is changed to point
+ * to the payload offset in the packet.
* @return hICN error code
*
* NOTE:
* - The buffer holding payload is assumed sufficiently large
*/
-int hicn_packet_get_payload (hicn_format_t format,
- const hicn_header_t * packet, u8 ** payload,
- size_t * payload_size, bool hard_copy);
+int hicn_packet_get_payload (hicn_format_t format, const hicn_header_t *packet,
+ u8 **payload, size_t *payload_size,
+ bool hard_copy);
/**
* @brief Retrieve the locator of an interest / data packet
@@ -232,9 +235,8 @@ int hicn_packet_get_payload (hicn_format_t format,
* data packet (0)
* @return hICN error code
*/
-int hicn_packet_get_locator (hicn_format_t format,
- const hicn_header_t * packet,
- ip_address_t * prefix, bool is_interest);
+int hicn_packet_get_locator (hicn_format_t format, const hicn_header_t *packet,
+ ip_address_t *prefix, bool is_interest);
/**
* @brief Sets the locator of an interest / data packet
@@ -245,9 +247,8 @@ int hicn_packet_get_locator (hicn_format_t format,
* data packet (0)
* @return hICN error code
*/
-int hicn_packet_set_locator (hicn_format_t format, hicn_header_t * packet,
- const ip_address_t * prefix,
- bool is_interest);
+int hicn_packet_set_locator (hicn_format_t format, hicn_header_t *packet,
+ const ip_address_t *prefix, bool is_interest);
/**
* @brief Retrieves the signature size
@@ -257,8 +258,8 @@ int hicn_packet_set_locator (hicn_format_t format, hicn_header_t * packet,
* @return hICN error code
*/
int hicn_packet_get_signature_size (hicn_format_t format,
- const hicn_header_t * packet,
- size_t * bytes);
+ const hicn_header_t *packet,
+ size_t *bytes);
/**
* @brief Sets the signature size
@@ -268,7 +269,7 @@ int hicn_packet_get_signature_size (hicn_format_t format,
* @return hICN error code
*/
int hicn_packet_set_signature_size (hicn_format_t format,
- hicn_header_t * packet, size_t bytes);
+ hicn_header_t *packet, size_t bytes);
/**
* @brief Sets the signature size
@@ -278,7 +279,7 @@ int hicn_packet_set_signature_size (hicn_format_t format,
* @return hICN error code
*/
int hicn_packet_set_signature_timestamp (hicn_format_t format,
- hicn_header_t * h,
+ hicn_header_t *h,
uint64_t signature_timestamp);
/**
@@ -289,8 +290,8 @@ int hicn_packet_set_signature_timestamp (hicn_format_t format,
* @return hICN error code
*/
int hicn_packet_get_signature_timestamp (hicn_format_t format,
- const hicn_header_t * h,
- uint64_t * signature_timestamp);
+ const hicn_header_t *h,
+ uint64_t *signature_timestamp);
/**
* @brief Sets the signature size
@@ -300,7 +301,7 @@ int hicn_packet_get_signature_timestamp (hicn_format_t format,
* @return hICN error code
*/
int hicn_packet_set_validation_algorithm (hicn_format_t format,
- hicn_header_t * h,
+ hicn_header_t *h,
uint8_t validation_algorithm);
/**
@@ -311,8 +312,8 @@ int hicn_packet_set_validation_algorithm (hicn_format_t format,
* @return hICN error code
*/
int hicn_packet_get_validation_algorithm (hicn_format_t format,
- const hicn_header_t * h,
- uint8_t * validation_algorithm);
+ const hicn_header_t *h,
+ uint8_t *validation_algorithm);
/**
* @brief Sets the signature size
@@ -321,8 +322,8 @@ int hicn_packet_get_validation_algorithm (hicn_format_t format,
* @param [in] key_id - Key id to set
* @return hICN error code
*/
-int hicn_packet_set_key_id (hicn_format_t format, hicn_header_t * h,
- uint8_t * key_id);
+int hicn_packet_set_key_id (hicn_format_t format, hicn_header_t *h,
+ uint8_t *key_id);
/**
* @brief Sets the signature size
@@ -331,8 +332,8 @@ int hicn_packet_set_key_id (hicn_format_t format, hicn_header_t * h,
* @param [out] key_id - Retrieved key id
* @return hICN error code
*/
-int hicn_packet_get_key_id (hicn_format_t format, hicn_header_t * h,
- uint8_t ** key_id, uint8_t * key_id_length);
+int hicn_packet_get_key_id (hicn_format_t format, hicn_header_t *h,
+ uint8_t **key_id, uint8_t *key_id_length);
/**
* @brief Retrieves the packet hop limit
@@ -340,7 +341,7 @@ int hicn_packet_get_key_id (hicn_format_t format, hicn_header_t * h,
* @param [out] hops - Retrieved hop limit
* @return hICN error code
*/
-int hicn_packet_get_hoplimit (const hicn_header_t * packet, u8 * hops);
+int hicn_packet_get_hoplimit (const hicn_header_t *packet, u8 *hops);
/**
* @brief Sets the packet hop limit
@@ -348,107 +349,111 @@ int hicn_packet_get_hoplimit (const hicn_header_t * packet, u8 * hops);
* @param [in] hops - Hop limit to set
* @return hICN error code
*/
-int hicn_packet_set_hoplimit (hicn_header_t * packet, u8 hops);
+int hicn_packet_set_hoplimit (hicn_header_t *packet, u8 hops);
-int hicn_packet_copy_header (hicn_format_t format,
- const hicn_header_t * packet,
- hicn_header_t * destination, bool copy_ah);
+int hicn_packet_copy_header (hicn_format_t format, const hicn_header_t *packet,
+ hicn_header_t *destination, bool copy_ah);
-int hicn_packet_get_lifetime (const hicn_header_t * packet, u32 * lifetime);
-int hicn_packet_set_lifetime (hicn_header_t * packet, u32 lifetime);
-int hicn_packet_get_reserved_bits (const hicn_header_t * packet,
- u8 * reserved_bits);
-int hicn_packet_set_reserved_bits (hicn_header_t * packet,
+int hicn_packet_get_lifetime (const hicn_header_t *packet, u32 *lifetime);
+int hicn_packet_set_lifetime (hicn_header_t *packet, u32 lifetime);
+int hicn_packet_get_reserved_bits (const hicn_header_t *packet,
+ u8 *reserved_bits);
+int hicn_packet_set_reserved_bits (hicn_header_t *packet,
const u8 reserved_bits);
-int hicn_packet_get_payload_type (const hicn_header_t * packet,
- hicn_payload_type_t * payload_type);
-int hicn_packet_set_payload_type (hicn_header_t * packet,
+int hicn_packet_get_payload_type (const hicn_header_t *packet,
+ hicn_payload_type_t *payload_type);
+int hicn_packet_set_payload_type (hicn_header_t *packet,
const hicn_payload_type_t payload_type);
-int hicn_packet_set_syn (hicn_header_t * packet);
-int hicn_packet_reset_syn (hicn_header_t * packet);
-int hicn_packet_test_syn (const hicn_header_t * packet, bool * flag);
-int hicn_packet_set_ack (hicn_header_t * packet);
-int hicn_packet_reset_ack (hicn_header_t * packet);
-int hicn_packet_test_ack (const hicn_header_t * packet, bool * flag);
-int hicn_packet_set_rst (hicn_header_t * packet);
-int hicn_packet_reset_rst (hicn_header_t * packet);
-int hicn_packet_test_rst (const hicn_header_t * packet, bool * flag);
-int hicn_packet_set_fin (hicn_header_t * packet);
-int hicn_packet_reset_fin (hicn_header_t * packet);
-int hicn_packet_test_fin (const hicn_header_t * packet, bool * flag);
-int hicn_packet_set_ece (hicn_header_t * packet);
-int hicn_packet_reset_ece (hicn_header_t * packet);
-int hicn_packet_test_ece (const hicn_header_t * packet, bool * flag);
-
-int hicn_packet_set_src_port (hicn_header_t * packet, u16 src_port);
-int hicn_packet_get_src_port (const hicn_header_t * packet, u16 * src_port);
-int hicn_packet_set_dst_port (hicn_header_t * packet, u16 dst_port);
-int hicn_packet_get_dst_port (const hicn_header_t * packet, u16 * dst_port);
-int hicn_packet_get_signature (hicn_format_t format, hicn_header_t * packet,
- uint8_t ** sign_buf);
+int hicn_packet_set_syn (hicn_format_t format, hicn_header_t *packet);
+int hicn_packet_reset_syn (hicn_format_t format, hicn_header_t *packet);
+int hicn_packet_test_syn (hicn_format_t format, const hicn_header_t *packet,
+ bool *flag);
+int hicn_packet_set_ack (hicn_format_t format, hicn_header_t *packet);
+int hicn_packet_reset_ack (hicn_format_t format, hicn_header_t *packet);
+int hicn_packet_test_ack (hicn_format_t format, const hicn_header_t *packet,
+ bool *flag);
+int hicn_packet_set_rst (hicn_format_t format, hicn_header_t *packet);
+int hicn_packet_reset_rst (hicn_format_t format, hicn_header_t *packet);
+int hicn_packet_test_rst (hicn_format_t format, const hicn_header_t *packet,
+ bool *flag);
+int hicn_packet_set_fin (hicn_format_t format, hicn_header_t *packet);
+int hicn_packet_reset_fin (hicn_format_t format, hicn_header_t *packet);
+int hicn_packet_test_fin (hicn_format_t format, const hicn_header_t *packet,
+ bool *flag);
+int hicn_packet_set_ece (hicn_format_t format, hicn_header_t *packet);
+int hicn_packet_reset_ece (hicn_format_t format, hicn_header_t *packet);
+int hicn_packet_test_ece (hicn_format_t format, const hicn_header_t *packet,
+ bool *flag);
+
+int hicn_packet_set_src_port (hicn_format_t format, hicn_header_t *packet,
+ u16 src_port);
+int hicn_packet_get_src_port (hicn_format_t format,
+ const hicn_header_t *packet, u16 *src_port);
+int hicn_packet_set_dst_port (hicn_format_t format, hicn_header_t *packet,
+ u16 dst_port);
+int hicn_packet_get_dst_port (hicn_format_t format,
+ const hicn_header_t *packet, u16 *dst_port);
+int hicn_packet_get_signature (hicn_format_t format, hicn_header_t *packet,
+ uint8_t **sign_buf);
/* Interest */
int hicn_interest_get_name (hicn_format_t format,
- const hicn_header_t * interest,
- hicn_name_t * name);
-int hicn_interest_set_name (hicn_format_t format, hicn_header_t * interest,
- const hicn_name_t * name);
+ const hicn_header_t *interest, hicn_name_t *name);
+int hicn_interest_set_name (hicn_format_t format, hicn_header_t *interest,
+ const hicn_name_t *name);
int hicn_interest_get_locator (hicn_format_t format,
- const hicn_header_t * interest,
- ip_address_t * prefix);
-int hicn_interest_set_locator (hicn_format_t format, hicn_header_t * interest,
- const ip_address_t * prefix);
-int hicn_interest_compare (const hicn_header_t * interest_1,
- const hicn_header_t * interest_2);
-int hicn_interest_set_lifetime (hicn_header_t * interest, u32 lifetime);
-int hicn_interest_get_lifetime (const hicn_header_t * interest,
- u32 * lifetime);
+ const hicn_header_t *interest,
+ ip_address_t *prefix);
+int hicn_interest_set_locator (hicn_format_t format, hicn_header_t *interest,
+ const ip_address_t *prefix);
+int hicn_interest_compare (const hicn_header_t *interest_1,
+ const hicn_header_t *interest_2);
+int hicn_interest_set_lifetime (hicn_header_t *interest, u32 lifetime);
+int hicn_interest_get_lifetime (const hicn_header_t *interest, u32 *lifetime);
int hicn_interest_get_header_length (hicn_format_t format,
- const hicn_header_t * interest,
- size_t * header_length);
+ const hicn_header_t *interest,
+ size_t *header_length);
int hicn_interest_get_payload_length (hicn_format_t format,
- const hicn_header_t * interest,
- size_t * payload_length);
-int hicn_interest_set_payload (hicn_format_t format, hicn_header_t * interest,
- const u8 * payload, size_t payload_length);
+ const hicn_header_t *interest,
+ size_t *payload_length);
+int hicn_interest_set_payload (hicn_format_t format, hicn_header_t *interest,
+ const u8 *payload, size_t payload_length);
int hicn_interest_get_payload (hicn_format_t format,
- const hicn_header_t * interest, u8 ** payload,
- size_t * payload_size, bool hard_copy);
-int hicn_interest_reset_for_hash (hicn_format_t format,
- hicn_header_t * packet);
+ const hicn_header_t *interest, u8 **payload,
+ size_t *payload_size, bool hard_copy);
+int hicn_interest_reset_for_hash (hicn_format_t format, hicn_header_t *packet);
/* Data */
-int hicn_data_get_name (hicn_format_t format, const hicn_header_t * data,
- hicn_name_t * name);
-int hicn_data_set_name (hicn_format_t format, hicn_header_t * data,
- const hicn_name_t * name);
-int hicn_data_get_locator (hicn_format_t format, const hicn_header_t * data,
- ip_address_t * prefix);
-int hicn_data_set_locator (hicn_format_t format, hicn_header_t * data,
- const ip_address_t * prefix);
-int hicn_data_compare (const hicn_header_t * data_1,
- const hicn_header_t * data_2);
-int hicn_data_get_expiry_time (const hicn_header_t * data, u32 * expiry_time);
-int hicn_data_set_expiry_time (hicn_header_t * data, u32 expiry_time);
-int hicn_data_get_header_length (hicn_format_t format, hicn_header_t * data,
- size_t * header_length);
+int hicn_data_get_name (hicn_format_t format, const hicn_header_t *data,
+ hicn_name_t *name);
+int hicn_data_set_name (hicn_format_t format, hicn_header_t *data,
+ const hicn_name_t *name);
+int hicn_data_get_locator (hicn_format_t format, const hicn_header_t *data,
+ ip_address_t *prefix);
+int hicn_data_set_locator (hicn_format_t format, hicn_header_t *data,
+ const ip_address_t *prefix);
+int hicn_data_compare (const hicn_header_t *data_1,
+ const hicn_header_t *data_2);
+int hicn_data_get_expiry_time (const hicn_header_t *data, u32 *expiry_time);
+int hicn_data_set_expiry_time (hicn_header_t *data, u32 expiry_time);
+int hicn_data_get_header_length (hicn_format_t format, hicn_header_t *data,
+ size_t *header_length);
int hicn_data_get_payload_length (hicn_format_t format,
- const hicn_header_t * data,
- size_t * payload_length);
-int hicn_data_get_path_label (const hicn_header_t * data, u32 * path_label);
-int hicn_data_set_path_label (hicn_header_t * data, u32 path_label);
-int hicn_data_get_payload (hicn_format_t format, const hicn_header_t * data,
- u8 ** payload, size_t * payload_size,
- bool hard_copy);
-int hicn_data_set_payload (hicn_format_t format, hicn_header_t * data,
- const u8 * payload, size_t payload_length);
-int hicn_data_get_payload_type (const hicn_header_t * data,
- hicn_payload_type_t * payload_type);
-int hicn_data_set_payload_type (hicn_header_t * data,
+ const hicn_header_t *data,
+ size_t *payload_length);
+int hicn_data_get_path_label (const hicn_header_t *data, u32 *path_label);
+int hicn_data_set_path_label (hicn_header_t *data, u32 path_label);
+int hicn_data_get_payload (hicn_format_t format, const hicn_header_t *data,
+ u8 **payload, size_t *payload_size, bool hard_copy);
+int hicn_data_set_payload (hicn_format_t format, hicn_header_t *data,
+ const u8 *payload, size_t payload_length);
+int hicn_data_get_payload_type (const hicn_header_t *data,
+ hicn_payload_type_t *payload_type);
+int hicn_data_set_payload_type (hicn_header_t *data,
hicn_payload_type_t payload_type);
-int hicn_data_reset_for_hash (hicn_format_t format, hicn_header_t * packet);
+int hicn_data_reset_for_hash (hicn_format_t format, hicn_header_t *packet);
#endif /* HICN_COMPAT_H */