Install instructions for building and running nrlolsr in ns-2.26:
ns-2.27 is not yet supported.

1. Download nrlolsr source code by following either a or b steps.

	a. Using cvs: 

		1) make current directory /ns-allinone-2.26/ns-2.26/ 
		   or which ever ns-2 code directory you want to install nrlolsr in.

		2) Log into cvs anonymously using 
"cvs -d :pserver:anonymous@olsr.pf.itd.nrl.navy.mil:/cvsroot/olsr login"

		3) type 
"cvs -d :pserver:anonymous@olsr.pf.itd.nrl.navy.mil:/cvsroot/olsr co nrlolsr"

		4) type 
"cvs -d :pserver:anonymous@protolib.pf.itd.nrl.navy.mil:/cvsroot/protolib co protolib"

		5) type "cd nrlolsr"

		6) create symoblic link named protolib pointing to ../protolib
			"ln -s ../protolib protolib"

	b. Using tar:

		1) make current directory /ns-allinone-2.26/ns-2.26/

		2) download nrlolsrdv7.0.tgz into /ns-allinone-2.26/ns-2.26

		3) type "tar -xvzf nrlolsrd7.0.tgz"

		4) create symbolic link protolib which points to nrlolsr/protolib
			"ln -s ../protolib protolib"
	
	note: actual protolib source code is located in different 
	      locations depending on method of downloading.

2. Modify Makefile.in to include new source. If you have modifided or added code 
   to ns you must add changes manually to perserve your existing code.	

	a. Copy Makefile.in from /ns/nrlolsr/ns/ directory to /ns/ directory.
	
	b. Manually modify Makefile.in by comparing your modified Makefile.in
	   with /ns-2.26/nrlolsr/ns/Makefile.in and adding lines which are not 
	   currently in your Makefile.in

3. Build new Makefile by running ./configure in your ns-2.26 directory.
   Do not compile yet.

4. Change your ns-2.26/common/packet.h file to include info on ProtolibManetKernel
   add "#define HDR_ProtolibManetKernel(p) (hdr_ProtolibManetKernel::access(p))"
       near the top of the file with the other #defines.
   add "PT_ProtolibManetKernel," in the enum packet_t section
   add "name_[PT_ProtolibManetKernel]= "ProtolibManetKernel";" in the p_info() section

5. Change your ns-2.26/trace/cmu-trace.h file adding ProtolibManetKernel hooks
   add "void	format_ProtolibManetKernel(Packet *p, int offset);" at the bottom with
   	the other format_ functions.

6. Change your ns-2.26/trace/cmu-trace.cc file adding ProtolibManetKernel hooks
   add "#include <nrlolsr/ns/protolibManetKernel.h>" at the end of the #includes
   add empty function:
      "void CMUTrace::format_ProtolibManetKernel(Packet *p, int offset) {return;}"
   add to the switch(ch->ptype()) (default one) statement
   "	case PT_ProtolibManetKernel:
		format_ProtolibManetKernel(p, offset);
		break;"

7. Change your ns-2.26/tcl/lib/ns-lib.tcl file.
   add to the "switch -exact $routingAgent" statement
   "	ProtolibManetKernel {
		set ragent [$self create-protolibmanetkernel-agent $node]
  	}"
   add along with other Simulator create functions
   " 	Simulator instproc create-protolibmanetkernel-agent { node } {
		# create a dummie wireless agent
		# it will foward packets up to protolib manet
		# and just act as a wedge into ns
		# used by protolib wireless manets
		set ragent [new Agent/ProtolibManetKernel [$node node-addr]]
		$node set ragent_ $ragent
		return $ragent
   	}"

8. Last edit! Change ns-2.26/queue/priqueue.cc file 
   add "case PT_ProtolibManetKernel:"
   to the switch statment in the if(Prefer_Routing_Protocols) conditional (at top)

9. Now we can compile the code by typing "make" in your ns directory

10. Run the sample tcl file basicmhop.tcl located in the ns-2.26/nrlolsr/ns 
    "ns basicmhop.tcl"  the output should be some invalid options then...

	Cbr agent0 received 28.197333333333333 Kbps
	Cbr agent1 received 61.925333333333334 Kbps
	Cbr agent2 received 67.637333333333331 Kbps

11. Additional tcl file setup is required for your existing simulations please 
    follow the basicmhop.tcl for hints on how to set up an nrlolsr node in your 
    existing simulation tcl files.

