@rm -f cache/iface.$* cache/link.$* cache/link.$(call opp,$*)
-
+ ### '%' here is leftid-rightid@{1,2}
+ # we retrieve % as $(*F)
+ #linkid=$(call linkpart,%)
+ #nodeid=$(call get,%)
+ #bridgefile=cache/bridge.$(nodeid)
cache/iface.%: cache/bridge.$$(call get,%)
- @echo "Creating interface for link $(call proj1,$*) on $(call get,$*)"
- @$(SSH) $(HOST_$(call get,$*)) \
- $(SUDO) sliver-ovs create-port $$(cat $^) L$(call proj1,$*) > $@ \
- || { rm $@; exit 1; }
-
- cache/link.%: cache/host.$$(call rget,$$*) cache/iface.% cache/iface.$$(call opp,$$*)
- @echo "Setting port number of link $(call proj1,$*) on $(call get,$*)"
- @$(SSH) $(HOST_$(call get,$*)) \
- $(SUDO) sliver-ovs set-remote-endpoint L$(call proj1,$*) \
- $$(cat cache/host.$(call rget,$*)) \
- $$(cat cache/iface.$(call opp,$*)) \
+ @echo "Creating interface for link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $@.log"
+ @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) sliver-ovs create-port $$(cat cache/bridge.$(call get,$(*F))) L$(call linkpart,$(*F)) > $@ 2> $@.log || { rm $@; exit 1; }
+ echo cache/bridge.$(call get,$(*F))
+ echo cache/host.$(call get,$(*F)) cache/iface.$(*F) cache/iface.$(call opp,$(*F))
+
+
+ # linkid=$(call linkpart,%)
+ # nodeid=$(call get,%)
+ # iface1=cache/iface.%
+ # iface2=cache/iface.$(call opp,%)
+ cache/link.%: cache/host.$$(call get,%) cache/iface.% cache/iface.$$(call opp,%)
+ @echo "Setting port number of link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $@.log"
- @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) ovs-vsctl set interface L$(call linkpart,$(*F)) \
- options:remote_ip=$$(cat cache/host.$(call get,$(*F))) \
- options:remote_port=$$(cat cache/iface.$(call opp,$(*F))) 2> $@.log \
++ @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) sliver-ovs set-remote-endpoint L$(call linkpart,$(*F)) \
++ $$(cat cache/host.$(call rget,$(*F))) \
++ $$(cat cache/iface.$(call opp,$(*F))) 2> $@.log \
&& touch $@
+ ####################
+ CLEANTARGETS=$(addprefix del-,$(notdir $(filter-out %.log,$(wildcard cache/bridge.*))))
+ clean: $(CLEANTARGETS)
+ distclean:
+ rm -rf L U cache
+ .PHONY: clean distclean
+
+ ####################
+ graph.dot:
+ ( echo "digraph $(SLICE) {"; ls L | sed 's/$(SEP)/->/;s/$$/;/'; echo "}" ) > $@
+ graph.ps: graph.dot
+ dot -Tps < $^ > $@
+
####################
# 'virtual' targets in that there's no real file attached
define node_shortcuts