]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/netapi.git/blob - ti/runtime/netapi/demo/demo_setup_files/stats1.awk
5fd71d84fcb67a9831a1758435f1f1a65d7c1f20
[keystone-rtos/netapi.git] / ti / runtime / netapi / demo / demo_setup_files / stats1.awk
1 #--------------------------------------
2 # awk script to process stats
3 #  output from dpidemo and build
4 #  web page
5 #  stats1->  dump navl proto stats (part1)
6 #_____________________________________
9 BEGIN { state=0;
10         printf("<HTML>\n");
11         printf("</HEAD>\n");
12         printf("<BODY>\n");
13         printf("<H2> DPI Protocol Statistics </H2>\n");
15  }
17 $0 ~ "NAVL DPI stats"  {
18   if (state==0)
19   {
20   state=1;
21   printf("<table>\n");
22   printf("<tr>\n");
23 #  printf("<th> colspan="6" <b>Results</b> </th> </tr> \n");
24   }
25 }
26  // {
27  if ((state==1)&&(NF>=8))
28  {
29     printf("<tr> ");
30     for(i=1;i<=6;i++) printf("<td> <b> %s </b> </td> ",$i);
31     printf("</tr> \n");
32  }
33  else if ((state==2) && (NF>=6))
34  {
35     printf("<tr> ");
36     for(i=1;i<=6;i++)  if (i==1) printf("<td> <b>%s</b> </td> ", $i); else  printf("<td> %s </td> ", $i);
37     printf("</tr> \n");
38  }
39 }
40 /--------/ { if (state==1) state=2}
41 /packets captured/ {if (state==2) {state=3; printf("</table>\n");}}
45 END {
46  printf("</PRE>\n");
47  printf("<A href=\"\\index.html\"> <p><u> RETURN </u> </p> </A>\n");
48  printf("</BODY>\n");
49  printf("</HTML>\n");
52 }