=head1 NAME

B<ibmssh> IB MANAGEMENT SIMULATOR - Extentended TCL shell

=head1 DESCRIPTION

B<ibmssh> is a TCL shell extended with interface for the IB Management Simulator facilities.
Normally you will not run this shell directly - but instead it will be invoked by the B<IBMgtSim> utility.
However, in order to write simulation flows that interacts closely with the simulated model, a simulation flow should be provided. This flow is loaded by IBMgtSim and excersize the API provided by this shell.

The following sub sections provide detailed definition for those objects and API.

=head1 IBMgtSim Constants

These constants are provided by IBMgtSim

=head2 Massage Manager Log Verbosity Flags

=over

=item [ Constant : int  ] $MsgShowFatal = 0x01

=item [ Constant : int  ] $MsgShowError = 0x02

=item [ Constant : int  ] $MsgShowWarning = 0x04

=item [ Constant : int  ] $MsgShowInfo = 0x08

=item [ Constant : int  ] $MsgShowVerbose = 0x10

=item [ Constant : int  ] $MsgShowContext = 0x20

=item [ Constant : int  ] $MsgShowSource = 0x40

=item [ Constant : int  ] $MsgShowTime = 0x80

=item [ Constant : int  ] $MsgShowModule = 0x100

=item [ Constant : int  ] $MsgShowMads = 0x200

=item [ Constant : int  ] $MsgShowFrames = 0x400

=item [ Constant : int  ] $MsgShowAll = 0xffff

=item [ Constant : int  ] $MsgDefault = 0x62f




=back

=head1 Message Manager Objects

=head2 class msgManager

=over

This is the Message Manager class

=item [ Member : returns int  ] getVerbLevel ?module?

=item [ Member : returns int  ] clrVerbLevel ?module?

=item [ Member : returns void  ] setVerbLevel vl ?module?

=item [ Member : returns int  ] outstandingMsgCount ?vl?

=item [ Member : returns string  ] outstandingMsgs ?vl?

=item [ Member : returns string  ] getNextMessage

=item [ Member : returns void  ] nullOutstandingMsgs

=item [ Member : returns int  ] setLogFile fileName




=back

=head1 Random Manager Functions

=item [ returns float  ] rmRand

obtain a random number in the range 0.0 - 1.0

=item [ returns int  ] rmSeed seed

initialize the seed for the random manager

=head2  class ib_node_info_t

=over

=item [ Member data: returns uint8_t * ] -base_version

=item [ Member data: returns uint8_t * ] -class_version

=item [ Member data: returns uint8_t * ] -node_type

=item [ Member data: returns uint8_t * ] -num_ports

=item [ Member data: returns ib_net64_t * ] -sys_guid

=item [ Member data: returns ib_net64_t * ] -node_guid

=item [ Member data: returns ib_net64_t * ] -port_guid

=item [ Member data: returns ib_net16_t * ] -partition_cap

=item [ Member data: returns ib_net16_t * ] -device_id

=item [ Member data: returns ib_net32_t * ] -revision

=item [ Member data: returns ib_net32_t * ] -port_num_vendor_id


=back

=head2 class ib_switch_info_t

=over

=item [ Member data: returns ib_net16_t * ] -lin_cap

=item [ Member data: returns ib_net16_t * ] -rand_cap

=item [ Member data: returns ib_net16_t * ] -mcast_cap

=item [ Member data: returns ib_net16_t * ] -lin_top

=item [ Member data: returns uint8_t * ] -def_port

=item [ Member data: returns uint8_t * ] -def_mcast_pri_port

=item [ Member data: returns uint8_t * ] -def_mcast_not_port

=item [ Member data: returns uint8_t * ] -life_state

=item [ Member data: returns ib_net16_t * ] -lids_per_port

=item [ Member data: returns ib_net16_t * ] -enforce_cap

=item [ Member data: returns uint8_t * ] -flags

=back

=head2 class ib_port_info_t

=over

=item [ Member data: returns ib_net64_t * ] -m_key

=item [ Member data: returns ib_net64_t * ] -subnet_prefix

=item [ Member data: returns ib_net16_t * ] -base_lid

