1 | <?php |
---|
2 | |
---|
3 | $finputfilters = fopen("$FILTERS_FILE",'r'); |
---|
4 | |
---|
5 | print "<div id=\"contenu\">\n"; |
---|
6 | |
---|
7 | print "<h2> Filters applied on the collector </h2>"; |
---|
8 | |
---|
9 | print "<table class=\"fields\">"; |
---|
10 | print "<tr> <th> Name </th><th> Output </th> <th> Agregation </th> <th> Record </th> <th> Compare </th> </tr> <br>\n"; |
---|
11 | |
---|
12 | while (!feof ($finputfilters)) { |
---|
13 | $line = fgets($finputfilters, 512); |
---|
14 | $line = trim($line); |
---|
15 | if ( $line[0] != NULL) { |
---|
16 | if ( $line[0] != '#') { |
---|
17 | $line_splt = split(" ", $line); |
---|
18 | if ( $line_splt[0] == "N" ) { |
---|
19 | $fName = $line; |
---|
20 | } else if ( $line_splt[0] == "O" ) { |
---|
21 | $fOutput = $line; |
---|
22 | } else if ( $line_splt[0] == "C" ) { |
---|
23 | $fComp = $line; |
---|
24 | } else if ( $line_splt[0] == "A" ) { |
---|
25 | $fAg = $line; |
---|
26 | } else if ( $line_splt[0] == "R" ) { |
---|
27 | $fRec = $line; |
---|
28 | } else { |
---|
29 | print "We have a syntax error in your file in this line: <br> $line.<br>\n"; |
---|
30 | } |
---|
31 | if ( $fRec || $fComp ) { |
---|
32 | print "<tr> <td> $fName </td><td> $fOutput </td><td> $fAg </td><td> $fRec </td><td> $fComp </td> </tr> \n"; |
---|
33 | $fRec = NULL; |
---|
34 | $fComp = NULL; |
---|
35 | $fName = NULL; |
---|
36 | $fOutput = NULL; |
---|
37 | $fAg = NULL; |
---|
38 | } |
---|
39 | } |
---|
40 | } |
---|
41 | } |
---|
42 | print " </table>"; |
---|
43 | |
---|
44 | print "<h2>Reminder </h2>\n"; |
---|
45 | print "<p class=\"mycode\">"; |
---|
46 | print " <br> # N: rule name (string without space) <br> |
---|
47 | # O: output type (only socket in this release) <br> |
---|
48 | # C: check field : C <field ID> <operator> <value> <br> |
---|
49 | # A: aggregation scheme (not present in this release) <br> |
---|
50 | # R: field ID to record (not present in this release), if no record all fields <br> |
---|
51 | # are recorded <br> |
---|
52 | # field IDs can be found on the following url: <br> |
---|
53 | # http://www.cisco.com/en/US/tech/tk648/tk362/technologies_white_paper09186a00800a3db9.shtml <br> |
---|
54 | # in table 6 <br> \n"; |
---|
55 | print "</p>"; |
---|
56 | |
---|
57 | print " </div>\n"; |
---|
58 | |
---|
59 | ?> |
---|