mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Remove some WIN32-guarded code.
This commit is contained in:
@@ -159,14 +159,12 @@ namespace Tins {
|
||||
*/
|
||||
bool matches_response(const uint8_t *ptr, uint32_t total_sz) const;
|
||||
|
||||
#ifndef WIN32
|
||||
/**
|
||||
* \brief Receives a matching response for this packet.
|
||||
*
|
||||
* \sa PDU::recv_response
|
||||
*/
|
||||
PDU *recv_response(PacketSender &sender, const NetworkInterface &iface);
|
||||
#endif // WIN32
|
||||
|
||||
/**
|
||||
* \brief Getter for the PDU's type.
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace Tins {
|
||||
*/
|
||||
PDU *send_recv(PDU &pdu, const NetworkInterface &iface);
|
||||
|
||||
#ifndef WIN32
|
||||
#if !defined(WIN32) || defined(HAVE_PACKET_SENDER_PCAP_SENDPACKET)
|
||||
/**
|
||||
* \brief Receives a layer 2 PDU response to a previously sent PDU.
|
||||
*
|
||||
@@ -331,7 +331,7 @@ namespace Tins {
|
||||
*/
|
||||
void send_l2(PDU &pdu, struct sockaddr* link_addr, uint32_t len_addr,
|
||||
const NetworkInterface &iface = NetworkInterface());
|
||||
#endif // WIN32
|
||||
#endif // !WIN32 || HAVE_PACKET_SENDER_PCAP_SENDPACKET
|
||||
|
||||
/**
|
||||
* \brief Receives a layer 3 PDU response to a previously sent PDU.
|
||||
|
||||
@@ -174,9 +174,8 @@ void EthernetII::write_serialization(uint8_t *buffer, uint32_t total_sz, const P
|
||||
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
PDU *EthernetII::recv_response(PacketSender &sender, const NetworkInterface &iface) {
|
||||
#if !defined(BSD) && !defined(__FreeBSD_kernel__)
|
||||
#if !defined(BSD) && !defined(__FreeBSD_kernel__) && !HAVE_PACKET_SENDER_PCAP_SENDPACKET
|
||||
struct sockaddr_ll addr;
|
||||
memset(&addr, 0, sizeof(struct sockaddr_ll));
|
||||
|
||||
@@ -191,5 +190,4 @@ PDU *EthernetII::recv_response(PacketSender &sender, const NetworkInterface &ifa
|
||||
return sender.recv_l2(*this, 0, 0, iface);
|
||||
#endif
|
||||
}
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
@@ -132,7 +132,9 @@ const NetworkInterface& PacketSender::default_interface() const {
|
||||
return default_iface;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
#if !defined(WIN32) || defined(HAVE_PACKET_SENDER_PCAP_SENDPACKET)
|
||||
|
||||
#ifdef WIN32
|
||||
bool PacketSender::ether_socket_initialized(const NetworkInterface& iface) const {
|
||||
#if defined(BSD) || defined(__FreeBSD_kernel__)
|
||||
return _ether_socket.count(iface.id());
|
||||
@@ -150,6 +152,7 @@ int PacketSender::get_ether_socket(const NetworkInterface& iface) {
|
||||
return _ether_socket;
|
||||
#endif
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
#ifdef HAVE_PACKET_SENDER_PCAP_SENDPACKET
|
||||
|
||||
@@ -216,7 +219,7 @@ void PacketSender::open_l2_socket(const NetworkInterface& iface) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif // WIN32
|
||||
#endif // !WIN32 || HAVE_PACKET_SENDER_PCAP_SENDPACKET
|
||||
|
||||
void PacketSender::open_l3_socket(SocketType type) {
|
||||
int socktype = find_type(type);
|
||||
|
||||
Reference in New Issue
Block a user