=item [ Member data: returns ib_net16_t * ] -master_sm_base_lid

=item [ Member data: returns ib_net32_t * ] -capability_mask

=item [ Member data: returns ib_net16_t * ] -diag_code

=item [ Member data: returns ib_net16_t * ] -m_key_lease_period

=item [ Member data: returns uint8_t * ] -local_port_num

=item [ Member data: returns uint8_t * ] -link_width_enabled

=item [ Member data: returns uint8_t * ] -link_width_supported

=item [ Member data: returns uint8_t * ] -link_width_active

=item [ Member data: returns uint8_t * ] -state_info1

=item [ Member data: returns uint8_t * ] -state_info2

LinkSpeedSupported and PortState

=item [ Member data: returns uint8_t * ] -mkey_lmc

PortPhysState and LinkDownDefaultState

=item [ Member data: returns uint8_t * ] -link_speed

=item [ Member data: returns uint8_t * ] -mtu_smsl

LinkSpeedEnabled and LinkSpeedActive

=item [ Member data: returns uint8_t * ] -vl_cap

=item [ Member data: returns uint8_t * ] -vl_high_limit

VlCap and InitType

=item [ Member data: returns uint8_t * ] -vl_arb_high_cap

=item [ Member data: returns uint8_t * ] -vl_arb_low_cap

=item [ Member data: returns uint8_t * ] -mtu_cap

=item [ Member data: returns uint8_t * ] -vl_stall_life

=item [ Member data: returns uint8_t * ] -vl_enforce

=item [ Member data: returns ib_net16_t * ] -m_key_violations

=item [ Member data: returns ib_net16_t * ] -p_key_violations

=item [ Member data: returns ib_net16_t * ] -q_key_violations

=item [ Member data: returns uint8_t * ] -guid_cap

=item [ Member data: returns uint8_t * ] -subnet_timeout

=item [ Member data: returns uint8_t * ] -resp_time_value

=item [ Member data: returns uint8_t * ] -error_threshold


=back

=head2 class ib_node_desc_t

=over

=item [ Member data: returns uint8_array_t * ] -description

Node String is an array of UTF-8 character that describes the node in text format
Note that this string is NOT NULL TERMINATED!


=back

=head2  class ib_lft_record_t

=over

=item [ Member data: returns ib_net16_t * ] -lid

=item [ Member data: returns ib_net16_t * ] -block_num

=item [ Member data: returns uint32_t * ] -resv0

=item [ Member data: returns uint8_array_t * ] -lft


=back

=head2 class ib_pm_counters_t

=over

=item [ Member data: returns ib_mad_t * ] -mad_header

=item [ Member data: returns uint32_array_t * ] -reserved0

=item [ Member data: returns uint8_t * ] -reserved1

=item [ Member data: returns uint8_t * ] -port_select

=item [ Member data: returns ib_net16_t * ] -counter_select

=item [ Member data: returns ib_net16_t * ] -symbol_error_counter

=item [ Member data: returns uint8_t * ] -link_error_recovery_counter

=item [ Member data: returns uint8_t * ] -link_down_counter

=item [ Member data: returns ib_net16_t * ] -port_rcv_errors

=item [ Member data: returns ib_net16_t * ] -port_rcv_remote_physical_errors

=item [ Member data: returns ib_net16_t * ] -port_rcv_switch_relay_errors

=item [ Member data: returns ib_net16_t * ] -port_xmit_discard

=item [ Member data: returns uint8_t * ] -port_xmit_constraint_errors

=item [ Member data: returns uint8_t * ] -port_rcv_constraint_errors

=item [ Member data: returns uint8_t * ] -reserved2

=item [ Member data: returns uint8_t * ] -lli_errors_exc_buf_errors

=item [ Member data: returns ib_net16_t * ] -reserved3

=item [ Member data: returns ib_net16_t * ] -vl15_dropped

=item [ Member data: returns ib_net32_t * ] -port_xmit_data

=item [ Member data: returns ib_net32_t * ] -port_rcv_data

=item [ Member data: returns ib_net32_t * ] -port_xmit_pkts

=item [ Member data: returns ib_net32_t * ] -port_rcv_pkts

=item [ Member data: returns uint32_array_t * ] -reserved5

