112
112
* \retval 0 No match.
113
113
* \retval 1 Match.
115
int DetectEngineInspectHttpMethod(DetectEngineCtx *de_ctx,
115
int DetectEngineInspectHttpMethod(ThreadVars *tv,
116
DetectEngineCtx *de_ctx,
116
117
DetectEngineThreadCtx *det_ctx,
117
118
Signature *s, Flow *f, uint8_t flags,
119
void *alstate, int tx_id)
122
HtpState *htp_state = NULL;
128
htp_state = (HtpState *)alstate;
129
if (htp_state == NULL) {
130
SCLogDebug("no HTTP state");
134
if (htp_state->connp == NULL || htp_state->connp->conn == NULL) {
135
SCLogDebug("HTP state has no conn(p)");
139
idx = AppLayerTransactionGetInspectId(f);
144
int size = (int)list_size(htp_state->connp->conn->transactions);
145
for (; idx < size; idx++) {
147
tx = list_get(htp_state->connp->conn->transactions, idx);
148
if (tx == NULL || tx->request_method == NULL)
151
det_ctx->buffer_offset = 0;
152
det_ctx->discontinue_matching = 0;
153
det_ctx->inspection_recursion_counter = 0;
155
r = DetectEngineContentInspection(de_ctx, det_ctx, s, s->sm_lists[DETECT_SM_LIST_HMDMATCH],
121
HtpState *htp_state = (HtpState *)alstate;
122
htp_tx_t *tx = list_get(htp_state->connp->conn->transactions, tx_id);
123
if (tx == NULL || tx->request_method == NULL)
126
det_ctx->buffer_offset = 0;
127
det_ctx->discontinue_matching = 0;
128
det_ctx->inspection_recursion_counter = 0;
129
int r = DetectEngineContentInspection(de_ctx, det_ctx, s, s->sm_lists[DETECT_SM_LIST_HMDMATCH],
157
131
(uint8_t *)bstr_ptr(tx->request_method),
158
132
bstr_len(tx->request_method),
159
133
DETECT_ENGINE_CONTENT_INSPECTION_MODE_HMD, NULL);
160
//r = DoInspectHttpMethod(de_ctx, det_ctx, s, s->sm_lists[DETECT_SM_LIST_HMDMATCH],
161
//(uint8_t *)bstr_ptr(tx->request_method),
162
//bstr_len(tx->request_method));
173
140
/***********************************Unittests**********************************/