2 # conf.mk is expected to define
3 # HOST_<id> and IP_<id> for all nodes involved, as well as
4 # LINKS as a list of <node_id>-<node_id> elements
6 # should work with any shell, but we have only tested bash
11 # run make CONF=anotherconfig.mk if you need several configs
16 # if undefined in the conf file, use single dash
19 # bridge name (XXX the same on all nodes)
25 flip=$(if $(findstring 1,$(1)),2,1)
27 cutsep=$(subst $(SEP), ,$(1))
29 leftnode=$(word 1,$(call cutsep,$(1)))
30 # rightnode (x-y) -> y
31 rightnode=$(word 2,$(call cutsep,$(1)))
33 linkpart=$(word 1,$(subst @, ,$(1)))
35 endpart=$(word 2,$(subst @, ,$(1)))
38 get=$(word $(call endpart,$(1)),$(call cutsep,$(call linkpart,$(1))))
41 opp=$(call linkpart,$(1))@$(call flip,$(call endpart,$(1)))
44 rget=$(call get,$(call opp,$(1)))
46 default=$(if $($(1)_$(2)),$($(1)_$(2)),$($(1)))
49 # can be redefined in conf.mk if that's not the expected behaviour
50 display?=host $(1) aka $(call solve,$(1))
53 log=$(addprefix log/,$(notdir $(1)))
55 #################### set variables after conf.mk
59 SSH_KEY_OPTION ?= -i $(SSH_KEY)
62 SSH_OPTIONS ?= $(SSH_KEY_OPTION) -l $(SLICE)
63 SSH = ssh $(SSH_OPTIONS)
67 ALL_NODE_IDS=$(sort $(foreach link,$(LINKS),$(call leftnode,$(link))) $(foreach link,$(LINKS),$(call rightnode,$(link))))
68 ALL_NODE_HOSTS=$(foreach id,$(ALL_NODE_IDS),$(call solve,$(id)))
69 ALL_LINK_IDS=$(addsuffix @1,$(LINKS)) $(addsuffix @2,$(LINKS))
70 CONF_NODE_IDS=$(subst HOST_,,$(filter HOST_%,$(.VARIABLES)))
75 @[ -d L ] || ( echo Creating tmp dir L; mkdir L)
76 @[ -d log ] || (echo Creating tmp dir log; mkdir log)
77 @[ -d cache ] || ( echo Creating tmp dir cache; mkdir cache)
84 LINKTARGETS=$(addprefix L/,$(LINKS))
88 # could also do make ++SLICE
89 showslice: ++SLICE FORCE
92 @$(foreach id,$(ALL_NODE_IDS),echo $(id)=$(call display,$(id));)
93 showhostnames: ++ALL_NODE_HOSTS
94 # xxx missing: something that outputs raw python stuff like
96 # that would belong in the export to OF
98 @$(foreach id,$(ALL_NODE_IDS),echo $(id)=$(call display,$(id)) has ip/network set to $(IP_$(id));)
100 @$(foreach link,$(LINKS), echo $(call display,$(call leftnode,$(link))) '====>' $(call display,$(call rightnode,$(link)));)
102 @$(foreach id,$(ALL_NODE_IDS), echo $(call display,$(id)) has controller $(call default,CONTROLLER,$(id));)
103 .PHONY: shownodes showhostnames showips showlinks showcontrollers
105 sshchecks: $(foreach id,$(ALL_NODE_IDS),sshcheck-$(id))
107 ovsversions: $(foreach id,$(ALL_NODE_IDS),ovsversion-$(id))
109 # more general form; run with make sshs SSH-COMMAND="bla bla bla"
110 sshs: $(foreach id,$(ALL_NODE_IDS),ssh-$(id))
112 showdpids: $(foreach id,$(ALL_NODE_IDS),showdpid-$(id))
114 showmacs: $(foreach id,$(ALL_NODE_IDS),showmac-$(id))
116 showports: $(foreach id,$(ALL_NODE_IDS),showports-$(id))
119 DBS=$(foreach id,$(ALL_NODE_IDS),cache/db.$(id))
123 SWITCHS=$(foreach id,$(ALL_NODE_IDS),cache/switch.$(id))
130 stop:$(foreach id,$(ALL_NODE_IDS),cache/stop.$(id))
133 status:$(foreach id,$(ALL_NODE_IDS),cache/status.$(id))
136 BRIDGES=$(foreach id,$(ALL_NODE_IDS),cache/bridge.$(id))
140 CONTROLLERS=$(foreach id,$(ALL_NODE_IDS),cache/controller.$(id))
141 controllers: $(CONTROLLERS)
144 del-controllers: $(foreach id,$(ALL_NODE_IDS),del-controller-$(id))
145 .PHONY: del-controllers
147 ### node-oriented targets
148 # check ssh connectivity
150 @if $(SSH) $(HOST_$*) hostname > /dev/null 2>&1; then echo "ssh on" $(call display,$*) "OK" ; \
151 else echo "ssh on" $(call display,$*) "KO !!!"; fi
154 @OVSVERSION=$$($(SSH) $(HOST_$*) rpm -q sliver-openvswitch); echo $(call display,$*) has $$OVSVERSION
157 @$(SSH) $(HOST_$*) $(SUDO) $(SSH-COMMAND)
160 @echo $*_DPID=0x$$( $(SSH) $(HOST_$*) $(SUDO) ovs-vsctl get bridge $(BRIDGE) datapath_id | sed -e 's,",,g')
163 @echo $*_MAC=\"$$( $(SSH) $(HOST_$*) $(SUDO) sliver-ovs get-mac $(BRIDGE))\"
166 @$(SSH) $(HOST_$*) $(SUDO) ovs-ofctl show $(BRIDGE) \
167 | perl -nle '/(\d+)\(L(.*?)\Q$(SEP)\E(.*?)\):/ && \
168 print "PORT_".("$$2" eq "$*" ? "$$2_$$3" : "$$3_$$2")."=$$1"'
169 # should probably replace sshcheck
170 cache/status.%: FORCE
171 @echo "=== DB and SWITCH processes on $(call display,$*)"
172 @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs status ||:
175 @echo "IP lookup for $(call display,$*) - logs in $(call log,$@)"
176 @host $(HOST_$*) | sed -n 's/^.*has address *//p' > $@ 2> $(call log,$@)
179 @echo "Starting db server on $(call display,$*) - logs in $(call log,$@)"
180 @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs start-db > $(call log,$@) 2>&1
183 cache/switch.%: | cache/db.%
184 @echo "Starting vswitchd on $(call display,$*) - logs in $(call log,$@)"
185 @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs start-switch > $(call log,$@) 2>&1
188 cache/bridge.%: | cache/db.%
189 @echo "Creating bridge on $(call display,$*) - logs in $(call log,$@)"
190 @$(SSH) $(HOST_$*) $(SUDO) \
191 sliver-ovs create-bridge $(BRIDGE) $(IP_$*) $(call default,BROPTIONS,$*) > $(call log,$@) 2>&1
192 @{ echo "IP_$*=$(IP_$*)"; echo "BROPTIONS_$*=$(call default,BROPTIONS,$*)"; } > $@
194 cache/controller.%: cache/bridge.%
195 @echo "Setting controller $(call default,CONTROLLER,$*) on $(call display,$*) - logs in $(call log,$@)"
196 @$(SSH) $(HOST_$*) $(SUDO) ovs-vsctl set-controller $(BRIDGE) $(call default,CONTROLLER,$*) > $(call log,$@) 2>&1
197 @echo "CONTROLLER_$*=$(call default,CONTROLLER,$*)" > $@
199 # xxx this probably needs a more thorough cleanup in cache/
200 cache/stop.%: del-bridge.%
201 @echo "Stopping switch & db on $(call display,$*)"
202 @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop && rm cache/switch.$* cache/db.$*
204 ### link-oriented targets
205 # L/<nodeid1>-<node_id2>:
206 # Establish a link between nodes <node_id1> and <node_id2>
207 L/%: cache/endpoint.%@1 cache/endpoint.%@2
209 @echo "Link $* is up"
211 # U/<node_id1>-<node_id2>
212 # Tear down the link between nodes <node_id1> and <node_id2>
213 U/%: del-iface.%@1 del-iface.%@2
215 @echo "Deleted link $*"
217 # del-bridge.<node_id>: Delete the bridge on node <node_id>.
219 # We can do this only if the db on node <node_id> is running, but
220 # we don't need to re-delete if the db is restarted (hence the
221 # order-only dependency).
223 # Deleting a bridge also deletes all interfaces of the bridge
224 # as a side effect. This in turn invalidates local tunnel
225 # port numbers and endpoint info on both sides of each affected tunnel.
226 # The corresponding links obviously go down.
227 # Controller information is also lost.
228 # We invalidate the cache accordingly.
229 del-bridge.%: | cache/db.%
230 @echo "Deleting bridge on $(call display,$*)"
231 @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs del-bridge $(BRIDGE)
232 @rm -f cache/bridge.$* \
233 cache/iface.$*$(SEP)*@1 cache/iface.*$(SEP)$*@2 \
234 cache/port.$*$(SEP)*@1 cache/port.*$(SEP)$*@2 \
235 cache/endpoint.$*$(SEP)*@? cache/endpoint.*$(SEP)$*@? \
236 L/$*$(SEP)* L/*$(SEP)$* \
239 # del-switch.<node_id>: Stops the switch daemon on <node_id>.
241 # As a side effect, the local port numbers of the tunnels
242 # are no longer valid (they will change when the daemon is restarted)
243 # and, therefore, the endpoint info on the remote side of
244 # the tunnels must be invalidated. The links also go down.
245 # Controller information is also lost.
246 # We invalidate the cache accordingly.
248 @echo "Shutting down switch on $(call display,$*)"
249 @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop-switch
250 @rm -f cache/switch.$* \
251 cache/port.$*$(SEP)*@1 cache/port.*$(SEP)$*@2 \
252 cache/endpoint.$*$(SEP)*@2 cache/endpoint.*$(SEP)$*@1 \
253 L/$*$(SEP)* L/*$(SEP)$* \
256 # del-db.<node_id>: Stops the db daemon on <node_id>.
258 # This has no additional side effects.
260 @echo "Shutting down db on $(call display,$*)"
261 @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop-db
264 # del-controller.<node_id>:
265 # Detaches <node_id> from the controller.
267 # This has no additional side effects.
268 del-controller-%: | cache/db.%
269 @echo "Removing controller for $(call display,$*)"
270 @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs del-controller $(BRIDGE)
271 @rm -f cache/controller.$*
273 # del-links: Shortcut to delete all currently up links.
274 del-links: $(addprefix U/,$(notdir $(wildcard L/*)))
276 # del-switchs: Shortcut to stop all currently running switch daemons.
277 del-switchs: $(addprefix del-,$(notdir $(wildcard cache/switch.*)))
279 # del-dbs: Shortcut to stop all currently running db daemona.s
280 del-dbs: $(addprefix del-,$(notdir $(wildcard cache/db.*)))
282 # shutdown: Shortcut to stop all currently running daemons.
283 shutdown: del-switchs del-dbs
285 .PHONY: del-links del-switchs del-dbs shutdown
290 @echo BRIDGE=$(BRIDGE)
291 @cat cache/bridge.* 2>/dev/null || :
292 @cat cache/controller.* 2>/dev/null || :
293 @ls L | sed 's/^/LINKS += /'
295 remote-snapshot: remote-snapshot-ips remote-snapshot-links
298 remote-snapshot-ips: $(addprefix cache/rsnap.ip.,$(CONF_NODE_IDS))
301 remote-snapshot-links: $(addprefix cache/rsnap.links.,$(CONF_NODE_IDS))
302 @sort -u /dev/null $^
304 .PHONY: remote-snapshot remote-snapshot-ips remote-snapshot-links
307 cache/rsnap.ip.%: FORCE
308 @$(SSH) $(HOST_$*) $(SUDO) \
309 sliver-ovs get-local-ip $(BRIDGE) | sed 's/^/IP_$*=/' > $@
311 cache/rsnap.links.%: FORCE
312 @$(SSH) $(HOST_$*) $(SUDO) \
313 sliver-ovs get-local-links $(BRIDGE) | sed -n 's/^L/LINKS += /p' > $@
315 ### update sliver-ovs
316 update: $(addprefix update-,$(CONF_NODE_IDS))
320 @[ -n "$(SLIVER_OVS)" ] || { echo "SLIVER_OVS not set" >&2; exit 1; }
321 @[ -f "$(SLIVER_OVS)" ] || { echo "$(SLIVER_OVS) not found" >&2; exit 1; }
322 @echo "Sending $(SLIVER_OVS) to $(call display,$*)"
323 @scp $(SSH_KEY_OPTION) -q $(SLIVER_OVS) $(SLICE)@$(call solve,$*):
324 @$(SSH) $(call solve,$*) $(SUDO) mv $(notdir $(SLIVER_OVS)) /usr/sbin/sliver-ovs
328 # del-iface.<node_id>-<node_id>@<endpoint>:
329 # Deletes the interface of link <node_id1>-<node_id2> on either
330 # <node_id1> or <node_id2>, according to <endpoint>.
332 # We need a running db daemon to do this, but we do not have to
333 # redo the delete if the db daemon is restarted.
335 # This also invalidates the local port of the tunnel and the endpoint
336 # info on both sides of the tunnel. The link goes down.
337 del-iface.%: | cache/db.$$(call get,%)
338 @echo "Removing interface for link $(call linkpart,$*) from $(call get,$*)"
339 @$(SSH) $(HOST_$(call get,$*)) \
340 $(SUDO) sliver-ovs del-port L$(call linkpart,$*)
341 @rm -f cache/iface.$* \
342 cache/port.$* cache/endpoint.$* cache/endpoint.$(call opp,$*) \
343 L/$(call linkpart,$*)
346 ### '%' here is leftid-rightid@{1,2}
347 # we retrieve % as $(*F)
348 #linkid=$(call linkpart,%)
349 #nodeid=$(call get,%)
350 #bridgefile=cache/bridge.$(nodeid)
352 # cache/iface.<node_id1>-<node_id2>@<endpoint>:
353 # Creates the interface for link <node_id1>-<node_id2> on
354 # <node_id<endpoint>>.
356 # The bridge of the local node must already exist, and we need to create
357 # the interface again if the bridge is re-created.
358 # We also need a running db daemon, but we do not need to do anything
359 # if the db daemon is restarted.
360 cache/iface.%: cache/bridge.$$(call get,%) | cache/db.$$(call get,%)
361 @echo "Creating interface for link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $(call log,$@)"
362 @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) sliver-ovs create-port $(BRIDGE) \
363 L$(call linkpart,$(*F)) > $(call log,$@) 2>&1
366 # cache/port.<node_id1>-<node_id2>@<endpoint>:
367 # Retrieves the local port of link <node_id1>-<node_id2> on
368 # node <node_id<endpoint>>.
370 # The local interface must have been created already and the
371 # switch daemon must be running. We need to retrieve the port
372 # number again if the interface is re-created, or the switch
373 # daemon is restarted.
374 cache/port.%: cache/iface.% cache/switch.$$(call get,%)
375 @echo "Getting port number for link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $(call log,$@)"
376 @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) \
377 sliver-ovs get-local-endpoint L$(call linkpart,$(*F)) > $@ 2> $(call log,$@)
380 # linkid=$(call linkpart,%)
381 # nodeid=$(call get,%)
382 # iface1=cache/iface.%
383 # iface2=cache/iface.$(call opp,%)
385 # cache/endpoint.<node_id1>-<node_id2>@<endpoint>:
386 # Sets the other side (IP address, UDP port) info for link <node_id1>-<node_id2>
387 # on <node_id<endpoint>>.
389 # We need the IP address and the UDP port of the other side and the interace of this side.
390 # We need to set the info again if any of these change.
391 cache/endpoint.%: cache/host.$$(call rget,%) cache/port.$$(call opp,%) cache/iface.% | cache/db.$$(call get,%)
392 @echo "Setting port number of link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $(call log,$@)"
393 @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) sliver-ovs set-remote-endpoint L$(call linkpart,$(*F)) \
394 $$(cat cache/host.$(call rget,$(*F))) \
395 $$(cat cache/port.$(call opp,$(*F))) 2> $(call log,$@)
399 ######################
401 ######################
403 test: $(foreach l,$(LINKS),test-$(l))
405 test-%: ping-% ping-$$(call get,$$*@2)$(SEP)$$(call get,$$*@1)
409 @echo "Testing connectivity $(call get,$*@1) ===> $(call get,$*@2) - logs in $(call log,$@)"
410 @$(SSH) $(call solve,$(call get,$*@1)) ping -c 1 $(call solve_ip_addr,$(call get,$*@2)) > $(call log,$@) 2>&1
411 @echo "Connectivity $(call get,$*@1) ===> $(call get,$*@2) OK"
414 CLEANTARGETS=$(addprefix del-,$(notdir $(wildcard cache/bridge.*)))
415 clean: $(CLEANTARGETS)
418 .PHONY: clean distclean
422 ( echo "digraph $(SLICE) {"; ls L | sed 's/$(SEP)/->/;s/$$/;/'; echo "}" ) > $@
429 # GMAP_SERVER, the hostname that runs an ndnmap instance
430 # GMAP_PROBES, a list of tuples of the form
431 # <linkid>=<nodeid>=<internal_linkid>=<frequency>
433 # SENDER-MUX=SENDER=3=0.5
434 # which would mean, the link 'SENDER-MUX' should be monitored at the 'SENDER' node and is coded
435 # in links.json with id=3, every half second
436 # sliver-ovs gmap-probe is designed to run in background,
437 # and so that a new run will kill any previously running instance
438 gprobes: $(foreach probe,$(GMAP_PROBES),gprobe-$(probe))
441 $(SSH) -n $(call solve,$(word 2,$(subst @, ,$(*F)))) $(SUDO) \
442 sliver-ovs gmap-probe L$(word 1,$(subst @, ,$(*F))) $(GMAP_SERVER) $(word 3,$(subst @, ,$(*F))) $(word 4,$(subst @, ,$(*F)))
444 jsons: routers.json links.json geocode.json
447 routers.json: $(CONF)
450 for n in $(CONF_NODE_IDS); do \
451 echo " $$sep\"$$n\""; \
457 links.json: $(foreach l,$(LINKS),cache/json.$(l))
459 cat $^ | sed '2,$$s/^/, /'; \
463 cache/json.%: $(CONF)
464 @echo "{\"id\": $($*_linkid), \"start\": \"$(call get,$*@1)\", \"end\": \"$(call get,$*@2)\"}" > $@
466 geocode.json: $(foreach n,$(CONF_NODE_IDS),cache/geocode.$(n))
477 cache/geocode.%: cache/loc.% $(CONF)
478 @{ echo "\"$*\": {"; \
479 echo " \"name\": \"$(HOST_$*)\","; \
480 echo " \"shortname\": \"$*\","; \
481 echo " \"site\": \"\","; \
482 echo " \"backbone\": false,"; \
483 echo " \"position\": [ $(shell cat cache/loc.$*) ]"; \
488 @wget -O - 'http://freegeoip.net/csv/$(HOST_$*)' | \
489 awk -F, '{ printf "%s, %s\n", $$8, $$9 }' > $@
492 # 'virtual' targets in that there's no real file attached
493 define node_shortcuts
494 sshcheck.$(1): sshcheck-$(1) FORCE
495 db.$(1): cache/db.$(1) FORCE
496 switch.$(1): cache/switch.$(1) FORCE
497 start.$(1): cache/start.$(1) FORCE
498 stop.$(1): cache/stop.$(1) FORCE
499 status.$(1): cache/status.$(1) FORCE
500 bridge.$(1): cache/bridge.$(1) FORCE
501 host.$(1): cache/host.$(1) FORCE
502 controller.$(1): cache/controller.$(1) FORCE
503 # switch already depends on db, but well
504 cache/start.$(1): cache/db.$(1) cache/switch.$(1) FORCE
507 $(foreach id,$(ALL_NODE_IDS), $(eval $(call node_shortcuts,$(id))))
509 define link_shortcuts
510 iface.%: cache/iface.%
511 endpoint.%: cache/endpoint.%
514 $(foreach id,$(ALL_LINK_IDS), $(eval $(call link_shortcuts,$(id))))
519 #################### convenience, for debugging only
520 # make +foo : prints the value of $(foo)
521 # make ++foo : idem but verbose, i.e. foo=$(foo)
522 ++%: varname=$(subst +,,$@)
524 @echo "$(varname)=$($(varname))"
525 +%: varname=$(subst +,,$@)
527 @echo "$($(varname))"
529 # external nodes and links
531 ALL_LINKS := $(LINKS) $(patsubst L/%,%,$(filter L/%,$(MAKECMDGOALS)))
532 EXTERNAL_LINKS := $(filter $(foreach host,$(EXTERNAL_HOSTS),%-$(host)),$(ALL_LINKS))
534 $(foreach host,$(EXTERNAL_HOSTS),sshcheck-$(host)): ;
535 $(foreach host,$(EXTERNAL_HOSTS),ovsversion-$(host)): ;
536 $(foreach host,$(EXTERNAL_HOSTS),showdpid-$(host)): ;
537 $(foreach host,$(EXTERNAL_HOSTS),showmac-$(host)): ;
538 $(foreach host,$(EXTERNAL_HOSTS),showports-$(host)): ;
539 $(foreach host,$(EXTERNAL_HOSTS),update-$(host)): ;
540 $(foreach host,$(EXTERNAL_HOSTS),del-controller-$(host)): ;
541 $(foreach host,$(EXTERNAL_HOSTS),cache/status.$(host)): ;
542 $(foreach host,$(EXTERNAL_HOSTS),cache/controller.$(host)): ;
544 $(foreach host,$(EXTERNAL_HOSTS),cache/rsnap.ip.$(host)): ;
547 $(foreach host,$(EXTERNAL_HOSTS),cache/rsnap.links.$(host)): ;
550 $(foreach host,$(EXTERNAL_HOSTS),cache/db.$(host)):
553 $(foreach host,$(EXTERNAL_HOSTS),del-db.$(host)): del-db.%:
556 $(foreach host,$(EXTERNAL_HOSTS),cache/switch.$(host)): ;
559 $(foreach host,$(EXTERNAL_HOSTS),del-switch.$(host)): del-switch.%:
560 @rm -f cache/switch.$* \
561 cache/port.$*$(SEP)*@1 cache/port.*$(SEP)$*@2 \
562 cache/endpoint.$*$(SEP)*@2 cache/endpoint.*$(SEP)$*@1 \
563 L/$*$(SEP)* L/*$(SEP)$* \
568 $(foreach host,$(EXTERNAL_HOSTS),cache/bridge.$(host)): cache/bridge.%: | cache/db.%
569 @echo "Creating fake bridge on external host $(call display,$*)"
572 $(foreach link,$(EXTERNAL_LINKS),cache/iface.$(link)@2): cache/iface.%: cache/bridge.$$(call get,%) | cache/db.$$(call get,%)
573 @echo "Creating fake interface for link $(call linkpart,$*) on external host $(call get,$*)"
576 $(foreach link,$(EXTERNAL_LINKS),cache/port.$(link)@2): cache/port.%: cache/iface.% cache/switch.$$(call get,%)
577 @echo "Getting port number for link $(call linkpart,$(*F)) on external host $(call display,$(call get,$(*F)))"
578 @echo $(call default,EXTERNAL_PORT,$(call rightnode,$*)) > $@
581 $(foreach link,$(EXTERNAL_LINKS),del-iface.$(link)@2): del-iface.%: | cache/db.$$(call get,%)
582 @echo "Removing fake interface for link $(call linkpart,$*) from external host $(call get,$*)"
583 @rm -f cache/iface.$* \
584 cache/port.$* cache/endpoint.$* cache/endpoint.$(call opp,$*) \
585 L/$(call linkpart,$*)
587 $(foreach host,$(EXTERNAL_HOSTS),del-bridge.$(host)): del-bridge.%: | cache/db.%
588 @echo "Deleting fake bridge on external host $(call display,$*)"
589 @rm -f cache/bridge.$* \
590 cache/iface.$*$(SEP)*@1 cache/iface.*$(SEP)$*@2 \
591 cache/port.$*$(SEP)*@1 cache/port.*$(SEP)$*@2 \
592 cache/endpoint.$*$(SEP)*@? cache/endpoint.*$(SEP)$*@? \
593 L/$*$(SEP)* L/*$(SEP)$* \
596 $(foreach link,$(EXTERNAL_LINKS),ping-$(call get,$(link)@2)$(SEP)$(call get,$(link)@1)): ping-%: FORCE
597 @echo "Test from external host $(call get,$*@1) to $(call get,$*@2) skipped"
599 # we assume that a program called tunproxy is available on the
601 $(foreach link,$(EXTERNAL_LINKS),cache/endpoint.$(link)@2): cache/endpoint.%@2: cache/port.%@1 cache/host.$$(call leftnode,%)
602 @#echo $* [$<] [$^] $(call rightnode,$*)
603 @echo "===>" $(call rightnode,$*): \
604 ./tunproxy -t $$(cat cache/host.$(call leftnode,$*)):$$(cat cache/port.$*@1) \
605 -p $(call default,EXTERNAL_PORT,$(call rightnode,$*)) -e -d
611 @echo "===> Configuration ($(CONF)):"
613 @for f in log/*; do \
614 echo "===> Log file $$(basename $$f):"; \