mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Ported almost everything to BSD. Utils::route_entries and sending link layer PDUs still don't work.
This commit is contained in:
10
include/ip.h
10
include/ip.h
@@ -36,6 +36,7 @@
|
||||
#include "endianness.h"
|
||||
#include "ip_address.h"
|
||||
#include "pdu_option.h"
|
||||
#include "arch.h"
|
||||
|
||||
namespace Tins {
|
||||
|
||||
@@ -257,7 +258,14 @@ namespace Tins {
|
||||
*
|
||||
* \return The total length of this IP PDU.
|
||||
*/
|
||||
uint16_t tot_len() const { return Endian::be_to_host(_ip.tot_len); }
|
||||
uint16_t tot_len() const {
|
||||
// BSD wants this in host byte order............
|
||||
#ifdef BSD
|
||||
return _ip.tot_len;
|
||||
#else
|
||||
return Endian::be_to_host(_ip.tot_len);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Getter for the id field.
|
||||
|
||||
Reference in New Issue
Block a user