AppLayerParserRegisterGetTxCnt(IPPROTO_TCP, ALPROTO_DNS, DNSGetTxCnt);
AppLayerParserRegisterGetStateProgressFunc(IPPROTO_TCP, ALPROTO_DNS,
DNSGetAlstateProgress);
- AppLayerParserRegisterGetStateProgressCompletionStatus(IPPROTO_TCP, ALPROTO_DNS,
+ AppLayerParserRegisterGetStateProgressCompletionStatus(ALPROTO_DNS,
DNSGetAlstateProgressCompletionStatus);
DNSAppLayerRegisterGetEventInfo(IPPROTO_TCP, ALPROTO_DNS);
} else {
DNSGetTxCnt);
AppLayerParserRegisterGetStateProgressFunc(IPPROTO_UDP, ALPROTO_DNS,
DNSGetAlstateProgress);
- AppLayerParserRegisterGetStateProgressCompletionStatus(IPPROTO_UDP, ALPROTO_DNS,
+ AppLayerParserRegisterGetStateProgressCompletionStatus(ALPROTO_DNS,
DNSGetAlstateProgressCompletionStatus);
DNSAppLayerRegisterGetEventInfo(IPPROTO_UDP, ALPROTO_DNS);
AppLayerParserRegisterGetStateProgressFunc(IPPROTO_TCP, ALPROTO_HTTP, HTPStateGetAlstateProgress);
AppLayerParserRegisterGetTxCnt(IPPROTO_TCP, ALPROTO_HTTP, HTPStateGetTxCnt);
AppLayerParserRegisterGetTx(IPPROTO_TCP, ALPROTO_HTTP, HTPStateGetTx);
- AppLayerParserRegisterGetStateProgressCompletionStatus(IPPROTO_TCP, ALPROTO_HTTP,
+ AppLayerParserRegisterGetStateProgressCompletionStatus(ALPROTO_HTTP,
HTPStateGetAlstateProgressCompletionStatus);
AppLayerParserRegisterHasEventsFunc(IPPROTO_TCP, ALPROTO_HTTP, HTPHasEvents);
AppLayerParserRegisterGetEventsFunc(IPPROTO_TCP, ALPROTO_HTTP, HTPGetEvents);
AppLayerParserRegisterTxFreeFunc(IPPROTO_TCP, ALPROTO_MODBUS, ModbusStateTxFree);
AppLayerParserRegisterGetStateProgressFunc(IPPROTO_TCP, ALPROTO_MODBUS, ModbusGetAlstateProgress);
- AppLayerParserRegisterGetStateProgressCompletionStatus(IPPROTO_TCP, ALPROTO_MODBUS,
+ AppLayerParserRegisterGetStateProgressCompletionStatus(ALPROTO_MODBUS,
ModbusGetAlstateProgressCompletionStatus);
AppLayerParserRegisterGetEventInfo(IPPROTO_TCP, ALPROTO_MODBUS, ModbusStateGetEventInfo);
SCReturn;
}
-void AppLayerParserRegisterGetStateProgressCompletionStatus(uint8_t ipproto,
- AppProto alproto,
+void AppLayerParserRegisterGetStateProgressCompletionStatus(AppProto alproto,
int (*StateGetProgressCompletionStatus)(uint8_t direction))
{
SCEnter();
- alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].
+ alp_ctx.ctxs[FLOW_PROTO_DEFAULT][alproto].
StateGetProgressCompletionStatus = StateGetProgressCompletionStatus;
SCReturn;
int direction = (flags & STREAM_TOSERVER) ? 0 : 1;
uint64_t total_txs = AppLayerParserGetTxCnt(ipproto, alproto, alstate);
uint64_t idx = AppLayerParserGetTransactionInspectId(pstate, flags);
- int state_done_progress = AppLayerParserGetStateProgressCompletionStatus(ipproto, alproto, flags);
+ int state_done_progress = AppLayerParserGetStateProgressCompletionStatus(alproto, flags);
void *tx;
int state_progress;
/* logger is disabled, return highest 'complete' tx id */
uint64_t total_txs = AppLayerParserGetTxCnt(f->proto, f->alproto, f->alstate);
uint64_t idx = AppLayerParserGetTransactionInspectId(f->alparser, flags);
- int state_done_progress = AppLayerParserGetStateProgressCompletionStatus(f->proto, f->alproto, flags);
+ int state_done_progress = AppLayerParserGetStateProgressCompletionStatus(f->alproto, flags);
void *tx;
int state_progress;
SCEnter();
int r = 0;
if (unlikely(IS_DISRUPTED(flags))) {
- r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].
+ r = alp_ctx.ctxs[FLOW_PROTO_DEFAULT][alproto].
StateGetProgressCompletionStatus(flags);
} else {
r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].
SCReturnPtr(r, "void *");
}
-int AppLayerParserGetStateProgressCompletionStatus(uint8_t ipproto, AppProto alproto,
- uint8_t direction)
+int AppLayerParserGetStateProgressCompletionStatus(AppProto alproto,
+ uint8_t direction)
{
SCEnter();
int r = 0;
- r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].
+ r = alp_ctx.ctxs[FLOW_PROTO_DEFAULT][alproto].
StateGetProgressCompletionStatus(direction);
SCReturnInt(r);
}
uint64_t (*StateGetTxCnt)(void *alstate));
void AppLayerParserRegisterGetTx(uint8_t ipproto, AppProto alproto,
void *(StateGetTx)(void *alstate, uint64_t tx_id));
-void AppLayerParserRegisterGetStateProgressCompletionStatus(uint8_t ipproto,
- AppProto alproto,
+void AppLayerParserRegisterGetStateProgressCompletionStatus(AppProto alproto,
int (*StateGetStateProgressCompletionStatus)(uint8_t direction));
void AppLayerParserRegisterGetEventInfo(uint8_t ipproto, AppProto alproto,
int (*StateGetEventInfo)(const char *event_name, int *event_id,
void *alstate, uint8_t direction);
uint64_t AppLayerParserGetTxCnt(uint8_t ipproto, AppProto alproto, void *alstate);
void *AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id);
-int AppLayerParserGetStateProgressCompletionStatus(uint8_t ipproto, AppProto alproto,
- uint8_t direction);
+int AppLayerParserGetStateProgressCompletionStatus(AppProto alproto, uint8_t direction);
int AppLayerParserGetEventInfo(uint8_t ipproto, AppProto alproto, const char *event_name,
int *event_id, AppLayerEventType *event_type);
AppLayerParserRegisterGetStateProgressFunc(IPPROTO_TCP, ALPROTO_SMTP, SMTPStateGetAlstateProgress);
AppLayerParserRegisterGetTxCnt(IPPROTO_TCP, ALPROTO_SMTP, SMTPStateGetTxCnt);
AppLayerParserRegisterGetTx(IPPROTO_TCP, ALPROTO_SMTP, SMTPStateGetTx);
- AppLayerParserRegisterGetStateProgressCompletionStatus(IPPROTO_TCP, ALPROTO_SMTP,
+ AppLayerParserRegisterGetStateProgressCompletionStatus(ALPROTO_SMTP,
SMTPStateGetAlstateProgressCompletionStatus);
AppLayerParserRegisterTruncateFunc(IPPROTO_TCP, ALPROTO_SMTP, SMTPStateTruncate);
} else {
AppLayerParserRegisterGetStateProgressFunc(IPPROTO_TCP, ALPROTO_TLS, SSLGetAlstateProgress);
- AppLayerParserRegisterGetStateProgressCompletionStatus(IPPROTO_TCP, ALPROTO_TLS,
+ AppLayerParserRegisterGetStateProgressCompletionStatus(ALPROTO_TLS,
SSLGetAlstateProgressCompletionStatus);
/* Get the value of no reassembly option from the config file */
TemplateGetTxCnt);
/* Transaction handling. */
- AppLayerParserRegisterGetStateProgressCompletionStatus(IPPROTO_TCP,
- ALPROTO_TEMPLATE, TemplateGetAlstateProgressCompletionStatus);
+ AppLayerParserRegisterGetStateProgressCompletionStatus(ALPROTO_TEMPLATE,
+ TemplateGetAlstateProgressCompletionStatus);
AppLayerParserRegisterGetStateProgressFunc(IPPROTO_TCP,
ALPROTO_TEMPLATE, TemplateGetStateProgress);
AppLayerParserRegisterGetTx(IPPROTO_TCP, ALPROTO_TEMPLATE,
return DETECT_ENGINE_INSPECT_SIG_MATCH;
} else {
if (AppLayerParserGetStateProgress(f->proto, alproto, tx, flags) ==
- AppLayerParserGetStateProgressCompletionStatus(f->proto, alproto, flags))
+ AppLayerParserGetStateProgressCompletionStatus(alproto, flags))
{
return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH;
} else {
/* if this is the last tx in our list, and it's incomplete: then
* we store the state so that ContinueDetection knows about it */
int tx_is_done = (AppLayerParserGetStateProgress(f->proto, alproto, tx, flags) >=
- AppLayerParserGetStateProgressCompletionStatus(f->proto, alproto, flags));
+ AppLayerParserGetStateProgressCompletionStatus(alproto, flags));
/* see if we need to consider the next tx in our decision to add
* a sig to the 'no inspect array'. */
int next_tx_no_progress = 0;
void *inspect_tx = AppLayerParserGetTx(f->proto, alproto, alstate, inspect_tx_id);
if (inspect_tx != NULL) {
int a = AppLayerParserGetStateProgress(f->proto, alproto, inspect_tx, flags);
- int b = AppLayerParserGetStateProgressCompletionStatus(f->proto, alproto, flags);
+ int b = AppLayerParserGetStateProgressCompletionStatus(alproto, flags);
if (a < b) {
inspect_tx_inprogress = 1;
}
HtpState *s = f->alstate;
if (s != NULL && s->conn != NULL) {
int tx_progress_done_value_ts =
- AppLayerParserGetStateProgressCompletionStatus(IPPROTO_TCP,
- ALPROTO_HTTP, STREAM_TOSERVER);
+ AppLayerParserGetStateProgressCompletionStatus(ALPROTO_HTTP,
+ STREAM_TOSERVER);
int tx_progress_done_value_tc =
- AppLayerParserGetStateProgressCompletionStatus(IPPROTO_TCP,
- ALPROTO_HTTP, STREAM_TOCLIENT);
+ AppLayerParserGetStateProgressCompletionStatus(ALPROTO_HTTP,
+ STREAM_TOCLIENT);
// for each tx
uint64_t tx_id = 0;
uint64_t total_txs = AppLayerParserGetTxCnt(p->proto, alproto, alstate);
uint64_t tx_id = AppLayerParserGetTransactionLogId(f->alparser);
int tx_progress_done_value_ts =
- AppLayerParserGetStateProgressCompletionStatus(p->proto, alproto,
+ AppLayerParserGetStateProgressCompletionStatus(alproto,
STREAM_TOSERVER);
int tx_progress_done_value_tc =
- AppLayerParserGetStateProgressCompletionStatus(p->proto, alproto,
+ AppLayerParserGetStateProgressCompletionStatus(alproto,
STREAM_TOCLIENT);
for (; tx_id < total_txs; tx_id++)
{