1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 04:54:28 +01:00

Updated IP, PDU and PacketSender so as to send forged ip packets successfully

This commit is contained in:
Santiago Alessandri
2011-08-11 09:35:23 -03:00
parent 8dc0a5a832
commit f9445b05b6
7 changed files with 87 additions and 68 deletions

View File

@@ -10,6 +10,14 @@ namespace Tins {
namespace Utils {
uint32_t ip_to_int(const std::string &ip);
std::string ip_to_string(uint32_t ip);
inline uint32_t ntohl(uint32_t address) {
return (((address & 0xff000000) >> 24) |
((address & 0x00ff0000) >> 8) |
((address & 0x0000ff00) << 8) |
((address & 0x000000ff) << 24));
}
};
};