From e11741625af584cbc4eba13eea0a2ad1495fb4e0 Mon Sep 17 00:00:00 2001 From: Giuseppe Lettieri Date: Tue, 9 Oct 2012 20:42:57 +0200 Subject: [PATCH] export OpenFlow port numbers make showports will produce several lines of the form PORT_src_dst=n meaning that on node src the port that goes to node dst has OpenFlow id equal to n. --- planetlab/exp-tool/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/planetlab/exp-tool/Makefile b/planetlab/exp-tool/Makefile index 7919aa5d4..dc5446664 100644 --- a/planetlab/exp-tool/Makefile +++ b/planetlab/exp-tool/Makefile @@ -104,6 +104,9 @@ sshs: $(foreach id,$(ALL_NODE_IDS),ssh-$(id)) showdpids: $(foreach id,$(ALL_NODE_IDS),showdpid-$(id)) .PHONY: showdpids +showports: $(foreach id,$(ALL_NODE_IDS),showports-$(id)) +.PHONY: showports + DBS=$(foreach id,$(ALL_NODE_IDS),cache/db.$(id)) dbs: $(DBS) .PHONY: dbs @@ -147,6 +150,11 @@ ssh-%: FORCE showdpid-%: FORCE @echo $*_DPID=0x$$( $(SSH) $(HOST_$*) $(SUDO) ovs-vsctl get bridge $(BRIDGE) datapath_id | sed -e 's,",,g') +showports-%: FORCE + @$(SSH) $(HOST_$*) $(SUDO) ovs-ofctl show $(BRIDGE) \ + | perl -nle '/(\d+)\(L(.*?)\Q$(SEP)\E(.*?)\):/ && \ + print "PORT_".("$$2" eq "$*" ? "$$2_$$3" : "$$3_$$2")."=$$1"' + # should probably replace sshcheck cache/status.%: FORCE @echo "=== DB and SWITCH processes on $(call display,$*)" -- 2.43.0