diff options
author | Tinku Mannan | 2014-08-08 13:42:37 -0500 |
---|---|---|
committer | Tinku Mannan | 2014-08-08 13:42:37 -0500 |
commit | a7dc18249aeaa00255e8ede7a027c30663578c8a (patch) | |
tree | 058f062feaba52a7bcd018a8b0a843a34d4bbaf1 | |
parent | 9ca5a877870b2292205d0a0b88e9606bea102632 (diff) | |
download | netapi-a7dc18249aeaa00255e8ede7a027c30663578c8a.tar.gz netapi-a7dc18249aeaa00255e8ede7a027c30663578c8a.tar.xz netapi-a7dc18249aeaa00255e8ede7a027c30663578c8a.zip |
Adding demo setup files
9 files changed, 259 insertions, 0 deletions
diff --git a/ti/runtime/netapi/demo/demo_setup_files/dpicgi1.sh b/ti/runtime/netapi/demo/demo_setup_files/dpicgi1.sh new file mode 100755 index 0000000..e817deb --- /dev/null +++ b/ti/runtime/netapi/demo/demo_setup_files/dpicgi1.sh | |||
@@ -0,0 +1,16 @@ | |||
1 | #!/bin/bash | ||
2 | #dump mac addresses from switch | ||
3 | echo Content-type: text/html | ||
4 | echo | ||
5 | echo | ||
6 | echo "<HTML>" | ||
7 | echo "<HEAD>" | ||
8 | echo "</HEAD>" | ||
9 | echo "<BODY>" | ||
10 | echo "<H2> MAC Addresses From Switch ALE </H2>" | ||
11 | echo "<PRE>" | ||
12 | cat /sys/devices/soc.0/24000000.netcp/ale_table | grep "touched" | grep "addr" | cut -d ' ' -f 10- | ||
13 | echo "</PRE>" | ||
14 | echo "<A href=\"\index.html\"> <p><u>RETURN</u></p> </A>" | ||
15 | echo "</BODY>" | ||
16 | echo "</HTML>" \ No newline at end of file | ||
diff --git a/ti/runtime/netapi/demo/demo_setup_files/dpicgi2.sh b/ti/runtime/netapi/demo/demo_setup_files/dpicgi2.sh new file mode 100755 index 0000000..3eaa0bc --- /dev/null +++ b/ti/runtime/netapi/demo/demo_setup_files/dpicgi2.sh | |||
@@ -0,0 +1,7 @@ | |||
1 | #!/bin/bash | ||
2 | echo Content-type: text/html | ||
3 | echo | ||
4 | echo | ||
5 | #dump proto seen stat | ||
6 | #awk -f ../stats1.awk ../stats2.txt | ||
7 | /sbin/transport_dpi_demo stats | awk -f ../stats1.awk \ No newline at end of file | ||
diff --git a/ti/runtime/netapi/demo/demo_setup_files/dpicgi3.sh b/ti/runtime/netapi/demo/demo_setup_files/dpicgi3.sh new file mode 100755 index 0000000..45bf5d7 --- /dev/null +++ b/ti/runtime/netapi/demo/demo_setup_files/dpicgi3.sh | |||
@@ -0,0 +1,7 @@ | |||
1 | #!/bin/bash | ||
2 | echo Content-type: text/html | ||
3 | echo | ||
4 | echo | ||
5 | #dump proto cycles stats | ||
6 | #awk -f ../stats2.awk ../stats1.txt | ||
7 | /sbin/transport_dpi_demo stats | awk -f ../stats2.awk \ No newline at end of file | ||
diff --git a/ti/runtime/netapi/demo/demo_setup_files/dpicgi4.sh b/ti/runtime/netapi/demo/demo_setup_files/dpicgi4.sh new file mode 100755 index 0000000..51ebca4 --- /dev/null +++ b/ti/runtime/netapi/demo/demo_setup_files/dpicgi4.sh | |||
@@ -0,0 +1,7 @@ | |||
1 | #!/bin/bash | ||
2 | echo Content-type: text/html | ||
3 | echo | ||
4 | echo | ||
5 | #dump mem stat | ||
6 | awk -f ../stats3.awk ../stats1.txt | ||
7 | #dpidemo stats | awk -f ../stats3.awk \ No newline at end of file | ||
diff --git a/ti/runtime/netapi/demo/demo_setup_files/index.html b/ti/runtime/netapi/demo/demo_setup_files/index.html new file mode 100755 index 0000000..9440abc --- /dev/null +++ b/ti/runtime/netapi/demo/demo_setup_files/index.html | |||
@@ -0,0 +1,23 @@ | |||
1 | <html> | ||
2 | <script type="text/javascript"> | ||
3 | function hello(msg) { | ||
4 | var msg= "this is the net_test_dpi home page"; | ||
5 | document.open(); | ||
6 | document.write(msg); | ||
7 | document.writeln("<A href=\"/index.html\"> <p><u>RETURN</u></p> </A>"); | ||
8 | document.close(); | ||
9 | } | ||
10 | </script> | ||
11 | <head><title> NET_TEST_DPI </title></head> | ||
12 | <body > | ||
13 | <img src="tilogo.gif"> | ||
14 | <text> <p> Hi there. Welcome to the <b>Texas Instruments DPI</b> demo </p> | ||
15 | <p> | ||
16 | featuring <b> Procera Networks Deep Packet Inspection Library </b> and TI Transp | ||
17 | xt> | ||
18 | <A href="cgi-bin/dpicgi1.sh"> <p>List of Mac Addresses</p> </A> | ||
19 | <A href="cgi-bin/dpicgi5.sh"> <p>Packet Forwarding Stats</p> </A> | ||
20 | <A href="cgi-bin/dpicgi2.sh"> <p>Protocols Seen</p> </A> | ||
21 | <A href="cgi-bin/dpicgi3.sh"> <p>Cycles by Protocol</p> </A> | ||
22 | <A href="cgi-bin/dpicgi4.sh"> <p>Memory Usage</p> </A> | ||
23 | </body> \ No newline at end of file | ||
diff --git a/ti/runtime/netapi/demo/demo_setup_files/stats1.awk b/ti/runtime/netapi/demo/demo_setup_files/stats1.awk new file mode 100644 index 0000000..5fd71d8 --- /dev/null +++ b/ti/runtime/netapi/demo/demo_setup_files/stats1.awk | |||
@@ -0,0 +1,52 @@ | |||
1 | #-------------------------------------- | ||
2 | # awk script to process stats | ||
3 | # output from dpidemo and build | ||
4 | # web page | ||
5 | # stats1-> dump navl proto stats (part1) | ||
6 | #_____________________________________ | ||
7 | |||
8 | |||
9 | BEGIN { state=0; | ||
10 | printf("<HTML>\n"); | ||
11 | printf("</HEAD>\n"); | ||
12 | printf("<BODY>\n"); | ||
13 | printf("<H2> DPI Protocol Statistics </H2>\n"); | ||
14 | |||
15 | } | ||
16 | |||
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");}} | ||
42 | |||
43 | |||
44 | |||
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"); | ||
50 | |||
51 | |||
52 | } \ No newline at end of file | ||
diff --git a/ti/runtime/netapi/demo/demo_setup_files/stats2.awk b/ti/runtime/netapi/demo/demo_setup_files/stats2.awk new file mode 100644 index 0000000..a3431ef --- /dev/null +++ b/ti/runtime/netapi/demo/demo_setup_files/stats2.awk | |||
@@ -0,0 +1,52 @@ | |||
1 | #-------------------------------------- | ||
2 | # awk script to process stats | ||
3 | # output from dpidemo and build | ||
4 | # web page | ||
5 | # stats2-> dump navl proto stats (part2) | ||
6 | #_____________________________________ | ||
7 | |||
8 | |||
9 | BEGIN { state=0; | ||
10 | printf("<HTML>\n"); | ||
11 | printf("</HEAD>\n"); | ||
12 | printf("<BODY>\n"); | ||
13 | printf("<H2> DPI Cycle Statistics by Protocol </H2>\n"); | ||
14 | |||
15 | } | ||
16 | |||
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 | printf("<td> <b> %s </b> </td> ",$1); | ||
31 | for(i=7;i<=19;i++) printf("<td> <b> %s </b> </td> ",$i); | ||
32 | printf("</tr> \n"); | ||
33 | } | ||
34 | else if ((state==2) && (NF>=6)) | ||
35 | { | ||
36 | printf("<tr> "); | ||
37 | printf("<td> <b> %s </b> </td> ",$1); | ||
38 | for(i=7;i<=19;i++) printf("<td> %s </td> ", $i); | ||
39 | printf("</tr> \n"); | ||
40 | } | ||
41 | } | ||
42 | /--------/ { if (state==1) state=2} | ||
43 | /packets captured/ {if (state==2) {state=3; printf("</table>\n");}} | ||
44 | |||
45 | |||
46 | |||
47 | END { | ||
48 | printf("</PRE>\n"); | ||
49 | printf("<A href=\"\\index.html\"> <p><u> RETURN </u> </p> </A>\n"); | ||
50 | printf("</BODY>\n"); | ||
51 | printf("</HTML>\n"); | ||
52 | } \ No newline at end of file | ||
diff --git a/ti/runtime/netapi/demo/demo_setup_files/stats3.awk b/ti/runtime/netapi/demo/demo_setup_files/stats3.awk new file mode 100644 index 0000000..4650d32 --- /dev/null +++ b/ti/runtime/netapi/demo/demo_setup_files/stats3.awk | |||
@@ -0,0 +1,62 @@ | |||
1 | #-------------------------------------- | ||
2 | # awk script to process stats | ||
3 | # output from dpidemo and build | ||
4 | # web page | ||
5 | # stats3-> dump navl mem stata | ||
6 | #_____________________________________ | ||
7 | |||
8 | |||
9 | BEGIN { state=0; | ||
10 | printf("<HTML>\n"); | ||
11 | printf("</HEAD>\n"); | ||
12 | printf("<BODY>\n"); | ||
13 | printf("<H2> DPI Memory Utilization Statistics </H2>\n"); | ||
14 | |||
15 | } | ||
16 | |||
17 | // { | ||
18 | if (state==1) | ||
19 | { | ||
20 | if ($0 ~"-------------") | ||
21 | { | ||
22 | } | ||
23 | else if (NF==1) | ||
24 | { | ||
25 | printf("<tr> "); | ||
26 | printf("<td> %s </td> ",$1); | ||
27 | printf("</tr> \n"); | ||
28 | } | ||
29 | else if (NF==3) | ||
30 | { | ||
31 | printf("<tr> "); | ||
32 | printf("<td> </td> \n"); | ||
33 | printf("<td> </td> \n"); | ||
34 | for(i=1;i<=NF;i++) { | ||
35 | printf("<td> <b> %s </b> </td> ",$i); | ||
36 | } | ||
37 | printf("</tr> \n"); | ||
38 | } | ||
39 | |||
40 | |||
41 | else | ||
42 | { | ||
43 | printf("<tr> "); | ||
44 | printf("<td> </td> \n"); | ||
45 | for(i=1;i<=NF;i++) { | ||
46 | printf("<td> %s </td> ",$i); | ||
47 | } | ||
48 | printf("</tr> \n"); | ||
49 | } | ||
50 | } | ||
51 | } | ||
52 | /packets captured/ {if (state==0) {state=1; printf("<table>\n");}} | ||
53 | /Peak allocated/ {if(state==1) {state=2; printf("</table>");}} | ||
54 | |||
55 | |||
56 | |||
57 | END { | ||
58 | printf("</PRE>\n"); | ||
59 | printf("<A href=\"\\index.html\"> <p><u> RETURN </u> </p> </A>\n"); | ||
60 | printf("</BODY>\n"); | ||
61 | printf("</HTML>\n"); | ||
62 | } \ No newline at end of file | ||
diff --git a/ti/runtime/netapi/demo/demo_setup_files/transport_dpi_demo_setup.sh b/ti/runtime/netapi/demo/demo_setup_files/transport_dpi_demo_setup.sh new file mode 100755 index 0000000..61b2b4b --- /dev/null +++ b/ti/runtime/netapi/demo/demo_setup_files/transport_dpi_demo_setup.sh | |||
@@ -0,0 +1,33 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | export KERNEL_VER=$(uname -r) | ||
4 | #copy over web files | ||
5 | |||
6 | cp /etc/transportnetlib/demo_setup_files/index.html /srv/www/index.html | ||
7 | cp /etc/transportnetlib/demo_setup_/files/stats1.awk /srv/www/stats1.awk | ||
8 | cp /etc/transportnetlib/demo_setup_/files/stats2.awk /srv/www/stats2.awk | ||
9 | cp /etc/transportnetlib/demo_setup_/files/stats3.awk /srv/www/stats3.awk | ||
10 | cp /etc/transportnetlib/demo_setup_/files/dpicgi1.sh /srv/www/dpicgi1.sh | ||
11 | cp /etc/transportnetlib/demo_setup_/files/dpicgi2.sh /srv/www/dpicgi2.sh | ||
12 | cp /etc/transportnetlib/demo_setup_/files/dpicgi3.sh /srv/www/dpicgi3.sh | ||
13 | cp /etc/transportnetlib/demo_setup_/files/dpicgi4.sh /srv/www/dpicgi4.sh | ||
14 | |||
15 | #install kernel module | ||
16 | echo $KERNEL_VER | ||
17 | insmod /lib/modules/$KERNEL_VER/extra/hplibmod.ko | ||
18 | # | ||
19 | # setup linux kernel bridge to handle broadcast packets | ||
20 | ifconfig eth0 0.0.0.0 | ||
21 | # | ||
22 | ifconfig eth1 0.0.0.0 | ||
23 | #create bridge | ||
24 | brctl addbr br0 | ||
25 | #add i/fs to bridge | ||
26 | brctl addif br0 eth0 | ||
27 | # | ||
28 | brctl addif br0 eth1 | ||
29 | # | ||
30 | dhclient br0 | ||
31 | # run transport_dpi_demo application | ||
32 | /usr/bin/transport_dpi_demo | ||
33 | |||