From 23e187b9a2225f4bd64c7088c2504432a6f477a1 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 27 Mar 2007 22:54:34 +0000 Subject: add cim extensions option --- src/wsman-client-options.c | 752 +++++++++++++++++++++++---------------------- src/wsman-client-options.h | 62 ++-- src/wsman.c | 170 ++++++---- 3 files changed, 522 insertions(+), 462 deletions(-) (limited to 'src') diff --git a/src/wsman-client-options.c b/src/wsman-client-options.c index 5e5ca76..a2e0226 100644 --- a/src/wsman-client-options.c +++ b/src/wsman-client-options.c @@ -52,17 +52,17 @@ #if 0 static char *auth_methods[] = { - "basic", - "digest", - "ntlm", - NULL, + "basic", + "digest", + "ntlm", + NULL, }; #endif static const char **wsman_argv = NULL; -static int server_port = 0; +static int server_port = 0; static char *cafile = NULL; static char *username = NULL; static char *password = NULL; @@ -78,11 +78,12 @@ static char *proxy_upwd = NULL; static int debug_level = -1; static char *test_case = NULL; static int enum_max_elements = 0; -char enum_optimize = 0; -char enum_estimate = 0; -char dump_request = 0; -char step = 0; -char request_only = 0; +char enum_optimize = 0; +char enum_estimate = 0; +char dump_request = 0; +char step = 0; +char request_only = 0; +char cim_extensions = 0; static char *enum_mode = NULL; static char *binding_enum_mode = NULL; static char *enum_context = NULL; @@ -105,367 +106,386 @@ static char *invoke_method = NULL; static char **properties = NULL; -WsActions action_data[] = - { - { "get", WSMAN_ACTION_TRANSFER_GET}, - { "put", WSMAN_ACTION_TRANSFER_PUT}, - { "create", WSMAN_ACTION_TRANSFER_CREATE}, - { "delete", WSMAN_ACTION_TRANSFER_DELETE}, - { "enumerate", WSMAN_ACTION_ENUMERATION}, - { "pull", WSMAN_ACTION_PULL}, - { "release", WSMAN_ACTION_RELEASE}, - { "invoke", WSMAN_ACTION_CUSTOM }, - { "identify", WSMAN_ACTION_IDENTIFY}, - { "test", WSMAN_ACTION_TEST}, - { NULL, 0}, - }; - -char wsman_parse_options(int argc, char **argv) -{ - - char retval = 0; - u_error_t *error = NULL; - - u_option_entry_t options[] = { - { "debug", 'd', U_OPTION_ARG_INT, &debug_level, - "Set the verbosity of debugging output.", "1-6" }, - { "cafile", 'c', U_OPTION_ARG_STRING, &cafile, - "Certificate file", "" }, - { "username", 'u', U_OPTION_ARG_STRING, &username, - "User name", "" }, - { "path", 'g', U_OPTION_ARG_STRING, &url_path, - "Path", "" }, - { "input", 'J', U_OPTION_ARG_STRING, &input, - "File with resource for Create and Put operations in XML, can be a SOAP envelope", "" }, - { "password", 'p', U_OPTION_ARG_STRING, &password, - "Password", "" }, - { "hostname", 'h', U_OPTION_ARG_STRING, &server, - "Host name", "" }, - { "port", 'P', U_OPTION_ARG_INT, &server_port, - "Server Port", ""}, - { "proxy", 'X', U_OPTION_ARG_STRING, &proxy, - "Proxy name", "" }, - { "proxyauth", 'Y', U_OPTION_ARG_STRING, &proxy_upwd, - "Proxy user:pwd", "" }, - { "auth", 'y', U_OPTION_ARG_STRING, &authentication_method, - "Authentication Method", "" }, - { "method", 'a', U_OPTION_ARG_STRING, &invoke_method, - "Method (Works only with 'invoke')", "" }, - { "prop", 'k', U_OPTION_ARG_STRING_ARRAY, &properties, - "Properties with key value pairs (For 'put', 'invoke' and 'create')", - "" }, - { "config-file",'C', U_OPTION_ARG_STRING, &config_file, - "Alternate configuration file", "" }, - { "out-file", 'O', U_OPTION_ARG_STRING, &output_file, - "Write output to file", "" }, - { "noverifypeer",'V', U_OPTION_ARG_NONE, &no_verify_peer, - "Not to verify peer certificate", NULL }, - { NULL } - }; - - - - u_option_entry_t request_options[] = { - { "filter", 'x', U_OPTION_ARG_STRING, &wsm_filter, - "Filter" , "" }, - { "dialect", 'D', U_OPTION_ARG_STRING, &wsm_dialect, - "Filter Dialect" , "" }, - { "timeout", 't', U_OPTION_ARG_INT, &operation_timeout, - "Operation timeout in seconds", "