suricata
util-ioctl.h File Reference
#include "suricata-common.h"
#include "util-device.h"
Include dependency graph for util-ioctl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int GetIfaceMTU (const char *pcap_dev)
 output the link MTU More...
 
int GetIfaceMaxPacketSize (const char *pcap_dev)
 output max packet size for a link More...
 
int GetIfaceOffloading (const char *dev, int csum, int other)
 output offloading status of the link More...
 
int GetIfaceRSSQueuesNum (const char *pcap_dev)
 
int DisableIfaceOffloading (LiveDevice *dev, int csum, int other)
 
void RestoreIfaceOffloading (LiveDevice *dev)
 

Detailed Description

Function Documentation

int DisableIfaceOffloading ( LiveDevice dev,
int  csum,
int  other 
)

Definition at line 707 of file util-ioctl.c.

References LiveDevice_::offload_orig.

Referenced by NoWinDivertSupportExit(), ReceivePcapThreadInit(), RunModeIdsAFPRegister(), RunModeIdsNetmapRegister(), and RunModeIdsPfringRegister().

Here is the caller graph for this function:

int GetIfaceMaxPacketSize ( const char *  pcap_dev)

output max packet size for a link

This does a best effort to find the maximum packet size for the link. In case of uncertainty, it will output a majorant to be sure avoid the cost of dynamic allocation.

Parameters
Nameof a network interface
Return values
0in case of error

Definition at line 132 of file util-ioctl.c.

References LiveDevice_::dev, flags, GetIfaceMTU(), OFFLOAD_FLAG_GRO, OFFLOAD_FLAG_GSO, OFFLOAD_FLAG_LRO, OFFLOAD_FLAG_RXCSUM, OFFLOAD_FLAG_SG, OFFLOAD_FLAG_TOE, OFFLOAD_FLAG_TSO, OFFLOAD_FLAG_TXCSUM, LiveDevice_::offload_orig, SC_ERR_NIC_OFFLOADING, SC_ERR_SYSCALL, SCLogDebug, SCLogError, SCLogPerf, SCLogWarning, and strlcpy().

Referenced by AFPGetLinkType(), PostRunDeinit(), and ReceivePcapThreadInit().

Here is the call graph for this function:

Here is the caller graph for this function:

int GetIfaceMTU ( const char *  pcap_dev)

output the link MTU

Parameters
Nameof link
Return values
-1in case of error, 0 if MTU can not be found

Definition at line 91 of file util-ioctl.c.

References SC_ERR_SYSCALL, SCLogInfo, SCLogWarning, and strlcpy().

Referenced by AFPPeersListCheck(), GetIfaceMaxPacketSize(), and PostRunDeinit().

Here is the call graph for this function:

Here is the caller graph for this function:

int GetIfaceOffloading ( const char *  dev,
int  csum,
int  other 
)

output offloading status of the link

Test interface for offloading features. If one of them is activated then suricata mays received packets merge at reception. The result is oversized packets and this may cause some serious problem in some capture mode where the size of the packet is limited (AF_PACKET in V2 more for example).

Parameters
Nameof link
csumcheck if checksums are offloaded
othercheck if other things are offloaded: TSO, GRO, etc.
Return values
-1in case of error, 0 if none, 1 if some

Definition at line 694 of file util-ioctl.c.

Referenced by NoWinDivertSupportExit(), ReceivePcapThreadInit(), RunModeIdsAFPRegister(), RunModeIdsNetmapRegister(), and RunModeIdsPfringRegister().

Here is the caller graph for this function:

int GetIfaceRSSQueuesNum ( const char *  pcap_dev)

Definition at line 737 of file util-ioctl.c.

References SC_ERR_SYSCALL, SCLogInfo, SCLogWarning, and strlcpy().

Referenced by RunModeIdsAFPRegister(), RunModeIdsNetmapRegister(), and RunModeIdsPfringRegister().

Here is the call graph for this function:

Here is the caller graph for this function:

void RestoreIfaceOffloading ( LiveDevice dev)

Definition at line 724 of file util-ioctl.c.

References LiveDevice_::offload_orig.

Referenced by LiveDeviceListClean(), and NoWinDivertSupportExit().

Here is the caller graph for this function: