suricata
util-ioctl.c File Reference
#include "suricata-common.h"
#include "util-ioctl.h"
#include "conf.h"
#include "decode.h"
#include "decode-sll.h"
Include dependency graph for util-ioctl.c:

Go to the source code of this file.

Functions

int GetIfaceMTU (const char *dev)
 output the link MTU More...
 
int GetIfaceMaxPacketSize (LiveDevice *ld)
 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 DisableIfaceOffloading (LiveDevice *dev, int csum, int other)
 
void RestoreIfaceOffloading (LiveDevice *dev)
 
int GetIfaceRSSQueuesNum (const char *dev)
 

Detailed Description

Function Documentation

◆ DisableIfaceOffloading()

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

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

References LiveDevice_::offload_orig.

◆ GetIfaceMaxPacketSize()

int GetIfaceMaxPacketSize ( LiveDevice ld)

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
LiveDeviceobject
Return values
0in case of error

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

References LiveDevice_::dev, GetIfaceMTU(), and LiveDevice_::mtu.

Here is the call graph for this function:

◆ GetIfaceMTU()

int GetIfaceMTU ( const char *  dev)

output the link MTU

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

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

References SCLogInfo, SCLogWarning, and strlcpy().

Referenced by GetIfaceMaxPacketSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIfaceOffloading()

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 666 of file util-ioctl.c.

◆ GetIfaceRSSQueuesNum()

int GetIfaceRSSQueuesNum ( const char *  dev)

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

References SCLogInfo, SCLogWarning, and strlcpy().

Here is the call graph for this function:

◆ RestoreIfaceOffloading()

void RestoreIfaceOffloading ( LiveDevice dev)

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

References LiveDevice_::offload_orig.