[120] | 1 | <?php |
---|
| 2 | |
---|
| 3 | $CONFfinputSUB = fopen($subnet_list_file,'r'); |
---|
| 4 | |
---|
| 5 | print "<div id=\"contenu\">\n"; |
---|
| 6 | |
---|
| 7 | print "<p> Below, the list of subnets defined in your configuration file: </p>\n"; |
---|
| 8 | print "<p>$subnet_list_file</p>\n"; |
---|
| 9 | |
---|
| 10 | $PREFIXV4_TABLE_INBUILT = ""; |
---|
| 11 | $nb_prefv4 = 0; |
---|
| 12 | $PREFIXV4_TABLE_INBUILT .= "<table class=\"fields\">\n"; |
---|
[122] | 13 | $PREFIXV4_TABLE_INBUILT .= "<tr> <th>Subnet</th> <th>Mask</th> <th>Sampling Value</th><th> IDR </th> </tr>\n"; |
---|
[120] | 14 | while (!feof ($CONFfinputSUB)) { |
---|
| 15 | $CONFline = fgets($CONFfinputSUB, 512); |
---|
| 16 | $CONFline_split = split("\t",$CONFline); |
---|
[122] | 17 | $CONFline_split2 = split("-",$CONFline_split[0]); |
---|
| 18 | if ($CONFline_split2[1] != NULL) { |
---|
| 19 | $CONFline_split3 = split("/",$CONFline_split2[0]); |
---|
| 20 | $CONFsubnet = $CONFline_split3[0]; |
---|
| 21 | $CONFmask = $CONFline_split3[1]; |
---|
| 22 | $CONFIDR = $CONFline_split2[1]; |
---|
| 23 | $CONFsamp = $CONFline_split[1]; |
---|
| 24 | if ($CONFsubnet) { |
---|
| 25 | $nb_prefv4 += 1; |
---|
| 26 | $PREFIXV4_TABLE_INBUILT .= "<tr>\n"; |
---|
| 27 | $PREFIXV4_TABLE_INBUILT .= "<td>$CONFsubnet</td><td>$CONFmask</td><td>$CONFsamp</td><td>$CONFIDR</td>\n"; |
---|
| 28 | $PREFIXV4_TABLE_INBUILT .= "</tr>\n"; |
---|
| 29 | } |
---|
| 30 | }else{ |
---|
| 31 | $CONFsubnet = $CONFline_split[0]; |
---|
| 32 | $CONFmask = $CONFline_split[1]; |
---|
| 33 | $CONFsamp = $CONFline_split[2]; |
---|
| 34 | if ($CONFsubnet) { |
---|
| 35 | $nb_prefv4 += 1; |
---|
| 36 | $PREFIXV4_TABLE_INBUILT .= "<tr>\n"; |
---|
| 37 | $PREFIXV4_TABLE_INBUILT .= "<td>$CONFsubnet</td><td>$CONFmask</td><td>$CONFsamp</td><td> UN </td>\n"; |
---|
| 38 | $PREFIXV4_TABLE_INBUILT .= "</tr>\n"; |
---|
| 39 | } |
---|
[120] | 40 | } |
---|
| 41 | } |
---|
| 42 | $PREFIXV4_TABLE_INBUILT .= "</table>"; |
---|
| 43 | |
---|
| 44 | fclose($CONFfinputSUB); |
---|
| 45 | |
---|
| 46 | $nb_prefv4_defined = $CONF_MAX_IPV4_PREFIX + $CONF_MAX_IPV4_SUBNET; |
---|
| 47 | print "PREFIX number <br> defined: $CONF_MAX_IPV4_PREFIX ($CONF_MAX_IPV4_SUBNET subnet in), <br> read: $nb_prefv4<br>\n"; |
---|
| 48 | print "$PREFIXV4_TABLE_INBUILT"; |
---|
| 49 | print "</div>\n"; |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | ?> |
---|