huawei-ftps

FTP server component.

  • Version: 2019-07-01

    huawei-ftps@2019-07-01


    
      module huawei-ftps {
    
        yang-version 1;
    
        namespace "urn:huawei:yang:huawei-ftps";
    
        prefix ftps;
    
        import huawei-pub-type {
          prefix pub-type;
        }
        import huawei-network-instance {
          prefix ni;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import huawei-extension {
          prefix ext;
        }
        import huawei-acl {
          prefix acl;
        }
    
        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 "FTP server component.";
    
        revision "2019-07-01" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "ftp-server";
    
        typedef ftps-bool-type {
          type enumeration {
            enum "disable" {
              value 0;
              description
                "Disable the FTP server service.";
            }
            enum "enable" {
              value 1;
              description
                "Enable the FTP server service.";
            }
          }
          description
            "FTP server bool datatype for ftps server.";
        }
    
        container ftps {
          description "FTP server component.";
          container server {
            description
              "Configure FTP server statistics.";
            leaf server-enable {
              type ftps-bool-type;
              default "disable";
              description
                "Whether to enable the FTP server service.";
            }
    
            leaf ipv6-server-enable {
              type ftps-bool-type;
              default "disable";
              description
                "Whether to enable the IPv6 FTP server service.";
            }
    
            leaf listen-port-number {
              type uint32 {
                range "21..65535";
              }
              default "21";
              description
                "Listening port of the FTP server.";
            }
    
            leaf ipv6-listen-port-number {
              type uint32 {
                range "21..65535";
              }
              default "21";
              description
                "Listening port of the IPv6 FTP server.";
            }
    
            leaf idle-timeout {
              type uint32 {
                range "1..35791";
              }
              units "min";
              default "10";
              description
                "Users can set the timeout period for an idle client to connect to the FTP server.";
            }
    
            leaf ipv6-idle-timeout {
              type uint32 {
                range "1..35791";
              }
              units "min";
              default "10";
              description
                "Users can set the timeout period for an idle client to connect to the IPv6 FTP server.";
            }
    
            leaf default-dir {
              type string {
                length "1..255";
              }
              description
                "When no root directory is configured for RADIUS/TACACS users, they can log in to the FTP server using the default root directory.";
            }
    
            leaf acl4-name-or-number {
              type leafref {
                path "/acl:acl/acl:groups/acl:group/acl:identity";
              }
              must
                "/acl:acl/acl:groups/acl:group[acl:identity=current()]/acl:type='basic' or /acl:acl/acl:groups/acl:group[acl:identity=current()]/acl:type='advance'";
              description
                "Server ACL name or number for IPv4 connections.";
            }
    
            leaf acl6-name-or-number {
              type leafref {
                path "/acl:acl/acl:group6s/acl:group6/acl:identity";
              }
              must
                "/acl:acl/acl:group6s/acl:group6[acl:identity=current()]/acl:type='basic' or /acl:acl/acl:group6s/acl:group6[acl:identity=current()]/acl:type='advance'";
              description
                "Server ACL name or number for IPv6 connections.";
            }
    
            leaf server-max-sessions {
              type uint32 {
                range "0..15";
              }
              default "15";
              description
                "User can configure maximum number of clients can be connected to server at any point of time for FTP service.";
            }
    
            leaf ip-max-sessions {
              type uint32 {
                range "1..15";
              }
              default "15";
              description
                "User can configure maximum number of clients can be connected to server from a single IP for FTP service.";
            }
          }  // container server
    
          container users-status {
            config false;
            description
              "FTP server configuration statistics.";
            leaf current-number-of-users {
              type uint32;
              config false;
              description
                "Number of FTP clients connected.";
            }
    
            leaf max-number-of-users {
              type uint32;
              config false;
              description
                "Maximum number of FTP clients.";
            }
          }  // container users-status
    
          container ip-block {
            description
              "Configure FTP IP block.";
            leaf ip-block-enable {
              type ftps-bool-type;
              default "enable";
              description
                "Whether to enable IP block function.";
            }
    
            leaf ip-block-failed-times {
              type uint32 {
                range "1..10";
              }
              default "6";
              description
                "IP block continuous authentication failures.";
            }
    
            leaf ip-block-period {
              type uint32 {
                range "1..120";
              }
              units "min";
              default "5";
              description
                "IP block continuous authentication failure time period.";
            }
    
            leaf ip-block-react-period {
              type uint32 {
                range "1..1000";
              }
              units "min";
              default "5";
              description
                "IP block automatically unlock time.";
            }
          }  // container ip-block
    
          container login-fail-alarm {
            description
              "Configure login failed frequently.";
            leaf upper-limit {
              type uint32 {
                range "0..100";
              }
              must
                "../upper-limit >= ../lower-limit";
              default "30";
              description
                "Login failed alarm report times.";
            }
    
            leaf lower-limit {
              type uint32 {
                range "0..45";
              }
              default "20";
              description
                "Login failed alarm resume times.";
            }
    
            leaf period {
              type uint32 {
                range "1..120";
              }
              units "min";
              default "5";
              description
                "Login failed alarm period.";
            }
          }  // container login-fail-alarm
    
          container ipv4-addr-sources {
            description
              "List of FTP IPv4 server source address.";
            list ipv4-addr-source {
              key "source-ipv4-address";
              max-elements 5;
              description
                "Configure FTP IPv4 server source address.";
              leaf source-ipv4-address {
                type inet:ipv4-address-no-zone;
                description
                  "FTP IPv4 server source address.";
              }
            }  // list ipv4-addr-source
          }  // container ipv4-addr-sources
    
          container ipv4-source-interfaces {
            description
              "List of specify the source interface.";
            list ipv4-source-interface {
              key "src-interface";
              max-elements 5;
              description
                "Configure specify the source interface.";
              leaf src-interface {
                type pub-type:if-name;
                description
                  "Specify the source interface name. The specified source interface must exist and an IP address must be configured on the interface.";
              }
            }  // list ipv4-source-interface
          }  // container ipv4-source-interfaces
    
          container ipv4-isolate-server-sources {
            description
              "List of the isolate source interface and source address.";
            list ipv4-isolate-server-source {
              key "src-interface src-ipv4-addr";
              max-elements 5;
              description
                "Configure the isolate source interface and source address.";
              leaf src-interface {
                type pub-type:if-name;
                must
                  "count(/ftps/ipv4-source-interfaces/ipv4-source-interface[src-interface = current()]) = 0";
                description
                  "Specify the source interface name.";
              }
    
              leaf src-ipv4-addr {
                type inet:ipv4-address-no-zone;
                description
                  "Specify the source IPv4 address.";
              }
            }  // list ipv4-isolate-server-source
          }  // container ipv4-isolate-server-sources
    
          container ipv6-server-sources {
            description
              "List of FTP IPv6 server source address.";
            list ipv6-server-source {
              key "src-ipv6-addr";
              max-elements 5;
              description
                "Configure FTP IPv6 server source address.";
              leaf src-ipv6-addr {
                type inet:ipv6-address-no-zone;
                description
                  "FTP IPv6 server source IP address.";
              }
    
              leaf src-ipv6-vpn-name {
                ext:support-filter "true";
                type string {
                  length "1..31";
                }
                description
                  "Specify the source VPN instance. The specified VPN instance must exist and IPv6-family must be enabled in the VPN instance.";
              }
            }  // list ipv6-server-source
          }  // container ipv6-server-sources
    
          container ipv6-isolate-server-sources {
            description
              "List of the isolate source interface and source IPv6 address.";
            list ipv6-isolate-server-source {
              key "src-interface src-ipv6-addr";
              max-elements 5;
              description
                "Configure the isolate source interface and source IPv6 address.";
              leaf src-interface {
                type pub-type:if-name;
                description
                  "Specify the source interface name.";
              }
    
              leaf src-ipv6-addr {
                type inet:ipv6-address-no-zone;
                must
                  "count(/ftps/ipv6-server-sources/ipv6-server-source[src-ipv6-addr = current()]) = 0";
                description
                  "Specify the source IPv6 address.";
              }
            }  // list ipv6-isolate-server-source
          }  // container ipv6-isolate-server-sources
    
          container all-server-source {
            description
              "Configure specify all interfaces.";
            leaf all-ipv4-interface {
              type boolean;
              default "false";
              description
                "Enable/disable specify all IPv4 interfaces.";
            }
    
            leaf all-ipv6-interface {
              type boolean;
              default "false";
              description
                "Enable/disable specify all IPv6 interfaces.";
            }
          }  // container all-server-source
    
          container session-car {
            must 'cir-interval<=pir-interval';
            must 'cbs-interval<=pbs-interval';
            description
              "Configure FTP server session CAR.";
            leaf enable {
              type boolean;
              default "true";
              description
                "Enable/disable session CAR.";
            }
    
            leaf cir-interval {
              type uint32 {
                range "1..1000000";
              }
              units "kbit/s";
              default "100";
              description
                "Specify the session CAR CIR interval.";
            }
    
            leaf cbs-interval {
              type uint32 {
                range "1..10000000";
              }
              units "bit/s";
              default "3000000";
              description
                "Specify the session CAR CBS interval.";
            }
    
            leaf pir-interval {
              type uint32 {
                range "1..1000000";
              }
              units "kbit/s";
              default "4000";
              description
                "Specify the session CAR PIR interval.";
            }
    
            leaf pbs-interval {
              type uint32 {
                range "1..10000000";
              }
              units "bit/s";
              default "9000000";
              description
                "Specify the session CAR PBS interval.";
            }
          }  // container session-car
        }  // container ftps
    
        rpc activate-ip {
          description "Activate IP.";
          input {
            leaf ip-address {
              type inet:ip-address-no-zone;
              mandatory true;
              description "IP address.";
            }
    
            leaf vpn-name {
              type leafref {
                path "/ni:network-instance/ni:instances/ni:instance/ni:name";
              }
              description "VPN name.";
            }
          }
        }  // rpc activate-ip
      }  // module huawei-ftps
    

© 2023 YumaWorks, Inc. All rights reserved.