suricata
|
#include "rust.h"
Go to the source code of this file.
Data Structures | |
struct | ENIPEncapHdr_ |
struct | ENIPEncapDataHdr_ |
struct | ENIPEncapAddressItem_ |
struct | ENIPEncapDataItem_ |
struct | CIPReqHdr_ |
struct | CIPRespHdr_ |
struct | SegmentEntry_ |
struct | AttributeEntry_ |
struct | CIPServiceEntry_ |
struct | ENIPTransaction_ |
struct | ENIPState_ |
Per flow ENIP state container. More... | |
Macros | |
#define | NOP 0x0000 |
#define | LIST_SERVICES 0x0004 |
#define | LIST_IDENTITY 0x0063 |
#define | LIST_INTERFACES 0x0064 |
#define | REGISTER_SESSION 0x0065 |
#define | UNREGISTER_SESSION 0x0066 |
#define | SEND_RR_DATA 0x006F |
#define | SEND_UNIT_DATA 0x0070 |
#define | INDICATE_STATUS 0x0072 |
#define | CANCEL 0x0073 |
#define | NULL_ADDR 0x0000 |
#define | CONNECTION_BASED 0x00a1 |
#define | CONNECTED_DATA_ITEM 0x00b1 |
#define | UNCONNECTED_DATA_ITEM 0x00b2 |
#define | SEQUENCE_ADDR_ITEM 0xB002 |
#define | SUCCESS 0x0000 |
#define | INVALID_CMD 0x0001 |
#define | NO_RESOURCES 0x0002 |
#define | INCORRECT_DATA 0x0003 |
#define | INVALID_SESSION 0x0064 |
#define | INVALID_LENGTH 0x0065 |
#define | UNSUPPORTED_PROT_REV 0x0069 |
#define | ENCAP_HEADER_ERROR 0x006A |
#define | MAX_CIP_SERVICE 127 |
#define | MAX_CIP_CLASS 65535 |
#define | MAX_CIP_ATTRIBUTE 65535 |
#define | CIP_RESERVED 0x00 |
#define | CIP_GET_ATTR_ALL 0x01 |
#define | CIP_GET_ATTR_LIST 0x03 |
#define | CIP_SET_ATTR_LIST 0x04 |
#define | CIP_RESET 0x05 |
#define | CIP_START 0x06 |
#define | CIP_STOP 0x07 |
#define | CIP_CREATE 0x08 |
#define | CIP_DELETE 0x09 |
#define | CIP_MSP 0x0a |
#define | CIP_APPLY_ATTR 0x0d |
#define | CIP_GET_ATTR_SINGLE 0x0e |
#define | CIP_SET_ATTR_SINGLE 0x10 |
#define | CIP_KICK_TIMER 0x4b |
#define | CIP_OPEN_CONNECTION 0x4c |
#define | CIP_CHANGE_START 0x4f |
#define | CIP_GET_STATUS 0x50 |
#define | PATH_CLASS_8BIT 0x20 |
#define | PATH_CLASS_16BIT 0x21 |
#define | PATH_INSTANCE_8BIT 0x24 |
#define | PATH_INSTANCE_16BIT 0x25 |
#define | PATH_ATTR_8BIT 0x30 |
#define | PATH_ATTR_16BIT 0x31 |
Typedefs | |
typedef struct ENIPEncapHdr_ | ENIPEncapHdr |
typedef struct ENIPEncapDataHdr_ | ENIPEncapDataHdr |
typedef struct ENIPEncapAddressItem_ | ENIPEncapAddressItem |
typedef struct ENIPEncapDataItem_ | ENIPEncapDataItem |
typedef struct CIPReqHdr_ | CIPReqHdr |
typedef struct CIPRespHdr_ | CIPRespHdr |
typedef struct SegmentEntry_ | SegmentEntry |
typedef struct AttributeEntry_ | AttributeEntry |
typedef struct CIPServiceEntry_ | CIPServiceEntry |
typedef struct ENIPTransaction_ | ENIPTransaction |
typedef struct ENIPState_ | ENIPState |
Per flow ENIP state container. More... | |
Functions | |
int | DecodeENIPPDU (const uint8_t *input, uint32_t input_len, ENIPTransaction *enip_data) |
Decode ENIP Encapsulation Header. More... | |
int | DecodeCommonPacketFormatPDU (const uint8_t *input, uint32_t input_len, ENIPTransaction *enip_data, uint16_t offset) |
Decode Common Packet Format. More... | |
int | DecodeCIPPDU (const uint8_t *input, uint32_t input_len, ENIPTransaction *enip_data, uint16_t offset) |
Decode CIP packet. More... | |
int | DecodeCIPRequestPDU (const uint8_t *input, uint32_t input_len, ENIPTransaction *enip_data, uint16_t offset) |
Decode CIP Request. More... | |
int | DecodeCIPResponsePDU (const uint8_t *input, uint32_t input_len, ENIPTransaction *enip_data, uint16_t offset) |
Decode CIP Response. More... | |
int | DecodeCIPRequestPathPDU (const uint8_t *input, uint32_t input_len, CIPServiceEntry *node, uint16_t offset) |
Decode CIP Request Path. More... | |
int | DecodeCIPRequestMSPPDU (const uint8_t *input, uint32_t input_len, ENIPTransaction *enip_data, uint16_t offset) |
Decode CIP Request Multi Service Packet. More... | |
int | DecodeCIPResponseMSPPDU (const uint8_t *input, uint32_t input_len, ENIPTransaction *enip_data, uint16_t offset) |
Decode CIP Response MultiService Packet. More... | |
Definition in file app-layer-enip-common.h.
#define CANCEL 0x0073 |
Definition at line 40 of file app-layer-enip-common.h.
#define CIP_APPLY_ATTR 0x0d |
Definition at line 75 of file app-layer-enip-common.h.
#define CIP_CHANGE_START 0x4f |
Definition at line 80 of file app-layer-enip-common.h.
#define CIP_CREATE 0x08 |
Definition at line 72 of file app-layer-enip-common.h.
#define CIP_DELETE 0x09 |
Definition at line 73 of file app-layer-enip-common.h.
#define CIP_GET_ATTR_ALL 0x01 |
Definition at line 66 of file app-layer-enip-common.h.
#define CIP_GET_ATTR_LIST 0x03 |
Definition at line 67 of file app-layer-enip-common.h.
#define CIP_GET_ATTR_SINGLE 0x0e |
Definition at line 76 of file app-layer-enip-common.h.
#define CIP_GET_STATUS 0x50 |
Definition at line 81 of file app-layer-enip-common.h.
#define CIP_KICK_TIMER 0x4b |
Definition at line 78 of file app-layer-enip-common.h.
#define CIP_MSP 0x0a |
Definition at line 74 of file app-layer-enip-common.h.
#define CIP_OPEN_CONNECTION 0x4c |
Definition at line 79 of file app-layer-enip-common.h.
#define CIP_RESERVED 0x00 |
Definition at line 65 of file app-layer-enip-common.h.
#define CIP_RESET 0x05 |
Definition at line 69 of file app-layer-enip-common.h.
#define CIP_SET_ATTR_LIST 0x04 |
Definition at line 68 of file app-layer-enip-common.h.
#define CIP_SET_ATTR_SINGLE 0x10 |
Definition at line 77 of file app-layer-enip-common.h.
#define CIP_START 0x06 |
Definition at line 70 of file app-layer-enip-common.h.
#define CIP_STOP 0x07 |
Definition at line 71 of file app-layer-enip-common.h.
#define CONNECTED_DATA_ITEM 0x00b1 |
Definition at line 45 of file app-layer-enip-common.h.
#define CONNECTION_BASED 0x00a1 |
Definition at line 44 of file app-layer-enip-common.h.
#define ENCAP_HEADER_ERROR 0x006A |
Definition at line 58 of file app-layer-enip-common.h.
#define INCORRECT_DATA 0x0003 |
Definition at line 53 of file app-layer-enip-common.h.
#define INDICATE_STATUS 0x0072 |
Definition at line 39 of file app-layer-enip-common.h.
#define INVALID_CMD 0x0001 |
Definition at line 51 of file app-layer-enip-common.h.
#define INVALID_LENGTH 0x0065 |
Definition at line 55 of file app-layer-enip-common.h.
#define INVALID_SESSION 0x0064 |
Definition at line 54 of file app-layer-enip-common.h.
#define LIST_IDENTITY 0x0063 |
Definition at line 33 of file app-layer-enip-common.h.
#define LIST_INTERFACES 0x0064 |
Definition at line 34 of file app-layer-enip-common.h.
#define LIST_SERVICES 0x0004 |
Definition at line 32 of file app-layer-enip-common.h.
#define MAX_CIP_ATTRIBUTE 65535 |
Definition at line 62 of file app-layer-enip-common.h.
#define MAX_CIP_CLASS 65535 |
Definition at line 61 of file app-layer-enip-common.h.
#define MAX_CIP_SERVICE 127 |
Definition at line 60 of file app-layer-enip-common.h.
#define NO_RESOURCES 0x0002 |
Definition at line 52 of file app-layer-enip-common.h.
#define NOP 0x0000 |
Definition at line 31 of file app-layer-enip-common.h.
#define NULL_ADDR 0x0000 |
Definition at line 43 of file app-layer-enip-common.h.
#define PATH_ATTR_16BIT 0x31 |
Definition at line 89 of file app-layer-enip-common.h.
#define PATH_ATTR_8BIT 0x30 |
Definition at line 88 of file app-layer-enip-common.h.
#define PATH_CLASS_16BIT 0x21 |
Definition at line 85 of file app-layer-enip-common.h.
#define PATH_CLASS_8BIT 0x20 |
Definition at line 84 of file app-layer-enip-common.h.
#define PATH_INSTANCE_16BIT 0x25 |
Definition at line 87 of file app-layer-enip-common.h.
#define PATH_INSTANCE_8BIT 0x24 |
Definition at line 86 of file app-layer-enip-common.h.
#define REGISTER_SESSION 0x0065 |
Definition at line 35 of file app-layer-enip-common.h.
#define SEND_RR_DATA 0x006F |
Definition at line 37 of file app-layer-enip-common.h.
#define SEND_UNIT_DATA 0x0070 |
Definition at line 38 of file app-layer-enip-common.h.
#define SEQUENCE_ADDR_ITEM 0xB002 |
Definition at line 47 of file app-layer-enip-common.h.
#define SUCCESS 0x0000 |
Definition at line 50 of file app-layer-enip-common.h.
#define UNCONNECTED_DATA_ITEM 0x00b2 |
Definition at line 46 of file app-layer-enip-common.h.
#define UNREGISTER_SESSION 0x0066 |
Definition at line 36 of file app-layer-enip-common.h.
#define UNSUPPORTED_PROT_REV 0x0069 |
Definition at line 56 of file app-layer-enip-common.h.
typedef struct AttributeEntry_ AttributeEntry |
typedef struct CIPReqHdr_ CIPReqHdr |
CIP Request Header
typedef struct CIPRespHdr_ CIPRespHdr |
CIP Response Header
typedef struct CIPServiceEntry_ CIPServiceEntry |
typedef struct ENIPEncapAddressItem_ ENIPEncapAddressItem |
ENIP encapsulation address item
typedef struct ENIPEncapDataHdr_ ENIPEncapDataHdr |
ENIP encapsulation data header
typedef struct ENIPEncapDataItem_ ENIPEncapDataItem |
ENIP encapsulation data item
typedef struct ENIPEncapHdr_ ENIPEncapHdr |
ENIP encapsulation header
typedef struct ENIPState_ ENIPState |
Per flow ENIP state container.
typedef struct ENIPTransaction_ ENIPTransaction |
typedef struct SegmentEntry_ SegmentEntry |
int DecodeCIPPDU | ( | const uint8_t * | input, |
uint32_t | input_len, | ||
ENIPTransaction * | enip_data, | ||
uint16_t | offset | ||
) |
Decode CIP packet.
input,input_len | data stream |
enip_data | stores data from Packet |
offset | current point in the packet |
Definition at line 414 of file app-layer-enip-common.c.
References DecodeCIPRequestPDU(), DecodeCIPResponsePDU(), ENIPTransaction_::encap_data_item, ENIPEncapDataItem_::length, offset, and SCLogDebug.
Referenced by DecodeCIPRequestMSPPDU(), and DecodeCIPResponseMSPPDU().
int DecodeCIPRequestMSPPDU | ( | const uint8_t * | input, |
uint32_t | input_len, | ||
ENIPTransaction * | enip_data, | ||
uint16_t | offset | ||
) |
Decode CIP Request Multi Service Packet.
input,input_len | data stream |
enip_data | stores data from Packet |
offset | current point in the packet |
Definition at line 869 of file app-layer-enip-common.c.
References BYTE_LITTLE_ENDIAN, ByteExtractUint16(), DecodeCIPPDU(), offset, and SCLogDebug.
int DecodeCIPRequestPathPDU | ( | const uint8_t * | input, |
uint32_t | input_len, | ||
CIPServiceEntry * | node, | ||
uint16_t | offset | ||
) |
Decode CIP Request Path.
input,input_len | data stream |
enip_data | stores data from Packet |
offset | current point in the packet |
cipserviced | the cip service rule |
Definition at line 577 of file app-layer-enip-common.c.
References CIPServiceEntry_::request.
int DecodeCIPRequestPDU | ( | const uint8_t * | input, |
uint32_t | input_len, | ||
ENIPTransaction * | enip_data, | ||
uint16_t | offset | ||
) |
Decode CIP Request.
input,input_len | data stream |
enip_data | stores data from Packet |
offset | current point in the packet |
Definition at line 458 of file app-layer-enip-common.c.
References ENIPTransaction_::encap_data_item, ENIPEncapDataItem_::length, and SCLogDebug.
Referenced by DecodeCIPPDU().
int DecodeCIPResponseMSPPDU | ( | const uint8_t * | input, |
uint32_t | input_len, | ||
ENIPTransaction * | enip_data, | ||
uint16_t | offset | ||
) |
Decode CIP Response MultiService Packet.
input,input_len | data stream |
enip_data | stores data from Packet |
offset | current point in the packet |
Definition at line 921 of file app-layer-enip-common.c.
References BYTE_LITTLE_ENDIAN, ByteExtractUint16(), DecodeCIPPDU(), offset, and SCLogDebug.
int DecodeCIPResponsePDU | ( | const uint8_t * | input, |
uint32_t | input_len, | ||
ENIPTransaction * | enip_data, | ||
uint16_t | offset | ||
) |
Decode CIP Response.
input,input_len | data stream |
enip_data | stores data from Packet |
offset | current point in the packet |
Definition at line 750 of file app-layer-enip-common.c.
References ENIPTransaction_::encap_data_item, ENIPEncapDataItem_::length, and SCLogDebug.
Referenced by DecodeCIPPDU().
int DecodeCommonPacketFormatPDU | ( | const uint8_t * | input, |
uint32_t | input_len, | ||
ENIPTransaction * | enip_data, | ||
uint16_t | offset | ||
) |
Decode Common Packet Format.
input,input_len | data stream |
enip_data | stores data from Packet |
offset | current point in the packet |
Definition at line 294 of file app-layer-enip-common.c.
References ENIPTransaction_::header, ENIPEncapHdr_::length, and SCLogDebug.
int DecodeENIPPDU | ( | const uint8_t * | input, |
uint32_t | input_len, | ||
ENIPTransaction * | enip_data | ||
) |
Decode ENIP Encapsulation Header.
input,input_len | data stream |
enip_data | stores data from Packet |
Definition at line 193 of file app-layer-enip-common.c.