Re source shown on page
http://www.openmash.org/lxr/source/tcl/dp-lib.tcl?c=lib
Line 275 will return an empty list if the first octet is one
digit, as the first char of any tcl string is 0, not 1.
#----------
264 # -- server function to maintain access control list
265 proc dp_Host {host} {
266 global _rpc
267 # -- validate host argument as being well formed
IP address
268 set opcode [string index $host 0]
269 if {$opcode != "+" && $opcode != "-"} {
270 return -code error "dp_Host usage: dp_Host
\[+|-\]ipaddress"
271 }
272 if {[string length $host] == 1} {
273 append host "*.*.*.*"
274 }
275 set iplist [string range $host 1 [expr [string
length $host] - 1]]
276 set iplist [split $iplist "."]
277 if {[llength $iplist] != 4} {
278 # -- assume non-ip hostname given...can't
handle it so return
279 return {}
280 }
281 foreach ipitem $iplist {
282 if {$ipitem != "*"} {
283 if {[catch {expr $ipitem * 1}] || $ipitem >
255} {
284 # -- assume non-ip hostname
given,..can't handle so return
285 return {}
286 }
287 }
288 }
289 # -- create the acl list, enable universal access,
add modifier
290 if {![info exists _rpc(acl)]} {
291 lappend _rpc(acl) [list + * * * *]
292 }
293 lappend _rpc(acl) "$opcode $iplist"
294 return {}
295 }