=back

=head1 IBMgtSim Simulator Objects

=head2 class IBMgtSim

=over

=item [ Member : returns IBFabric * ] getFabric

=item [ Member : returns IBMSServer * ] getServer

=item [ Member : returns IBMSDispatcher * ] getDispatcher

=item [ Member : returns int  ] init topoFileName serverPortNum numWorkers

=back

=head2 class IBMSNode

=over

=item [ Member : returns IBNode * ] getIBNode

get the IBNode of the IBMSNode

=item [ Member : returns int  ] getLinkStatus outPortNum

get the link status of the given port

=item [ Member : returns int  ] setPhyPortErrProfile portNum errProfileIn

set a particular port err profile

=item [ Member : returns int  ] getPhyPortErrProfile portNum

get a particular port err profile

=item [ Member : returns int  ] setPhyPortPMCounter portNum counterSelect countersVal

set a specific port counter

=item [ Member : returns ib_pm_counters_t * ] getPhyPortPMCounter portNum counterSelect
get a specific port counter

=item [ Member : returns ib_port_info_t * ] getPortInfo portNum

get a specific port info

=item [ Member : returns int  ] setLinkStatus portNum newState

set the Link status including sending trap128

=item [ Member : returns ib_node_info_t * ] getNodeInfo

get the node info

=item [ Member : returns ib_switch_info_t * ] getSwitchInfo

get the switch info

=item [ Member : returns ib_pkey_table_t * ] getPKeyTblBlock portNum blockNum

get pkey table block

=item [ Member : returns int  ] setPKeyTblBlock portNum blockNum tbl

set pkey table block

=item [ Member : returns int  ] setCrSpace startAddr length data

set CR Space Value

=item [ Member : returns int  ] getCrSpace startAddr length data

get CR Space Value

=item [ Member : returns int  ] getMFTBlock blockIdx portIdx

get MFT block

=item [ Member : returns int  ] setMFTBlock blockIdx portIdx inMftBlock

set MFT block

=back

=head2 class madMcMemberRec

=over

=item [ Constructor: returns madMcMemberRec * ] madMcMemberRec name

=item [ Destructor: returns void  ] rename obj {}

=item [ Member data: returns ib_gid_t * ] -mgid

=item [ Member data: returns ib_gid_t * ] -port_gid

=item [ Member data: returns ib_net32_t * ] -qkey

=item [ Member data: returns ib_net16_t * ] -mlid

=item [ Member data: returns uint8_t * ] -mtu

=item [ Member data: returns uint8_t * ] -tclass

=item [ Member data: returns ib_net16_t * ] -pkey

=item [ Member data: returns uint8_t * ] -rate

=item [ Member data: returns uint8_t * ] -pkt_life

=item [ Member data: returns ib_net32_t * ] -sl_flow_hop

=item [ Member data: returns uint8_t * ] -scope_state

=item [ Member : returns int  ] send_set pFromNode fromPort destLid comp_mask

=item [ Member : returns int  ] send_get pFromNode fromPort destLid comp_mask

=item [ Member : returns int  ] send_del pFromNode fromPort destLid comp_mask

=back

=head2 class madPathRec

=over

=item [ Constructor: returns madPathRec * ] madPathRec name

=item [ Destructor: returns void  ] rename obj {}

=item [ Member data: returns uint8_array_t * ] -resv0

=item [ Member data: returns ib_gid_t * ] -dgid

=item [ Member data: returns ib_gid_t * ] -sgid

=item [ Member data: returns ib_net16_t * ] -dlid

=item [ Member data: returns ib_net16_t * ] -slid

=item [ Member data: returns ib_net32_t * ] -hop_flow_raw

=item [ Member data: returns uint8_t * ] -tclass

=item [ Member data: returns uint8_t * ] -num_path

=item [ Member data: returns ib_net16_t * ] -pkey

=item [ Member data: returns ib_net16_t * ] -sl

=item [ Member data: returns uint8_t * ] -mtu

=item [ Member data: returns uint8_t * ] -rate

=item [ Member data: returns uint8_t * ] -pkt_life

=item [ Member data: returns uint8_t * ] -preference

