From 25511d70dc149034aacb2a6b25eab04c07f1a1da Mon Sep 17 00:00:00 2001 From: "ahrenholz@gmail.com" Date: Tue, 28 Apr 2009 18:57:35 +0000 Subject: [PATCH] added three node wireless example --- wiki/APIExamples.wiki | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/wiki/APIExamples.wiki b/wiki/APIExamples.wiki index 960a1b15..1b725d53 100644 --- a/wiki/APIExamples.wiki +++ b/wiki/APIExamples.wiki @@ -56,4 +56,32 @@ NODE(num=1,) # as part of the shutdown sequence, the CORE GUI kills running processes on each node; this is performed by sending cored the first two EXEC messages containing the _killall_ command. Each EXEC message is given a sequence number (101, 102, etc...) so the response output can be matches. # the LINK message with flags=2 instructs cored to remove the link between n0 and n1 # the two NODE messages that follow with flags=del instruct cored to shutdown nodes n0 and n1; the str "status request" flag tells cored that the status is requested once the node shutdown completes - # similar to startup, the GUI draws a red square around each node indicating the request to shutdown each node; the last two NODE messages have the str flag set and are the response to the node shutdown request; the red squares are then removed in the GUI \ No newline at end of file + # similar to startup, the GUI draws a red square around each node indicating the request to shutdown each node; the last two NODE messages have the str flag set and are the response to the node shutdown request; the red squares are then removed in the GUI + += Three wireless nodes example = + +http://hipserver.mct.phantomworks.org/core/images/wiki/api_example_three_wireless.png + +Three nodes connected to a wireless LAN (WLAN), and the built-in on/off model is being used. (This is the simplest wireless model where the GUI calculates the range between nodes and tells cored to link or unlink nodes as needed.) + +{{{ +>NODE(n0,type=0x0,n0,m=0,x=181,y=82) +>NODE(n1,type=0x0,n1,m=0,x=107,y=172) +>NODE(n2,type=0x0,n2,m=0,x=318,y=54) +>NODE(n3,type=0x6,wlan3,x=34,y=39) +>LINK(flags=1,3-0,25000,54000000,type=0,if2n=0,10.0.0.1/32,a:0::1/128,) +>LINK(flags=1,3-1,25000,54000000,type=0,if2n=0,10.0.0.2/32,a:0::2/128,) +>LINK(flags=1,3-2,25000,54000000,type=0,if2n=0,10.0.0.3/32,a:0::3/128,) +>FILE(flag=1,n0,f=/etc/quagga/Quagga.conf,src=/tmp/core_n0.conf) +>FILE(flag=1,n1,f=/etc/quagga/Quagga.conf,src=/tmp/core_n1.conf) +>FILE(flag=1,n2,f=/etc/quagga/Quagga.conf,src=/tmp/core_n2.conf) +>LINK(flags=1,0-1,type=0,) +>LINK(flags=1,0-2,type=0,) +>LINK(flags=1,1-2,type=0,) +read 16 bytes (type=1, flags=9, len=16)... +NODE(num=0,emuid=1000,) +read 16 bytes (type=1, flags=9, len=16)... +NODE(num=1,emuid=1001,) +read 16 bytes (type=1, flags=9, len=16)... +NODE(num=2,emuid=1002,) +}}} \ No newline at end of file