Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-385

Union objects are generated incorrectly when using bits type

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 2480

    Description

      I have defined following model:

      typedef port-state-v13 {
      description
      "Current state of the physical port. These are not configurable from
      the controller.";
      type bits {
      bit link_down

      { //description "No physical link present."; position 0; }

      bit blocked

      { //description "Port is blocked"; position 1; }

      bit live

      { //description "Live for Fast Failover Group."; position 2; }

      }
      }

      typedef port-state-v10 {
      description "Current state of the physical port. These are not configurable from
      the controller.";
      type bits {
      bit link_down

      { description "No physical link present."; position 0; }

      bit blocked

      { description "Port is blocked"; position 1; }

      bit live

      { description "Live for Fast Failover Group."; position 2; }

      bit stp_listen

      { description "Not learning or relaying frames."; }

      bit stp_learn

      { description "Learning but not relaying frames."; }

      bit stp_forward

      { description "Learning and relaying frames."; }

      bit stp_block

      { description "Not part of spanning tree."; }

      bit stp_mask

      { description "Bit mask for OFPPS_STP_* values."; }

      }
      }

      typedef port-state {
      type union

      { type port-state-v10; type port-state-v13; }

      }

      Code generation succeeds, but compilation of PortState object fails due to incorrect method call:

      Attachments

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

        Activity

          People

            martin.ciglan Martin Ciglan
            michal.polkorab@gmail.com Michal Polkorab
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: