Database Queries Using SubnAdmGetTable()

General

When performing the SubnAdmGetTable() operation, the AttributeID identifies the table (i.e., the record type). The following types of table queries can be performed:

  • Query by template.

  • Query by RID range.

  • Request the entire table.

  • Request only table records that have changed since the last access to the table.

The records are returned in a series of one or more SubnAdmGetTableResp() MADs. Note that records may be broken across successive response MADs. For a detailed description of multi-packet operations, refer to “Reliable Multi-Packet Transaction Protocol” on page 949.

Query by Template

The caller supplies the SA with the ComponentMask identifying which record elements to match, as well as the corresponding element values to look for (in the Admin Data Area). Table 33-9 on page 946 illustrates an example search of the database's entire SwitchRecord table for records with the value 0008h in the LIDsPerPort attribute element. Setting the AttributeModifier = FFFFFFFFh indicates that this is a query by template and the End RID field is ignored by the SA.

The SA will return all records from the indicated table that have a template match. The records are returned in a series of one or more SubnGetTableResp() MADs. For a detailed description of multi-packet operations, refer to “Reliable Multi-Packet Transaction Protocol” on page 949.

Table 33-9. Example SubnAdmGetTable(SwitchRecord) Query by Template
Dword Byte 0Byte 1Byte 2Byte 3
0Base MAD HeaderBase Version = 01hManagement Class = SubnAdmClass Version = 01hRSA Method = SubnAdmGetTable()
1Status is only meaningful in response packets. See Table 27-2 on page 776 and Table 33-8 on page 939Not used
2Transaction ID
3
4SA AttributeID = Table Type (i.e., record type)Reserved
5AttributeModifier = FFFFFFFFh
6SMP- specific fieldsSA_Key = 0
7
8SM_Key
9
10Segment Number = 0
11Payload Length = 0
12Fragment Flag = 0Edit Modifier= 0Window = 0
13End RID = 0
14Component Mask = 0000000000100000000000000000000000000000000000000000000000000000b
15
16–63192 byte Admin Data Area = 000000000000000000000000000800000h (followed by all zeros)

Query by RID Range

The table type is specified in the AttributeID. The caller specifies a query by RID range by specifying the start RID in the AttributeModifier field (it must be a value other than all ones) and the end RID in the End RID field.

The SA will return all records from the indicated table that are in the specified RID range. The records are returned in a series of one or more SubnGetTableResp() MADs. For a detailed description of multi-packet operations, refer to “Reliable Multi-Packet Transaction Protocol” on page 949.

Request the Entire Table

The AttributeID identifies the table type:

  • The SA_Key must = 0.

  • The AttributeModifier = 0.

  • The End RID = FFFFFFFFh.

The SA will return all records from the indicated table. The records are returned in a series of one or more SubnGetTableResp() MADs. For a detailed description of multi-packet operations, refer to “Reliable Multi-Packet Transaction Protocol” on page 949.

Request Only Table Changes

Issuing a SubnAdmGetTable() request with a non-zero SA_Key tells the SA to only return table records that are new or have been altered since the last query was made with the same non-zero SA_Key value.

Whether or not the SA supports this feature is optional. If the SA doesn't support it, then it will return all records in the table (rather than just the new or modified records).

Issuing a table query with a non-zero SA_Key that has not been used before is considered to be an error. The SA will respond with a SubnAdmGetTableResp() with its Status field set to indicate an invalid attribute (see Table 27-2 on page 776).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset