# Struct keywords

Struct keywords are similar to C language structures. A struct is a group of related named values (elements) under a common name. The fully qualified keyword name for each element in a struct consists of the struct name, followed by a period (.) and then the element name as shown in the following illustration. Within NMS OAM, the fully qualified keyword name for an element is always used to refer to the element.

Structs can contain structs. In the following example, struct Clocking contains structs HBus and MVIP:

Clocking.HBus.ClockMode = MASTER_A
Clocking.HBus.AutoFallBack = YES
Clocking.MVIP.ClockRef = SEC8K
Clocking.MVIP.AutoFallBack = NO

Structs can contain arrays. For example, struct NetworkInterface contains array T1E1[x]. This is specified as NetworkInterface.T1E1[x].

An array can contain multiple instances of a struct, each containing an identical set of elements. For example, Resource[x] is an array containing multiple instances of struct Resource. Resource contains several elements, some of which are arrays:

Resource[0].Name = RSC1
Resource[0].Size = 120
Resource[0].FileName[0] = myfile.foo
Resource[0].FileName[1] = myfile2.foo
Resource[0].SpanEnable=AUTO
Resource[1].Name = RSC1
Resource[1].Size = 60
Resource[1].FileName[0] = myfile.foo
Resource[1].SpanEnable=AUTO

For any Struct keyword, the qualifier Keywords represents an array containing a list of elements contained within the Struct keyword. For example, for the Resource[x] keyword:

- The qualifier Keywords[1] yields "Name"

- The qualifier Keywords[2] yields "Size"

- The qualifier Keywords[3] yields "FileName"

- The qualifier Keywords[4] yields "SpanEnable"

The qualifier Keywords.Count indicates the number of elements in the Struct keyword. This value is zero based. For example, for the Resource[x] keyword, Keywords.Count yields 3.

A Struct keyword without an element does not represent a value. If oamGetKeyword is performed for a keyword that is of type Struct, the error OAMERR_NOT_FOUND is returned.