37 #define PARSE_REGEX "^\\s*([0-9]*)?\\s*([<>=-]+)?\\s*([0-9]+)?\\s*$"
50 static bool PrefilterTcpmssIsPrefilterable(
const Signature *s);
74 static inline int TcpmssMatch(
const uint16_t parg,
const uint8_t mode,
75 const uint16_t darg1,
const uint16_t darg2)
112 return TcpmssMatch(ptcpmss, tcpmssd->
mode, tcpmssd->
arg1, tcpmssd->
arg2);
130 int ret = 0,
res = 0;
134 if (ret < 2 || ret > 4) {
140 res = pcre2_substring_get_bynumber(parse_regex.
match, 1, (PCRE2_UCHAR8 **)&str_ptr, &pcre2_len);
145 arg1 = (
char *) str_ptr;
149 res = pcre2_substring_get_bynumber(
150 parse_regex.
match, 2, (PCRE2_UCHAR8 **)&str_ptr, &pcre2_len);
155 arg2 = (
char *) str_ptr;
159 res = pcre2_substring_get_bynumber(
160 parse_regex.
match, 3, (PCRE2_UCHAR8 **)&str_ptr, &pcre2_len);
165 arg3 = (
char *) str_ptr;
189 if (strlen(arg1) > 0)
203 if (strlen(arg1) > 0)
208 if (arg1 == NULL || strlen(arg1)== 0)
210 if (arg3 == NULL || strlen(arg3)== 0)
223 if (tcpmssd->
arg1 >= tcpmssd->
arg2) {
231 if ((arg2 != NULL && strlen(arg2) > 0) ||
232 (arg3 != NULL && strlen(arg3) > 0) ||
233 (arg1 == NULL ||strlen(arg1) == 0))
245 if ((arg3 != NULL && strlen(arg3) > 0) ||
246 (arg1 == NULL ||strlen(arg1) == 0))
255 pcre2_substring_free((PCRE2_UCHAR8 *)arg1);
256 pcre2_substring_free((PCRE2_UCHAR8 *)arg2);
257 pcre2_substring_free((PCRE2_UCHAR8 *)arg3);
264 pcre2_substring_free((PCRE2_UCHAR8 *)arg1);
266 pcre2_substring_free((PCRE2_UCHAR8 *)arg2);
268 pcre2_substring_free((PCRE2_UCHAR8 *)arg3);
330 if (!PrefilterPacketHeaderExtraMatch(ctx, p))
335 if (TcpmssMatch(ptcpmss, ctx->
v1.
u8[0], ctx->
v1.
u16[1], ctx->
v1.
u16[2]))
337 SCLogDebug(
"packet matches tcpmss/hl %u", ptcpmss);
365 PrefilterPacketTcpmssSet,
366 PrefilterPacketTcpmssCompare,
367 PrefilterPacketTcpmssMatch);
370 static bool PrefilterTcpmssIsPrefilterable(
const Signature *s)