diff options
Diffstat (limited to 'lib/src/protocol/ipv6.c')
-rw-r--r-- | lib/src/protocol/ipv6.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/lib/src/protocol/ipv6.c b/lib/src/protocol/ipv6.c index 622355294..bf8123497 100644 --- a/lib/src/protocol/ipv6.c +++ b/lib/src/protocol/ipv6.c @@ -99,6 +99,18 @@ ipv6_set_interest_name_suffix (hicn_type_t type, hicn_protocol_t * h, } int +ipv6_mark_packet_as_interest (hicn_type_t type, hicn_protocol_t * h) +{ + return CHILD_OPS (mark_packet_as_interest, type, h); +} + +int +ipv6_mark_packet_as_data (hicn_type_t type, hicn_protocol_t * h) +{ + return CHILD_OPS (mark_packet_as_data, type, h); +} + +int ipv6_reset_interest_for_hash (hicn_type_t type, hicn_protocol_t * h) { /* Sets everything to 0 up to IP destination address */ @@ -208,19 +220,13 @@ ipv6_update_checksums (hicn_type_t type, hicn_protocol_t * h, u16 partial_csum, size_t payload_length) { /* Retrieve payload length if not specified */ - if (payload_length == 0) + if (payload_length == ~0) { int rc = ipv6_get_payload_length (type, h, &payload_length); if (rc < 0) return rc; } - /* Ignore the payload if payload_length = ~0 */ - if (payload_length == ~0) - { - payload_length = 0; - } - /* Build pseudo-header */ ipv6_pseudo_header_t psh; psh.ip_src = h->ipv6.saddr; @@ -246,7 +252,7 @@ ipv6_verify_checksums (hicn_type_t type, hicn_protocol_t * h, u16 partial_csum, size_t payload_length) { /* Retrieve payload length if not specified */ - if (payload_length == 0) + if (payload_length == ~0) { int rc = ipv6_get_payload_length (type, h, &payload_length); if (rc < 0) @@ -264,7 +270,11 @@ ipv6_verify_checksums (hicn_type_t type, hicn_protocol_t * h, pseudo.protocol = h->ipv6.nxt; /* Compute partial checksum based on pseudo-header */ - partial_csum = csum (&pseudo, IPV6_PSHDRLEN, 0); + if (partial_csum != 0) + { + partial_csum = ~partial_csum; + } + partial_csum = csum (&pseudo, IPV6_PSHDRLEN, partial_csum); return CHILD_OPS (verify_checksums, type, h, partial_csum, payload_length); } @@ -284,13 +294,13 @@ ipv6_rewrite_interest (hicn_type_t type, hicn_protocol_t * h, int ipv6_rewrite_data (hicn_type_t type, hicn_protocol_t * h, const ip46_address_t * addr_new, ip46_address_t * addr_old, - const hicn_faceid_t face_id) + const hicn_faceid_t face_id, u8 reset_pl) { // ASSERT(addr_old == NULL); addr_old->ip6 = h->ipv6.daddr; h->ipv6.daddr = addr_new->ip6; - return CHILD_OPS (rewrite_data, type, h, addr_new, addr_old, face_id); + return CHILD_OPS (rewrite_data, type, h, addr_new, addr_old, face_id, reset_pl); } int |