1 #ifndef PCAPPP_SYSTEM_UTILS 2 #define PCAPPP_SYSTEM_UTILS 10 #define MAX_NUM_OF_CORES 32 13 int gettimeofday(
struct timeval * tp,
struct timezone * tzp);
189 typedef uint32_t CoreMask;
300 static std::string m_AppName;
309 static void init(
int argc,
char* argv[])
320 size_t lastPos = m_AppName.rfind(
'/');
321 if (lastPos != std::string::npos)
323 m_AppName = m_AppName.substr(lastPos + 1);
327 lastPos = m_AppName.rfind(
'\\');
328 if (lastPos != std::string::npos)
330 m_AppName = m_AppName.substr(lastPos + 1);
334 m_AppName = m_AppName.substr(0, m_AppName.rfind(
'.'));
340 static const std::string&
get() {
return m_AppName; }
356 typedef void (*EventHandlerCallback)(
void* cookie);
374 void onApplicationInterrupted(EventHandlerCallback handler,
void* cookie);
377 EventHandlerCallback m_ApplicationInterruptedHandler;
378 void* m_ApplicationInterruptedCookie;
384 static int handlerRoutine(
unsigned long fdwCtrlType);
386 static void handlerRoutine(
int signum);
The main namespace for the PcapPlusPlus lib.
static const SystemCore Core1
Definition: SystemUtils.h:61
static const SystemCore Core26
Definition: SystemUtils.h:161
static const SystemCore Core24
Definition: SystemUtils.h:153
static const SystemCore Core3
Definition: SystemUtils.h:69
static const SystemCore Core30
Definition: SystemUtils.h:177
Definition: SystemUtils.h:297
Definition: SystemUtils.h:27
static const SystemCore Core14
Definition: SystemUtils.h:113
static const SystemCore Core21
Definition: SystemUtils.h:141
uint32_t hostToNet32(uint32_t host)
int clockGetTime(long &sec, long &nsec)
bool operator==(const SystemCore &other) const
Definition: SystemUtils.h:45
static const SystemCore Core22
Definition: SystemUtils.h:145
void createCoreVectorFromCoreMask(CoreMask coreMask, std::vector< SystemCore > &resultVec)
uint16_t netToHost16(uint16_t net)
uint16_t hostToNet16(uint16_t host)
static const SystemCore Core9
Definition: SystemUtils.h:93
static const SystemCore Core18
Definition: SystemUtils.h:129
static void init(int argc, char *argv[])
Definition: SystemUtils.h:309
bool directoryExists(const std::string &dirPath)
static const SystemCore Core17
Definition: SystemUtils.h:125
uint32_t Mask
Definition: SystemUtils.h:34
static ApplicationEventHandler & getInstance()
Definition: SystemUtils.h:362
uint8_t Id
Definition: SystemUtils.h:39
static const SystemCore Core16
Definition: SystemUtils.h:121
static const SystemCore Core5
Definition: SystemUtils.h:77
void multiPlatformMSleep(uint32_t milliseconds)
uint32_t netToHost32(uint32_t net)
CoreMask createCoreMaskFromCoreVector(std::vector< SystemCore > cores)
static const SystemCore Core4
Definition: SystemUtils.h:73
static const SystemCore Core0
Definition: SystemUtils.h:57
static const SystemCore Core29
Definition: SystemUtils.h:173
Definition: SystemUtils.h:52
static const SystemCore Core7
Definition: SystemUtils.h:85
static const SystemCore Core23
Definition: SystemUtils.h:149
static const SystemCore Core8
Definition: SystemUtils.h:89
static const SystemCore Core25
Definition: SystemUtils.h:157
static const SystemCore Core6
Definition: SystemUtils.h:81
static const SystemCore Core31
Definition: SystemUtils.h:181
static const SystemCore Core20
Definition: SystemUtils.h:137
static const SystemCore Core28
Definition: SystemUtils.h:169
static const SystemCore Core15
Definition: SystemUtils.h:117
std::string executeShellCommand(const std::string &command)
Definition: SystemUtils.h:348
static const SystemCore Core27
Definition: SystemUtils.h:165
static const SystemCore Core2
Definition: SystemUtils.h:65
static const SystemCore Core19
Definition: SystemUtils.h:133
static const SystemCore Core13
Definition: SystemUtils.h:109
static const SystemCore Core11
Definition: SystemUtils.h:101
CoreMask getCoreMaskForAllMachineCores()
static const SystemCore Core10
Definition: SystemUtils.h:97
static const SystemCore Core12
Definition: SystemUtils.h:105
void multiPlatformSleep(uint32_t seconds)
CoreMask createCoreMaskFromCoreIds(std::vector< int > coreIds)