From 6b94663b2455e212009a544ae23bb6a8c55407f8 Mon Sep 17 00:00:00 2001 From: Luca Muscariello Date: Thu, 9 Jun 2022 21:34:09 +0200 Subject: 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mauro Sardara Co-authored-by: Jordan Augé Co-authored-by: Michele Papalini Co-authored-by: Olivier Roques Co-authored-by: Enrico Loparco Change-Id: Iaddebfe6aa5279ea8553433b0f519578f6b9ccd9 Signed-off-by: Luca Muscariello --- lib/src/protocol/tcp.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'lib/src/protocol/tcp.c') diff --git a/lib/src/protocol/tcp.c b/lib/src/protocol/tcp.c index 8097cfd12..82fc461ea 100644 --- a/lib/src/protocol/tcp.c +++ b/lib/src/protocol/tcp.c @@ -250,6 +250,35 @@ tcp_set_lifetime (hicn_type_t type, hicn_protocol_t *h, return HICN_LIB_ERROR_NONE; } +int +tcp_get_source_port (hicn_type_t type, const hicn_protocol_t *h, + u16 *source_port) +{ + *source_port = ntohs (h->tcp.sport); + return HICN_LIB_ERROR_NONE; +} + +int +tcp_get_dest_port (hicn_type_t type, const hicn_protocol_t *h, u16 *dest_port) +{ + *dest_port = ntohs (h->tcp.dport); + return HICN_LIB_ERROR_NONE; +} + +int +tcp_set_source_port (hicn_type_t type, hicn_protocol_t *h, u16 source_port) +{ + h->tcp.sport = htons (source_port); + return HICN_LIB_ERROR_NONE; +} + +int +tcp_set_dest_port (hicn_type_t type, hicn_protocol_t *h, u16 dest_port) +{ + h->tcp.dport = htons (dest_port); + return HICN_LIB_ERROR_NONE; +} + int tcp_update_checksums (hicn_type_t type, hicn_protocol_t *h, u16 partial_csum, size_t payload_length) -- cgit 1.2.3-korg