public icon indicating copy to clipboard operation
public copied to clipboard

openconfig-packet-match.yang - leaf ethertype cannot be expressed in hexadecimal notation

Open sgrazian opened this issue 8 years ago • 3 comments

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.

sgrazian avatar Jan 30 '18 17:01 sgrazian

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.

aashaikh avatar Feb 06 '18 07:02 aashaikh

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.

sgrazian avatar Feb 19 '18 16:02 sgrazian

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.

github-actions[bot] avatar Jun 27 '24 02:06 github-actions[bot]