=item [ Member data: returns uint8_array_t * ] -resv2

=item [ Member : returns int  ] send_get pFromNode fromPort destLid comp_mask

=back

=head2 class madServiceRec

=over

=item [ Constructor: returns madServiceRec * ] madServiceRec name

=item [ Destructor: returns void  ] rename obj {}

=item [ Member data: returns ib_net64_t * ] -service_id

=item [ Member data: returns ib_gid_t * ] -service_gid

=item [ Member data: returns ib_net16_t * ] -service_pkey

=item [ Member data: returns ib_net16_t * ] -resv

=item [ Member data: returns ib_net32_t * ] -service_lease

=item [ Member data: returns uint8_array_t * ] -service_key

=item [ Member data: returns uint8_array_t * ] -service_name

=item [ Member data: returns uint8_array_t * ] -service_data8

=item [ Member data: returns uint16_array_t * ] -service_data16

=item [ Member data: returns uint32_array_t * ] -service_data32

=item [ Member data: returns uint64_array_t * ] -service_data64

=item [ Member : returns int  ] send_set pFromNode fromPort destLid comp_mask

=item [ Member : returns int  ] send_get pFromNode fromPort destLid comp_mask

=item [ Member : returns int  ] send_del pFromNode fromPort destLid comp_mask

=back

=head2 class madNotice128

=over

=item [ Constructor: returns madNotice128 * ] madNotice128 name

=item [ Destructor: returns void  ] rename obj {}

=item [ Member data: returns uint8_t * ] -generic_type

=item [ Member data: returns uint8_t * ] -prod_type_msb

=item [ Member data: returns ib_net16_t * ] -prod_type_lsb

=item [ Member data: returns ib_net16_t * ] -trap_num

=item [ Member data: returns ib_net16_t * ] -issuer_lid

=item [ Member data: returns ib_net16_t * ] -toggle_count

=item [ Member data: returns ib_net16_t * ] -sw_lid

the sw lid of which link state changed - for 128 only

=item [ Member data: returns ib_gid_t * ] -issuer_gid

=item [ Member : returns int  ] send_trap pFromNode fromPort destLid

=back

=head2 class madNotice129

=over

=item [ Constructor: returns madNotice129 * ] madNotice129 name

=item [ Destructor: returns void  ] rename obj {}

=item [ Member data: returns uint8_t * ] -generic_type

=item [ Member data: returns uint8_t * ] -prod_type_msb

=item [ Member data: returns ib_net16_t * ] -prod_type_lsb

=item [ Member data: returns ib_net16_t * ] -trap_num

=item [ Member data: returns ib_net16_t * ] -issuer_lid

=item [ Member data: returns ib_net16_t * ] -toggle_count

=item [ Member data: returns ib_net16_t * ] -pad

=item [ Member data: returns ib_net16_t * ] -lid

lid and port number of the violation

=item [ Member data: returns uint8_t * ] -port_num

=item [ Member data: returns ib_gid_t * ] -issuer_gid

=item [ Member : returns int  ] send_trap pFromNode fromPort destLid

=back

=head2 class madNotice144

=over

=item [ Constructor: returns madNotice144 * ] madNotice144 name

=item [ Destructor: returns void  ] rename obj {}

=item [ Member data: returns uint8_t * ] -generic_type

=item [ Member data: returns uint8_t * ] -prod_type_msb

=item [ Member data: returns ib_net16_t * ] -prod_type_lsb

=item [ Member data: returns ib_net16_t * ] -trap_num

=item [ Member data: returns ib_net16_t * ] -issuer_lid

=item [ Member data: returns ib_net16_t * ] -toggle_count

=item [ Member data: returns ib_net16_t * ] -pad1

=item [ Member data: returns ib_net16_t * ] -lid

lid where capability mask changed

=item [ Member data: returns ib_net16_t * ] -pad2

=item [ Member data: returns ib_net32_t * ] -new_cap_mask

new capability mask

=item [ Member data: returns ib_gid_t * ] -issuer_gid

=item [ Member : returns int  ] send_trap pFromNode fromPort destLid


=back

=head1 AUTHOR

Eitan Zahavi, Mellanox Technologies LTD, eitan@mellanox.co.il
