OLSR simulation in ns2

# Create the simulator object that we need in order to run NS
set ns [new Simulator]

# Set the parameters that we will use for wireless communications
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) CMUPriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 10 ;# max packet in ifq
set val(rp) DSR ;# routing protocol
set val(x) 1000 ;# X dimension of topography
set val(y) 1000 ;# Y dimension of topography
set val(nn) 4 ;# number of mobile nodes

# Open a trace file
set f [open distant.tr w]
$ns trace-all $f
$ns use-newtrace

#Open the nam trace file
set nf [open out_2a.nam w]
$ns namtrace-all $nf
$ns namtrace-all-wireless $nf $val(x) $val(y)

# Create the topology of the world. In this case, flat with dimensions defined above.
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)

# The God object is an all seeing entity that needs to know how many nodes are present.
create-god $val(nn)

# Create a wireless channel
set chan_1_ [new $val(chan)]

Mac/802_11 set RTSThreshold_ 0

# Configure the nodes so that when we create them they are ready to do wireless.
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel $chan_1_ \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace ON

# Create the 4 nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]

# define color index
$ns color 1 blue
$ns color 0 red
$n(0) color blue
$ns at 0 "$n(0) color blue"
$n(2) color green
$ns at 0 "$n(2) color green"

# Position the nodes in the world
$n0 set X_ 100
$n0 set Y_ 600
$n0 set Z_ 0

$n1 set X_ 300
$n1 set Y_ 600
$n1 set Z_ 0

$n2 set X_ 100
$n2 set Y_ 100
$n2 set Z_ 0

$n3 set X_ 300
$n3 set Y_ 100
$n3 set Z_ 0

#Setup 2 UDP connection
set udp1 [new Agent/UDP]
set dst1 [new Agent/Null]
$udp1 set fid_ 1

set udp2 [new Agent/UDP]
set dst2 [new Agent/Null]
$udp2 set fid_ 2

#Setup 2 CBR over UDP connection
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp1
$cbr set type_ CBR
$cbr set packet_size_ 1000
$cbr set rate_ 250k
$cbr set random_ false

set cbr1 [new Application/Traffic/CBR]
$cbr1 attach-agent $udp2
$cbr1 set type_ CBR
$cbr1 set packet_size_ 1000
$cbr1 set rate_ 250k
$cbr1 set random_ false

# Connect the flow
$ns attach-agent $n0 $udp1
$ns attach-agent $n1 $dst1
$ns connect $udp1 $dst1

$ns attach-agent $n2 $udp2
$ns attach-agent $n3 $dst2
$ns connect $udp2 $dst2

#Show the movement of the nodes

$ns at 0.00 "$n0 setdest 100 100 0"
$ns at 0.00 "$n2 setdest 100 600 0"
$ns at 5.00 "$n0 setdest 100 100 10"
$ns at 5.00 "$n2 setdest 100 600 10"

# Start the FTP flow
$ns at 0.00 "$cbr start"
$ns at 0.00 "$cbr1 start"

# Run the simulation for 0 minute and 50 second
$ns at 50.0 "finish"

#Define a 'finish' procedure
proc finish {} {
global ns nf
$ns flush-trace
#Close the trace file
close $nf
#Execute nam on the trace file
exec nam out.nam &
exit 0
}

$ns run

Can anyone help me to change the above tcl script to use OLSR routing protocol. in the simplest possible way.

Thank you in advance.