Difference: YangExamplesExecdInterface (1 vs. 2)

Revision 22008-11-04 - MartinBjoerklund

Line: 1 to 1
 
META TOPICPARENT name="YangExamples"
Changed:
<
<
submodule execd-interfaces {

>
>
submodule execd-interfaces {

 
Changed:
<
<
belongs-to execd;
>
>
belongs-to execd { prefix execd; }
  import yang-types { prefix yang; } import inet-types { prefix inet; }
Line: 22 to 21
  configuring VLAN tagging without exposing the interface naming scheme used natively by Linux for this.";
Added:
>
>
revision "2008-11-04" { description "draft-ietf-netmod-yang-02 compatible."; }
  revision "2007-08-29" { description "Syntax fixes after pyang validation."; }
Line: 31 to 33
  typedef interfaceSpeed { type enumeration {
Changed:
<
<
enum "10"; enum "100"; enum "1000";
>
>
enum ten { value "10";} enum hundred { value "100";} enum thousand { value "1000"; }
  } }

Line: 152 to 154
  } container family { choice family {
Changed:
<
<
case 1 {
>
>
case c1 {
  container inet { list address { key name;
Line: 168 to 170
  } } }
Changed:
<
<
case 2 {
>
>
case c2 {
  container inet6 { list address { key name;

Revision 12007-11-19 - MartinBjoerklund

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="YangExamples"
submodule execd-interfaces {

    belongs-to execd;

    import yang-types { prefix yang; }
    import inet-types { prefix inet; }
    import ieee-types { prefix ieee; }

    include execd-types;
  
    description
        "The 'interfaces' component provides support for configuring network
         interfaces, both link-level (including VLAN-tagged interfaces)
         and IP addresses (IPv4 and IPv6).

         The data model is loosely based on (a subset of) Juniper's, in
         particular the sub-division of interfaces into numbered 'logical
         units' - this allows for grouping of IP addresses, as well as for
         configuring VLAN tagging without exposing the interface naming
         scheme used natively by Linux for this.";

    revision "2007-08-29" {
        description "Syntax fixes after pyang validation.";
    }
    revision "2007-06-08" {
        description "Initial revision.";
    }
    
    typedef interfaceSpeed {
        type enumeration {
            enum "10";
            enum "100";
            enum "1000";
        }
    }
    
    typedef interfaceDuplex {
        type enumeration {
            enum "half";
            enum "full";
        }
    }

    grouping commonPacketsCounters {
        leaf bytes {
            type yang:counter64;
        }
        leaf packets {
            type yang:counter64;
        }
        leaf errors {
            type yang:counter32;
        }
        leaf dropped {
            type yang:counter32;
        }
    }
    
    grouping txPacketsCounters {
        uses commonPacketsCounters;
        leaf collisions {
            type yang:counter32;
        }
    }
    
    grouping interfaces {
        container interfaces {
            list interface {
                must "(duplex and speed) or (not(duplex) and not(speed))" {
                    error-message "Neither or both of 'speed' and 'duplex'
                                   must be set";
                }
                key name;
                leaf name {
                    type interfaceName;
                }
                leaf description {
                    type string;
                }
                leaf enabled {
                    type boolean;
                    default true;
                }
                leaf speed {
                    type interfaceSpeed;
                    description "not supported for all types of interfaces";
                }
                leaf duplex {
                    type interfaceDuplex;
                    description "not supported for all types of interfaces";
                }
                leaf mtu {
                    type int16 {
                        range "68..1500";
                    }
                }
                leaf mac {
                    type ieee:mac-address;
                }
                container status {
                    config false;
          
                    leaf link {
                        type enumeration {
                            enum up;
                            enum down;
                        }
                    }
                    leaf speed {
                        type interfaceSpeed;
                    }
                    leaf duplex {
                        type interfaceDuplex;
                    }
                    leaf mtu {
                        type int32;
                    }
                    leaf mac {
                        type ieee:mac-address;
                    }
                    container receive {
                        uses commonPacketsCounters;
                    }
                    container transmit {
                        uses txPacketsCounters;
                    }
                }
                list unit {
                    key name;
                    leaf name {
                        type interfaceLogicalUnit;
                    }
                    leaf enabled {
                        type boolean;
                    }
                    leaf description {
                        type string;
                    }
                    leaf vlan-id {
                        type ieee:vlanid;
                    }
                    container status {
                        container receive {
                            uses commonPacketsCounters;
                        }
                        container transmit {
                            uses txPacketsCounters;
                        }
                    }
                    container family {
                        choice family {
                            case 1 {
                                container inet {
                                    list address {
                                        key name;
                                        leaf name {
                                            type inet:ipv4-address;
                                        }
                                        leaf prefix-length {
                                            type prefixLengthIPv4;
                                        }
                                        leaf broadcast {
                                            type inet:ipv4-address;
                                        }
                                    }
                                }
                            }
                            case 2 {
                                container inet6 {
                                    list address {
                                        key name;
                                        leaf name {
                                            type inet:ipv6-address;
                                        }
                                        leaf prefix-length {
                                            type prefixLengthIPv6;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback