openconfig-packet-match.yang - leaf ethertype cannot be expressed in hexadecimal notation
leaf ethertype defined in openconfig-packet-match.yang is defined as:
leaf ethertype {
type oc-pkt-match-types:ethertype-type;
description
"Ethertype field to match in Ethernet packets";
}
Where type oc-pkt-match-types:ethertype-type is defined as (openconfig-packet-match-types.yang):
typedef ethertype-type { type union { type uint16 { //Note range can only be expressed in decimal //but value is expected in hex notation. range 1..65535; } type identityref { base ETHERTYPE; } } description "The Ethertype value may be expressed as a 16-bit number in hexadecimal notation, or using a type defined by the ETHERTYPE identity"; }
But according to Yang RFC (sections 9.2 and 9.2.1) an hexadecimal notation can be used only to specify the default value of an integer type, while value must be a decimal number.
Thanks for the comment -- it does look like both YANG 1.0 / 1.1 allow hex lexical representation for only the default value. We'll take a look and work on an update.
Hi,
another thing to take into account here is that a value < 1536 does not map to any valid frame type. A string with a pattern representing hex values from 600 to FFFF may be used along with the ETHERTYPE identityref.
This issue is stale because it has been open 180 days with no activity. If you wish to keep this issue active, please remove the stale label or add a comment, otherwise will be closed in 14 days.