Description
The
grab
command is a convenience function which allocates a network device from of type
type.
The default
is to allocate from type
port
in descending order.
The device handle (Tcl variable) will be called
net,
which defaults to
net
. A DSP resource will then be
attached to
net,
called
vp
(defaulting to
vp
). Resources will be allocated as in
grab res -decending
order
unless the
-ascending
option is used. The
-group
argument is the same as for
grab res
; you may use it
or
-unit
, but not both simultaneously. Similarly,
-specific type
and
-port
are the same as for
grab res
and have the same restrictions on its use as with that function.
If
net
and
vp
are defaulted, then the function also performs a
make local net vp
command to make those
handles’ member functions be “locally” available in the interpreter.
Return values:
A return of
-1
indicates that the network device type type was unavailable, while
-2
indicates that the
subsequent
dsp attach
failed. Otherwise, an empty string is returned to indicate success.
39