Connected: An Internet Encyclopedia
3.1. Mapping of the DISPLAY-HINT clause

Up: Connected: An Internet Encyclopedia
Up: Requests For Comments
Up: RFC 1903
Up: 3. Mapping of the TEXTUAL-CONVENTION macro
Prev: 3. Mapping of the TEXTUAL-CONVENTION macro
Next: 3.2. Mapping of the STATUS clause

3.1. Mapping of the DISPLAY-HINT clause

3.1. Mapping of the DISPLAY-HINT clause

The DISPLAY-HINT clause, which need not be present, gives a hint as to how the value of an instance of an object with the syntax defined using this textual convention might be displayed. The DISPLAY-HINT clause may be present if and only if the syntax has an underlying primitive type of INTEGER or OCTET STRING. (Note, however, that the semantics defined for a particular syntax can cause the use of DISPLAY-HINT for that syntax to make no sense, e.g., for Counter32 [2].)

When the syntax has an underlying primitive type of INTEGER, the hint consists of an integer-format specification, containing two parts. The first part is a single character suggesting a display format, either: 'x' for hexadecimal, or 'd' for decimal, or 'o' for octal, or 'b' for binary. The second part is always omitted for 'x', 'o' and 'b', and need not be present for 'd'. If present, the second part starts with a hyphen and is followed by a decimal number, which defines the implied decimal point when rendering the value. For example:

     Hundredths ::= TEXTUAL-CONVENTION
         DISPLAY-HINT "d-2"
         ...
         SYNTAX     INTEGER (0..10000)

suggests that a Hundredths value of 1234 be rendered as "12.34"

When the syntax has an underlying primitive type of OCTET STRING, the hint consists of one or more octet-format specifications. Each specification consists of five parts, with each part using and removing zero or more of the next octets from the value and producing the next zero or more characters to be displayed. The octets within the value are processed in order of significance, most significant first.

The five parts of a octet-format specification are:

  1. the (optional) repeat indicator; if present, this part is a `*', and indicates that the current octet of the value is to be used as the repeat count. The repeat count is an unsigned integer (which may be zero) which specifies how many times the remainder of this octet-format specification should be successively applied. If the repeat indicator is not present, the repeat count is one.

  2. the octet length: one or more decimal digits specifying the number of octets of the value to be used and formatted by this octet- specification. Note that the octet length can be zero. If less than this number of octets remain in the value, then the lesser number of octets are used.

  3. the display format, either: `x' for hexadecimal, `d' for decimal, `o' for octal, or `a' for ascii. If the octet length part is greater than one, and the display format part refers to a numeric format, then network-byte ordering (big-endian encoding) is used interpreting the octets in the value.

  4. the (optional) display separator character; if present, this part is a single character which is produced for display after each application of this octet-specification; however, this character is not produced for display if it would be immediately followed by the display of the repeat terminator character for this octet- specification. This character can be any character other than a decimal digit and a `*'.

  5. the (optional) repeat terminator character, which can be present only if the display separator character is present and this octet- specification begins with a repeat indicator; if present, this part is a single character which is produced after all the zero or more repeated applications (as given by the repeat count) of this octet-specification. This character can be any character other than a decimal digit and a `*'.

Output of a display separator character or a repeat terminator character is suppressed if it would occur as the last character of the display.

If the octets of the value are exhausted before all the octet-format specification have been used, then the excess specifications are ignored. If additional octets remain in the value after interpreting all the octet-format specifications, then the last octet-format specification is re-interpreted to process the additional octets, until no octets remain in the value.


Next: 3.2. Mapping of the STATUS clause

Connected: An Internet Encyclopedia
3.1. Mapping of the DISPLAY-HINT clause