/* * Class providing utilities functions. */ #ifndef UTILITIES_H #define UTILITIES_H #include #include #include #include #include #include #include #include #include typedef unsigned short u16; typedef unsigned long u32; using namespace Tins; std::string getIPv4Class(std::string ipAddress); void snifferIteratorIncrement(Tins::SnifferIterator& iterator); void convertIPv4toArray(std::string IP, unsigned short IP_bytes[]); void split_str(const std::string& s, char delim,std::vector& v); int getClosestIndex(std::vector v, std::chrono::microseconds refElem); u16 tcp_sum_calc(u16 len_tcp, u16 src_addr[],u16 dest_addr[], bool padding, u16 buff[]); bool check_tcpChecksum(std::string ipAddressSender, std::string ipAddressReceiver, TCP tcpPkt); template std::string integral_to_binary_string(T byte); #endif //UTILITIES_H