Commit 3b06c6b8 authored by 's avatar
Browse files

Minor interface changes


git-svn-id: file:///home/svn/mapi/trunk@866 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 8f013b49
...@@ -12,4 +12,4 @@ appform.cgi: appform.o util.o ...@@ -12,4 +12,4 @@ appform.cgi: appform.o util.o
$(CC) $(CFLAGS) $^ -o $@ -lcgic $(CC) $(CFLAGS) $^ -o $@ -lcgic
clean: clean:
$(RM) *.o $(BINS) appmon_form.html appmon.cgi appmon.rrd $(RM) *.o $(BINS) appmon_form.html appmon.cgi
...@@ -65,6 +65,7 @@ int main(int argc, char **argv) { ...@@ -65,6 +65,7 @@ int main(int argc, char **argv) {
int opt; int opt;
void sig_chld(int); void sig_chld(int);
FILE *fp = NULL;
verbose = 0; verbose = 0;
anonymize = 1; anonymize = 1;
refresh_time = 10; refresh_time = 10;
...@@ -129,7 +130,13 @@ int main(int argc, char **argv) { ...@@ -129,7 +130,13 @@ int main(int argc, char **argv) {
/* start processing */ /* start processing */
create_flows(scope); create_flows(scope);
my_rrd_create(RRD_FILENAME, NUMFILTERS); if((fp = fopen(RRD_FILENAME, "r")) == NULL) {
my_rrd_create(RRD_FILENAME, NUMFILTERS);
}
else {
fclose(fp);
}
create_cgi(); create_cgi();
processing = 1; processing = 1;
...@@ -233,11 +240,20 @@ void create_flows(char *scope) { ...@@ -233,11 +240,20 @@ void create_flows(char *scope) {
static char top_page[] = "\ static char top_page[] = "\
<html>\n<head>\n\ <html>\n<head>\n\
<style type=\"text/css\">\
<!--\
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}\
.style6 {color: #000000}\
.style7 {color: #CCCCCC}\
.style8 {color: #00CC00}\
.style9 {font-size: xx-small}\
-->\
</style>\
<META Http-Equiv=\"Cache-Control\" Content=\"no-cache\">\n\ <META Http-Equiv=\"Cache-Control\" Content=\"no-cache\">\n\
<META Http-Equiv=\"Pragma\" Content=\"no-cache\">\n\ <META Http-Equiv=\"Pragma\" Content=\"no-cache\">\n\
<META Http-Equiv=\"Expires\" Content=\"0\">\n\ <META Http-Equiv=\"Expires\" Content=\"0\">\n\
<META Http-Equiv=\"Refresh\" Content=\"10;url=./%s\">\ <META Http-Equiv=\"Refresh\" Content=\"10;url=./%s\">\
</head>\n<body>\n"; </head>\n<body><div class=style1>\n";
struct top_clients_t { struct top_clients_t {
unsigned int tracker_id; unsigned int tracker_id;
...@@ -468,7 +484,7 @@ void *process() { ...@@ -468,7 +484,7 @@ void *process() {
fprintf(fp, "\n<tr> <th colspan=2>INCOMING TRAFFIC</th> <th colspan=2>OUTGOING TRAFFIC</th></tr>\n"); fprintf(fp, "\n<tr> <th colspan=2>INCOMING TRAFFIC</th> <th colspan=2>OUTGOING TRAFFIC</th></tr>\n");
fprintf(fp, "<tr><th>IP</th><th>Traffic</th><th>IP</th><th>Traffic</th></tr>\n"); fprintf(fp, "<tr><th>IP</th><th>Traffic</th><th>IP</th><th>Traffic</th></tr>\n");
for(i = 0; i < 10;i++) { for(i = 0; i < 5;i++) {
fprintf(fp, "<tr >\n"); fprintf(fp, "<tr >\n");
struct in_addr ip; struct in_addr ip;
// IN // IN
...@@ -486,7 +502,7 @@ void *process() { ...@@ -486,7 +502,7 @@ void *process() {
fprintf(fp, "</table></center>\n"); fprintf(fp, "</table></center>\n");
fprintf(fp, "</body></html>"); fprintf(fp, "</div></body></html>");
fflush(fp); fflush(fp);
fclose(fp); fclose(fp);
// } // }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment