huawei-efm

Ethernet in the First Mile, which is used for fault and performance detection.

  • Version: 2019-04-28

    huawei-efm@2019-04-28


    
      module huawei-efm {
    
        yang-version 1;
    
        namespace "urn:huawei:yang:huawei-efm";
    
        prefix efm;
    
        import huawei-pub-type {
          prefix pub-type;
        }
        import ietf-yang-types {
          prefix yang;
        }
        import huawei-extension {
          prefix ext;
        }
        import huawei-ifm {
          prefix ifm;
        }
    
        organization
          "Huawei Technologies Co., Ltd.";
    
        contact
          "Huawei Industrial Base
    Bantian, Longgang
    Shenzhen 518129
    People's Republic of China
    Website: http://www.huawei.com
    Email: support@huawei.com";
    
        description
          "Ethernet in the First Mile, which is used for fault and performance detection.";
    
        revision "2019-04-28" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "efm";
    
        typedef enable-state {
          type enumeration {
            enum "disable" {
              value 0;
              description
                "Indicates that EFM is disabled.";
            }
            enum "enable" {
              value 1;
              description
                "Indicates that EFM is enabled.";
            }
          }
          description "Enable-state.";
        }
    
        typedef work-mode {
          type enumeration {
            enum "active" {
              value 1;
              description
                "Indicates that EFM works in active mode.";
            }
            enum "passive" {
              value 0;
              description
                "Indicates that EFM works in passive mode.";
            }
          }
          description "Work-mode.";
        }
    
        typedef session-state {
          type enumeration {
            enum "discovery" {
              value 2;
              description
                "Indicates that the EFM session is in the discovery state.";
            }
            enum "detect" {
              value 1;
              description
                "Indicates that the EFM session is in the detect state.";
            }
            enum "loopback-be-controlled" {
              value 5;
              description
                "Indicates that the EFM session is in the loopback state on the end that receives the session connection request.";
            }
            enum "loopback-control" {
              value 3;
              description
                "Indicates that the EFM session is in the loopback state on the end that initiates the session connection request.";
            }
            enum "loopback-control-forward" {
              value 4;
              description
                "The EFM session is in the Loopback state (control, forward).";
            }
          }
          description "Session-state.";
        }
    
        typedef parser-action {
          type enumeration {
            enum "forward" {
              value 0;
              description
                "The EFM parser action is forward.";
            }
            enum "loopback" {
              value 1;
              description
                "The EFM parser action is loopback.";
            }
            enum "discard" {
              value 2;
              description
                "The EFM parser action is discard.";
            }
            enum "reserve" {
              value 3;
              description
                "The EFM parser action is reserve.";
            }
          }
          description "Parser-action.";
        }
    
        typedef multiplexer-action {
          type enumeration {
            enum "forward" {
              value 0;
              description
                "The EFM multiplexer action is forward.";
            }
            enum "discard" {
              value 1;
              description
                "The EFM multiplexer action is discard.";
            }
          }
          description "Multiplexer-action.";
        }
    
        typedef test-packet-status {
          type enumeration {
            enum "working" {
              value 0;
              description
                "The EFM test packet is working.";
            }
            enum "finished" {
              value 1;
              description
                "The EFM test packet is finished.";
            }
          }
          description
            "The type of efm test packet status.";
        }
    
        typedef discovery-state {
          type enumeration {
            enum "FAULT" {
              value 0;
              description "FAULT state.";
            }
            enum "ACTIVE-SEND-LOCAL" {
              value 1;
              description
                "ACTIVE_SEND_LOCAL state.";
            }
            enum "PASSIVE-WAIT" {
              value 2;
              description "PASSIVE_WAIT state.";
            }
            enum "SEND-LOCAL-REMOTE" {
              value 3;
              description
                "SEND_LOCAL_REMOTE state.";
            }
            enum "SEND-LOCAL-REMOTE-OK" {
              value 4;
              description
                "SEND_LOCAL_REMOTE_OK state.";
            }
            enum "SEND-ANY" {
              value 5;
              description "SEND_ANY state.";
            }
          }
          description
            "The type of efm discovery state.";
        }
    
        typedef error-frame-period-unit {
          type enumeration {
            enum "second" {
              value 0;
              description
                "Error frame period unit: seconds.";
            }
            enum "millisecond" {
              value 1;
              description
                "Error frame period unit: milliseconds.";
            }
          }
          description
            "EFM error frame period unit.";
        }
    
        typedef loopback-state {
          type enumeration {
            enum "none" {
              value 0;
              description
                "Indicates that the EFM session is in the Loopback state (none).";
            }
            enum "loopback-be-controlled" {
              value 1;
              description
                "Indicates that the EFM session is in the Loopback state on the end that receives the session connection request.";
            }
            enum "loopback-control" {
              value 2;
              description
                "Indicates that the EFM session is in the Loopback state on the end that initiates the session connection request.";
            }
          }
          description
            "The type of EFM loopback state.";
        }
    
        typedef extended-info-transmit-type {
          type enumeration {
            enum "receive" {
              value 0;
              description
                "EFM receives extended information.";
            }
            enum "send" {
              value 1;
              description
                "EFM sends extended information.";
            }
            enum "send-and-receive" {
              value 2;
              description
                "EFM sends and receives extended information.";
            }
          }
          description
            "The type of EFM extended information transmit.";
        }
    
        container efm {
          presence "Enables EFM";
          description
            "Ethernet in the First Mile, which is used for fault and performance detection.";
          container error-packets {
            config false;
            description
              "List of EFM error packet.";
            list error-packet {
              key "slot-id pkt-number";
              config false;
              description
                "Statistics of EFM error packet.";
              leaf slot-id {
                type string {
                  length "1..23";
                }
                description
                  "Specify the slot ID.";
              }
    
              leaf pkt-number {
                type uint32 {
                  range "1..10";
                }
                description "Packet number.";
              }
    
              leaf if-name {
                type leafref {
                  path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                description
                  "Specify the name of the interface.";
              }
    
              leaf time {
                type yang:date-and-time;
                description "Time.";
              }
    
              leaf packet {
                type string {
                  length "0..1024";
                }
                description
                  "Content of the error packet.";
              }
    
              leaf reason {
                type string {
                  length "0..64";
                }
                description
                  "Error packet reason.";
              }
            }  // list error-packet
          }  // container error-packets
        }  // container efm
    
        rpc efm-loopback-start {
          ext:node-ref "/ifm:ifm/ifm:interfaces/ifm:interface/efm:efm/efm:session";
          description "Enable remote loopback.";
          input {
            leaf if-name {
              type leafref {
                path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
              }
              mandatory true;
              description
                "Specify the interface enabled with remote loopback.";
            }
    
            leaf timeout {
              type uint16 {
                range "0..1000";
              }
              default "20";
              description
                "Specify the timeout period for remote loopback.";
            }
          }
        }  // rpc efm-loopback-start
    
        rpc efm-loopback-stop {
          ext:node-ref "/ifm:ifm/ifm:interfaces/ifm:interface/efm:efm/efm:session";
          description "Disable remote loopback.";
          input {
            leaf if-name {
              type leafref {
                path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
              }
              mandatory true;
              description
                "Specify the interface enabled with remote loopback.";
            }
          }
        }  // rpc efm-loopback-stop
    
        rpc efm-recover-efm-down {
          ext:node-ref "/ifm:ifm/ifm:interfaces/ifm:interface/efm:efm/efm:session";
          description
            "Indicate that the interface blocked by EFM goes up.";
          input {
            leaf if-name {
              type leafref {
                path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
              }
              mandatory true;
              description
                "Specify the name of the interface enabled with EFM.";
            }
          }
        }  // rpc efm-recover-efm-down
    
        rpc efm-test-packet {
          ext:node-ref "/ifm:ifm/ifm:interfaces/ifm:interface/efm:efm/efm:session";
          description "Send test packets.";
          input {
            leaf if-name {
              type leafref {
                path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
              }
              mandatory true;
              description
                "Specify the name of the interface sending test packets.";
            }
    
            leaf packet-size {
              type uint32 {
                range "64..1518";
              }
              units "Byte";
              default "64";
              description
                "Specify the size of the sent test packet.";
            }
    
            leaf packet-count {
              type uint32 {
                range "1..65535";
              }
              default "5";
              description
                "Specify the number of sent test packets.";
            }
    
            leaf packet-speed {
              type uint32 {
                range "1..5";
              }
              units "Mbit/s";
              default "1";
              description
                "Specify the speed at which test packets are sent.";
            }
          }
        }  // rpc efm-test-packet
      }  // module huawei-efm
    

© 2023 YumaWorks, Inc. All rights reserved.