suricata
app-layer-modbus.h File Reference
#include "decode.h"
#include "detect-engine-state.h"
#include "queue.h"
Include dependency graph for app-layer-modbus.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ModbusTransaction_
 
struct  ModbusState_
 

Macros

#define MODBUS_CAT_NONE   0x0
 
#define MODBUS_CAT_PUBLIC_ASSIGNED   (1<<0)
 
#define MODBUS_CAT_PUBLIC_UNASSIGNED   (1<<1)
 
#define MODBUS_CAT_USER_DEFINED   (1<<2)
 
#define MODBUS_CAT_RESERVED   (1<<3)
 
#define MODBUS_CAT_ALL   0xFF
 
#define MODBUS_TYP_NONE   0x0
 
#define MODBUS_TYP_ACCESS_MASK   0x03
 
#define MODBUS_TYP_READ   (1<<0)
 
#define MODBUS_TYP_WRITE   (1<<1)
 
#define MODBUS_TYP_ACCESS_FUNCTION_MASK   0x3C
 
#define MODBUS_TYP_BIT_ACCESS_MASK   0x0C
 
#define MODBUS_TYP_DISCRETES   (1<<2)
 
#define MODBUS_TYP_COILS   (1<<3)
 
#define MODBUS_TYP_WORD_ACCESS_MASK   0x30
 
#define MODBUS_TYP_INPUT   (1<<4)
 
#define MODBUS_TYP_HOLDING   (1<<5)
 
#define MODBUS_TYP_SINGLE   (1<<6)
 
#define MODBUS_TYP_MULTIPLE   (1<<7)
 
#define MODBUS_TYP_WRITE_SINGLE   (MODBUS_TYP_WRITE | MODBUS_TYP_SINGLE)
 
#define MODBUS_TYP_WRITE_MULTIPLE   (MODBUS_TYP_WRITE | MODBUS_TYP_MULTIPLE)
 
#define MODBUS_TYP_READ_WRITE_MULTIPLE   (MODBUS_TYP_READ | MODBUS_TYP_WRITE | MODBUS_TYP_MULTIPLE)
 
#define MODBUS_FUNC_NONE   0x00
 

Typedefs

typedef struct ModbusTransaction_ ModbusTransaction
 
typedef struct ModbusState_ ModbusState
 

Enumerations

enum  {
  MODBUS_DECODER_EVENT_INVALID_PROTOCOL_ID, MODBUS_DECODER_EVENT_UNSOLICITED_RESPONSE, MODBUS_DECODER_EVENT_INVALID_LENGTH, MODBUS_DECODER_EVENT_INVALID_UNIT_IDENTIFIER,
  MODBUS_DECODER_EVENT_INVALID_FUNCTION_CODE, MODBUS_DECODER_EVENT_INVALID_VALUE, MODBUS_DECODER_EVENT_INVALID_EXCEPTION_CODE, MODBUS_DECODER_EVENT_VALUE_MISMATCH,
  MODBUS_DECODER_EVENT_FLOODED
}
 

Functions

void RegisterModbusParsers (void)
 Function to register the Modbus protocol parsers and other functions. More...
 
void ModbusParserRegisterTests (void)
 

Detailed Description

Author
David DIALLO diall.nosp@m.o@et.nosp@m..esie.nosp@m.a.fr

Definition in file app-layer-modbus.h.

Macro Definition Documentation

◆ MODBUS_CAT_ALL

#define MODBUS_CAT_ALL   0xFF

Definition at line 62 of file app-layer-modbus.h.

◆ MODBUS_CAT_NONE

#define MODBUS_CAT_NONE   0x0

Definition at line 57 of file app-layer-modbus.h.

◆ MODBUS_CAT_PUBLIC_ASSIGNED

#define MODBUS_CAT_PUBLIC_ASSIGNED   (1<<0)

Definition at line 58 of file app-layer-modbus.h.

◆ MODBUS_CAT_PUBLIC_UNASSIGNED

#define MODBUS_CAT_PUBLIC_UNASSIGNED   (1<<1)

Definition at line 59 of file app-layer-modbus.h.

◆ MODBUS_CAT_RESERVED

#define MODBUS_CAT_RESERVED   (1<<3)

Definition at line 61 of file app-layer-modbus.h.

◆ MODBUS_CAT_USER_DEFINED

#define MODBUS_CAT_USER_DEFINED   (1<<2)

Definition at line 60 of file app-layer-modbus.h.

◆ MODBUS_FUNC_NONE

#define MODBUS_FUNC_NONE   0x00

Definition at line 83 of file app-layer-modbus.h.

◆ MODBUS_TYP_ACCESS_FUNCTION_MASK

