Commit c2fe8581 authored by Shashi Guruprasad's avatar Shashi Guruprasad

If the bandwidth unit is missing a 'b', we still consider it to be in bits.

For example, a 56kbps == 56kb == 56k. Missing a 'b' caused it to make
the links 100Mb whereas ns2 supports not specifying the 'b'.
parent 8ad1c1a1
......@@ -387,13 +387,17 @@ proc parse_bw {bspec} {
set unit b
}
# We could do better below with a regexp match. But it is better to keep it simple.
switch -- $unit {
b {set val [expr int($bw/1000)]}
bps {set val [expr int($bw/1000)]}
k {set val [expr int($bw)]}
kb {set val [expr int($bw)]}
kbps {set val [expr int($bw)]}
M {set val [expr int($bw*1000)]}
Mb {set val [expr int($bw*1000)]}
Mbps {set val [expr int($bw*1000)]}
G {set val [expr int($bw*1000000)]}
Gb {set val [expr int($bw*1000000)]}
Gbps {set val [expr int($bw*1000000)]}
default {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment