Check network ethernet type whitelist instead of hard-coded ethernet types.
This commit is contained in:
parent
8e1b897f0a
commit
55616388ea
5 changed files with 83 additions and 28 deletions
|
@ -31,6 +31,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <string>
|
||||
|
@ -460,6 +461,38 @@ public:
|
|||
#endif
|
||||
}
|
||||
|
||||
// String to int converters (and hex string to int)
|
||||
static inline unsigned int stoui(const char *s)
|
||||
throw()
|
||||
{
|
||||
return (unsigned int)strtoul(s,(char **)0,10);
|
||||
}
|
||||
static inline unsigned long stoul(const char *s)
|
||||
throw()
|
||||
{
|
||||
return strtoul(s,(char **)0,10);
|
||||
}
|
||||
static inline unsigned long long stoull(const char *s)
|
||||
throw()
|
||||
{
|
||||
return strtoull(s,(char **)0,10);
|
||||
}
|
||||
static inline unsigned int hstoui(const char *s)
|
||||
throw()
|
||||
{
|
||||
return (unsigned int)strtoul(s,(char **)0,16);
|
||||
}
|
||||
static inline unsigned long hstoul(const char *s)
|
||||
throw()
|
||||
{
|
||||
return strtoul(s,(char **)0,16);
|
||||
}
|
||||
static inline unsigned long long hstoull(const char *s)
|
||||
throw()
|
||||
{
|
||||
return strtoull(s,(char **)0,16);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a safe C string copy
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue