Well-Known Types
There are some generally useful types which are defined across the system and are considered well-known. These types support abstract notions that are frequently used in other definitions.
TYPE: Error
Error ::= [APPLICATION 0] IMPLICIT SEQUENCE {
errorCode INTEGER,
errorOffset INTEGER
errorDescription IA5String,
}
The Error type is returned within reply messages when an error is countered. The errorCode is a number specifying a general class of error. The errorOffset is the octet in the query where the error was discovered. Note that the query starts at the first octet (octet 0) of the HEMP data section. The errorDescription is a text message explaining the error. Note that the definition of this section is the same (except for the start of the offset) as that of the HEMP protocol error structure and the error codes have been selected to keep the code spaces distinct. This is intended to ease the processing of error messages. The defined errorCodes are:
100 -- Any error not listed below.
101 -- System error. The query processor has failed in some way.
102 -- Format error. An error has been detected in the input stream.
103 -- Stack error. A stack overflow or underflow has occurred.
104 -- Instruction error. The instruction is either unknown, or not supported on the object to which it has been applied.
105 -- Operand error. The wrong number of operands or inappropriate operands have been given to an instruction.
TYPE: Counter
Counter ::= [APPLICATION 4] IMPLICIT INTEGER
The Counter type is an unsigned integer which is defined to roll-over to 0 when incremented past a certain value. (The roll-over point may be found by examining the attributes for the particular counter.) Counter sizes should be chosen such that the counters will not roll over more than once every 24 hours.
TYPE: InstructionGroup
InstructionGroup ::= [APPLICATION 5] IMPLICIT SEQUENCE
of ANY
An InstructionGroup is an encapsulated sequence of operands and operations. It allows applications to encode queries as objects.
TYPE: Histogram
Histogram ::= SET of HistEntry
HistEntry ::= SEQUENCE {
histValue INTEGER,
histCount Counter
}
A Histogram associates a count, histCount, with a numeric value, histValue. No meaning is placed on the count or value by this definition. Each HistEntry may represent a simple map (e.g., histCount instances of histValue), or a more complex relationship (e.g., a count of all values between this histValue and the next lowest histValue in the Histogram). The meaning of the particular Histogram is given in the object definition.
TYPE: TrafficMatrix
TrafficMatrix ::= SET of TrafficEntry
TrafficEntry ::= SEQUENCE {
src IpAddress,
dst IpAddress,
count Counter
}
A TrafficMatrix measures traffic observed between two IP addresses. Typically it is used to count packets flowing through a gateway.
TYPE: IpAddress
IpAddress ::= OCTETSTRING
The 4 octet IP address. If the length of the string is less than 4 then the missing octets are wildcarded. A zero length string is a default address (e.g., for indicating default routes).
TYPE: Fraction
Fraction ::= INTEGER
A Fraction is an integer representation of a fractional value. It contains the numerator of a value as expressed over 256. (For example dividing the Fraction by 256 gives the fractional value.)
TYPE: BootClock
BootClock ::= INTEGER
The time in milliseconds since the machine was last booted or reset. This value is always defined.
TYPE: localClock
LocalClock ::= INTEGER
The local system clock, measured in milliseconds since 00:00 1 January 1900 UTC. Assumed to be only a local estimate of the time. The value 0 is reserved for an uninitialized clock (For example, an uninitialized time-of-day chip.)
TYPE: NetClock
NetClock ::= INTEGER
A network synchronized clock, which is assumed to be synchronized across some part of a network. The clock value is measured in milliseconds since 00:00 1 January 1900 UTC. Specific information about the synchronization protocol is found in the system variable dictionary. The value 0 is used to indicate an uninitialized clock.
TYPE: TimeStamp
TimeStamp ::= CHOICE {
[0] BootClock
[1] localClock
[2] NetClock
}
A TimeStamp, which was taken from the boot clock, system clock or the synchronized clock. In general, a time of day is preferred to the time since boot, and a synchronized clock is preferred to an unsynchronized clock. It is more useful to know that an event occurred at a particular time, than that it happened so many milliseconds after the machine booted.