ixTakeOwnership

ixTakeOwnership - takes ownership of all the ports in the list

SYNOPSIS

ixTakeOwnership portList [takeType]

DESCRIPTION

The ixTakeOwnership command takes ownership of all the ports in the list.

When a list of ports is supplied to ixTakeOwnership and one of the ports does not exist, the command takes ownership where it can, and prints a message line for the port that it cannot take ownership, and returns a 0. The port for which ownership cannot be taken is removed from the list, and the process continues.

This message is posted:

Port [getPortId $c $l $p] is not available, removing port from the list.

A value of 1 is returned when ixTakeOwnership is given just one, non-existent port as a parameter.

ARGUMENTS
portList

(By value) The list of ports in one of the following formats:

One of the following literal strings, or a reference to a variable with the $ (for example, $pl after set pl ...)

{{1 1 1}}

{{1 1 1} {1 1 2} {1 1 3} {1 1 4}}

{{1 1 *} {1 2 1} {1 2 2}}

takeType

(By value) (Optional) Valid values:

force: take regardless of whether the port is owned by someone else

notForce: do not force ownership

RETURNS
0

No error; the command was successfully delivered to the IxServer. Ownership of at least one port (in the list) was successfully acquired.

1

Error; the command was delivered to the IxServer but it could not process the message.

EXAMPLES

package require IxTclHal

set host galaxy

set username user

# Check if we're running on UNIX - connect to the TCL Server

# which must be running on the chassis

if [isUNIX] {

if [ixConnectToTclServer $host] {

ixPuts "Could not connect to $host"

return 1

}

}

# Now connect to the chassis

if [ixConnectToChassis $host] {

ixPuts $::ixErrorInfo

return 1

}

# Get the chassis ID to use in port lists

set chas [ixGetChassisID $host]

set portsToOwn {{$chas 1 *} {$chas 2 1} {$chas 2 2}}

# Login before taking ownership

if [ixLogin $username] {

ixPuts $::ixErrorInfo

return 1

}

# Take ownership of the ports we'll use

if [ixTakeOwnership $portsToOwn force] {

ixPuts $::ixErrorInfo

return 1

}

SEE ALSO

ixClearOwnership, ixPortClearOwnership, ixPortTakeOwnership