OSSP CVS Repository

ossp - Difference in ossp-pkg/l2/l2_test.c versions 1.27 and 1.28
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/l2/l2_test.c 1.27 -> 1.28

--- l2_test.c    2001/09/21 17:30:26     1.27
+++ l2_test.c    2001/09/28 14:28:41     1.28
@@ -63,6 +63,7 @@
 
 int main(int argc, char *argv[])
 {
+    l2_channel_t *chFilt;
     l2_channel_t *chPrefix;
     l2_channel_t *chBuf;
     l2_channel_t *chFile;
@@ -92,6 +93,12 @@
     if (l2_channel_configure(chPrefix, "prefix,timezone", "[%d-%m-%Y/%H:%M:%S] %L test[%P]: ", "local") != L2_OK)
         die("failed to configure prefix channel");
 
+    if ((chFilt = l2_channel_create(&l2_handler_filter)) == NULL)    /* Filter */
+        die("failed to create filter channel");
+
+    if (l2_channel_configure(chFilt, "regex,negate", "hecking", 0) != L2_OK)
+        die("failed to configure filter channel");
+
     if ((chBuf  = l2_channel_create(&l2_handler_buffer)) == NULL)    /* Buffer */
         die("failed to create buffer channel");
 
@@ -110,10 +117,13 @@
     if (l2_channel_stack(chBuf, chPrefix) != L2_OK)
         die("failed to stack prefix channel on top of buffer channel");
 
-    if (l2_channel_open(chPrefix) != L2_OK)
+    if (l2_channel_stack(chPrefix, chFilt) != L2_OK)
+        die("failed to stack filter channel on top of prefix channel");
+    
+    if (l2_channel_open(chFilt) != L2_OK)
         die("failed to open channel stack");
 
-    if (l2_stream_channel(st, chPrefix, L2_LEVEL_UPTO(L2_LEVEL_WARNING), L2_LEVEL_NONE) != L2_OK)
+    if (l2_stream_channel(st, chFilt, L2_LEVEL_UPTO(L2_LEVEL_WARNING), L2_LEVEL_NONE) != L2_OK)
         die("failed to attach channel stack into stream");
 
 #ifdef WITH_SYSLOG

CVSTrac 2.0.1