snort  2.9.17.1
About: Snort is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.
  Fossies Dox: snort-2.9.17.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

service_api.h File Reference
#include <stdbool.h>
#include "sf_dynamic_preprocessor.h"
#include "appIdApi.h"
#include "service_util.h"
#include "commonAppMatcher.h"
#include "flow.h"
Include dependency graph for service_api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _ServiceValidationArgs
 
struct  CleanServiceAPI
 
struct  _INIT_SERVICE_API
 
struct  _RNA_SERVICE_PERF
 
struct  RNAServiceElement
 
struct  _SERVICE_API
 
struct  _RNA_tAppIdData_STATE
 
struct  _RNA_SERVICE_VALIDATION_PP
 
struct  RNAServiceValidationModule
 

Macros

#define MakeRNAServiceValidationPrototype(name)   static int name(ServiceValidationArgs* args)
 
#define APPID_EARLY_SESSION_FLAG_FW_RULE   1
 
#define LETOHS(p)   (*((uint16_t *)(p)))
 
#define LETOHL(p)   (*((uint32_t *)(p)))
 

Typedefs

typedef struct _ServiceValidationArgs ServiceValidationArgs
 
typedef int(* RNAServiceValidationFCN) (ServiceValidationArgs *)
 
typedef int(* RNAServiceCallbackFCN) (const uint8_t *, uint16_t, const int, tAppIdData *session, const SFSnortPacket *pkt, struct _Detector *userData, const struct appIdConfig_ *pConfig)
 
typedef int(* RNAServiceValidationInitFCN) (const struct _INIT_SERVICE_API *const)
 
typedef void(* RNAServiceValidationCleanFCN) (const CleanServiceAPI *const)
 
typedef struct _INIT_SERVICE_API InitServiceAPI
 
typedef struct _RNA_SERVICE_PERF RNAServicePerf
 
typedef struct RNAServiceElement tRNAServiceElement
 
typedef void *(* ServiceFlowdataGet) (tAppIdData *, unsigned)
 
typedef int(* ServiceFlowdataAdd) (tAppIdData *, void *, unsigned, AppIdFreeFCN)
 
typedef int(* ServiceFlowdataAddId) (tAppIdData *, uint16_t, const tRNAServiceElement *const)
 
typedef int(* ServiceFlowdataAddDHCP) (tAppIdData *, unsigned, const uint8_t *, unsigned, const uint8_t *, const uint8_t *)
 
typedef tAppIdData *(* ServiceCreateNewFlow) (tAppIdData *flowp, SFSnortPacket *, sfaddr_t *, uint16_t, sfaddr_t *, uint16_t, uint8_t, int16_t, int flags)
 
typedef void(* ServiceDhcpNewLease) (tAppIdData *flow, const uint8_t *mac, uint32_t ip, int32_t zone, uint32_t subnetmask, uint32_t leaseSecs, uint32_t router)
 
typedef void(* ServiceAnalyzeFP) (tAppIdData *, unsigned, unsigned, uint32_t)
 
typedef int(* AddService) (tAppIdData *flow, const SFSnortPacket *pkt, int dir, const tRNAServiceElement *svc_element, tAppId service, const char *vendor, const char *version, const RNAServiceSubtype *subtype, AppIdServiceIDState *id_state)
 
typedef int(* AddServiceConsumeSubtype) (tAppIdData *flow, const SFSnortPacket *pkt, int dir, const tRNAServiceElement *svc_element, tAppId service, const char *vendor, const char *version, RNAServiceSubtype *subtype, AppIdServiceIDState *id_state)
 
typedef int(* ServiceInProcess) (tAppIdData *flow, const SFSnortPacket *pkt, int dir, const tRNAServiceElement *svc_element, AppIdServiceIDState *id_state)
 
typedef int(* FailService) (tAppIdData *flow, const SFSnortPacket *pkt, int dir, const tRNAServiceElement *svc_element, unsigned flow_data_index, const struct appIdConfig_ *pConfig, AppIdServiceIDState *id_state)
 
typedef int(* IncompatibleData) (tAppIdData *flow, const SFSnortPacket *pkt, int dir, const tRNAServiceElement *svc_element, unsigned flow_data_index, const struct appIdConfig_ *pConfig, AppIdServiceIDState *id_state)
 
typedef void(* AddHostInfo) (tAppIdData *flow, SERVICE_HOST_INFO_CODE code, const void *info)
 
