18 int gettimeofday(
struct timeval* tp,
struct timezone* tzp);
44 return Id == other.
Id;
121 using CoreMask = uint32_t;
169 PCPP_DEPRECATED(
"Please use std::this_thread::sleep_for(std::chrono::seconds(seconds)) instead")
177 PCPP_DEPRECATED("Please use std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds)) instead")
207 static std::string m_AppName;
214 static void init(
int argc,
char* argv[])
225 size_t lastPos = m_AppName.rfind(
'/');
226 if (lastPos != std::string::npos)
228 m_AppName = m_AppName.substr(lastPos + 1);
232 lastPos = m_AppName.rfind(
'\\');
233 if (lastPos != std::string::npos)
235 m_AppName = m_AppName.substr(lastPos + 1);
239 lastPos = m_AppName.rfind(
'.');
240 if (lastPos != std::string::npos)
242 m_AppName.resize(lastPos);
247 static const std::string&
get()
281 void* m_ApplicationInterruptedCookie;
287 static int handlerRoutine(
unsigned long fdwCtrlType);
289 static void handlerRoutine(
int signum);
Definition: SystemUtils.h:205
static void init(int argc, char *argv[])
Definition: SystemUtils.h:214
static const std::string & get()
Definition: SystemUtils.h:247
Definition: SystemUtils.h:257
static ApplicationEventHandler & getInstance()
Definition: SystemUtils.h:266
void(*)(void *) EventHandlerCallback
Definition: SystemUtils.h:262
void onApplicationInterrupted(EventHandlerCallback handler, void *cookie)
The main namespace for the PcapPlusPlus lib.
CoreMask createCoreMaskFromCoreIds(const std::vector< int > &coreIds)
void multiPlatformMSleep(uint32_t milliseconds)
std::string executeShellCommand(const std::string &command)
CoreMask createCoreMaskFromCoreVector(const std::vector< SystemCore > &cores)
CoreMask getCoreMaskForAllMachineCores()
void createCoreVectorFromCoreMask(CoreMask coreMask, std::vector< SystemCore > &resultVec)
uint32_t netToHost32(uint32_t net)
uint16_t hostToNet16(uint16_t host)
uint32_t hostToNet32(uint32_t host)
uint16_t netToHost16(uint16_t net)
int clockGetTime(long &sec, long &nsec)
void multiPlatformSleep(uint32_t seconds)
bool directoryExists(const std::string &dirPath)
Definition: SystemUtils.h:29
bool operator==(const SystemCore &other) const
Definition: SystemUtils.h:42
uint32_t Mask
Definition: SystemUtils.h:35
uint8_t Id
Core ID - a value between 0 and 31.
Definition: SystemUtils.h:38
Definition: SystemUtils.h:52
static const SystemCore Core9
Static representation of core #9.
Definition: SystemUtils.h:72
static const SystemCore Core16
Static representation of core #16.
Definition: SystemUtils.h:86
static const SystemCore Core15
Static representation of core #15.
Definition: SystemUtils.h:84
static const SystemCore Core29
Static representation of core #29.
Definition: SystemUtils.h:112
static const SystemCore Core26
Static representation of core #26.
Definition: SystemUtils.h:106
static const SystemCore Core13
Static representation of core #13.
Definition: SystemUtils.h:80
static const SystemCore Core22
Static representation of core #22.
Definition: SystemUtils.h:98
static const SystemCore Core10
Static representation of core #10.
Definition: SystemUtils.h:74
static const SystemCore Core8
Static representation of core #8.
Definition: SystemUtils.h:70
static const SystemCore Core1
Static representation of core #1.
Definition: SystemUtils.h:56
static const SystemCore Core23
Static representation of core #23.
Definition: SystemUtils.h:100
static const SystemCore Core17
Static representation of core #17.
Definition: SystemUtils.h:88
static const SystemCore Core14
Static representation of core #14.
Definition: SystemUtils.h:82
static const SystemCore Core20
Static representation of core #20.
Definition: SystemUtils.h:94
static const SystemCore Core3
Static representation of core #3.
Definition: SystemUtils.h:60
static const SystemCore Core27
Static representation of core #27.
Definition: SystemUtils.h:108
static const SystemCore Core30
Static representation of core #30.
Definition: SystemUtils.h:114
static const SystemCore Core18
Static representation of core #18.
Definition: SystemUtils.h:90
static const SystemCore Core0
Static representation of core #0.
Definition: SystemUtils.h:54
static const SystemCore Core12
Static representation of core #12.
Definition: SystemUtils.h:78
static const SystemCore Core24
Static representation of core #24.
Definition: SystemUtils.h:102
static const SystemCore Core25
Static representation of core #25.
Definition: SystemUtils.h:104
static const SystemCore Core11
Static representation of core #11.
Definition: SystemUtils.h:76
static const SystemCore Core28
Static representation of core #28.
Definition: SystemUtils.h:110
static const SystemCore Core7
Static representation of core #7.
Definition: SystemUtils.h:68
static const SystemCore Core19
Static representation of core #19.
Definition: SystemUtils.h:92
static const SystemCore Core4
Static representation of core #4.
Definition: SystemUtils.h:62
static const SystemCore Core31
Static representation of core #31.
Definition: SystemUtils.h:116
static const SystemCore Core2
Static representation of core #2.
Definition: SystemUtils.h:58
static const SystemCore Core5
Static representation of core #5.
Definition: SystemUtils.h:64
static const SystemCore Core6
Static representation of core #6.
Definition: SystemUtils.h:66
static const SystemCore Core21
Static representation of core #21.
Definition: SystemUtils.h:96
static const SystemCore IdToSystemCore[MAX_NUM_OF_CORES]
A static array for mapping core ID (integer) to the corresponding static SystemCore representation.
Definition: SystemUtils.h:118