1 /*
   2  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
   4  */
   5 
   6 /*
   7  * BSD 3 Clause License
   8  *
   9  * Copyright (c) 2007, The Storage Networking Industry Association.
  10  *
  11  * Redistribution and use in source and binary forms, with or without
  12  * modification, are permitted provided that the following conditions
  13  * are met:
  14  *      - Redistributions of source code must retain the above copyright
  15  *        notice, this list of conditions and the following disclaimer.
  16  *
  17  *      - Redistributions in binary form must reproduce the above copyright
  18  *        notice, this list of conditions and the following disclaimer in
  19  *        the documentation and/or other materials provided with the
  20  *        distribution.
  21  *
  22  *      - Neither the name of The Storage Networking Industry Association (SNIA)
  23  *        nor the names of its contributors may be used to endorse or promote
 
 
  84 static ndmp_command_t command_table[] = {
  85         { "get",                ndmp_get_config,        HELP_GET_CONFIG },
  86         { "set",                ndmp_set_config,        HELP_SET_CONFIG },
  87         { "show-devices",       ndmp_show_devices,      HELP_SHOW_DEVICES },
  88         { "show-sessions",      ndmp_show_sessions,     HELP_SHOW_SESSIONS },
  89         { "kill-sessions",      ndmp_kill_sessions,     HELP_KILL_SESSIONS },
  90         { "enable",             ndmp_enable_auth,       HELP_ENABLE_AUTH },
  91         { "disable",            ndmp_disable_auth,      HELP_DISABLE_AUTH }
  92 };
  93 
  94 #define NCOMMAND        (sizeof (command_table) / sizeof (command_table[0]))
  95 
  96 static char *prop_table[] = {
  97         "debug-path",
  98         "dump-pathnode",
  99         "tar-pathnode",
 100         "ignore-ctime",
 101         "token-maxseq",
 102         "version",
 103         "dar-support",
 104         "tcp-port",
 105         "backup-quarantine",
 106         "restore-quarantine",
 107         "overwrite-quarantine",
 108         "zfs-force-override",
 109         "drive-type",
 110         "debug-mode"
 111 };
 112 
 113 #define NDMPADM_NPROP   (sizeof (prop_table) / sizeof (prop_table[0]))
 114 
 115 typedef struct ndmp_auth {
 116         const char *auth_type;
 117         const char *username;
 118         const char *password;
 119 } ndmp_auth_t;
 120 
 121 static ndmp_auth_t ndmp_auth_table[] = {
 122         { "cram-md5", "cram-md5-username", "cram-md5-password" },
 123         { "cleartext", "cleartext-username", "cleartext-password" }
 124 };
 125 #define NAUTH   (sizeof (ndmp_auth_table) / sizeof (ndmp_auth_table[0]))
 126 #define NDMP_PASSWORD_RETRIES   3
 127 
 128 #if !defined(TEXT_DOMAIN)
 
 | 
   1 /*
   2  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
   4  */
   5 
   6 /*
   7  * BSD 3 Clause License
   8  *
   9  * Copyright (c) 2007, The Storage Networking Industry Association.
  10  *
  11  * Redistribution and use in source and binary forms, with or without
  12  * modification, are permitted provided that the following conditions
  13  * are met:
  14  *      - Redistributions of source code must retain the above copyright
  15  *        notice, this list of conditions and the following disclaimer.
  16  *
  17  *      - Redistributions in binary form must reproduce the above copyright
  18  *        notice, this list of conditions and the following disclaimer in
  19  *        the documentation and/or other materials provided with the
  20  *        distribution.
  21  *
  22  *      - Neither the name of The Storage Networking Industry Association (SNIA)
  23  *        nor the names of its contributors may be used to endorse or promote
 
 
  84 static ndmp_command_t command_table[] = {
  85         { "get",                ndmp_get_config,        HELP_GET_CONFIG },
  86         { "set",                ndmp_set_config,        HELP_SET_CONFIG },
  87         { "show-devices",       ndmp_show_devices,      HELP_SHOW_DEVICES },
  88         { "show-sessions",      ndmp_show_sessions,     HELP_SHOW_SESSIONS },
  89         { "kill-sessions",      ndmp_kill_sessions,     HELP_KILL_SESSIONS },
  90         { "enable",             ndmp_enable_auth,       HELP_ENABLE_AUTH },
  91         { "disable",            ndmp_disable_auth,      HELP_DISABLE_AUTH }
  92 };
  93 
  94 #define NCOMMAND        (sizeof (command_table) / sizeof (command_table[0]))
  95 
  96 static char *prop_table[] = {
  97         "debug-path",
  98         "dump-pathnode",
  99         "tar-pathnode",
 100         "ignore-ctime",
 101         "token-maxseq",
 102         "version",
 103         "dar-support",
 104         "autosync-support",
 105         "hpr-support",
 106         "tcp-port",
 107         "backup-quarantine",
 108         "restore-quarantine",
 109         "overwrite-quarantine",
 110         "drive-type",
 111         "debug-mode"
 112 };
 113 
 114 #define NDMPADM_NPROP   (sizeof (prop_table) / sizeof (prop_table[0]))
 115 
 116 typedef struct ndmp_auth {
 117         const char *auth_type;
 118         const char *username;
 119         const char *password;
 120 } ndmp_auth_t;
 121 
 122 static ndmp_auth_t ndmp_auth_table[] = {
 123         { "cram-md5", "cram-md5-username", "cram-md5-password" },
 124         { "cleartext", "cleartext-username", "cleartext-password" }
 125 };
 126 #define NAUTH   (sizeof (ndmp_auth_table) / sizeof (ndmp_auth_table[0]))
 127 #define NDMP_PASSWORD_RETRIES   3
 128 
 129 #if !defined(TEXT_DOMAIN)
 
 |