Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-4544

LEAF ENUM TYPE issue: after max enum vlaue, next element should come with value. but yang utils genrating code with the least value

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.6.0
    • Component/s: None
    • Environment:

      ONOS BUILD

    • Story Points:
      3

      Description

      RFC6020:
      If the current highest value is equal to 2147483647, then an enum
      value MUST be specified for "enum" substatements following the one
      with the current highest value.

      leaf ifType {
      type enumeration {
      enum "unbounded";
      enum ZERO;
      enum two;
      enum four;
      enum seven

      { value 2147483647; }

      enum five;

      }
      }

      switch (value)

      { case 1: return IfTypeEnum.ZERO; case 3: return IfTypeEnum.FOUR; case 2147483647: return IfTypeEnum.SEVEN; case 0: return IfTypeEnum.UNBOUNDED; case 2: return IfTypeEnum.TWO; case -2147483648: return IfTypeEnum.FIVE; default : return null; }

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              Vidyashree-Huawei Vidyashree Rama
              Reporter:
              sathishmurugesan sathishkumar murugesan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: