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é --- libtransport/includes/hicn/transport/core/io_module.h | 2 +- libtransport/includes/hicn/transport/core/packet.h | 7 +------ libtransport/includes/hicn/transport/interfaces/socket_consumer.h | 6 ------ libtransport/includes/hicn/transport/interfaces/socket_producer.h | 6 ------ 4 files changed, 2 insertions(+), 19 deletions(-) (limited to 'libtransport/includes') diff --git a/libtransport/includes/hicn/transport/core/io_module.h b/libtransport/includes/hicn/transport/core/io_module.h index ce6f3a629..cfaa61975 100644 --- a/libtransport/includes/hicn/transport/core/io_module.h +++ b/libtransport/includes/hicn/transport/core/io_module.h @@ -88,7 +88,7 @@ class IoModule : utils::NonCopyable { counters_.tx_packets++; counters_.tx_bytes += packet.payloadSize() + packet.headerSize(); - if (_is_ipv4(packet.getFormat())) { + if (HICN_PACKET_FORMAT_IS_IPV4(packet.getFormat())) { packet.setLocator(inet_address_); } else { packet.setLocator(inet6_address_); diff --git a/libtransport/includes/hicn/transport/core/packet.h b/libtransport/includes/hicn/transport/core/packet.h index 9277a52c2..31d856cd5 100644 --- a/libtransport/includes/hicn/transport/core/packet.h +++ b/libtransport/includes/hicn/transport/core/packet.h @@ -100,6 +100,7 @@ class Packet : public utils::MemBuf, void initialize(std::size_t additional_header_size = 0); void analyze(); + void initializeType(Packet::Type type); hicn_packet_type_t getType() const; void setType(Packet::Type type); @@ -146,12 +147,6 @@ class Packet : public utils::MemBuf, // TCP methods void setChecksum(); bool checkIntegrity() const; - Packet &setSrcPort(uint16_t srcPort); - Packet &setDstPort(uint16_t dstPort); - uint16_t getSrcPort() const; - uint16_t getDstPort() const; - Packet &setTTL(uint8_t hops); - uint8_t getTTL() const; // Authentication Header methods bool hasAH() const; diff --git a/libtransport/includes/hicn/transport/interfaces/socket_consumer.h b/libtransport/includes/hicn/transport/interfaces/socket_consumer.h index d997634da..1c709eb72 100644 --- a/libtransport/includes/hicn/transport/interfaces/socket_consumer.h +++ b/libtransport/includes/hicn/transport/interfaces/socket_consumer.h @@ -266,9 +266,6 @@ class ConsumerSocket : private utils::NonCopyable { int setSocketOption(int socket_option_key, StrategyCallback socket_option_value); - int setSocketOption(int socket_option_key, - Packet::Format socket_option_value); - int getSocketOption(int socket_option_key, double &socket_option_value); int getSocketOption(int socket_option_key, uint32_t &socket_option_value); @@ -302,9 +299,6 @@ class ConsumerSocket : private utils::NonCopyable { int getSocketOption(int socket_option_key, interface::TransportStatistics **socket_option_value); - int getSocketOption(int socket_option_key, - Packet::Format &socket_option_value); - protected: ConsumerSocket(); std::unique_ptr socket_; diff --git a/libtransport/includes/hicn/transport/interfaces/socket_producer.h b/libtransport/includes/hicn/transport/interfaces/socket_producer.h index be08c9a0b..2627b3138 100644 --- a/libtransport/includes/hicn/transport/interfaces/socket_producer.h +++ b/libtransport/includes/hicn/transport/interfaces/socket_producer.h @@ -130,9 +130,6 @@ class ProducerSocket : private utils::NonCopyable { int setSocketOption(int socket_option_key, const std::string &socket_option_value); - int setSocketOption(int socket_option_key, - Packet::Format socket_option_value); - int getSocketOption(int socket_option_key, uint32_t &socket_option_value); int getSocketOption(int socket_option_key, bool &socket_option_value); @@ -163,9 +160,6 @@ class ProducerSocket : private utils::NonCopyable { int getSocketOption(int socket_option_key, std::string &socket_option_value); - int getSocketOption(int socket_option_key, - Packet::Format &socket_option_value); - protected: ProducerSocket(bool); std::unique_ptr socket_; -- cgit 1.2.3-korg