From 3476dd9ddecc87d9212c3bf56a5be52079e27def Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Wed, 21 Sep 2022 17:11:22 +0200 Subject: feat: support for new packet format in hicn-light MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ref: HICN-792 Change-Id: I3204006bd2dd2be6504c33035c6578ec0292455a Signed-off-by: Jordan Augé --- lib/src/protocol/new.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'lib/src/protocol/new.c') diff --git a/lib/src/protocol/new.c b/lib/src/protocol/new.c index 5308e8c0a..e86ce4753 100644 --- a/lib/src/protocol/new.c +++ b/lib/src/protocol/new.c @@ -24,13 +24,6 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" -DECLARE_get_ttl (new, UNEXPECTED); -DECLARE_set_ttl (new, UNEXPECTED); -DECLARE_get_src_port (new, UNEXPECTED); -DECLARE_set_src_port (new, UNEXPECTED); -DECLARE_get_dst_port (new, UNEXPECTED); -DECLARE_set_dst_port (new, UNEXPECTED); - int new_init_packet_header (hicn_packet_buffer_t *pkbuf, size_t pos) { @@ -45,8 +38,9 @@ new_init_packet_header (hicn_packet_buffer_t *pkbuf, size_t pos) memset (new, 0, sizeof (_new_header_t)); _set_new_header_version (new); - uint8_t ah_flag = - format.as_u8[pos + 1] == IPPROTO_AH ? HICN_NEW_FLAG_SIG : 0; + uint8_t ah_flag = (HICN_PACKET_FORMAT_GET (format, pos + 1) == IPPROTO_AH) ? + HICN_NEW_FLAG_SIG : + 0; new->flags |= ah_flag; return CALL_CHILD (init_packet_header, pkbuf, pos); @@ -128,6 +122,8 @@ new_get_interest_name (const hicn_packet_buffer_t *pkbuf, size_t pos, return HICN_LIB_ERROR_NONE; } +// XXX never called and thus packet is never initialized as interest +// DECLARE_set_interest_name (udp, UNEXPECTED); int new_set_interest_name (const hicn_packet_buffer_t *pkbuf, size_t pos, const hicn_name_t *name) -- cgit 1.2.3-korg