huawei-device-lock

Device lock, stolen devices can not be used normally.

  • Version: 2020-08-18

    huawei-device-lock@2020-08-18


    
      module huawei-device-lock {
    
        yang-version 1;
    
        namespace
          "urn:huawei:yang:huawei-device-lock";
    
        prefix devicelock;
    
        import huawei-extension {
          prefix ext;
        }
    
        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
          "Device lock, stolen devices can not be used normally.";
    
        revision "2020-08-18" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "device-lock";
    
        typedef devlock-enable-status {
          type enumeration {
            enum "disable" {
              value 0;
              description
                "Device lock is disabled.";
            }
            enum "enable" {
              value 1;
              description
                "Device lock is enabled.";
            }
          }
          description
            "Enable status of device lock.";
        }
    
        typedef devlock-authorization-status {
          type enumeration {
            enum "unauthorized" {
              value 0;
              description
                "Device lock is unauthorized.";
            }
            enum "authorized" {
              value 1;
              description
                "Device lock is authorized.";
            }
          }
          description
            "Authorization status of device lock.";
        }
    
        typedef devlock-enable-type {
          type enumeration {
            enum "disable" {
              value 0;
              description "Disable device lock.";
            }
            enum "enable" {
              value 1;
              description "Enable device lock.";
            }
          }
          description
            "Enable type of device lock.";
        }
    
        typedef devlock-action-type {
          type enumeration {
            enum "unlock" {
              value 1;
              description "Device unlock.";
            }
            enum "relock" {
              value 2;
              description "Device relock.";
            }
            enum "modify-grace-time" {
              value 3;
              description "Modify grace period.";
            }
          }
          description
            "Action type of device lock.";
        }
    
        container device-lock {
          config false;
          description "Device lock.";
          container generated-random {
            description
              "Operational data of random.";
            leaf random-number {
              type string {
                length "1..25";
              }
              description
                "Random number generated by the device.";
            }
          }  // container generated-random
    
          container lock-status {
            description
              "Operational state of devicelock.";
            leaf enable-status {
              type devlock-enable-status;
              description "Enable status.";
            }
    
            leaf authorization-status {
              type devlock-authorization-status;
              description
                "Authorization status.";
            }
    
            leaf authorization-time {
              type uint32;
              units "h";
              description
                "Authorization period.";
            }
    
            leaf authorization-time-remain {
              type uint32;
              units "min";
              description
                "Authorization remaining period.";
            }
    
            leaf grace-time {
              type uint32;
              units "d";
              description "Grace period.";
            }
    
            leaf grace-time-remain {
              type uint32;
              units "min";
              description
                "Grace remaining period.";
            }
          }  // container lock-status
        }  // container device-lock
    
        rpc authorization {
          description
            "Devicelock authorization related actions.";
          input {
            container devicelock-actions {
              description
                "List of devicelock actions.";
              list devicelock-action {
                key "operator-name esn";
                description
                  "List of devicelock action.";
                leaf operator-name {
                  type string {
                    length "1..104";
                  }
                  description "Operator name.";
                }
    
                leaf esn {
                  type string {
                    length "1..68";
                  }
                  description
                    "Device serial number.";
                }
    
                leaf salt-value {
                  type string {
                    length "1..20";
                  }
                  mandatory true;
                  description "Salt value.";
                }
    
                leaf sign-value {
                  type string {
                    length "1..516";
                  }
                  mandatory true;
                  description
                    "Signature for checking the packets used to enable device lock.";
                }
    
                leaf grace-time {
                  when
                    "../action-type = 'relock' or ../action-type = 'modify-grace-time'";
                  type uint32 {
                    range "1..50";
                  }
                  units "d";
                  mandatory true;
                  description "Grace period.";
                }
    
                leaf action-type {
                  type devlock-action-type;
                  mandatory true;
                  description "Action type.";
                }
              }  // list devicelock-action
            }  // container devicelock-actions
          }
        }  // rpc authorization
    
        rpc load-pubkey {
          description "Devicelock pubkey.";
          input {
            container devicelock-pubkeys {
              description
                "List of devicelock pubkeys.";
              list devicelock-pubkey {
                key "operator-name esn";
                description
                  "List of devicelock pubkey.";
                leaf operator-name {
                  type string {
                    length "1..104";
                  }
                  description "Operator name.";
                }
    
                leaf esn {
                  type string {
                    length "1..68";
                  }
                  description
                    "Device serial number.";
                }
    
                leaf public-key {
                  when
                    "../enable-type = 'enable'";
                  type string {
                    length "1..544";
                  }
                  mandatory true;
                  description "Public key.";
                }
    
                leaf grace-time {
                  when
                    "../enable-type = 'enable'";
                  type uint32 {
                    range "1..50";
                  }
                  units "d";
                  mandatory true;
                  description "Grace period.";
                }
    
                leaf enable-type {
                  type devlock-enable-type;
                  mandatory true;
                  description "Enable type.";
                }
    
                leaf salt-value {
                  when
                    "../enable-type = 'disable'";
                  type string {
                    length "1..20";
                  }
                  mandatory true;
                  description "Salt value.";
                }
    
                leaf sign-value {
                  when
                    "../enable-type = 'disable'";
                  type string {
                    length "1..516";
                  }
                  mandatory true;
                  description
                    "Signature for checking the packets used to authorize device lock.";
                }
              }  // list devicelock-pubkey
            }  // container devicelock-pubkeys
          }
        }  // rpc load-pubkey
      }  // module huawei-device-lock
    

© 2023 YumaWorks, Inc. All rights reserved.