typedef void(* AddPayload) (tAppIdData *, tAppId)
 
typedef void(* AddMultiPayload) (tAppIdData *, tAppId)
 
typedef void(* AddUser) (tAppIdData *, const char *, tAppId, int)
 
typedef void(* AddMisc) (tAppIdData *, tAppId)
 
typedef void(* AddDnsQueryInfo) (tAppIdData *flow, uint16_t id, const uint8_t *host, uint8_t host_len, uint16_t host_offset, uint16_t record_type, uint16_t options_offset)
 
typedef void(* AddDnsResponseInfo) (tAppIdData *flow, uint16_t id, const uint8_t *host, uint8_t host_len, uint16_t host_offset, uint8_t response_type, uint32_t ttl)
 
typedef void(* ResetDnsInfo) (tAppIdData *flow)
 
typedef struct _SERVICE_API ServiceApi
 
typedef struct _RNA_tAppIdData_STATE RNAFlowState
 
typedef struct _RNA_SERVICE_VALIDATION_PP RNAServiceValidationPort
 
typedef struct RNAServiceValidationModule tRNAServiceValidationModule
 

Enumerations

enum  SERVICE_RETCODE {
  SERVICE_SUCCESS = 0 , SERVICE_INPROCESS = 10 , SERVICE_NEED_REASSEMBLY = 11 , SERVICE_NOT_COMPATIBLE = 12 ,
  SERVICE_INVALID_CLIENT = 13 , SERVICE_REVERSED = 14 , SERVICE_NOMATCH = 100 , SERVICE_ENULL = -10 ,
  SERVICE_EINVALID = -11 , SERVICE_ENOMEM = -12
}
 

Macro Definition Documentation

◆ APPID_EARLY_SESSION_FLAG_FW_RULE

#define APPID_EARLY_SESSION_FLAG_FW_RULE   1

Definition at line 137 of file service_api.h.

◆ LETOHL

#define LETOHL (   p)    (*((uint32_t *)(p)))

Definition at line 231 of file service_api.h.

◆ LETOHS

#define LETOHS (   p)    (*((uint16_t *)(p)))

Definition at line 230 of file service_api.h.

◆ MakeRNAServiceValidationPrototype

#define MakeRNAServiceValidationPrototype (   name)    static int name(ServiceValidationArgs* args)

Definition at line 70 of file service_api.h.

Typedef Documentation

◆ AddDnsQueryInfo

typedef void(* AddDnsQueryInfo) (tAppIdData *flow, uint16_t id, const uint8_t *host, uint8_t host_len, uint16_t host_offset, uint16_t record_type, uint16_t options_offset)

Definition at line 163 of file service_api.h.

◆ AddDnsResponseInfo

typedef void(* AddDnsResponseInfo) (tAppIdData *flow, uint16_t id, const uint8_t *host, uint8_t host_len, uint16_t host_offset, uint8_t response_type, uint32_t ttl)

Definition at line 167 of file service_api.h.

◆ AddHostInfo

typedef void(* AddHostInfo) (tAppIdData *flow, SERVICE_HOST_INFO_CODE code, const void *info)

Definition at line 158 of file service_api.h.

◆ AddMisc

typedef void(* AddMisc) (tAppIdData *, tAppId)

Definition at line 162 of file service_api.h.

◆ AddMultiPayload

typedef void(* AddMultiPayload) (tAppIdData *, tAppId)

Definition at line 160 of file service_api.h.

◆ AddPayload

typedef void(* AddPayload) (tAppIdData *, tAppId)

Definition at line 159 of file service_api.h.

◆ AddService

typedef int(* AddService) (tAppIdData *flow, const SFSnortPacket *pkt, int dir, const tRNAServiceElement *svc_element, tAppId service, const char *vendor, const char *version, const RNAServiceSubtype *subtype, AppIdServiceIDState *id_state)

Definition at line 144 of file service_api.h.

◆ AddServiceConsumeSubtype

typedef int(* AddServiceConsumeSubtype) (tAppIdData *flow, const SFSnortPacket *pkt, int dir, const tRNAServiceElement *svc_element, tAppId service, const char *vendor, const char *version, RNAServiceSubtype *subtype, AppIdServiceIDState *id_state)

Definition at line 148 of file service_api.h.

◆ AddUser

typedef void(* AddUser) (tAppIdData *, const char *, tAppId, int)

Definition at line 161 of file service_api.h.

◆ FailService

