rpcclient/cmd_shutdown.c

ソースコードを見る。

関数

static NTSTATUS cmd_shutdown_init (struct cli_state *cli, TALLOC_CTX *mem_ctx, int argc, const char **argv)
static NTSTATUS cmd_shutdown_abort (struct cli_state *cli, TALLOC_CTX *mem_ctx, int argc, const char **argv)

変数

cmd_set shutdown_commands []


関数

static NTSTATUS cmd_shutdown_init ( struct cli_state cli,
TALLOC_CTX mem_ctx,
int  argc,
const char **  argv 
) [static]

cmd_shutdown.c33 行で定義されています。

参照先 clioptargoptindresulttimeout.

00035 {
00036         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
00037         fstring msg;
00038         uint32 timeout = 20;
00039         BOOL force = False;
00040         BOOL reboot = False;
00041         int opt;
00042 
00043         *msg = 0;
00044         optind = 0; /* TODO: test if this hack works on other systems too --simo */
00045 
00046         while ((opt = getopt(argc, argv, "m:t:rf")) != EOF)
00047         {
00048                 /*fprintf (stderr, "[%s]\n", argv[argc-1]);*/
00049         
00050                 switch (opt)
00051                 {
00052                         case 'm':
00053                                 fstrcpy(msg, optarg);
00054                                 /*fprintf (stderr, "[%s|%s]\n", optarg, msg);*/
00055                                 break;
00056 
00057                         case 't':
00058                                 timeout = atoi(optarg);
00059                                 /*fprintf (stderr, "[%s|%d]\n", optarg, timeout);*/
00060                                 break;
00061 
00062                         case 'r':
00063                                 reboot = True;
00064                                 break;
00065 
00066                         case 'f':
00067                                 force = True;
00068                                 break;
00069 
00070                 }
00071         }
00072 
00073         /* create an entry */
00074         result = cli_shutdown_init(cli, mem_ctx, msg, timeout, reboot, force);
00075 
00076         if (NT_STATUS_IS_OK(result))
00077                 DEBUG(5,("cmd_shutdown_init: query succeeded\n"));
00078         else
00079                 DEBUG(5,("cmd_shutdown_init: query failed\n"));
00080 
00081         return result;
00082 }

static NTSTATUS cmd_shutdown_abort ( struct cli_state cli,
TALLOC_CTX mem_ctx,
int  argc,
const char **  argv 
) [static]

cmd_shutdown.c87 行で定義されています。

参照先 cliresult.

00090 {
00091         NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
00092 
00093         result = cli_shutdown_abort(cli, mem_ctx);
00094 
00095         if (NT_STATUS_IS_OK(result))
00096                 DEBUG(5,("cmd_shutdown_abort: query succeeded\n"));
00097         else
00098                 DEBUG(5,("cmd_shutdown_abort: query failed\n"));
00099 
00100         return result;
00101 }


変数

struct cmd_set shutdown_commands[]

初期値:

 {

        { "SHUTDOWN"  },

#if 0
        { "shutdowninit", RPC_RTYPE_NTSTATUS, cmd_shutdown_init, NULL, PI_SHUTDOWN, "Remote Shutdown (over shutdown pipe)",
                                "syntax: shutdown [-m message] [-t timeout] [-r] [-h] [-f] (-r == reboot, -h == halt, -f == force)" },
                                
        { "shutdownabort", RPC_RTYPE_NTSTATUS, cmd_shutdown_abort, NULL, PI_SHUTDOWN, "Abort Shutdown (over shutdown pipe)",
                                "syntax: shutdownabort" },
#endif
        { NULL }
}

cmd_shutdown.c106 行で定義されています。


Sambaに対してSat Aug 29 21:24:24 2009に生成されました。  doxygen 1.4.7