mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Moved endianness change functions to endianness.h.
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#endif
|
||||
#include "pdu.h"
|
||||
#include "small_uint.h"
|
||||
#include "utils.h"
|
||||
#include "endianness.h"
|
||||
|
||||
|
||||
namespace Tins {
|
||||
@@ -142,49 +142,49 @@ namespace Tins {
|
||||
*
|
||||
* \return The destination port in an uint16_t.
|
||||
*/
|
||||
uint16_t dport() const { return Utils::be_to_host(_tcp.dport); }
|
||||
uint16_t dport() const { return Endian::be_to_host(_tcp.dport); }
|
||||
|
||||
/**
|
||||
* \brief Getter for the source port field.
|
||||
*
|
||||
* \return The source port in an uint16_t.
|
||||
*/
|
||||
uint16_t sport() const { return Utils::be_to_host(_tcp.sport); }
|
||||
uint16_t sport() const { return Endian::be_to_host(_tcp.sport); }
|
||||
|
||||
/**
|
||||
* \brief Getter for the sequence number field.
|
||||
*
|
||||
* \return The sequence number in an uint32_t.
|
||||
*/
|
||||
uint32_t seq() const { return Utils::be_to_host(_tcp.seq); }
|
||||
uint32_t seq() const { return Endian::be_to_host(_tcp.seq); }
|
||||
|
||||
/**
|
||||
* \brief Getter for the acknowledge number field.
|
||||
*
|
||||
* \return The acknowledge number in an uint32_t.
|
||||
*/
|
||||
uint32_t ack_seq() const { return Utils::be_to_host(_tcp.ack_seq); }
|
||||
uint32_t ack_seq() const { return Endian::be_to_host(_tcp.ack_seq); }
|
||||
|
||||
/**
|
||||
* \brief Getter for the window size field.
|
||||
*
|
||||
* \return The window size in an uint32_t.
|
||||
*/
|
||||
uint16_t window() const { return Utils::be_to_host(_tcp.window); }
|
||||
uint16_t window() const { return Endian::be_to_host(_tcp.window); }
|
||||
|
||||
/**
|
||||
* \brief Getter for the checksum field.
|
||||
*
|
||||
* \return The checksum field in an uint16_t.
|
||||
*/
|
||||
uint16_t check() const { return Utils::be_to_host(_tcp.check); }
|
||||
uint16_t check() const { return Endian::be_to_host(_tcp.check); }
|
||||
|
||||
/**
|
||||
* \brief Getter for the urgent pointer field.
|
||||
*
|
||||
* \return The urgent pointer in an uint16_t.
|
||||
*/
|
||||
uint16_t urg_ptr() const { return Utils::be_to_host(_tcp.urg_ptr); }
|
||||
uint16_t urg_ptr() const { return Endian::be_to_host(_tcp.urg_ptr); }
|
||||
|
||||
/**
|
||||
* \brief Getter for the data offset field.
|
||||
|
||||
Reference in New Issue
Block a user