1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-25 11:41:35 +01:00

Fixed compilation errors on Windows.

This commit is contained in:
Matias Fontanini
2014-05-06 00:13:05 -03:00
parent 4bf5876adf
commit 559c963d63
15 changed files with 674 additions and 542 deletions

View File

@@ -34,10 +34,12 @@
#include <netinet/in.h>
#include <net/ethernet.h>
#endif
#else
#include <ws2tcpip.h>
#endif
#include <stdexcept>
#ifdef TINS_DEBUG
#include <cassert>
#include <cassert>
#endif
#include <cstring>
#include "loopback.h"
@@ -96,11 +98,13 @@ void Loopback::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU
#ifdef TINS_DEBUG
assert(total_sz >= sizeof(_family));
#endif
#ifndef WIN32
if(tins_cast<const Tins::IP*>(inner_pdu()))
_family = PF_INET;
else if(tins_cast<const Tins::LLC*>(inner_pdu()))
_family = PF_LLC;
*reinterpret_cast<uint32_t*>(buffer) = _family;
#endif // WIN32
}
#ifdef BSD
void Loopback::send(PacketSender &sender, const NetworkInterface &iface) {