configure: remove HAVE_IPV6 test as LIBREPLACE_NETWORK_CHECKS already have this
[Samba.git] / source / utils / net_help.c
blobddb8d76336567542277aefc9b1c92d8f00a25317
1 /*
2 Samba Unix/Linux SMB client library
3 net help commands
4 Copyright (C) 2002 Jim McDonough (jmcd@us.ibm.com)
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "includes.h"
21 #include "utils/net.h"
23 static int net_help_usage(struct net_context *c, int argc, const char **argv)
25 d_printf(
26 "\n"\
27 "Usage: net help <function>\n"\
28 "\n"\
29 "Valid functions are:\n"\
30 " RPC RAP ADS FILE SHARE SESSION SERVER DOMAIN PRINTQ USER GROUP VALIDATE\n"\
31 " GROUPMEMBER ADMIN SERVICE PASSWORD TIME LOOKUP GETLOCALSID SETLOCALSID\n"\
32 " SETDOMAINSID CHANGESCRETPW LOOKUP SAM\n");
33 return -1;
36 static int net_usage(struct net_context *c, int argc, const char **argv)
38 d_printf(" net time\t\tto view or set time information\n"\
39 " net lookup\t\tto lookup host name or ip address\n"\
40 " net user\t\tto manage users\n"\
41 " net group\t\tto manage groups\n"\
42 " net sam\t\tto edit the local user database directly\n"\
43 " net lookup\t\tto look up various things\n"\
44 " net groupmap\t\tto manage group mappings\n"\
45 " net join\t\tto join a domain\n"\
46 " net cache\t\tto operate on cache tdb file\n"\
47 " net getlocalsid [NAME]\tto get the SID for local name\n"\
48 " net setlocalsid SID\tto set the local domain SID\n"\
49 " net setdomainsid SID\tto set the domain SID on member servers\n"\
50 " net changesecretpw\tto change the machine password in the local secrets database only\n"\
51 " \tthis requires the -f flag as a safety barrier\n"\
52 " net status\t\tShow server status\n"\
53 " net usersidlist\tto get a list of all users with their SIDs\n"
54 " net usershare\t\tto add, delete and list locally user-modifiable shares\n"
55 " net conf\t\tto view and edit samba's registry based configuration\n"
56 "\n"\
57 " net ads <command>\tto run ADS commands\n"\
58 " net rap <command>\tto run RAP (pre-RPC) commands\n"\
59 " net rpc <command>\tto run RPC commands\n"\
60 "\n"\
61 "Type \"net help <option>\" to get more information on that option\n");
62 net_common_flags_usage(c, argc, argv);
63 return -1;
67 handle "net help *" subcommands
69 int net_help(struct net_context *c, int argc, const char **argv)
71 struct functable func[] = {
72 {"ADS", net_ads_usage},
73 {"RAP", net_rap_usage},
74 {"RPC", net_rpc_usage},
76 {"FILE", net_file_usage},
77 {"SHARE", net_share_usage},
78 {"SESSION", net_rap_session_usage},
79 {"SERVER", net_rap_server_usage},
80 {"DOMAIN", net_rap_domain_usage},
81 {"PRINTQ", net_rap_printq_usage},
82 {"USER", net_user_usage},
83 {"GROUP", net_group_usage},
84 {"GROUPMAP", net_groupmap_usage},
85 {"JOIN", net_join_usage},
86 {"DOM", net_dom_usage},
87 {"VALIDATE", net_rap_validate_usage},
88 {"GROUPMEMBER", net_rap_groupmember_usage},
89 {"ADMIN", net_rap_admin_usage},
90 {"SERVICE", net_rap_service_usage},
91 {"PASSWORD", net_rap_password_usage},
92 {"TIME", net_time_usage},
93 {"LOOKUP", net_lookup_usage},
94 {"USERSHARE", net_usershare_usage},
95 {"USERSIDLIST", net_usersidlist_usage},
96 #ifdef WITH_FAKE_KASERVER
97 {"AFS", net_afs_usage},
98 #endif
100 {"HELP", net_help_usage},
101 {NULL, NULL}};
103 return net_run_function(c, argc, argv, func, net_usage);