mirror of
https://github.com/mfontanini/libtins
synced 2026-01-29 21:14:28 +01:00
libtins compiles and runs under windows. Packets apparently can't be sent yet.
This commit is contained in:
344
depends.d
344
depends.d
@@ -1,17 +1,17 @@
|
||||
src/arp.o: src/arp.cpp include/arp.h include/pdu.h include/endianness.h \
|
||||
include/arch.h include/hw_address.h include/ip_address.h include/ip.h \
|
||||
include/small_uint.h include/pdu_option.h include/ethernetII.h \
|
||||
include/network_interface.h include/rawpdu.h include/constants.h \
|
||||
include/network_interface.h
|
||||
src/arp.o: src/arp.cpp include/arp.h include/macros.h include/pdu.h \
|
||||
include/endianness.h include/hw_address.h include/ip_address.h \
|
||||
include/ip.h include/small_uint.h include/pdu_option.h \
|
||||
include/ethernetII.h include/network_interface.h include/rawpdu.h \
|
||||
include/constants.h include/network_interface.h
|
||||
|
||||
include/arp.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
include/ip_address.h:
|
||||
@@ -31,37 +31,36 @@ include/rawpdu.h:
|
||||
include/constants.h:
|
||||
|
||||
include/network_interface.h:
|
||||
src/bootp.o: src/bootp.cpp include/bootp.h include/pdu.h \
|
||||
include/endianness.h include/arch.h include/ip_address.h \
|
||||
include/hw_address.h
|
||||
src/bootp.o: src/bootp.cpp include/bootp.h include/pdu.h include/macros.h \
|
||||
include/endianness.h include/ip_address.h include/hw_address.h
|
||||
|
||||
include/bootp.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
include/macros.h:
|
||||
|
||||
include/arch.h:
|
||||
include/endianness.h:
|
||||
|
||||
include/ip_address.h:
|
||||
|
||||
include/hw_address.h:
|
||||
src/crypto.o: src/crypto.cpp include/crypto.h include/dot11.h \
|
||||
include/pdu.h include/endianness.h include/arch.h include/hw_address.h \
|
||||
include/macros.h include/pdu.h include/endianness.h include/hw_address.h \
|
||||
include/small_uint.h include/pdu_option.h include/network_interface.h \
|
||||
include/ip_address.h include/utils.h include/ipv6_address.h \
|
||||
include/snap.h include/rawpdu.h
|
||||
include/internals.h include/snap.h include/rawpdu.h
|
||||
|
||||
include/crypto.h:
|
||||
|
||||
include/dot11.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
include/small_uint.h:
|
||||
@@ -76,17 +75,19 @@ include/utils.h:
|
||||
|
||||
include/ipv6_address.h:
|
||||
|
||||
include/internals.h:
|
||||
|
||||
include/snap.h:
|
||||
|
||||
include/rawpdu.h:
|
||||
src/dhcp.o: src/dhcp.cpp include/endianness.h include/arch.h \
|
||||
src/dhcp.o: src/dhcp.cpp include/endianness.h include/macros.h \
|
||||
include/dhcp.h include/bootp.h include/pdu.h include/endianness.h \
|
||||
include/ip_address.h include/hw_address.h include/pdu_option.h \
|
||||
include/ethernetII.h include/network_interface.h
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
include/macros.h:
|
||||
|
||||
include/dhcp.h:
|
||||
|
||||
@@ -105,47 +106,49 @@ include/pdu_option.h:
|
||||
include/ethernetII.h:
|
||||
|
||||
include/network_interface.h:
|
||||
src/dns.o: src/dns.cpp include/dns.h include/pdu.h include/endianness.h \
|
||||
include/arch.h include/dns_record.h include/ip_address.h \
|
||||
include/ipv6_address.h
|
||||
src/dns.o: src/dns.cpp include/dns.h include/macros.h include/pdu.h \
|
||||
include/endianness.h include/dns_record.h include/cxxstd.h \
|
||||
include/ip_address.h include/ipv6_address.h
|
||||
|
||||
include/dns.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/dns_record.h:
|
||||
|
||||
include/cxxstd.h:
|
||||
|
||||
include/ip_address.h:
|
||||
|
||||
include/ipv6_address.h:
|
||||
src/dns_record.o: src/dns_record.cpp include/dns_record.h \
|
||||
include/endianness.h include/arch.h
|
||||
include/cxxstd.h include/macros.h include/endianness.h
|
||||
|
||||
include/dns_record.h:
|
||||
|
||||
include/cxxstd.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
src/dot11.o: src/dot11.cpp include/arch.h include/dot11.h include/pdu.h \
|
||||
include/endianness.h include/arch.h include/hw_address.h \
|
||||
include/small_uint.h include/pdu_option.h include/network_interface.h \
|
||||
include/ip_address.h include/rawpdu.h include/rsn_information.h \
|
||||
include/packet_sender.h include/snap.h
|
||||
|
||||
include/arch.h:
|
||||
src/dot11.o: src/dot11.cpp include/dot11.h include/macros.h include/pdu.h \
|
||||
include/endianness.h include/hw_address.h include/small_uint.h \
|
||||
include/pdu_option.h include/network_interface.h include/ip_address.h \
|
||||
include/rawpdu.h include/rsn_information.h include/packet_sender.h \
|
||||
include/snap.h
|
||||
|
||||
include/dot11.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
include/small_uint.h:
|
||||
@@ -163,8 +166,8 @@ include/rsn_information.h:
|
||||
include/packet_sender.h:
|
||||
|
||||
include/snap.h:
|
||||
src/eapol.o: src/eapol.cpp include/eapol.h include/pdu.h \
|
||||
include/small_uint.h include/endianness.h include/arch.h include/dot11.h \
|
||||
src/eapol.o: src/eapol.cpp include/eapol.h include/pdu.h include/macros.h \
|
||||
include/small_uint.h include/endianness.h include/dot11.h \
|
||||
include/hw_address.h include/pdu_option.h include/network_interface.h \
|
||||
include/ip_address.h include/rsn_information.h
|
||||
|
||||
@@ -172,12 +175,12 @@ include/eapol.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/small_uint.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/dot11.h:
|
||||
|
||||
include/hw_address.h:
|
||||
@@ -189,22 +192,23 @@ include/network_interface.h:
|
||||
include/ip_address.h:
|
||||
|
||||
include/rsn_information.h:
|
||||
src/ethernetII.o: src/ethernetII.cpp include/arch.h include/ethernetII.h \
|
||||
include/pdu.h include/endianness.h include/arch.h include/hw_address.h \
|
||||
include/network_interface.h include/ip_address.h include/packet_sender.h \
|
||||
include/rawpdu.h include/ip.h include/small_uint.h include/pdu_option.h \
|
||||
include/ipv6.h include/ipv6_address.h include/arp.h include/constants.h
|
||||
src/ethernetII.o: src/ethernetII.cpp include/macros.h \
|
||||
include/ethernetII.h include/macros.h include/pdu.h include/endianness.h \
|
||||
include/hw_address.h include/network_interface.h include/ip_address.h \
|
||||
include/packet_sender.h include/rawpdu.h include/ip.h \
|
||||
include/small_uint.h include/pdu_option.h include/ipv6.h \
|
||||
include/ipv6_address.h include/arp.h include/constants.h
|
||||
|
||||
include/arch.h:
|
||||
include/macros.h:
|
||||
|
||||
include/ethernetII.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
include/network_interface.h:
|
||||
@@ -228,18 +232,19 @@ include/ipv6_address.h:
|
||||
include/arp.h:
|
||||
|
||||
include/constants.h:
|
||||
src/icmp.o: src/icmp.cpp include/icmp.h include/pdu.h \
|
||||
include/endianness.h include/arch.h include/rawpdu.h include/utils.h \
|
||||
include/ip_address.h include/ipv6_address.h include/hw_address.h
|
||||
src/icmp.o: src/icmp.cpp include/icmp.h include/macros.h include/pdu.h \
|
||||
include/endianness.h include/rawpdu.h include/utils.h \
|
||||
include/ip_address.h include/ipv6_address.h include/hw_address.h \
|
||||
include/internals.h
|
||||
|
||||
include/icmp.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/rawpdu.h:
|
||||
|
||||
include/utils.h:
|
||||
@@ -249,14 +254,18 @@ include/ip_address.h:
|
||||
include/ipv6_address.h:
|
||||
|
||||
include/hw_address.h:
|
||||
src/icmpv6.o: src/icmpv6.cpp include/icmpv6.h include/pdu.h \
|
||||
include/ipv6_address.h include/pdu_option.h include/endianness.h \
|
||||
include/arch.h include/small_uint.h include/ipv6.h include/rawpdu.h \
|
||||
include/utils.h include/ip_address.h include/hw_address.h \
|
||||
include/constants.h
|
||||
|
||||
include/internals.h:
|
||||
src/icmpv6.o: src/icmpv6.cpp include/icmpv6.h include/macros.h \
|
||||
include/pdu.h include/ipv6_address.h include/pdu_option.h \
|
||||
include/endianness.h include/small_uint.h include/hw_address.h \
|
||||
include/ipv6.h include/rawpdu.h include/utils.h include/ip_address.h \
|
||||
include/internals.h include/constants.h
|
||||
|
||||
include/icmpv6.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/ipv6_address.h:
|
||||
@@ -265,10 +274,10 @@ include/pdu_option.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/small_uint.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
include/ipv6.h:
|
||||
|
||||
include/rawpdu.h:
|
||||
@@ -277,24 +286,24 @@ include/utils.h:
|
||||
|
||||
include/ip_address.h:
|
||||
|
||||
include/hw_address.h:
|
||||
include/internals.h:
|
||||
|
||||
include/constants.h:
|
||||
src/ieee802_3.o: src/ieee802_3.cpp include/arch.h include/ieee802_3.h \
|
||||
include/pdu.h include/endianness.h include/arch.h include/hw_address.h \
|
||||
src/ieee802_3.o: src/ieee802_3.cpp include/macros.h include/ieee802_3.h \
|
||||
include/macros.h include/pdu.h include/endianness.h include/hw_address.h \
|
||||
include/network_interface.h include/ip_address.h include/packet_sender.h \
|
||||
include/llc.h
|
||||
|
||||
include/arch.h:
|
||||
include/macros.h:
|
||||
|
||||
include/ieee802_3.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
include/network_interface.h:
|
||||
@@ -304,20 +313,15 @@ include/ip_address.h:
|
||||
include/packet_sender.h:
|
||||
|
||||
include/llc.h:
|
||||
src/ip_address.o: src/ip_address.cpp include/ip_address.h \
|
||||
include/endianness.h include/arch.h
|
||||
src/internals.o: src/internals.cpp include/internals.h
|
||||
|
||||
include/ip_address.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
include/internals.h:
|
||||
src/ip.o: src/ip.cpp include/ip.h include/pdu.h include/small_uint.h \
|
||||
include/endianness.h include/arch.h include/ip_address.h \
|
||||
include/endianness.h include/macros.h include/ip_address.h \
|
||||
include/pdu_option.h include/ipv6.h include/ipv6_address.h include/tcp.h \
|
||||
include/udp.h include/icmp.h include/rawpdu.h include/utils.h \
|
||||
include/hw_address.h include/packet_sender.h include/network_interface.h \
|
||||
include/constants.h
|
||||
include/hw_address.h include/internals.h include/packet_sender.h \
|
||||
include/network_interface.h include/constants.h
|
||||
|
||||
include/ip.h:
|
||||
|
||||
@@ -327,7 +331,7 @@ include/small_uint.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
include/macros.h:
|
||||
|
||||
include/ip_address.h:
|
||||
|
||||
@@ -349,32 +353,36 @@ include/utils.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
include/internals.h:
|
||||
|
||||
include/packet_sender.h:
|
||||
|
||||
include/network_interface.h:
|
||||
|
||||
include/constants.h:
|
||||
src/ipv6_address.o: src/ipv6_address.cpp include/arch.h \
|
||||
include/ipv6_address.h
|
||||
src/ip_address.o: src/ip_address.cpp include/ip_address.h \
|
||||
include/endianness.h include/macros.h
|
||||
|
||||
include/arch.h:
|
||||
include/ip_address.h:
|
||||
|
||||
include/ipv6_address.h:
|
||||
src/ipv6.o: src/ipv6.cpp include/ipv6.h include/pdu.h \
|
||||
include/endianness.h include/arch.h include/small_uint.h \
|
||||
include/pdu_option.h include/ipv6_address.h include/constants.h \
|
||||
include/packet_sender.h include/network_interface.h include/hw_address.h \
|
||||
include/ip_address.h include/ip.h include/tcp.h include/udp.h \
|
||||
include/icmp.h include/icmpv6.h include/rawpdu.h
|
||||
include/endianness.h:
|
||||
|
||||
include/macros.h:
|
||||
src/ipv6.o: src/ipv6.cpp include/ipv6.h include/macros.h include/pdu.h \
|
||||
include/endianness.h include/small_uint.h include/pdu_option.h \
|
||||
include/ipv6_address.h include/constants.h include/packet_sender.h \
|
||||
include/network_interface.h include/hw_address.h include/ip_address.h \
|
||||
include/ip.h include/tcp.h include/udp.h include/icmp.h include/icmpv6.h \
|
||||
include/rawpdu.h
|
||||
|
||||
include/ipv6.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/small_uint.h:
|
||||
|
||||
include/pdu_option.h:
|
||||
@@ -402,25 +410,31 @@ include/icmp.h:
|
||||
include/icmpv6.h:
|
||||
|
||||
include/rawpdu.h:
|
||||
src/llc.o: src/llc.cpp include/pdu.h include/llc.h include/pdu.h \
|
||||
include/endianness.h include/arch.h include/rawpdu.h
|
||||
src/ipv6_address.o: src/ipv6_address.cpp include/macros.h \
|
||||
include/ipv6_address.h
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/ipv6_address.h:
|
||||
src/llc.o: src/llc.cpp include/pdu.h include/llc.h include/macros.h \
|
||||
include/pdu.h include/endianness.h include/rawpdu.h
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/llc.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/rawpdu.h:
|
||||
src/loopback.o: src/loopback.cpp include/loopback.h include/pdu.h \
|
||||
include/packet_sender.h include/network_interface.h include/hw_address.h \
|
||||
include/ip_address.h include/ip.h include/small_uint.h \
|
||||
include/endianness.h include/arch.h include/pdu_option.h include/llc.h \
|
||||
include/arch.h include/rawpdu.h
|
||||
include/ip_address.h include/macros.h include/ip.h include/small_uint.h \
|
||||
include/endianness.h include/pdu_option.h include/llc.h include/macros.h \
|
||||
include/rawpdu.h
|
||||
|
||||
include/loopback.h:
|
||||
|
||||
@@ -434,27 +448,27 @@ include/hw_address.h:
|
||||
|
||||
include/ip_address.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/ip.h:
|
||||
|
||||
include/small_uint.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/pdu_option.h:
|
||||
|
||||
include/llc.h:
|
||||
|
||||
include/arch.h:
|
||||
include/macros.h:
|
||||
|
||||
include/rawpdu.h:
|
||||
src/network_interface.o: src/network_interface.cpp include/arch.h \
|
||||
src/network_interface.o: src/network_interface.cpp include/macros.h \
|
||||
include/network_interface.h include/hw_address.h include/ip_address.h \
|
||||
include/utils.h include/ipv6_address.h include/endianness.h \
|
||||
include/arch.h
|
||||
include/utils.h include/macros.h include/ipv6_address.h \
|
||||
include/internals.h include/endianness.h
|
||||
|
||||
include/arch.h:
|
||||
include/macros.h:
|
||||
|
||||
include/network_interface.h:
|
||||
|
||||
@@ -464,18 +478,17 @@ include/ip_address.h:
|
||||
|
||||
include/utils.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/ipv6_address.h:
|
||||
|
||||
include/internals.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
src/packet_sender.o: src/packet_sender.cpp include/arch.h include/pdu.h \
|
||||
include/packet_sender.h include/network_interface.h include/hw_address.h \
|
||||
include/ip_address.h include/network_interface.h
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/pdu.h:
|
||||
src/packet_sender.o: src/packet_sender.cpp include/packet_sender.h \
|
||||
include/network_interface.h include/hw_address.h include/ip_address.h \
|
||||
include/macros.h include/pdu.h include/macros.h \
|
||||
include/network_interface.h
|
||||
|
||||
include/packet_sender.h:
|
||||
|
||||
@@ -485,25 +498,36 @@ include/hw_address.h:
|
||||
|
||||
include/ip_address.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/network_interface.h:
|
||||
src/packet_writer.o: src/packet_writer.cpp include/packet_writer.h \
|
||||
include/utils.h include/ip_address.h include/ipv6_address.h \
|
||||
include/hw_address.h include/pdu.h
|
||||
include/utils.h include/macros.h include/ip_address.h \
|
||||
include/ipv6_address.h include/hw_address.h include/internals.h \
|
||||
include/pdu.h
|
||||
|
||||
include/packet_writer.h:
|
||||
|
||||
include/utils.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/ip_address.h:
|
||||
|
||||
include/ipv6_address.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
include/internals.h:
|
||||
|
||||
include/pdu.h:
|
||||
src/pdu.o: src/pdu.cpp include/pdu.h include/rawpdu.h include/pdu.h \
|
||||
include/packet_sender.h include/network_interface.h include/hw_address.h \
|
||||
include/ip_address.h
|
||||
include/ip_address.h include/macros.h
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
@@ -518,22 +542,25 @@ include/network_interface.h:
|
||||
include/hw_address.h:
|
||||
|
||||
include/ip_address.h:
|
||||
src/radiotap.o: src/radiotap.cpp include/arch.h include/radiotap.h \
|
||||
include/pdu.h include/endianness.h include/arch.h \
|
||||
|
||||
include/macros.h:
|
||||
src/radiotap.o: src/radiotap.cpp include/macros.h include/radiotap.h \
|
||||
include/macros.h include/pdu.h include/endianness.h \
|
||||
include/network_interface.h include/hw_address.h include/ip_address.h \
|
||||
include/dot11.h include/small_uint.h include/pdu_option.h \
|
||||
include/utils.h include/ipv6_address.h include/packet_sender.h
|
||||
include/utils.h include/ipv6_address.h include/internals.h \
|
||||
include/packet_sender.h
|
||||
|
||||
include/arch.h:
|
||||
include/macros.h:
|
||||
|
||||
include/radiotap.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/network_interface.h:
|
||||
|
||||
include/hw_address.h:
|
||||
@@ -550,6 +577,8 @@ include/utils.h:
|
||||
|
||||
include/ipv6_address.h:
|
||||
|
||||
include/internals.h:
|
||||
|
||||
include/packet_sender.h:
|
||||
src/rawpdu.o: src/rawpdu.cpp include/rawpdu.h include/pdu.h
|
||||
|
||||
@@ -557,25 +586,25 @@ include/rawpdu.h:
|
||||
|
||||
include/pdu.h:
|
||||
src/rsn_information.o: src/rsn_information.cpp include/rsn_information.h \
|
||||
include/endianness.h include/arch.h
|
||||
include/endianness.h include/macros.h
|
||||
|
||||
include/rsn_information.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
src/snap.o: src/snap.cpp include/snap.h include/pdu.h \
|
||||
include/endianness.h include/arch.h include/small_uint.h \
|
||||
include/constants.h include/arp.h include/hw_address.h \
|
||||
include/ip_address.h include/ip.h include/pdu_option.h include/eapol.h
|
||||
include/macros.h:
|
||||
src/snap.o: src/snap.cpp include/snap.h include/pdu.h include/macros.h \
|
||||
include/endianness.h include/small_uint.h include/constants.h \
|
||||
include/arp.h include/hw_address.h include/ip_address.h include/ip.h \
|
||||
include/pdu_option.h include/eapol.h
|
||||
|
||||
include/snap.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
include/macros.h:
|
||||
|
||||
include/arch.h:
|
||||
include/endianness.h:
|
||||
|
||||
include/small_uint.h:
|
||||
|
||||
@@ -593,7 +622,7 @@ include/pdu_option.h:
|
||||
|
||||
include/eapol.h:
|
||||
src/sniffer.o: src/sniffer.cpp include/sniffer.h include/pdu.h \
|
||||
include/ethernetII.h include/endianness.h include/arch.h \
|
||||
include/ethernetII.h include/macros.h include/endianness.h \
|
||||
include/hw_address.h include/network_interface.h include/ip_address.h \
|
||||
include/radiotap.h include/packet.h include/cxxstd.h include/timestamp.h \
|
||||
include/loopback.h include/dot11.h include/small_uint.h \
|
||||
@@ -605,9 +634,9 @@ include/pdu.h:
|
||||
|
||||
include/ethernetII.h:
|
||||
|
||||
include/endianness.h:
|
||||
include/macros.h:
|
||||
|
||||
include/arch.h:
|
||||
include/endianness.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
@@ -630,19 +659,19 @@ include/dot11.h:
|
||||
include/small_uint.h:
|
||||
|
||||
include/pdu_option.h:
|
||||
src/tcp.o: src/tcp.cpp include/tcp.h include/pdu.h include/endianness.h \
|
||||
include/arch.h include/small_uint.h include/pdu_option.h include/ip.h \
|
||||
include/ip_address.h include/ipv6.h include/ipv6_address.h \
|
||||
src/tcp.o: src/tcp.cpp include/tcp.h include/pdu.h include/macros.h \
|
||||
include/endianness.h include/small_uint.h include/pdu_option.h \
|
||||
include/ip.h include/ip_address.h include/ipv6.h include/ipv6_address.h \
|
||||
include/constants.h include/rawpdu.h include/utils.h \
|
||||
include/hw_address.h
|
||||
include/hw_address.h include/internals.h
|
||||
|
||||
include/tcp.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
include/macros.h:
|
||||
|
||||
include/arch.h:
|
||||
include/endianness.h:
|
||||
|
||||
include/small_uint.h:
|
||||
|
||||
@@ -663,13 +692,15 @@ include/rawpdu.h:
|
||||
include/utils.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
include/internals.h:
|
||||
src/tcp_stream.o: src/tcp_stream.cpp include/rawpdu.h include/pdu.h \
|
||||
include/tcp_stream.h include/sniffer.h include/ethernetII.h \
|
||||
include/endianness.h include/arch.h include/hw_address.h \
|
||||
include/macros.h include/endianness.h include/hw_address.h \
|
||||
include/network_interface.h include/ip_address.h include/radiotap.h \
|
||||
include/packet.h include/cxxstd.h include/timestamp.h include/loopback.h \
|
||||
include/dot11.h include/small_uint.h include/pdu_option.h include/tcp.h \
|
||||
include/utils.h include/ipv6_address.h include/ip.h
|
||||
include/utils.h include/ipv6_address.h include/internals.h include/ip.h
|
||||
|
||||
include/rawpdu.h:
|
||||
|
||||
@@ -681,9 +712,9 @@ include/sniffer.h:
|
||||
|
||||
include/ethernetII.h:
|
||||
|
||||
include/endianness.h:
|
||||
include/macros.h:
|
||||
|
||||
include/arch.h:
|
||||
include/endianness.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
@@ -713,20 +744,23 @@ include/utils.h:
|
||||
|
||||
include/ipv6_address.h:
|
||||
|
||||
include/internals.h:
|
||||
|
||||
include/ip.h:
|
||||
src/udp.o: src/udp.cpp include/udp.h include/pdu.h include/endianness.h \
|
||||
include/arch.h include/constants.h include/utils.h include/ip_address.h \
|
||||
include/ipv6_address.h include/hw_address.h include/ip.h \
|
||||
include/small_uint.h include/pdu_option.h include/rawpdu.h
|
||||
src/udp.o: src/udp.cpp include/udp.h include/macros.h include/pdu.h \
|
||||
include/endianness.h include/constants.h include/utils.h \
|
||||
include/ip_address.h include/ipv6_address.h include/hw_address.h \
|
||||
include/internals.h include/ip.h include/small_uint.h \
|
||||
include/pdu_option.h include/rawpdu.h
|
||||
|
||||
include/udp.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/constants.h:
|
||||
|
||||
include/utils.h:
|
||||
@@ -737,6 +771,8 @@ include/ipv6_address.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
include/internals.h:
|
||||
|
||||
include/ip.h:
|
||||
|
||||
include/small_uint.h:
|
||||
@@ -744,23 +780,25 @@ include/small_uint.h:
|
||||
include/pdu_option.h:
|
||||
|
||||
include/rawpdu.h:
|
||||
src/utils.o: src/utils.cpp include/arch.h include/utils.h \
|
||||
src/utils.o: src/utils.cpp include/utils.h include/macros.h \
|
||||
include/ip_address.h include/ipv6_address.h include/hw_address.h \
|
||||
include/pdu.h include/arp.h include/pdu.h include/endianness.h \
|
||||
include/arch.h include/ethernetII.h include/network_interface.h \
|
||||
include/internals.h include/pdu.h include/arp.h include/pdu.h \
|
||||
include/endianness.h include/ethernetII.h include/network_interface.h \
|
||||
include/endianness.h include/network_interface.h include/packet_sender.h \
|
||||
include/cxxstd.h
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/utils.h:
|
||||
|
||||
include/macros.h:
|
||||
|
||||
include/ip_address.h:
|
||||
|
||||
include/ipv6_address.h:
|
||||
|
||||
include/hw_address.h:
|
||||
|
||||
include/internals.h:
|
||||
|
||||
include/pdu.h:
|
||||
|
||||
include/arp.h:
|
||||
@@ -769,8 +807,6 @@ include/pdu.h:
|
||||
|
||||
include/endianness.h:
|
||||
|
||||
include/arch.h:
|
||||
|
||||
include/ethernetII.h:
|
||||
|
||||
include/network_interface.h:
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#ifndef TINS_ARP_H
|
||||
#define TINS_ARP_H
|
||||
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "endianness.h"
|
||||
#include "hw_address.h"
|
||||
@@ -285,6 +286,7 @@ namespace Tins {
|
||||
return new ARP(*this);
|
||||
}
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct arphdr {
|
||||
uint16_t ar_hrd; /* format of hardware address */
|
||||
uint16_t ar_pro; /* format of protocol address */
|
||||
@@ -300,7 +302,7 @@ namespace Tins {
|
||||
uint8_t ar_tha[hwaddress_type::address_size];
|
||||
/* target IP address */
|
||||
uint32_t ar_tip;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent);
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
#include "ip_address.h"
|
||||
#include "hw_address.h"
|
||||
@@ -320,6 +321,7 @@ namespace Tins {
|
||||
/**
|
||||
* Struct that represents the Bootp datagram.
|
||||
*/
|
||||
TINS_BEGIN_PACK
|
||||
struct bootphdr {
|
||||
uint8_t opcode;
|
||||
uint8_t htype;
|
||||
@@ -335,7 +337,7 @@ namespace Tins {
|
||||
uint8_t chaddr[16];
|
||||
uint8_t sname[64];
|
||||
uint8_t file[128];
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
bootphdr _bootp;
|
||||
vend_type _vend;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "endianness.h"
|
||||
#include "dns_record.h"
|
||||
@@ -583,6 +584,7 @@ namespace Tins {
|
||||
return DNSResourceRecord::info((uint16_t)type, (uint16_t)qclass, ttl);
|
||||
}
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct dnshdr {
|
||||
uint16_t id;
|
||||
#if TINS_IS_LITTLE_ENDIAN
|
||||
@@ -612,7 +614,7 @@ namespace Tins {
|
||||
#endif
|
||||
uint16_t questions, answers,
|
||||
authority, additional;
|
||||
} __attribute__((packed));
|
||||
} TINS_END_PACK;
|
||||
|
||||
typedef std::map<uint16_t, std::string> SuffixMap;
|
||||
typedef std::map<uint16_t, uint16_t> SuffixIndices;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <vector>
|
||||
#include <stdint.h>
|
||||
#include "cxxstd.h"
|
||||
#include "macros.h"
|
||||
|
||||
namespace Tins {
|
||||
class DNSRRImpl;
|
||||
@@ -46,6 +47,7 @@ public:
|
||||
/**
|
||||
* \brief The type used to store resource records' information.
|
||||
*/
|
||||
TINS_BEGIN_PACK
|
||||
struct info {
|
||||
uint16_t type, qclass;
|
||||
uint32_t ttl;
|
||||
@@ -54,7 +56,7 @@ public:
|
||||
: type(tp), qclass(qc), ttl(tm) { }
|
||||
|
||||
info() : type(), qclass(), ttl() {}
|
||||
} __attribute__((packed));
|
||||
} TINS_END_PACK;
|
||||
|
||||
/**
|
||||
* \brief Constructs a record.
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "endianness.h"
|
||||
#include "hw_address.h"
|
||||
@@ -449,38 +450,40 @@ namespace Tins {
|
||||
/**
|
||||
* Struct that represents the 802.11 header
|
||||
*/
|
||||
TINS_BEGIN_PACK
|
||||
struct ieee80211_header {
|
||||
TINS_BEGIN_PACK
|
||||
struct {
|
||||
#if TINS_IS_LITTLE_ENDIAN
|
||||
unsigned int protocol:2;
|
||||
unsigned int type:2;
|
||||
unsigned int subtype:4;
|
||||
unsigned int to_ds:1;
|
||||
unsigned int from_ds:1;
|
||||
unsigned int more_frag:1;
|
||||
unsigned int retry:1;
|
||||
unsigned int power_mgmt:1;
|
||||
unsigned int more_data:1;
|
||||
unsigned int wep:1;
|
||||
unsigned int order:1;
|
||||
uint16_t protocol:2,
|
||||
type:2,
|
||||
subtype:4,
|
||||
to_ds:1,
|
||||
from_ds:1,
|
||||
more_frag:1,
|
||||
retry:1,
|
||||
power_mgmt:1,
|
||||
more_data:1,
|
||||
wep:1,
|
||||
order:1;
|
||||
#elif TINS_IS_BIG_ENDIAN
|
||||
unsigned int subtype:4;
|
||||
unsigned int type:2;
|
||||
unsigned int protocol:2;
|
||||
unsigned int order:1;
|
||||
unsigned int wep:1;
|
||||
unsigned int more_data:1;
|
||||
unsigned int power_mgmt:1;
|
||||
unsigned int retry:1;
|
||||
unsigned int more_frag:1;
|
||||
unsigned int from_ds:1;
|
||||
unsigned int to_ds:1;
|
||||
uint16_t subtype:4,
|
||||
type:2,
|
||||
protocol:2,
|
||||
order:1,
|
||||
wep:1,
|
||||
more_data:1,
|
||||
power_mgmt:1,
|
||||
retry:1,
|
||||
more_frag:1,
|
||||
from_ds:1,
|
||||
to_ds:1;
|
||||
#endif
|
||||
} __attribute__((__packed__)) control;
|
||||
} TINS_END_PACK control;
|
||||
uint16_t duration_id;
|
||||
uint8_t addr1[address_type::address_size];
|
||||
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
private:
|
||||
|
||||
Dot11(const ieee80211_header *header_ptr);
|
||||
@@ -557,6 +560,7 @@ namespace Tins {
|
||||
/**
|
||||
* Represents the IEEE 802.11 frames' capability information.
|
||||
*/
|
||||
TINS_BEGIN_PACK
|
||||
class capability_information {
|
||||
private:
|
||||
#if TINS_IS_LITTLE_ENDIAN
|
||||
@@ -819,8 +823,9 @@ namespace Tins {
|
||||
*/
|
||||
void immediate_block_ack(bool new_value) { _immediate_block_ack = new_value; }
|
||||
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
TINS_BEGIN_PACK
|
||||
struct fh_params_set {
|
||||
uint16_t dwell_time;
|
||||
uint8_t hop_set, hop_pattern, hop_index;
|
||||
@@ -831,8 +836,9 @@ namespace Tins {
|
||||
uint8_t hop_pattern, uint8_t hop_index)
|
||||
: dwell_time(dwell_time), hop_set(hop_set),
|
||||
hop_pattern(hop_pattern), hop_index(hop_index) {}
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
TINS_BEGIN_PACK
|
||||
struct cf_params_set {
|
||||
uint8_t cfp_count, cfp_period;
|
||||
uint16_t cfp_max_duration, cfp_dur_remaining;
|
||||
@@ -844,7 +850,7 @@ namespace Tins {
|
||||
: cfp_count(cfp_count), cfp_period(cfp_period),
|
||||
cfp_max_duration(cfp_max_duration),
|
||||
cfp_dur_remaining(cfp_dur_remaining) {}
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
struct ibss_dfs_params {
|
||||
static const size_t minimum_size = address_type::address_size + sizeof(uint8_t) + 2 * sizeof(uint8_t);
|
||||
@@ -1441,11 +1447,12 @@ namespace Tins {
|
||||
return flag == pdu_flag || Dot11::matches_flag(flag);
|
||||
}
|
||||
protected:
|
||||
TINS_BEGIN_PACK
|
||||
struct ExtendedHeader {
|
||||
uint8_t addr2[address_type::address_size];
|
||||
uint8_t addr3[address_type::address_size];
|
||||
uint16_t frag_seq;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
|
||||
Dot11ManagementFrame(const address_type &dst_hw_addr = address_type(),
|
||||
@@ -1582,11 +1589,12 @@ namespace Tins {
|
||||
*/
|
||||
PDUType pdu_type() const { return pdu_flag; }
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct BeaconBody {
|
||||
uint64_t timestamp;
|
||||
uint16_t interval;
|
||||
capability_information capability;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
uint32_t write_fixed_parameters(uint8_t *buffer, uint32_t total_sz);
|
||||
|
||||
@@ -2516,11 +2524,12 @@ namespace Tins {
|
||||
protected:
|
||||
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct ProbeResp {
|
||||
uint64_t timestamp;
|
||||
uint16_t interval;
|
||||
capability_information capability;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
ProbeResp _body;
|
||||
|
||||
@@ -2671,11 +2680,12 @@ namespace Tins {
|
||||
return new Dot11Data(*this);
|
||||
}
|
||||
protected:
|
||||
TINS_BEGIN_PACK
|
||||
struct ExtendedHeader {
|
||||
uint8_t addr2[address_type::address_size];
|
||||
uint8_t addr3[address_type::address_size];
|
||||
uint16_t frag_seq;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
uint32_t write_ext_header(uint8_t *buffer, uint32_t total_sz);
|
||||
|
||||
@@ -3244,15 +3254,17 @@ namespace Tins {
|
||||
protected:
|
||||
uint32_t write_ext_header(uint8_t *buffer, uint32_t total_sz);
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct BarControl {
|
||||
uint16_t reserved:12,
|
||||
tid:4;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
TINS_BEGIN_PACK
|
||||
struct StartSequence {
|
||||
uint16_t frag:4,
|
||||
seq:12;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void init_block_ack();
|
||||
|
||||
@@ -3371,15 +3383,17 @@ namespace Tins {
|
||||
return new Dot11BlockAck(*this);
|
||||
}
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct BarControl {
|
||||
uint16_t reserved:12,
|
||||
tid:4;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
TINS_BEGIN_PACK
|
||||
struct StartSequence {
|
||||
uint16_t frag:4,
|
||||
seq:12;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void init_block_ack();
|
||||
uint32_t write_ext_header(uint8_t *buffer, uint32_t total_sz);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "small_uint.h"
|
||||
#include "endianness.h"
|
||||
|
||||
@@ -148,11 +149,12 @@ namespace Tins {
|
||||
|
||||
void copy_eapol_fields(const EAPOL *other);
|
||||
|
||||
TINS_BEGIN_PACK
|
||||
struct eapolhdr {
|
||||
uint8_t version, packet_type;
|
||||
uint16_t length;
|
||||
uint8_t type;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
/**
|
||||
* \brief Virtual method which should serialize the subclass specific
|
||||
@@ -337,6 +339,7 @@ namespace Tins {
|
||||
return new RC4EAPOL(*this);
|
||||
}
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct rc4hdr {
|
||||
uint16_t key_length;
|
||||
uint64_t replay_counter;
|
||||
@@ -344,7 +347,7 @@ namespace Tins {
|
||||
uint8_t key_index:7,
|
||||
key_flag:1;
|
||||
uint8_t key_sign[16];
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void write_body(uint8_t *buffer, uint32_t total_sz);
|
||||
|
||||
@@ -678,6 +681,7 @@ namespace Tins {
|
||||
return new RSNEAPOL(*this);
|
||||
}
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct rsnhdr {
|
||||
#if TINS_IS_LITTLE_ENDIAN
|
||||
uint16_t key_mic:1,
|
||||
@@ -716,7 +720,7 @@ namespace Tins {
|
||||
uint8_t mic[mic_size];
|
||||
uint16_t wpa_length;
|
||||
#endif
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void write_body(uint8_t *buffer, uint32_t total_sz);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#define TINS_ENDIANNESS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
|
||||
#if defined(BSD)
|
||||
#if defined(__APPLE__)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#define TINS_ETHERNET_II_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "endianness.h"
|
||||
#include "hw_address.h"
|
||||
@@ -203,11 +203,12 @@ namespace Tins {
|
||||
/**
|
||||
* Struct that represents the Ethernet II header
|
||||
*/
|
||||
TINS_BEGIN_PACK
|
||||
struct ethhdr {
|
||||
uint8_t dst_mac[address_type::address_size];
|
||||
uint8_t src_mac[address_type::address_size];
|
||||
uint16_t payload_type;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#ifndef TINS_ICMP_H
|
||||
#define TINS_ICMP_H
|
||||
|
||||
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "endianness.h"
|
||||
|
||||
@@ -301,6 +301,7 @@ namespace Tins {
|
||||
return new ICMP(*this);
|
||||
}
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct icmphdr {
|
||||
uint8_t type;
|
||||
uint8_t code;
|
||||
@@ -317,7 +318,7 @@ namespace Tins {
|
||||
} frag;
|
||||
uint8_t pointer;
|
||||
} un;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
/** \brief Serialices this ICMP PDU.
|
||||
* \param buffer The buffer in which the PDU will be serialized.
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define TINS_ICMPV6_H
|
||||
|
||||
#include <list>
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "ipv6_address.h"
|
||||
#include "pdu_option.h"
|
||||
@@ -150,6 +151,7 @@ public:
|
||||
/**
|
||||
* Type type used to store the prefix information option data.
|
||||
*/
|
||||
TINS_BEGIN_PACK
|
||||
struct prefix_info_type {
|
||||
uint8_t prefix_len;
|
||||
#if TINS_IS_LITTLE_ENDIAN
|
||||
@@ -179,7 +181,7 @@ public:
|
||||
{
|
||||
addr.copy(prefix);
|
||||
}
|
||||
} __attribute__((packed));
|
||||
} TINS_END_PACK;
|
||||
|
||||
/**
|
||||
* \brief Constructs an ICMPv6 object.
|
||||
@@ -646,6 +648,7 @@ public:
|
||||
*/
|
||||
new_ha_info_type new_home_agent_info() const;
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct icmp6hdr {
|
||||
uint8_t type;
|
||||
uint8_t code;
|
||||
@@ -688,7 +691,7 @@ private:
|
||||
uint16_t router_lifetime;
|
||||
} u_nd_ra;
|
||||
};
|
||||
} __attribute__((packed));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent);
|
||||
bool has_options() const;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#define TINS_IEEE802_3_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "endianness.h"
|
||||
#include "hw_address.h"
|
||||
@@ -201,11 +201,12 @@ namespace Tins {
|
||||
/**
|
||||
* Struct that represents the Ethernet II header
|
||||
*/
|
||||
TINS_BEGIN_PACK
|
||||
struct ethhdr {
|
||||
uint8_t dst_mac[address_type::address_size];
|
||||
uint8_t src_mac[address_type::address_size];
|
||||
uint16_t length;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent);
|
||||
|
||||
|
||||
18
include/ip.h
18
include/ip.h
@@ -36,7 +36,7 @@
|
||||
#include "endianness.h"
|
||||
#include "ip_address.h"
|
||||
#include "pdu_option.h"
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
|
||||
namespace Tins {
|
||||
|
||||
@@ -100,6 +100,7 @@ namespace Tins {
|
||||
/**
|
||||
* \brief The type used to represent an option's type.
|
||||
*/
|
||||
TINS_BEGIN_PACK
|
||||
struct option_identifier {
|
||||
#if TINS_IS_LITTLE_ENDIAN
|
||||
uint8_t number:5,
|
||||
@@ -162,7 +163,7 @@ namespace Tins {
|
||||
bool operator==(const option_identifier &rhs) const {
|
||||
return number == rhs.number && op_class == rhs.op_class && copied == rhs.copied;
|
||||
}
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
/**
|
||||
* The IP options type.
|
||||
@@ -591,15 +592,14 @@ namespace Tins {
|
||||
private:
|
||||
static const uint8_t DEFAULT_TTL;
|
||||
|
||||
TINS_BEGIN_PACK
|
||||
struct iphdr {
|
||||
#if TINS_IS_LITTLE_ENDIAN
|
||||
unsigned int ihl:4;
|
||||
unsigned int version:4;
|
||||
#elif TINS_IS_BIG_ENDIAN
|
||||
unsigned int version:4;
|
||||
unsigned int ihl:4;
|
||||
uint8_t ihl:4,
|
||||
version:4;
|
||||
#else
|
||||
# error "Endian is not LE nor BE..."
|
||||
uint8_t version:4,
|
||||
ihl:4;
|
||||
#endif
|
||||
uint8_t tos;
|
||||
uint16_t tot_len;
|
||||
@@ -611,7 +611,7 @@ namespace Tins {
|
||||
uint32_t saddr;
|
||||
uint32_t daddr;
|
||||
/*The options start here. */
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void init_ip_fields();
|
||||
void write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <list>
|
||||
#include <stdexcept>
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "endianness.h"
|
||||
#include "small_uint.h"
|
||||
@@ -290,6 +291,7 @@ private:
|
||||
static uint8_t *write_header(const ipv6_ext_header &header, uint8_t *buffer);
|
||||
static bool is_extension_header(uint8_t header_id);
|
||||
|
||||
TINS_BEGIN_PACK
|
||||
struct ipv6_header {
|
||||
#if TINS_IS_BIG_ENDIAN
|
||||
uint32_t version:4,
|
||||
@@ -299,7 +301,7 @@ private:
|
||||
next_header:8,
|
||||
hop_limit:8;
|
||||
#else
|
||||
uint32_t traffic_class:4,
|
||||
uint8_t traffic_class:4,
|
||||
version:4;
|
||||
uint8_t flow_label[3];
|
||||
uint16_t payload_length;
|
||||
@@ -307,7 +309,7 @@ private:
|
||||
uint8_t hop_limit;
|
||||
#endif
|
||||
uint8_t src_addr[16], dst_addr[16];
|
||||
} __attribute__((packed));
|
||||
} TINS_END_PACK;
|
||||
|
||||
ipv6_header _header;
|
||||
headers_type ext_headers;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <stdint.h>
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "endianness.h"
|
||||
|
||||
@@ -314,57 +315,63 @@ namespace Tins {
|
||||
return new LLC(*this);
|
||||
}
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct llchdr {
|
||||
uint8_t dsap;
|
||||
uint8_t ssap;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
#if TINS_IS_LITTLE_ENDIAN
|
||||
TINS_BEGIN_PACK
|
||||
struct info_control_field {
|
||||
uint16_t
|
||||
type_bit:1,
|
||||
send_seq_num:7,
|
||||
poll_final_bit:1,
|
||||
recv_seq_num:7;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
TINS_BEGIN_PACK
|
||||
struct super_control_field {
|
||||
uint16_t type_bit:2,
|
||||
supervisory_func:2,
|
||||
unused:4,
|
||||
poll_final_bit:1,
|
||||
recv_seq_num:7;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
TINS_BEGIN_PACK
|
||||
struct un_control_field {
|
||||
uint8_t type_bits:2,
|
||||
mod_func1:2,
|
||||
poll_final_bit:1,
|
||||
mod_func2:3;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
#elif TINS_IS_BIG_ENDIAN
|
||||
TINS_BEGIN_PACK
|
||||
struct info_control_field {
|
||||
uint16_t send_seq_num:7,
|
||||
type_bit:1,
|
||||
recv_seq_num:7,
|
||||
poll_final_bit:1;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
TINS_BEGIN_PACK
|
||||
struct super_control_field {
|
||||
uint16_t unused:4,
|
||||
supervisory_func:2,
|
||||
type_bit:2,
|
||||
recv_seq_num:7,
|
||||
poll_final_bit:1;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
TINS_BEGIN_PACK
|
||||
struct un_control_field {
|
||||
uint8_t mod_func2:3,
|
||||
poll_final_bit:1,
|
||||
mod_func1:2,
|
||||
type_bits:2;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
} TINS_END_PACK;
|
||||
#endif
|
||||
|
||||
typedef std::vector<uint8_t> field_type;
|
||||
|
||||
@@ -34,4 +34,15 @@
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
// Packing directives....
|
||||
#ifdef _MSC_VER
|
||||
#define TINS_BEGIN_PACK __pragma( pack(push, 1) )
|
||||
#define TINS_END_PACK __pragma( pack(pop) )
|
||||
#define TINS_PACKED(DECLARATION) __pragma( pack(push, 1) ) DECLARATION __pragma( pack(pop) )
|
||||
#else
|
||||
#define TINS_BEGIN_PACK
|
||||
#define TINS_END_PACK __attribute__((packed))
|
||||
#define TINS_PACKED(DECLARATION) DECLARATION __attribute__((packed))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
* \return true if pdu() == nullptr, false otherwise.
|
||||
*/
|
||||
operator bool() const {
|
||||
return pdu_;
|
||||
return bool(pdu_);
|
||||
}
|
||||
private:
|
||||
PDU *pdu_;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <stdint.h>
|
||||
#include <map>
|
||||
#include "network_interface.h"
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
|
||||
struct timeval;
|
||||
struct sockaddr;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#ifndef TINS_RADIOTAP_H
|
||||
#define TINS_RADIOTAP_H
|
||||
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "endianness.h"
|
||||
#include "network_interface.h"
|
||||
@@ -318,6 +319,7 @@ namespace Tins {
|
||||
*/
|
||||
PDUType pdu_type() const { return PDU::RADIOTAP; }
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct radiotap_hdr {
|
||||
#if TINS_IS_LITTLE_ENDIAN
|
||||
uint8_t it_version;
|
||||
@@ -368,7 +370,7 @@ namespace Tins {
|
||||
reserved4:7,
|
||||
ext:1;
|
||||
#endif
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void init();
|
||||
void write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent);
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
#include "small_uint.h"
|
||||
|
||||
@@ -154,19 +155,13 @@ namespace Tins {
|
||||
return new SNAP(*this);
|
||||
}
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct snaphdr {
|
||||
uint8_t dsap;
|
||||
uint8_t ssap;
|
||||
/*#if TINS_IS_LITTLE_ENDIAN
|
||||
uint32_t control:8,
|
||||
org_code:24;
|
||||
#elif TINS_IS_BIG_ENDIAN
|
||||
uint32_t org_code:24,
|
||||
control:8;
|
||||
#endif*/
|
||||
uint32_t control_org;
|
||||
uint16_t eth_type;
|
||||
} __attribute__((__packed__));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent);
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
#include "pdu.h"
|
||||
#include "macros.h"
|
||||
#include "endianness.h"
|
||||
#include "small_uint.h"
|
||||
#include "pdu_option.h"
|
||||
@@ -391,6 +392,7 @@ namespace Tins {
|
||||
return new TCP(*this);
|
||||
}
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct tcphdr {
|
||||
uint16_t sport;
|
||||
uint16_t dport;
|
||||
@@ -424,7 +426,7 @@ namespace Tins {
|
||||
uint16_t window;
|
||||
uint16_t check;
|
||||
uint16_t urg_ptr;
|
||||
} __attribute__((packed));
|
||||
} TINS_END_PACK;
|
||||
|
||||
static const uint16_t DEFAULT_WINDOW;
|
||||
|
||||
|
||||
@@ -30,7 +30,12 @@
|
||||
#ifndef TINS_TIMESTAMP_H
|
||||
#define TINS_TIMESTAMP_H
|
||||
|
||||
#include <sys/time.h>
|
||||
#ifdef WIN32
|
||||
#define NOMINMAX
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include "cxxstd.h"
|
||||
#if TINS_IS_CXX11
|
||||
#include <chrono>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#ifndef TINS_UDP_H
|
||||
#define TINS_UDP_H
|
||||
|
||||
|
||||
#include "macros.h"
|
||||
#include "pdu.h"
|
||||
#include "endianness.h"
|
||||
|
||||
@@ -123,12 +123,13 @@ namespace Tins {
|
||||
return new UDP(*this);
|
||||
}
|
||||
private:
|
||||
TINS_BEGIN_PACK
|
||||
struct udphdr {
|
||||
uint16_t sport;
|
||||
uint16_t dport;
|
||||
uint16_t len;
|
||||
uint16_t check;
|
||||
} __attribute__((packed));
|
||||
} TINS_END_PACK;
|
||||
|
||||
void copy_fields(const UDP *other);
|
||||
void write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent);
|
||||
|
||||
@@ -33,11 +33,12 @@
|
||||
#ifndef WIN32
|
||||
#include <ifaddrs.h>
|
||||
#else
|
||||
#define NOMINMAX
|
||||
#include <winsock2.h>
|
||||
#include <iphlpapi.h>
|
||||
#undef interface
|
||||
#endif
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
#ifdef BSD
|
||||
#include <sys/file.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -349,6 +350,30 @@ void Tins::Utils::route_entries(ForwardIterator output) {
|
||||
next += rtm->rtm_msglen;
|
||||
}
|
||||
}
|
||||
#elif defined(WIN32)
|
||||
template<class ForwardIterator>
|
||||
void Tins::Utils::route_entries(ForwardIterator output) {
|
||||
MIB_IPFORWARDTABLE *table;
|
||||
ULONG size = 0;
|
||||
char iface_name[256];
|
||||
GetIpForwardTable(0, &size, 0);
|
||||
std::vector<uint8_t> buffer(size);
|
||||
table = (MIB_IPFORWARDTABLE*)&buffer[0];
|
||||
GetIpForwardTable(table, &size, 0);
|
||||
|
||||
for (DWORD i = 0; i < table->dwNumEntries; i++) {
|
||||
MIB_IPFORWARDROW *row = &table->table[i];
|
||||
if(row->dwForwardType == MIB_IPROUTE_TYPE_INDIRECT) {
|
||||
if_indextoname(row->dwForwardIfIndex, iface_name);
|
||||
RouteEntry entry;
|
||||
entry.interface = iface_name;
|
||||
entry.destination = IPv4Address(row->dwForwardDest);
|
||||
entry.mask = IPv4Address(row->dwForwardMask);
|
||||
entry.gateway = IPv4Address(row->dwForwardNextHop);
|
||||
*output++ = entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
template<class ForwardIterator>
|
||||
void Tins::Utils::route_entries(ForwardIterator output) {
|
||||
|
||||
@@ -207,7 +207,8 @@ uint32_t NamedDNSRRImpl::size() const {
|
||||
}
|
||||
|
||||
uint32_t NamedDNSRRImpl::do_write(uint8_t *buffer) const {
|
||||
std::copy(name.begin(), name.end() + 1, buffer);
|
||||
buffer = std::copy(name.begin(), name.end(), buffer);
|
||||
*buffer = 0;
|
||||
return name.size() + 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
#include "arch.h"
|
||||
|
||||
#ifndef WIN32
|
||||
#ifdef BSD
|
||||
|
||||
@@ -188,7 +188,7 @@ RSNEAPOL::RSNEAPOL(const uint8_t *buffer, uint32_t total_sz)
|
||||
_key.assign(buffer, buffer + total_sz);
|
||||
}
|
||||
|
||||
void RSNEAPOL::RSNEAPOL::nonce(const uint8_t *new_nonce) {
|
||||
void RSNEAPOL::nonce(const uint8_t *new_nonce) {
|
||||
std::copy(new_nonce, new_nonce + nonce_size, _header.nonce);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
#ifndef WIN32
|
||||
#ifdef BSD
|
||||
#include <net/if_dl.h>
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
#ifndef WIN32
|
||||
#define NOMINMAX
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#include "icmp.h"
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
#ifndef WIN32
|
||||
#ifdef BSD
|
||||
#include <net/if_dl.h>
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#else
|
||||
#define NOMINMAX
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
#include "ip.h"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
#ifndef WIN32
|
||||
#include <arpa/inet.h>
|
||||
#ifdef BSD
|
||||
@@ -62,11 +62,17 @@ namespace Tins {
|
||||
|
||||
void IPv6Address::init(const char *addr) {
|
||||
#ifdef WIN32
|
||||
ULONG dummy1;
|
||||
USHORT dummy2;
|
||||
// Maybe change this, mingw doesn't have any other conversion function
|
||||
if(RtlIpv6StringToAddressExA(addr, (IN6_ADDR*)address, &dummy1, &dummy2) != NO_ERROR)
|
||||
throw malformed_address();
|
||||
// mingw on linux somehow doesn't have InetPton
|
||||
#ifdef _MSC_VER
|
||||
if(InetPtonA(AF_INET6, addr, address) != 1)
|
||||
throw malformed_address();
|
||||
#else
|
||||
ULONG dummy1;
|
||||
USHORT dummy2;
|
||||
// Maybe change this, mingw doesn't have any other conversion function
|
||||
if(RtlIpv6StringToAddressExA(addr, (IN6_ADDR*)address, &dummy1, &dummy2) != NO_ERROR)
|
||||
throw malformed_address();
|
||||
#endif
|
||||
#else
|
||||
if(inet_pton(AF_INET6, addr, address) == 0)
|
||||
throw malformed_address();
|
||||
@@ -76,9 +82,15 @@ namespace Tins {
|
||||
std::string IPv6Address::to_string() const {
|
||||
char buffer[INET6_ADDRSTRLEN];
|
||||
#ifdef WIN32
|
||||
ULONG sz = sizeof(buffer);
|
||||
if(RtlIpv6AddressToStringExA((const IN6_ADDR*)address, 0, 0, buffer, &sz) != NO_ERROR)
|
||||
throw malformed_address();
|
||||
// mingw on linux somehow doesn't have InetNtop
|
||||
#ifdef _MSC_VER
|
||||
if(InetNtopA(AF_INET6, (PVOID)address, buffer, sizeof(buffer)) != 0)
|
||||
throw malformed_address();
|
||||
#else
|
||||
ULONG sz = sizeof(buffer);
|
||||
if(RtlIpv6AddressToStringExA((const IN6_ADDR*)address, 0, 0, buffer, &sz) != NO_ERROR)
|
||||
throw malformed_address();
|
||||
#endif
|
||||
#else
|
||||
if(inet_ntop(AF_INET6, address, buffer, sizeof(buffer)) == 0)
|
||||
throw malformed_address();
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "packet_sender.h"
|
||||
#include "ip.h"
|
||||
#include "llc.h"
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
#include "rawpdu.h"
|
||||
|
||||
#if defined(BSD) && !defined(PF_LLC)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include <cstring>
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
#ifndef WIN32
|
||||
#include <netinet/in.h>
|
||||
#ifdef BSD
|
||||
@@ -42,6 +42,7 @@
|
||||
#endif
|
||||
#include <net/if.h>
|
||||
#else
|
||||
#define NOMINMAX
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
#include "network_interface.h"
|
||||
@@ -98,19 +99,16 @@ struct InterfaceInfoCollector {
|
||||
#else // WIN32
|
||||
bool operator() (const IP_ADAPTER_ADDRESSES *iface) {
|
||||
using Tins::IPv4Address;
|
||||
// This surely doesn't work
|
||||
using Tins::Endian::host_to_be;
|
||||
if(iface_id == uint32_t(iface->IfIndex)) {
|
||||
std::copy(iface->PhysicalAddress, iface->PhysicalAddress + 6, info->hw_addr.begin());
|
||||
const IP_ADAPTER_PREFIX *prefix_ptr = iface->FirstPrefix;
|
||||
for(size_t i = 0; prefix_ptr; prefix_ptr = prefix_ptr->Next, i++) {
|
||||
if(i == 0)
|
||||
info->ip_addr = IPv4Address(((const struct sockaddr_in *)prefix_ptr->Address.lpSockaddr)->sin_addr.s_addr);
|
||||
else if(i == 2)
|
||||
info->bcast_addr = IPv4Address(((const struct sockaddr_in *)prefix_ptr->Address.lpSockaddr)->sin_addr.s_addr);
|
||||
const IP_ADAPTER_UNICAST_ADDRESS *unicast = iface->FirstUnicastAddress;
|
||||
if(unicast) {
|
||||
info->ip_addr = IPv4Address(((const struct sockaddr_in *)unicast->Address.lpSockaddr)->sin_addr.s_addr);
|
||||
info->netmask = IPv4Address(host_to_be<uint32_t>(0xffffffff << (32 - unicast->OnLinkPrefixLength)));
|
||||
info->bcast_addr = IPv4Address((info->ip_addr & info->netmask) | ~info->netmask);
|
||||
found = true;
|
||||
}
|
||||
// (?????)
|
||||
info->netmask = IPv4Address(info->ip_addr - info->bcast_addr);
|
||||
found = true;
|
||||
}
|
||||
return found;
|
||||
}
|
||||
@@ -185,26 +183,9 @@ NetworkInterface::Info NetworkInterface::addresses() const {
|
||||
}
|
||||
|
||||
NetworkInterface::id_type NetworkInterface::resolve_index(const char *name) {
|
||||
#ifndef WIN32
|
||||
id_type id = if_nametoindex(name);
|
||||
if(!id)
|
||||
throw std::runtime_error("Invalid interface error");
|
||||
#else // WIN32
|
||||
id_type id;
|
||||
ULONG size;
|
||||
GetAdaptersInfo(0, &size);
|
||||
std::vector<uint8_t> buffer(size);
|
||||
if ( GetAdaptersInfo((IP_ADAPTER_INFO *)&buffer[0], &size) == ERROR_SUCCESS) {
|
||||
PIP_ADAPTER_INFO iface = (IP_ADAPTER_INFO *)&buffer[0];
|
||||
while(iface) {
|
||||
if(!strcmp(iface->AdapterName, name)) {
|
||||
id = iface->Index;
|
||||
break;
|
||||
}
|
||||
iface = iface->Next;
|
||||
}
|
||||
}
|
||||
#endif // WIN32
|
||||
throw std::runtime_error("Invalid interface");
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <errno.h>
|
||||
#else
|
||||
#define NOMINMAX
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
@@ -56,7 +57,7 @@
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include "pdu.h"
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
#include "network_interface.h"
|
||||
|
||||
|
||||
@@ -272,10 +273,12 @@ PDU *PacketSender::recv_match_loop(int sock, PDU &pdu, struct sockaddr* link_add
|
||||
if(FD_ISSET(sock, &readfds)) {
|
||||
#ifdef WIN32
|
||||
int length = addrlen;
|
||||
int size;
|
||||
#else
|
||||
socklen_t length = addrlen;
|
||||
ssize_t size;
|
||||
#endif
|
||||
ssize_t size = recvfrom(sock, (char*)buffer, 2048, 0, link_addr, &length);
|
||||
size = recvfrom(sock, (char*)buffer, 2048, 0, link_addr, &length);
|
||||
if(pdu.matches_response(buffer, size)) {
|
||||
return pdu.clone_packet(buffer, size);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
#include <stdexcept>
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
#ifndef WIN32
|
||||
#ifdef BSD
|
||||
#include <net/if_dl.h>
|
||||
|
||||
@@ -149,7 +149,7 @@ void TCP::sack_permitted() {
|
||||
}
|
||||
|
||||
bool TCP::has_sack_permitted() const {
|
||||
return search_option(SACK_OK);
|
||||
return bool(search_option(SACK_OK));
|
||||
}
|
||||
|
||||
void TCP::sack(const sack_type &edges) {
|
||||
@@ -189,7 +189,7 @@ std::pair<uint32_t, uint32_t> TCP::timestamp() const {
|
||||
throw option_not_found();
|
||||
uint64_t buffer = *(const uint64_t*)option->data_ptr();
|
||||
buffer = Endian::be_to_host(buffer);
|
||||
return std::make_pair((buffer >> 32) & 0xffffffff, buffer & 0xffffffff);
|
||||
return std::make_pair(static_cast<uint32_t>(buffer >> 32), buffer & 0xffffffff);
|
||||
}
|
||||
|
||||
void TCP::altchecksum(AltChecksums value) {
|
||||
|
||||
@@ -114,7 +114,7 @@ bool Utils::resolve_hwaddr(const NetworkInterface &iface, IPv4Address ip,
|
||||
ARP *arp_resp = response->find_pdu<ARP>();
|
||||
if(arp_resp)
|
||||
*address = arp_resp->sender_hw_addr();
|
||||
return arp_resp;
|
||||
return arp_resp != 0;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
927
tests/depends.d
927
tests/depends.d
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include "ethernetII.h"
|
||||
#include "utils.h"
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
#include "network_interface.h"
|
||||
|
||||
using namespace Tins;
|
||||
@@ -12,8 +12,8 @@ typedef EthernetII::address_type address_type;
|
||||
class EthernetIITest : public ::testing::Test {
|
||||
public:
|
||||
static const uint8_t expected_packet[];
|
||||
static address_type s_addr;
|
||||
static address_type d_addr;
|
||||
static address_type src_addr;
|
||||
static address_type dst_addr;
|
||||
static address_type empty_addr;
|
||||
static const NetworkInterface iface;
|
||||
static const uint16_t p_type;
|
||||
@@ -28,9 +28,9 @@ const uint8_t EthernetIITest::expected_packet[] = {
|
||||
'\xd0', '\xab'
|
||||
};
|
||||
|
||||
address_type EthernetIITest::s_addr("8a:8b:8c:8d:8e:8f");
|
||||
address_type EthernetIITest::src_addr("8a:8b:8c:8d:8e:8f");
|
||||
|
||||
address_type EthernetIITest::d_addr("aa:bb:cc:dd:ee:ff");
|
||||
address_type EthernetIITest::dst_addr("aa:bb:cc:dd:ee:ff");
|
||||
|
||||
address_type EthernetIITest::empty_addr;
|
||||
|
||||
@@ -83,14 +83,14 @@ TEST_F(EthernetIITest, NestedCopy) {
|
||||
|
||||
TEST_F(EthernetIITest, SourceAddress) {
|
||||
EthernetII eth;
|
||||
eth.src_addr(s_addr);
|
||||
ASSERT_EQ(eth.src_addr(), s_addr);
|
||||
eth.src_addr(src_addr);
|
||||
ASSERT_EQ(eth.src_addr(), src_addr);
|
||||
}
|
||||
|
||||
TEST_F(EthernetIITest, DestinationAddress) {
|
||||
EthernetII eth;
|
||||
eth.dst_addr(d_addr);
|
||||
ASSERT_EQ(eth.dst_addr(), d_addr);
|
||||
eth.dst_addr(dst_addr);
|
||||
ASSERT_EQ(eth.dst_addr(), dst_addr);
|
||||
}
|
||||
|
||||
TEST_F(EthernetIITest, PayloadType) {
|
||||
@@ -107,16 +107,16 @@ TEST_F(EthernetIITest, Interface) {
|
||||
|
||||
TEST_F(EthernetIITest, CompleteConstructor) {
|
||||
EthernetII* eth2 = new EthernetII();
|
||||
EthernetII eth(iface, d_addr, s_addr, eth2);
|
||||
EXPECT_EQ(eth.dst_addr(), d_addr);
|
||||
EXPECT_EQ(eth.src_addr(), s_addr);
|
||||
EthernetII eth(iface, dst_addr, src_addr, eth2);
|
||||
EXPECT_EQ(eth.dst_addr(), dst_addr);
|
||||
EXPECT_EQ(eth.src_addr(), src_addr);
|
||||
EXPECT_TRUE(eth.inner_pdu() == eth2);
|
||||
EXPECT_EQ(eth.payload_type(), 0);
|
||||
EXPECT_EQ(eth.iface(), iface);
|
||||
}
|
||||
|
||||
TEST_F(EthernetIITest, Serialize) {
|
||||
EthernetII eth(iface, d_addr, s_addr);
|
||||
EthernetII eth(iface, dst_addr, src_addr);
|
||||
eth.payload_type(p_type);
|
||||
PDU::serialization_type serialized = eth.serialize();
|
||||
ASSERT_EQ(serialized.size(), sizeof(expected_packet));
|
||||
@@ -125,8 +125,8 @@ TEST_F(EthernetIITest, Serialize) {
|
||||
|
||||
TEST_F(EthernetIITest, ConstructorFromBuffer) {
|
||||
EthernetII eth(expected_packet, sizeof(expected_packet));
|
||||
EXPECT_EQ(eth.src_addr(), s_addr);
|
||||
EXPECT_EQ(eth.dst_addr(), d_addr);
|
||||
EXPECT_EQ(eth.src_addr(), src_addr);
|
||||
EXPECT_EQ(eth.dst_addr(), dst_addr);
|
||||
EXPECT_EQ(eth.payload_type(), p_type);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ using namespace std;
|
||||
|
||||
class LLCTest : public testing::Test {
|
||||
public:
|
||||
static const uint8_t expected_packet[];
|
||||
static const uint8_t from_buffer_unnumbered[];
|
||||
static const uint8_t from_buffer_info[];
|
||||
static const uint8_t from_buffer_super[];
|
||||
@@ -18,7 +17,6 @@ public:
|
||||
//void test_equals(const IP &ip1, const IP &ip2);
|
||||
};
|
||||
|
||||
const uint8_t LLCTest::expected_packet[] = {};
|
||||
const uint8_t LLCTest::from_buffer_info[] = {'\xfe', '\x48', '\x3c', '\x3b'};
|
||||
const uint8_t LLCTest::from_buffer_super[] = {'\x4b', '\x19', '\x05', '\x3a'};
|
||||
const uint8_t LLCTest::from_buffer_unnumbered[] = {'\xaa', '\x17', '\xcf'};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <string>
|
||||
#include "network_interface.h"
|
||||
#include "utils.h"
|
||||
#include "arch.h"
|
||||
#include "macros.h"
|
||||
|
||||
using namespace Tins;
|
||||
|
||||
@@ -14,6 +14,10 @@ public:
|
||||
#ifdef BSD
|
||||
const std::string NetworkInterfaceTest::iface_name("lo0"),
|
||||
NetworkInterfaceTest::iface_addr("");
|
||||
#elif defined(WIN32)
|
||||
// modify me on every windows environment :D
|
||||
const std::string NetworkInterfaceTest::iface_name("{INSERT-SOME-INTERFACE-NAME}"),
|
||||
NetworkInterfaceTest::iface_addr("");
|
||||
#else
|
||||
const std::string NetworkInterfaceTest::iface_name("lo"),
|
||||
NetworkInterfaceTest::iface_addr("");
|
||||
|
||||
@@ -10,13 +10,10 @@ using namespace Tins;
|
||||
|
||||
class RC4EAPOLTest : public testing::Test {
|
||||
public:
|
||||
static const uint8_t expected_packet[];
|
||||
};
|
||||
|
||||
const uint8_t RC4EAPOLTest::expected_packet[] = {
|
||||
|
||||
};
|
||||
|
||||
|
||||
TEST_F(RC4EAPOLTest, DefaultConstructor) {
|
||||
uint8_t empty_iv[RC4EAPOL::key_iv_size] = { 0 };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user