#define MODBUS_TYP_ACCESS_FUNCTION_MASK   0x3C

Definition at line 69 of file app-layer-modbus.h.

◆ MODBUS_TYP_ACCESS_MASK

#define MODBUS_TYP_ACCESS_MASK   0x03

Definition at line 66 of file app-layer-modbus.h.

◆ MODBUS_TYP_BIT_ACCESS_MASK

#define MODBUS_TYP_BIT_ACCESS_MASK   0x0C

Definition at line 70 of file app-layer-modbus.h.

◆ MODBUS_TYP_COILS

#define MODBUS_TYP_COILS   (1<<3)

Definition at line 72 of file app-layer-modbus.h.

◆ MODBUS_TYP_DISCRETES

#define MODBUS_TYP_DISCRETES   (1<<2)

Definition at line 71 of file app-layer-modbus.h.

◆ MODBUS_TYP_HOLDING

#define MODBUS_TYP_HOLDING   (1<<5)

Definition at line 75 of file app-layer-modbus.h.

◆ MODBUS_TYP_INPUT

#define MODBUS_TYP_INPUT   (1<<4)

Definition at line 74 of file app-layer-modbus.h.

◆ MODBUS_TYP_MULTIPLE

#define MODBUS_TYP_MULTIPLE   (1<<7)

Definition at line 77 of file app-layer-modbus.h.

◆ MODBUS_TYP_NONE

#define MODBUS_TYP_NONE   0x0

Definition at line 65 of file app-layer-modbus.h.

◆ MODBUS_TYP_READ

#define MODBUS_TYP_READ   (1<<0)

Definition at line 67 of file app-layer-modbus.h.

◆ MODBUS_TYP_READ_WRITE_MULTIPLE

#define MODBUS_TYP_READ_WRITE_MULTIPLE   (MODBUS_TYP_READ | MODBUS_TYP_WRITE | MODBUS_TYP_MULTIPLE)

Definition at line 80 of file app-layer-modbus.h.

◆ MODBUS_TYP_SINGLE

#define MODBUS_TYP_SINGLE   (1<<6)

Definition at line 76 of file app-layer-modbus.h.

◆ MODBUS_TYP_WORD_ACCESS_MASK

#define MODBUS_TYP_WORD_ACCESS_MASK   0x30

Definition at line 73 of file app-layer-modbus.h.

◆ MODBUS_TYP_WRITE

#define MODBUS_TYP_WRITE   (1<<1)

Definition at line 68 of file app-layer-modbus.h.

◆ MODBUS_TYP_WRITE_MULTIPLE

#define MODBUS_TYP_WRITE_MULTIPLE   (MODBUS_TYP_WRITE | MODBUS_TYP_MULTIPLE)

Definition at line 79 of file app-layer-modbus.h.

◆ MODBUS_TYP_WRITE_SINGLE

#define MODBUS_TYP_WRITE_SINGLE   (MODBUS_TYP_WRITE | MODBUS_TYP_SINGLE)

Definition at line 78 of file app-layer-modbus.h.

Typedef Documentation

◆ ModbusState

typedef struct ModbusState_ ModbusState

◆ ModbusTransaction

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MODBUS_DECODER_EVENT_INVALID_PROTOCOL_ID 
MODBUS_DECODER_EVENT_UNSOLICITED_RESPONSE 
MODBUS_DECODER_EVENT_INVALID_LENGTH 
MODBUS_DECODER_EVENT_INVALID_UNIT_IDENTIFIER 
MODBUS_DECODER_EVENT_INVALID_FUNCTION_CODE 
MODBUS_DECODER_EVENT_INVALID_VALUE 
MODBUS_DECODER_EVENT_INVALID_EXCEPTION_CODE 
MODBUS_DECODER_EVENT_VALUE_MISMATCH 
MODBUS_DECODER_EVENT_FLOODED 

Definition at line 43 of file app-layer-modbus.h.

Function Documentation

◆ ModbusParserRegisterTests()

void ModbusParserRegisterTests ( void  )

Definition at line 3052 of file app-layer-modbus.c.

References UtRegisterTest().

Here is the call graph for this function:

◆ RegisterModbusParsers()

void RegisterModbusParsers ( void  )

Function to register the Modbus protocol parsers and other functions.

Definition at line 1490 of file app-layer-modbus.c.

References ALPROTO_MODBUS, AppLayerProtoDetectConfProtoDetectionEnabled(), AppLayerProtoDetectPPRegister(), AppLayerProtoDetectRegisterProtocol(), RunmodeIsUnittests(), SCEnter, and STREAM_TOSERVER.

Referenced by AppLayerParserRegisterProtocolParsers().

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