NAT32 Permanent Port Mappings are documented here.
The following TCL scripts serve as examples for using TCL to write scripts which can be invoked from the NAT32 Console or from within the file startup.
Example 1: QuickTime 4
#!tcl
#
# Quicktime 4 mappings
#
if {$argc == 0} {
error {Usage: qt4 IPaddress|off}
}
set addr [lindex $argv 0]
if {$addr == "off"} {
exec "ppmap delete udp 6970:6999"
} else {
exec "ppmap add udp 6970:6999 $addr 6970:6999"
}
Example 2: REAL AUDIO
#!tcl
#
# Real Player mappings
#
if {$argc == 0} {
error {Usage: real IPaddress|off}
}
set addr [lindex $argv 0]
if {$addr == "off"} {
exec "ppmap delete udp 6970:7170"
} else {
exec "ppmap add udp 6970:7170 $addr 6970:7170"
}
Example 3: Battle Net
#!tcl
#
# Battle Net mappings
#
if {$argc == 0} {
error {Usage: battle IPaddress|off}
}
set addr [lindex $argv 0]
if {$addr == "off"} {
exec "ppmap delete udp 6112"
exec "umap delete 6112"
} else {
exec "ppmap add udp 6112 $addr 6112"
exec "umap add 6112 1"
}
Example 4: DialPad
#!tcl
#
# DialPad mappings
#
if {$argc == 0} {
error {Usage: dialpad IPaddress|off}
}
set addr [lindex $argv 0]
if {$addr == "off"} {
exec "ppmap delete udp 51200:51201"
exec "ppmap delete tcp 51210"
} else {
exec "ppmap add udp 51200:51201 $addr 51200:51201"
exec "ppmap add tcp 51210 $addr 51210"
}
The TCL help Page documents the special features of the NAT32 implementation of TCL.
ppmap tcl