@@ -88,18 +88,6 @@ compile_pattern(FilterRE *f, gchar *regexp, const gchar *type, gint flags)
88
88
return NULL ;
89
89
}
90
90
91
- FilterExprNode *
92
- create_posix_regexp_filter (NVHandle handle , gchar * regexp , gint flags )
93
- {
94
- return compile_pattern (filter_re_new (handle ), regexp , "posix" , flags );
95
- }
96
-
97
- FilterExprNode *
98
- create_posix_regexp_match (gchar * regexp , gint flags )
99
- {
100
- return compile_pattern (filter_match_new (), regexp , "posix" , flags );
101
- }
102
-
103
91
FilterExprNode *
104
92
create_pcre_regexp_filter (gint field , gchar * regexp , gint flags )
105
93
{
@@ -305,42 +293,42 @@ main(int argc G_GNUC_UNUSED, char *argv[] G_GNUC_UNUSED)
305
293
testcase ("<7> openvpn[2499]: PTHREAD support initialized" , filter_level_new (level_bits ("debug" )), 1 );
306
294
}
307
295
308
- testcase ("<15> openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_filter (LM_V_PROGRAM , "^openvpn$" , 0 ),
296
+ testcase ("<15> openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_filter (LM_V_PROGRAM , "^openvpn$" , 0 ),
309
297
1 );
310
- testcase ("<15> openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_filter (LM_V_PROGRAM , "^open$" , 0 ), 0 );
311
- TEST_ASSERT (create_posix_regexp_filter (LM_V_PROGRAM , "((" , 0 ) == NULL );
298
+ testcase ("<15> openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_filter (LM_V_PROGRAM , "^open$" , 0 ), 0 );
299
+ TEST_ASSERT (create_pcre_regexp_filter (LM_V_PROGRAM , "((" , 0 ) == NULL );
312
300
313
- testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_filter (LM_V_HOST ,
301
+ testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_filter (LM_V_HOST ,
314
302
"^host$" , 0 ), 1 );
315
- testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_filter (LM_V_HOST ,
303
+ testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_filter (LM_V_HOST ,
316
304
"^hos$" , 0 ), 0 );
317
- testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_filter (LM_V_HOST ,
305
+ testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_filter (LM_V_HOST ,
318
306
"pthread" , 0 ), 0 );
319
- TEST_ASSERT (create_posix_regexp_filter (LM_V_HOST , "((" , 0 ) == NULL );
307
+ TEST_ASSERT (create_pcre_regexp_filter (LM_V_HOST , "((" , 0 ) == NULL );
320
308
321
309
322
- testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_filter (LM_V_MESSAGE ,
310
+ testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_filter (LM_V_MESSAGE ,
323
311
"^PTHREAD " , 0 ), 1 );
324
- testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_filter (LM_V_MESSAGE ,
312
+ testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_filter (LM_V_MESSAGE ,
325
313
"PTHREAD s" , 0 ), 1 );
326
- testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_filter (LM_V_MESSAGE ,
314
+ testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_filter (LM_V_MESSAGE ,
327
315
"^PTHREAD$" , 0 ), 0 );
328
- testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_filter (LM_V_MESSAGE ,
316
+ testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_filter (LM_V_MESSAGE ,
329
317
"(?i)pthread" , 0 ), 1 );
330
318
331
319
332
- testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_match (" PTHREAD " ,
320
+ testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_match (" PTHREAD " ,
333
321
0 ), 1 );
334
322
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
335
- create_posix_regexp_match ("^openvpn\\[2499\\]: PTHREAD" , 0 ), 1 );
336
- testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_match ("^PTHREAD$" ,
323
+ create_pcre_regexp_match ("^openvpn\\[2499\\]: PTHREAD" , 0 ), 1 );
324
+ testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_match ("^PTHREAD$" ,
337
325
0 ), 0 );
338
- testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_match ("(?i)pthread" ,
326
+ testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_match ("(?i)pthread" ,
339
327
0 ), 1 );
340
- testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_posix_regexp_match ("pthread" ,
328
+ testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , create_pcre_regexp_match ("pthread" ,
341
329
LMF_ICASE ), 1 );
342
330
343
- TEST_ASSERT (create_posix_regexp_match ("((" , 0 ) == NULL );
331
+ TEST_ASSERT (create_pcre_regexp_match ("((" , 0 ) == NULL );
344
332
345
333
#if SYSLOG_NG_ENABLE_IPV6
346
334
sender_saddr = g_sockaddr_inet6_new ("2001:db80:85a3:8d30:1319:8a2e:3700:7348" , 5000 );
@@ -391,22 +379,22 @@ main(int argc G_GNUC_UNUSED, char *argv[] G_GNUC_UNUSED)
391
379
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" , filter_netmask_new ("127.0.0.2/32" ), 0 );
392
380
393
381
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
394
- fop_or_new (create_posix_regexp_match (" PTHREAD " , 0 ), create_posix_regexp_match ("PTHREAD" , 0 )), 1 );
382
+ fop_or_new (create_pcre_regexp_match (" PTHREAD " , 0 ), create_pcre_regexp_match ("PTHREAD" , 0 )), 1 );
395
383
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
396
- fop_or_new (create_posix_regexp_match (" PTHREAD " , 0 ), create_posix_regexp_match ("^PTHREAD$" , 0 )), 1 );
384
+ fop_or_new (create_pcre_regexp_match (" PTHREAD " , 0 ), create_pcre_regexp_match ("^PTHREAD$" , 0 )), 1 );
397
385
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
398
- fop_or_new (create_posix_regexp_match ("^PTHREAD$" , 0 ), create_posix_regexp_match (" PTHREAD " , 0 )), 1 );
386
+ fop_or_new (create_pcre_regexp_match ("^PTHREAD$" , 0 ), create_pcre_regexp_match (" PTHREAD " , 0 )), 1 );
399
387
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
400
- fop_or_new (create_posix_regexp_match (" PAD " , 0 ), create_posix_regexp_match ("^PTHREAD$" , 0 )), 0 );
388
+ fop_or_new (create_pcre_regexp_match (" PAD " , 0 ), create_pcre_regexp_match ("^PTHREAD$" , 0 )), 0 );
401
389
402
390
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
403
- fop_and_new (create_posix_regexp_match (" PTHREAD " , 0 ), create_posix_regexp_match ("PTHREAD" , 0 )), 1 );
391
+ fop_and_new (create_pcre_regexp_match (" PTHREAD " , 0 ), create_pcre_regexp_match ("PTHREAD" , 0 )), 1 );
404
392
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
405
- fop_and_new (create_posix_regexp_match (" PTHREAD " , 0 ), create_posix_regexp_match ("^PTHREAD$" , 0 )), 0 );
393
+ fop_and_new (create_pcre_regexp_match (" PTHREAD " , 0 ), create_pcre_regexp_match ("^PTHREAD$" , 0 )), 0 );
406
394
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
407
- fop_and_new (create_posix_regexp_match ("^PTHREAD$" , 0 ), create_posix_regexp_match (" PTHREAD " , 0 )), 0 );
395
+ fop_and_new (create_pcre_regexp_match ("^PTHREAD$" , 0 ), create_pcre_regexp_match (" PTHREAD " , 0 )), 0 );
408
396
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
409
- fop_and_new (create_posix_regexp_match (" PAD " , 0 ), create_posix_regexp_match ("^PTHREAD$" , 0 )), 0 );
397
+ fop_and_new (create_pcre_regexp_match (" PAD " , 0 ), create_pcre_regexp_match ("^PTHREAD$" , 0 )), 0 );
410
398
411
399
/* LEVEL_NUM is 7 */
412
400
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
@@ -469,13 +457,13 @@ main(int argc G_GNUC_UNUSED, char *argv[] G_GNUC_UNUSED)
469
457
create_template ("alma" ), KW_GT ), 0 );
470
458
471
459
472
- testcase_with_backref_chk ("<15>Oct 15 16:17:01 host openvpn[2499]: al fa" , create_posix_regexp_filter (LM_V_MESSAGE ,
460
+ testcase_with_backref_chk ("<15>Oct 15 16:17:01 host openvpn[2499]: al fa" , create_pcre_regexp_filter (LM_V_MESSAGE ,
473
461
"(a)(l) (fa)" , LMF_STORE_MATCHES ), 1 , "1" ,"a" );
474
462
475
- testcase_with_backref_chk ("<15>Oct 15 16:17:01 host openvpn[2499]: al fa" , create_posix_regexp_filter (LM_V_MESSAGE ,
463
+ testcase_with_backref_chk ("<15>Oct 15 16:17:01 host openvpn[2499]: al fa" , create_pcre_regexp_filter (LM_V_MESSAGE ,
476
464
"(a)(l) (fa)" , LMF_STORE_MATCHES ), 1 , "0" ,"al fa" );
477
465
478
- testcase_with_backref_chk ("<15>Oct 15 16:17:01 host openvpn[2499]: al fa" , create_posix_regexp_filter (LM_V_MESSAGE ,
466
+ testcase_with_backref_chk ("<15>Oct 15 16:17:01 host openvpn[2499]: al fa" , create_pcre_regexp_filter (LM_V_MESSAGE ,
479
467
"(a)(l) (fa)" , LMF_STORE_MATCHES ), 1 , "232" , NULL );
480
468
481
469
@@ -491,7 +479,7 @@ main(int argc G_GNUC_UNUSED, char *argv[] G_GNUC_UNUSED)
491
479
"pthread" , 0 ), 0 );
492
480
TEST_ASSERT (create_pcre_regexp_filter (LM_V_HOST , "((" , 0 ) == NULL );
493
481
494
- TEST_ASSERT (create_posix_regexp_filter (LM_V_HOST , "(?iana" , 0 ) == NULL );
482
+ TEST_ASSERT (create_pcre_regexp_filter (LM_V_HOST , "(?iana" , 0 ) == NULL );
495
483
496
484
TEST_ASSERT (create_pcre_regexp_filter (LM_V_HOST , "(?iana" , 0 ) == NULL );
497
485
@@ -505,13 +493,13 @@ main(int argc G_GNUC_UNUSED, char *argv[] G_GNUC_UNUSED)
505
493
"(?i)pthread" , 0 ), 1 );
506
494
507
495
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
508
- fop_and_new (create_pcre_regexp_match (" PTHREAD " , 0 ), create_posix_regexp_match ("PTHREAD" , 0 )), 1 );
496
+ fop_and_new (create_pcre_regexp_match (" PTHREAD " , 0 ), create_pcre_regexp_match ("PTHREAD" , 0 )), 1 );
509
497
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
510
- fop_and_new (create_pcre_regexp_match (" PTHREAD " , 0 ), create_posix_regexp_match ("^PTHREAD$" , 0 )), 0 );
498
+ fop_and_new (create_pcre_regexp_match (" PTHREAD " , 0 ), create_pcre_regexp_match ("^PTHREAD$" , 0 )), 0 );
511
499
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
512
- fop_and_new (create_pcre_regexp_match ("^PTHREAD$" , 0 ), create_posix_regexp_match (" PTHREAD " , 0 )), 0 );
500
+ fop_and_new (create_pcre_regexp_match ("^PTHREAD$" , 0 ), create_pcre_regexp_match (" PTHREAD " , 0 )), 0 );
513
501
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
514
- fop_and_new (create_pcre_regexp_match (" PAD " , 0 ), create_posix_regexp_match ("^PTHREAD$" , 0 )), 0 );
502
+ fop_and_new (create_pcre_regexp_match (" PAD " , 0 ), create_pcre_regexp_match ("^PTHREAD$" , 0 )), 0 );
515
503
516
504
testcase ("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized" ,
517
505
fop_or_new (create_pcre_regexp_match (" PTHREAD " , 0 ), create_pcre_regexp_match ("PTHREAD" , 0 )), 1 );
0 commit comments