blob: 15824d76f28e6badc75424f0768da8047175ce82 [file] [log] [blame]
Masayoshi Kobayashice249712013-03-15 02:29:38 +00001#! /bin/bash
2controller=""
Masayoshi Kobayashib738b212013-04-03 02:26:51 +00003switches=`sudo ovs-vsctl list-br`
Masayoshi Kobayashice249712013-03-15 02:29:38 +00004
5function host2ip (){
6 ip=`grep $1 /etc/hosts |grep -v "ip6"| awk '{print $1}'`
7 echo $ip
8}
9
Masayoshi Kobayashi8afa8822013-04-02 22:20:33 +000010dpids=()
Masayoshi Kobayashice249712013-03-15 02:29:38 +000011for s in $switches; do
Masayoshi Kobayashi8afa8822013-04-02 22:20:33 +000012 i=`sudo ovs-ofctl show $s |grep dpid | awk -F ":" '{print $4}'`
13 dpids+=($i)
14done
15((j=0))
16for s in $switches; do
Masayoshi Kobayashib738b212013-04-03 02:26:51 +000017 sudo ovs-ofctl dump-flows $s |grep cookie| awk -vsw=$s -vdpid=${dpids[$j]} '{printf("%s dpid=%s %s\n",sw,dpid,$0)}'
Masayoshi Kobayashi8afa8822013-04-02 22:20:33 +000018 ((j ++ ))
Masayoshi Kobayashice249712013-03-15 02:29:38 +000019done