suricata
|
Go to the source code of this file.
Data Structures | |
struct | LiveDevice_ |
struct | LiveDeviceName_ |
Macros | |
#define | OFFLOAD_FLAG_SG (1<<0) |
#define | OFFLOAD_FLAG_TSO (1<<1) |
#define | OFFLOAD_FLAG_GSO (1<<2) |
#define | OFFLOAD_FLAG_GRO (1<<3) |
#define | OFFLOAD_FLAG_LRO (1<<4) |
#define | OFFLOAD_FLAG_RXCSUM (1<<5) |
#define | OFFLOAD_FLAG_TXCSUM (1<<6) |
#define | OFFLOAD_FLAG_TOE (1<<7) |
#define | MAX_DEVNAME 10 |
Typedefs | |
typedef struct LiveDevice_ | LiveDevice |
typedef struct LiveDeviceName_ | LiveDeviceName |
Functions | |
void | LiveSetOffloadDisable (void) |
void | LiveSetOffloadWarn (void) |
int | LiveGetOffload (void) |
void | LiveDevRegisterExtension (void) |
int | LiveRegisterDeviceName (const char *dev) |
Add a device for monitoring. More... | |
int | LiveRegisterDevice (const char *dev) |
Add a pcap device for monitoring and create structure. More... | |
int | LiveDevUseBypass (LiveDevice *dev) |
void | LiveDevAddBypassStats (LiveDevice *dev, uint64_t cnt, int family) |
void | LiveDevSubBypassStats (LiveDevice *dev, uint64_t cnt, int family) |
void | LiveDevAddBypassFail (LiveDevice *dev, uint64_t cnt, int family) |
void | LiveDevAddBypassSuccess (LiveDevice *dev, uint64_t cnt, int family) |
int | LiveGetDeviceCount (void) |
Get the number of registered devices. More... | |
const char * | LiveGetDeviceName (int number) |
Get a pointer to the device name at idx. More... | |
LiveDevice * | LiveGetDevice (const char *dev) |
Get a pointer to the device at idx. More... | |
const char * | LiveGetShortName (const char *dev) |
int | LiveBuildDeviceList (const char *base) |
void | LiveDeviceHasNoStats (void) |
int | LiveDeviceListClean (void) |
int | LiveBuildDeviceListCustom (const char *base, const char *itemname) |
LiveDevice * | LiveDeviceForEach (LiveDevice **ldev, LiveDevice **ndev) |
void | LiveDeviceFinalize (void) |
#define MAX_DEVNAME 10 |
Definition at line 42 of file util-device.h.
#define OFFLOAD_FLAG_GRO (1<<3) |
Definition at line 32 of file util-device.h.
#define OFFLOAD_FLAG_GSO (1<<2) |
Definition at line 31 of file util-device.h.
#define OFFLOAD_FLAG_LRO (1<<4) |
Definition at line 33 of file util-device.h.
#define OFFLOAD_FLAG_RXCSUM (1<<5) |
Definition at line 34 of file util-device.h.
#define OFFLOAD_FLAG_SG (1<<0) |
Definition at line 29 of file util-device.h.
#define OFFLOAD_FLAG_TOE (1<<7) |
Definition at line 36 of file util-device.h.
#define OFFLOAD_FLAG_TSO (1<<1) |
Definition at line 30 of file util-device.h.
#define OFFLOAD_FLAG_TXCSUM (1<<6) |
Definition at line 35 of file util-device.h.
typedef struct LiveDevice_ LiveDevice |
storage for live device names
typedef struct LiveDeviceName_ LiveDeviceName |
int LiveBuildDeviceList | ( | const char * | base | ) |
Definition at line 274 of file util-device.c.
References LiveBuildDeviceListCustom().
int LiveBuildDeviceListCustom | ( | const char * | base, |
const char * | itemname | ||
) |
Definition at line 279 of file util-device.c.
Referenced by LiveBuildDeviceList().
void LiveDevAddBypassFail | ( | LiveDevice * | dev, |
uint64_t | cnt, | ||
int | family | ||
) |
Increase number of failed captured flows for a protocol family
dev | pointer to LiveDevice to set stats for |
cnt | number of flows to add |
family | AF_INET to set IPv4 count or AF_INET6 to set IPv6 count |
Definition at line 534 of file util-device.c.
References BypassInfo, and LiveDevGetStorageById().
void LiveDevAddBypassStats | ( | LiveDevice * | dev, |
uint64_t | cnt, | ||
int | family | ||
) |
Increase number of currently bypassed flows for a protocol family
dev | pointer to LiveDevice to set stats for |
cnt | number of flows to add |
family | AF_INET to set IPv4 count or AF_INET6 to set IPv6 count |
Definition at line 496 of file util-device.c.
References BypassInfo, and LiveDevGetStorageById().
void LiveDevAddBypassSuccess | ( | LiveDevice * | dev, |
uint64_t | cnt, | ||
int | family | ||
) |
Increase number of currently successfully bypassed flows for a protocol family
dev | pointer to LiveDevice to set stats for |
cnt | number of flows to add |
family | AF_INET to set IPv4 count or AF_INET6 to set IPv6 count |
Definition at line 553 of file util-device.c.
References BypassInfo, and LiveDevGetStorageById().
void LiveDeviceFinalize | ( | void | ) |
Create registered devices
This function creates all needed LiveDevice from the LiveDeviceName list created via LiveRegisterDevice()
Definition at line 442 of file util-device.c.
References LiveDeviceName_::dev, LiveRegisterDevice(), next, SCFree, SCLogDebug, and TAILQ_FOREACH_SAFE.
Referenced by PostConfLoadedSetup().
LiveDevice* LiveDeviceForEach | ( | LiveDevice ** | ldev, |
LiveDevice ** | ndev | ||
) |
Definition at line 420 of file util-device.c.
References next, TAILQ_FIRST, and TAILQ_NEXT.
void LiveDeviceHasNoStats | ( | void | ) |
Call this function to disable stat on live devices
This can be useful in the case, this is not a real interface.
Definition at line 309 of file util-device.c.
Referenced by RunModeIpsIPFWAutoFp(), RunModeIpsIPFWWorker(), RunModeIpsNFQAutoFp(), RunModeIpsNFQWorker(), and RunModeIpsWinDivertAutoFp().
int LiveDeviceListClean | ( | void | ) |
Definition at line 314 of file util-device.c.
References DPDKCloseDevice(), next, SCEnter, TAILQ_FOREACH, and TAILQ_FOREACH_SAFE.
Referenced by GlobalsDestroy().
void LiveDevRegisterExtension | ( | void | ) |
Register bypass stats storage
Definition at line 465 of file util-device.c.
Referenced by PostConfLoadedSetup().
void LiveDevSubBypassStats | ( | LiveDevice * | dev, |
uint64_t | cnt, | ||
int | family | ||
) |
Decrease number of currently bypassed flows for a protocol family
dev | pointer to LiveDevice to set stats for |
cnt | number of flows to remove |
family | AF_INET to set IPv4 count or AF_INET6 to set IPv6 count |
Definition at line 515 of file util-device.c.
References BypassInfo, and LiveDevGetStorageById().
int LiveDevUseBypass | ( | LiveDevice * | dev | ) |
Prepare a LiveDevice so we can set bypass stats
Definition at line 474 of file util-device.c.
References BypassInfo, LiveDevSetStorageById(), SC_ATOMIC_INIT, SCCalloc, and SCLogError.
LiveDevice* LiveGetDevice | ( | const char * | name | ) |
Get a pointer to the device at idx.
number | idx of the device in our list |
ptr | pointer to the string containing the device |
NULL | on error |
Definition at line 248 of file util-device.c.
References LiveDevice_::dev, next, SCLogWarning, and TAILQ_FOREACH.
Referenced by LiveGetShortName(), and ReceiveErfDagThreadInit().
int LiveGetDeviceCount | ( | void | ) |
Get the number of registered devices.
cnt | the number of registered devices |
Definition at line 164 of file util-device.c.
References next, and TAILQ_FOREACH.
Referenced by LiveRegisterDevice(), RunModeSetIPSAutoFp(), RunModeSetIPSWorker(), RunModeSetLiveCaptureAutoFp(), RunModeSetLiveCaptureSingle(), and RunModeSetLiveCaptureWorkers().
const char* LiveGetDeviceName | ( | int | number | ) |
Get a pointer to the device name at idx.
number | idx of the device in our list |
ptr | pointer to the string containing the device |
NULL | on error |
Definition at line 184 of file util-device.c.
References LiveDevice_::dev, next, and TAILQ_FOREACH.
Referenced by RunModeSetIPSAutoFp(), RunModeSetIPSWorker(), RunModeSetLiveCaptureAutoFp(), RunModeSetLiveCaptureSingle(), and RunModeSetLiveCaptureWorkers().
int LiveGetOffload | ( | void | ) |
Definition at line 81 of file util-device.c.
const char* LiveGetShortName | ( | const char * | dev | ) |
Definition at line 266 of file util-device.c.
References LiveDevice_::dev_short, and LiveGetDevice().
Referenced by RunModeSetLiveCaptureAutoFp().
int LiveRegisterDevice | ( | const char * | dev | ) |
Add a pcap device for monitoring and create structure.
dev | string with the device name |
0 | on success. |
-1 | on failure. |
Definition at line 126 of file util-device.c.
References LiveDevice_::dev, LiveDevStorageSize(), LiveGetDeviceCount(), SCCalloc, SCFree, SCStrdup, and unlikely.
Referenced by LiveDeviceFinalize().
int LiveRegisterDeviceName | ( | const char * | dev | ) |
Add a device for monitoring.
To be used during option parsing. When a device has to be created during runmode init, use LiveRegisterDevice()
dev | string with the device name |
0 | on success. |
-1 | on failure. |
Definition at line 97 of file util-device.c.
References LiveDeviceName_::dev, next, SCCalloc, SCFree, SCLogDebug, SCStrdup, TAILQ_INSERT_TAIL, and unlikely.
Referenced by SCParseCommandLine().
void LiveSetOffloadDisable | ( | void | ) |
Definition at line 71 of file util-device.c.
Referenced by PostConfLoadedSetup().
void LiveSetOffloadWarn | ( | void | ) |
Definition at line 76 of file util-device.c.
Referenced by PostConfLoadedSetup().