Masayoshi Kobayashi | ce24971 | 2013-03-15 02:29:38 +0000 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | controller="" |
Masayoshi Kobayashi | b738b21 | 2013-04-03 02:26:51 +0000 | [diff] [blame] | 3 | switches=`sudo ovs-vsctl list-br` |
Masayoshi Kobayashi | ce24971 | 2013-03-15 02:29:38 +0000 | [diff] [blame] | 4 | |
Masayoshi Kobayashi | 8afa882 | 2013-04-02 22:20:33 +0000 | [diff] [blame] | 5 | dpids=() |
Masayoshi Kobayashi | ce24971 | 2013-03-15 02:29:38 +0000 | [diff] [blame] | 6 | for s in $switches; do |
Masayoshi Kobayashi | 8afa882 | 2013-04-02 22:20:33 +0000 | [diff] [blame] | 7 | i=`sudo ovs-ofctl show $s |grep dpid | awk -F ":" '{print $4}'` |
| 8 | dpids+=($i) |
| 9 | done |
| 10 | ((j=0)) |
| 11 | for s in $switches; do |
Masayoshi Kobayashi | b738b21 | 2013-04-03 02:26:51 +0000 | [diff] [blame] | 12 | sudo ovs-ofctl dump-flows $s |grep cookie| awk -vsw=$s -vdpid=${dpids[$j]} '{printf("%s dpid=%s %s\n",sw,dpid,$0)}' |
Masayoshi Kobayashi | 8afa882 | 2013-04-02 22:20:33 +0000 | [diff] [blame] | 13 | ((j ++ )) |
Masayoshi Kobayashi | ce24971 | 2013-03-15 02:29:38 +0000 | [diff] [blame] | 14 | done |