; SNAP SVC TEST PACKET ; ; snap prototype packet ; ; (c) 2003, Willem de Bruijn ; all code is licensed under the BSD License ; NB: this does not necessary apply to the SNAP interpreter code ; written by Jonathan Moore of the University of Pennsylvania dforw ; continue until at route destination stackcount ; find the bottom stack element ;subi 1 ; stack numbers start from 0, not 1 pullstack ; get the bottom element print bez atsource-pc ; ... we are at the final destination if element==0 ; execute the requests ; INSERT PROCESSING ACTIONS HERE ; prepare the extended send instruction (startpoint , stacklength, rb) push 0 ; startpoint is the beginning of the packet stackcount ; copy the entire stack ... subi 3 ; ... MINUS the bottom two elements getrb ; use up all resource bound ; prepare the extended send instruction (ip address) stackcount ; again get the stackcount subi 1 ; stack numbers strart from 0, not 1 pullstack ; fetch an ip address print ; debug ; go to the next hop (from the bottom of the stack) dsend exit atsource: ; at the source: print result print lti 400 ; define a threshold, demux only accepts strings (for now) bne totalok-pc push "not ok" ji returnok-pc totalok: push "ok" returnok: push 7777 ; push clientport demux ; send top stackvalue to the client ; do not place the first destination here! it is sent there from the (commandline) client #data 1 #data 10.0.0.34 #data 1 #data 127.0.0.1 #data 0 #data 0 #data 0