[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Discriminated unions in MIBs
Hi MIB experts,
I am wrestling with the issue of discriminated unions in the GMPLS LSR MIB (latest
published version
http://www.ietf.org/internet-drafts/draft-ietf-ccamp-gmpls-lsr-mib-03.txt)
There is reasonable precedent for simple unions in RFC3291 with
InetAddress/InetAddressType.
What we currently have in the label table (gmplsLabelTable) is a complex union.
GmplsLabelEntry ::= SEQUENCE {
gmplsLabelInterface InterfaceIndexOrZero,
gmplsLabelIndex Unsigned32,
gmplsLabelSubindex Unsigned32,
gmplsLabelType GmplsGeneralizedLabelTypes,
gmplsLabel GmplsLabel,
gmplsLabelMplsLabel MplsLabel,
gmplsLabelPortWavelength Unsigned32,
gmplsLabelFreeformLength Integer32,
gmplsLabelFreeform GmplsFreeformLabel,
gmplsLabelSonetSdhSignalIndex Integer32,
gmplsLabelSdhVc Integer32,
gmplsLabelSdhVcBranch Integer32,
gmplsLabelSonetSdhBranch Integer32,
gmplsLabelSonetSdhGroupBranch Integer32,
gmplsLabelWavebandId Unsigned32,
gmplsLabelWavebandStart Unsigned32,
gmplsLabelWavebandEnd Unsigned32,
gmplsLabelRowStatus RowStatus,
gmplsLabelStorageType StorageType
}
In 'C' the row entry might be written as...
typdef struct
{
InterfaceIndexOrZero gmplsLabelInterface;
Unsigned32 gmplsLabelIndex;
Unsigned32 gmplsLabelSubindex;
GmplsGeneralizedLabelTypes gmplsLabelType;
union
{
MplsLabel gmplsLabelMplsLabel;
Unsigned32 gmplsLabelPortWavelength;
struct
{
Integer32 gmplsLabelFreeformLength;
GmplsFreeformLabel gmplsLabelFreeform;
} freeForm;
struct
{
Integer32 gmplsLabelSonetSdhSignalIndex;
Integer32 gmplsLabelSdhVc;
Integer32 gmplsLabelSdhVcBranch;
Integer32 gmplsLabelSonetSdhBranch;
Integer32 gmplsLabelSonetSdhGroupBranch;
} sonetSdh;
struct
{
Unsigned32 gmplsLabelWavebandId;
Unsigned32 gmplsLabelWavebandStart;
Unsigned32 gmplsLabelWavebandEnd;
} waveband;
} label;
RowStatus gmplsLabelRowStatus;
StorageType gmplsLabelStorageType;
} gmplsLabelEntry;
(Ignore the fact that there is no requirement for gmplsLabelFreeformLength given that
gmplsLabelFreeform is an OCTET STRING.)
I could compress the whole into an OCTET STRING and give guidance about interpretation.
This is what the signaling protocol does, but I don't want to do this because I want it to
be simpler to read or write (for example) gmplsLabelSonetSdhBranch.
I could follow the example of InetAddress and define a set of syntaxes for each member of
the union. This is fine for the simple members, but for the more complex members I would
have to give DISPALY HINTs and interpretation clauses in the DESCRIPTION. And it would
still be impossible to read or write a single component.
I could leave the table entry as currently defined. This is most readily accessible, but
it leaves a lot of unused objects in any logical row.
Do you have any advice.
Thanks,
Adrian