typedef int(* FailService) (tAppIdData *flow, const SFSnortPacket *pkt, int dir, const tRNAServiceElement *svc_element, unsigned flow_data_index, const struct appIdConfig_ *pConfig, AppIdServiceIDState *id_state)

Definition at line 154 of file service_api.h.

◆ IncompatibleData

typedef int(* IncompatibleData) (tAppIdData *flow, const SFSnortPacket *pkt, int dir, const tRNAServiceElement *svc_element, unsigned flow_data_index, const struct appIdConfig_ *pConfig, AppIdServiceIDState *id_state)

Definition at line 156 of file service_api.h.

◆ InitServiceAPI

◆ ResetDnsInfo

typedef void(* ResetDnsInfo) (tAppIdData *flow)

Definition at line 171 of file service_api.h.

◆ RNAFlowState

◆ RNAServiceCallbackFCN

typedef int(* RNAServiceCallbackFCN) (const uint8_t *, uint16_t, const int, tAppIdData *session, const SFSnortPacket *pkt, struct _Detector *userData, const struct appIdConfig_ *pConfig)

Definition at line 67 of file service_api.h.

◆ RNAServicePerf

◆ RNAServiceValidationCleanFCN

typedef void(* RNAServiceValidationCleanFCN) (const CleanServiceAPI *const)

Definition at line 80 of file service_api.h.

◆ RNAServiceValidationFCN

typedef int(* RNAServiceValidationFCN) (ServiceValidationArgs *)

Definition at line 66 of file service_api.h.

◆ RNAServiceValidationInitFCN

typedef int(* RNAServiceValidationInitFCN) (const struct _INIT_SERVICE_API *const)

Definition at line 79 of file service_api.h.

◆ RNAServiceValidationPort

◆ ServiceAnalyzeFP

typedef void(* ServiceAnalyzeFP) (tAppIdData *, unsigned, unsigned, uint32_t)

Definition at line 142 of file service_api.h.

◆ ServiceApi

typedef struct _SERVICE_API ServiceApi

◆ ServiceCreateNewFlow

typedef tAppIdData*(* ServiceCreateNewFlow) (tAppIdData *flowp, SFSnortPacket *, sfaddr_t *, uint16_t, sfaddr_t *, uint16_t, uint8_t, int16_t, int flags)

Definition at line 138 of file service_api.h.

◆ ServiceDhcpNewLease

typedef void(* ServiceDhcpNewLease) (tAppIdData *flow, const uint8_t *mac, uint32_t ip, int32_t zone, uint32_t subnetmask, uint32_t leaseSecs, uint32_t router)

Definition at line 140 of file service_api.h.

◆ ServiceFlowdataAdd

typedef int(* ServiceFlowdataAdd) (tAppIdData *, void *, unsigned, AppIdFreeFCN)

Definition at line 134 of file service_api.h.

◆ ServiceFlowdataAddDHCP

typedef int(* ServiceFlowdataAddDHCP) (tAppIdData *, unsigned, const uint8_t *, unsigned, const uint8_t *, const uint8_t *)

Definition at line 136 of file service_api.h.

◆ ServiceFlowdataAddId

typedef int(* ServiceFlowdataAddId) (tAppIdData *, uint16_t, const tRNAServiceElement *const)

Definition at line 135 of file service_api.h.

◆ ServiceFlowdataGet

typedef void*(* ServiceFlowdataGet) (tAppIdData *, unsigned)

Definition at line 133 of file service_api.h.

◆ ServiceInProcess

typedef int(* ServiceInProcess) (tAppIdData *flow, const SFSnortPacket *pkt, int dir, const tRNAServiceElement *svc_element, AppIdServiceIDState *id_state)

Definition at line 152 of file service_api.h.

◆ ServiceValidationArgs

◆ tRNAServiceElement

Definition at line 80 of file service_api.h.

◆ tRNAServiceValidationModule

Definition at line 171 of file service_api.h.

Enumeration Type Documentation

◆ SERVICE_RETCODE

Enumerator
SERVICE_SUCCESS 
SERVICE_INPROCESS 
SERVICE_NEED_REASSEMBLY 
SERVICE_NOT_COMPATIBLE 
SERVICE_INVALID_CLIENT 
SERVICE_REVERSED 
SERVICE_NOMATCH 
SERVICE_ENULL 
SERVICE_EINVALID 
SERVICE_ENOMEM 

Definition at line 41 of file service_api.h.