# Specifying keywords and values

This topic provides the following information:

- Keyword name/value pairs

- Struct keywords

- Array keywords

- Array keyword expansion

## Keyword name/value pairs

In its simplest form, a statement consists of a keyword name, followed by an equal sign (=) and then a value:

keyword_name = value

where keyword_name denotes a parameter and value indicates the value to assign the parameter:

AutoStart = YES

For a list of valid keywords for a component, see the manual for the device you are configuring. NMS OAM Supervisor keywords, Clock Management EMC keywords, and Hot Swap EMC keywords are listed in the NMS OAM Service Developer's Reference Manual.

## 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 the struct consists of the struct name, followed by a period (.) and then the element name. Within NMS OAM, the fully qualified keyword name for an element is always used to refer to the element. The following illustration shows Struct keyword names:

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

In this example, Clocking, Hbus, and MVIP are struct keywords.

## Array keywords

Many keywords are organized into arrays: lists of items of the same type. Each element of the array can have a unique value.

The index for an array keyword appears as a suffix, surrounded by square brackets. Each index is zero based:

TCPFile[0] = nocc

A struct can contain arrays:

DSPStream.SignalIdleCode[0] = 0x00
DSPStream.VoiceIdleCode[0] = 0x00
DSPStream.SignalIdleCode[1] = 0x00
DSPStream.VoiceIdleCode[1] = 0x00

It is also possible to have an array of structs:

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 array keyword xxx, xxx.Count indicates the number of elements in the array. For example:

Resource.Count=2

xxx.Count is automatically updated for each element added or removed from an array. This value cannot be set directly.

## Array keyword expansion

For convenience, there is a shorthand method of assigning values to keywords in an array.

Multiple keyword names can be assigned the same value in a single line, as follows:

Statement | Expanded equivalent
--- | ---
keyword[0..2] = value | keyword[0] = value keyword[1] = value keyword[2] = value
keyword[0-2] = value | (same as previous row)
keyword[1,3,5] = value | keyword[1] = value keyword[3] = value keyword[5] = value
keyword[0..3,5..7,9] = value | keyword[0] = value keyword[1] = value keyword[2] = value keyword[3] = value keyword[5] = value keyword[6] = value keyword[7] = value keyword[9] = value

A separate range can be specified for each keyword array index in the name:

Statement | Expanded equivalent
--- | ---
kywd1[1].kywd2[1..2] = value | kywd1[1].kywd2[1] = value kywd1[1].kywd2[2] = value
kywd1[1..3].kywd2[1..2] = value | kywd1[1].kywd2[1] = value kywd1[1].kywd2[2] = value kywd1[2].kywd2[1] = value kywd1[2].kywd2[2] = value kywd1[3].kywd2[1] = value kywd1[3].kywd2[2] = value

Multiple values for keywords in an array can be specified on a single line, separated by spaces. To include spaces in a value, surround the value with quotation marks. Values are assigned to keywords in numerical order, starting with 0. The array keyword is specified without the square brackets or index value (for example, Resource for Resource[x]):

Statement | Expanded equivalent
--- | ---
keyword = val1 val2 val1 val4 | keyword[0] = val1 keyword[1] = val2 keyword[2] = val1 keyword[3] = val4
keyword = val1 val2 "val 1" val4 | keyword[0] = val1 keyword[1] = val2 keyword[2] = "val 1" keyword[3] = val4
kywd1[1..3].kywd2[1..2].list = val1 val2 | kywd1[1].kywd2[1].list[0] = val1 kywd1[1].kywd2[1].list[1] = val2 kywd1[1].kywd2[2].list[0] = val1 kywd1[1].kywd2[2].list[1] = val2 kywd1[2].kywd2[1].list[0] = val1 kywd1[2].kywd2[1].list[1] = val2 kywd1[2].kywd2[2].list[0] = val1 kywd1[2].kywd2[2].list[1] = val2 kywd1[3].kywd2[1].list[0] = val1 kywd1[3].kywd2[1].list[1] = val2 kywd1[3].kywd2[2].list[0] = val1 kywd1[3].kywd2[2].list[1] = val2

Note: For users of the NMS OAM service API: oamcfg performs keyword expansion, not NMS OAM. When specifying keywords and values using the NMS OAM service, do not use this keyword expansion syntax.