bbf-l2-forwarding-forwarders

This submodule contains a collection of YANG definitions for managing forwarders. Copyright (c) 2017-2023, Broadband Forum Red...

  • Version: 2023-03-07

    bbf-l2-forwarding-forwarders@2023-03-07


    
      submodule bbf-l2-forwarding-forwarders {
    
        yang-version 1.1;
    
        belongs-to bbf-l2-forwarding {
            prefix bbf-l2-fwd;
        }
    
        import bbf-yang-types {
          prefix bbf-yang;
        }
        import bbf-if-type {
          prefix bbfift;
        }
        import ietf-interfaces {
          prefix if;
        }
    
        include bbf-l2-forwarding-base;
    
        organization
          "Broadband Forum <https://www.broadband-forum.org>
         Common YANG Work Area";
    
        contact
          "Comments or questions about this Broadband Forum YANG module
         should be directed to <mailto:help@broadband-forum.org>.
    
         Editor:      Nick Hancock, Adtran
    
         Editor:      Ludwig Pauwels, Nokia
    
         PS Leader:   Joey Boyd, Adtran
    
         WA Director: Joey Boyd, Adtran
    
         WA Director: Sven Ooghe, Nokia";
    
        description
          "This submodule contains a collection of YANG definitions for
         managing forwarders.
    
         Copyright (c) 2017-2023, Broadband Forum
    
         Redistribution and use in source and binary forms, with or
         without modification, are permitted provided that the following
         conditions are met:
    
         1. Redistributions of source code must retain the above copyright
            notice, this list of conditions and the following disclaimer.
    
         2. Redistributions in binary form must reproduce the above
            copyright notice, this list of conditions and the following
            disclaimer in the documentation and/or other materials
            provided with the distribution.
    
         3. Neither the name of the copyright holder nor the names of its
            contributors may be used to endorse or promote products
            derived from this software without specific prior written
            permission.
    
         THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
         CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,
         INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
         MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
         DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
         CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
         SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
         NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
         LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
         CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
         STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
         ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
         The above license is used as a license under copyright only.
         Please reference the Forum IPR Policy for patent licensing terms
         <https://www.broadband-forum.org/ipr-policy>.
    
         Any moral rights which are necessary to exercise under the above
         license grant are also deemed granted under this license.
    
         This version of this YANG module is part of TR-383a6; see
         the TR itself for full legal notices.";
    
        revision "2023-03-07" {
          description
            "Amendment 6.
           * Approval Date:    2023-03-07.
           * Publication Date: 2023-03-07.";
          reference
            "TR-383a6: Common YANG Modules
            	  <https://www.broadband-forum.org/technical/download/
            		   TR-383_Amendment-6.pdf>";
    
        }
    
        revision "2022-03-01" {
          description
            "Amendment 5.
           * Approval Date:    2022-03-01.
           * Publication Date: 2022-03-01.";
          reference
            "TR-383a5: Common YANG Modules
            	  <https://www.broadband-forum.org/technical/download/
            		   TR-383_Amendment-5.pdf>";
    
        }
    
        revision "2020-10-13" {
          description
            "Amendment 3.
           * Approval Date:    2020-10-13.
           * Publication Date: 2020-10-13.";
          reference
            "TR-383a3: Common YANG Modules
            	  <https://www.broadband-forum.org/technical/download/
            		   TR-383_Amendment-3.pdf>";
    
        }
    
        revision "2018-12-03" {
          description
            "Amendment 2.
           * Approval Date:    2018-12-03.
           * Publication Date: 2018-12-03.";
          reference
            "TR-383a2: Common YANG Modules
            	<https://www.broadband-forum.org/technical/download/
            		 TR-383_Amendment-2.pdf>";
    
        }
    
        revision "2018-07-13" {
          description
            "Amendment 1.
           * Approval Date:    2018-06-04.
           * Publication Date: see revision date above.";
          reference
            "TR-383: Common YANG Modules
            	<https://www.broadband-forum.org/technical/download/
            		 TR-383_Amendment-1.pdf>";
    
        }
    
        revision "2017-05-08" {
          description
            "Initial revision.
           * Approval Date:    see revision date above.
           * Publication Date: 2017-06-02.";
          reference
            "TR-383: Common YANG Modules
            	<https://www.broadband-forum.org/technical/download/
            		 TR-383.pdf>";
    
        }
    
    
        feature forwarder-port-groups {
          description
            "Indicates support for a grouping of forwarder ports.";
        }
    
        typedef forwarder-ref {
          type leafref {
            path "/bbf-l2-fwd:forwarding/bbf-l2-fwd:forwarders/bbf-l2-fwd:forwarder/bbf-l2-fwd:name";
          }
          description
            "This type is used by data models that need to reference
           configured forwarders.";
        }
    
        typedef forwarder-state-ref {
          type leafref {
            path "/bbf-l2-fwd:forwarding-state/bbf-l2-fwd:forwarders/bbf-l2-fwd:forwarder/bbf-l2-fwd:name";
          }
          description
            "This type is used by data models that need to reference
           operational forwarders.";
        }
    
        grouping forwarder-port {
          description
            "This grouping is use by data models that need to reference
           configured forwarder ports.";
          leaf forwarder {
            type forwarder-ref;
            description
              "This leaf references a forwarder.";
          }
    
          leaf port {
            type leafref {
              path
                "/bbf-l2-fwd:forwarding/bbf-l2-fwd:forwarders/bbf-l2-"
                  + "fwd:forwarder[bbf-l2-fwd:name = current()/../"
                  + "forwarder]/bbf-l2-fwd:ports/bbf-l2-fwd:port/bbf-l2-"
                  + "fwd:name";
            }
            description
              "This leaf references a port within the forwarder identified
             by the leaf 'forwarder'.";
          }
        }  // grouping forwarder-port
    
        grouping forwarder-port-state {
          description
            "This grouping is use by data models that need to reference
           operational forwarder ports.";
          leaf forwarder {
            type forwarder-state-ref;
            description
              "This leaf references a forwarder.";
          }
    
          leaf port {
            type leafref {
              path
                "/bbf-l2-fwd:forwarding-state/bbf-l2-fwd:forwarders/"
                  + "bbf-l2-fwd:forwarder[bbf-l2-fwd:name = current()/../"
                  + "forwarder]/bbf-l2-fwd:ports/bbf-l2-fwd:port/bbf-l2-"
                  + "fwd:name";
            }
            description
              "This leaf references a port within the forwarder identified
             by the leaf 'forwarder'.";
          }
        }  // grouping forwarder-port-state
    
        grouping forwarder-port-group {
          description
            "This grouping is use by data models that need to reference
           configured forwarder port-groups.";
          leaf forwarder {
            type forwarder-ref;
            description
              "This leaf references a forwarder.";
          }
    
          leaf group {
            type leafref {
              path
                "/bbf-l2-fwd:forwarding/bbf-l2-fwd:forwarders/bbf-l2-"
                  + "fwd:forwarder[bbf-l2-fwd:name = current()/../"
                  + "forwarder]/bbf-l2-fwd:port-groups/bbf-l2-fwd:port-"
                  + "group/bbf-l2-fwd:name";
            }
            description
              "This leaf references a port-group within the forwarder
             identified by the leaf 'forwarder'.";
          }
        }  // grouping forwarder-port-group
    
        augment /bbf-l2-fwd:forwarding {
          description
            "Augment the configuration nodes associated with layer 2
           forwarding with forwarder data nodes.";
          container forwarders {
            description
              "A forwarder is used to forward traffic between interfaces.";
            list forwarder {
              key "name";
              description
                "A list of forwarders.";
              leaf name {
                type bbf-yang:string-ascii64;
                description
                  "The name of the forwarder.";
              }
    
              container ports {
                description
                  "Configuration for ports associated with this forwarder.";
                list port {
                  key "name";
                  description
                    "The list of ports associated with this forwarder.";
                  leaf name {
                    type bbf-yang:string-ascii64;
                    description
                      "The name of the forwarder port.";
                  }
    
                  leaf sub-interface {
                    type if:interface-ref;
                    must
                      "derived-from-or-self(
                        /if:interfaces/if:interface[if:name = current()]
                        /if:type, 'bbfift:vlan-sub-interface') or
                        derived-from-or-self(
                        /if:interfaces/if:interface[if:name = current()]
                        /if:type, 'bbfift:l2-termination')" {
                      error-message
                        "The type of the interface being referenced is not "
                          + "a 'vlan-sub-interface', nor a 'l2-termination',  "
                          + "nor is it derived from one of them.";
                      description
                        "The type of interface being referenced MUST either
                       be a 'vlan-sub-interface', 'l2-termination' or a
                       derivation of either type.";
                    }
                    must
                      "count(/bbf-l2-fwd:forwarding
                              /bbf-l2-fwd:forwarders
                              /bbf-l2-fwd:forwarder
                              /bbf-l2-fwd:ports/bbf-l2-fwd:port
                              [bbf-l2-fwd:sub-interface
                               = current()])< 2" {
                      error-message
                        "Two forwarder ports, possibly from different "
                          + "forwarders, refer to the same sub-interface.";
                      description
                        "No two forwarder ports can refer to the same
                       sub-interface.";
                    }
                    description
                      "The VLAN sub-interface or layer 2 termination
                     associated with this port.";
                  }
                }  // list port
              }  // container ports
    
              container port-groups {
                if-feature forwarder-port-groups;
                description
                  "A group of ports associated with this forwarder that
                 have common forwarding characteristics.";
                list port-group {
                  key "name";
                  description
                    "A list of port groups";
                  leaf name {
                    type bbf-yang:string-ascii64;
                    description
                      "The name of the group.";
                  }
    
                  leaf-list port {
                    type leafref {
                      path
                        "../../../bbf-l2-fwd:ports/bbf-l2-fwd:port/"
                          + "bbf-l2-fwd:name";
                    }
                    description
                      "A grouping of ports associated with this forwarder.";
                  }
                }  // list port-group
              }  // container port-groups
            }  // list forwarder
          }  // container forwarders
        }
    
        augment /bbf-l2-fwd:forwarding-state {
          description
            "Augment the state data nodes associated with layer 2
           forwarding with forwarder data nodes.";
          container forwarders {
            description
              "A forwarder is used to forward traffic between interfaces.";
            list forwarder {
              key "name";
              description
                "A list of forwarders.";
              leaf name {
                type bbf-yang:string-ascii64;
                description
                  "The name of the forwarder.";
              }
    
              container ports {
                description
                  "Configuration for ports associated with this forwarder.";
                list port {
                  key "name";
                  description
                    "The list of ports associated with this forwarder.";
                  leaf name {
                    type bbf-yang:string-ascii64;
                    description
                      "The name of the forwarder port.";
                  }
    
                  leaf sub-interface {
                    type if:interface-state-ref;
                    must
                      "derived-from-or-self(/if:interfaces-state"
                        + "/if:interface[if:name = current()]/if:type,"
                        + "'bbfift:vlan-sub-interface' ) or "
                        + "derived-from-or-self( /if:interfaces-state"
                        + "/if:interface[if:name = current()]/if:type,"
                        + "'bbfift:l2-termination')" {
                      description
                        "The type of interface being referenced must be a
                       VLAN sub-interface or a Layer 2 termination.";
                    }
                    description
                      "The VLAN sub-interface or Layer 2 termination
                     associated with this port.";
                  }
                }  // list port
              }  // container ports
            }  // list forwarder
          }  // container forwarders
        }
      }  // submodule bbf-l2-forwarding-forwarders
    

© 2023 YumaWorks, Inc. All rights reserved.