From: zrinka Date: Fri, 2 Dec 2005 09:23:19 +0000 (+0000) Subject: source documentation for ipv6.tcl X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=5b2df283a513228a4e0de836927fab960c3b7e71;p=imunes.git source documentation for ipv6.tcl Bug found by: Submitted by: Requested by: Reviewed by: Approved by: Obtained from: --- diff --git a/ipv6.tcl b/ipv6.tcl index 5d53f19..12ecfba 100755 --- a/ipv6.tcl +++ b/ipv6.tcl @@ -33,7 +33,25 @@ # and Technology through the research contract #IP-2003-143. # +#****h* imunes/ipv6.tcl +# NAME +# ipv6.tcl -- file for handeling IPv6 +#**** +#****f* ipv6.tcl/findFreeIPv6Net +# NAME +# findFreeIPv6Net -- find free IPv6 network +# SYNOPSIS +# set ipnet [findFreeIPv4Net $mask] +# FUNCTION +# Finds a free IPv6 network. Network is concidered to be free +# if there are no simulated nodes attached to it. +# INPUTS +# * mask -- this parameter is left unused for now +# RESULT +# * ipnet -- returns the free IPv6 network address in the form "a $i". +#**** + proc findFreeIPv6Net { mask } { global node_list @@ -54,6 +72,20 @@ proc findFreeIPv6Net { mask } { } } +#****f* ipv6.tcl/autoIPv6addr +# NAME +# autoIPv6addr -- automaticaly assign an IPv6 address +# SYNOPSIS +# autoIPv6addr $node_id $iface +# FUNCTION +# automaticaly assignes an IPv6 address to the interface $iface of +# of the node $node. +# INPUTS +# * node_id -- the node containing the interface to witch a new +# IPv6 address should be assigned +# * iface -- the interface to witch a new, automatilacy generated, IPv6 +# address will be assigned +#**** proc autoIPv6addr { node iface } { set peer_ip6addrs {} @@ -102,6 +134,18 @@ proc autoIPv6addr { node iface } { return } +#****f* ipv6.tcl/autoIPv6defaultroute +# NAME +# autoIPv6defaultroute -- automaticaly assign a default route +# SYNOPSIS +# autoIPv6defaultroute $node_id $iface +# FUNCTION +# searches the interface of the node for a router, if a router is found +# then it is a new default gateway. +# INPUTS +# * node_id -- default gateway is provided for this node +# * iface -- the interface on witch we search for a new default gateway +#**** proc autoIPv6defaultroute { node iface } { if { [[typemodel $node].layer] != "NETWORK" } { @@ -144,6 +188,19 @@ proc autoIPv6defaultroute { node iface } { } } +#****f* ipv6.tcl/checkIPv6Addr +# NAME +# checkIPv6Addr -- check the IPv6 address +# SYNOPSIS +# set valid [checkIPv6Addr $str] +# FUNCTION +# Checks if the provided string is a valid IPv6 address. +# INPUTS +# * str -- string to be evaluated. +# RESULT +# * valid -- function returns 0 if the input string is not in the form +# of a valid IP address, 1 otherwise +#**** proc checkIPv6Addr { str } { set doublec false @@ -180,6 +237,19 @@ proc checkIPv6Addr { str } { return 1 } +#****f* ipv6.tcl/checkIPv6Net +# NAME +# checkIPv6Net -- check the IPv6 network +# SYNOPSIS +# set valid [checkIPv6Net $str] +# FUNCTION +# Checks if the provided string is a valid IPv6 network. +# INPUTS +# * str -- string to be evaluated. Valid string is in form ipv6addr/m +# RESULT +# * valid -- function returns 0 if the input string is not in the form +# of a valid IP address, 1 otherwise. +#**** proc checkIPv6Net { str } { if { $str == "" } { @@ -194,5 +264,3 @@ proc checkIPv6Net { str } { } return [checkIntRange $net 0 128] } - -