summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/Makefile.am19
-rw-r--r--examples/create_resource.c2
-rw-r--r--examples/enum_epr.c2
-rw-r--r--examples/win32_service.c2
-rw-r--r--src/wsman-client-options.c30
-rw-r--r--src/wsman-client-options.h1
-rw-r--r--src/wsman.c17
-rw-r--r--tests/interop/interop.c2
8 files changed, 51 insertions, 24 deletions
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 51247c5..9bb9994 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = cpp
+#SUBDIRS = cpp
AM_CFLAGS = @CFLAGS@
@@ -21,27 +21,12 @@ serialize_SOURCES = serialize.c
create_resource_SOURCES = \
create_resource.c
-session_example_SOURCES = \
- session_example.c
-
-session_transfer_create_SOURCES = \
- session_transfer_create.c
-
-session_invoke_SOURCES = \
- session_invoke.c
-
-session_transfer_get_put_SOURCES = \
- session_transfer_get_put.c
noinst_PROGRAMS = \
wsmid_identify \
win32_service \
enum_epr \
create_resource \
- serialize \
- session_example \
- session_transfer_create \
- session_invoke \
- session_transfer_get_put
+ serialize
diff --git a/examples/create_resource.c b/examples/create_resource.c
index 69ee688..8135e52 100644
--- a/examples/create_resource.c
+++ b/examples/create_resource.c
@@ -128,13 +128,13 @@ int main(int argc, char** argv)
}
- wsman_client_transport_init(NULL);
cl = wsman_create_client( uri->host,
uri->port,
uri->path,
uri->scheme,
uri->user,
uri->pwd);
+ wsman_client_transport_init(cl, NULL);
options = initialize_action_options();
if (dump) wsman_set_action_option(options,FLAG_DUMP_REQUEST );
diff --git a/examples/enum_epr.c b/examples/enum_epr.c
index 1659323..59a4629 100644
--- a/examples/enum_epr.c
+++ b/examples/enum_epr.c
@@ -169,13 +169,13 @@ int main(int argc, char** argv)
}
- wsman_client_transport_init(NULL);
cl = wsman_create_client( uri->host,
uri->port,
uri->path,
uri->scheme,
uri->user,
uri->pwd);
+ wsman_client_transport_init(cl, NULL);
options = initialize_action_options();
wsman_set_action_option(options, FLAG_ENUMERATION_ENUM_EPR);
diff --git a/examples/win32_service.c b/examples/win32_service.c
index 476f828..ce1c61e 100644
--- a/examples/win32_service.c
+++ b/examples/win32_service.c
@@ -233,13 +233,13 @@ int main(int argc, char** argv)
}
- wsman_client_transport_init(NULL);
cl = wsman_create_client( uri->host,
uri->port,
uri->path,
uri->scheme,
uri->user,
uri->pwd);
+ wsman_client_transport_init(cl, NULL);
options = initialize_action_options();
if (listall) {
diff --git a/src/wsman-client-options.c b/src/wsman-client-options.c
index 26b3b32..efa355b 100644
--- a/src/wsman-client-options.c
+++ b/src/wsman-client-options.c
@@ -318,11 +318,11 @@ int wsman_read_client_config(dictionary * ini)
}
return 1;
}
-
+#if 0
void wsman_setup_transport_and_library_options()
{
// transport options
- wsman_transport_set_auth_method(authentication_method);
+ wsman_transport_set_auth_method(cl, authentication_method);
if (proxy) {
wsman_transport_set_proxy(proxy);
if (proxy_upwd) {
@@ -338,6 +338,7 @@ void wsman_setup_transport_and_library_options()
// library options
wsman_debug_set_level(debug_level);
}
+#endif
const char **wsman_options_get_argv(void)
@@ -366,6 +367,11 @@ char *wsman_options_get_cafile(void)
return cafile;
}
+char *wsman_options_get_auth_method(void)
+{
+ return authentication_method;
+}
+
char *wsman_options_get_server(void)
{
if (server)
@@ -507,3 +513,23 @@ char *wsman_options_get_path(void)
{
return url_path;
}
+char *wsman_options_get_proxy(void)
+{
+ return proxy;
+}
+char *wsman_options_get_proxy_upwd(void)
+{
+ return proxy_upwd;
+}
+char wsman_options_get_no_verify_peer(void)
+{
+ return no_verify_peer;
+}
+int wsman_options_get_debug_level(void)
+{
+ return debug_level;
+}
+unsigned long wsman_options_get_transport_timeout(void)
+{
+ return transport_timeout;
+}
diff --git a/src/wsman-client-options.h b/src/wsman-client-options.h
index 4218d2d..e9e1232 100644
--- a/src/wsman-client-options.h
+++ b/src/wsman-client-options.h
@@ -20,6 +20,7 @@ extern char *wsman_options_get_path(void);
extern char *wsman_options_get_username(void);
extern char *wsman_options_get_password(void);
extern char *wsman_options_get_cafile(void);
+extern char *wsman_options_get_authentication_method(void);
extern int wsman_options_get_max_elements(void);
extern char *wsman_options_get_test_file(void);
diff --git a/src/wsman.c b/src/wsman.c
index e89d3e0..193b597 100644
--- a/src/wsman.c
+++ b/src/wsman.c
@@ -125,7 +125,6 @@ int main(int argc, char **argv)
if (!wsman_parse_options(argc, argv)) {
exit(EXIT_FAILURE);
}
- wsman_setup_transport_and_library_options();
initialize_logging();
// wsman_client_transport_init(NULL);
@@ -146,6 +145,22 @@ int main(int argc, char **argv)
error("Null Client");
exit(EXIT_FAILURE);
}
+ // transport options
+ wsman_transport_set_auth_method(cl, wsman_options_get_auth_method());
+ if (wsman_options_get_proxy()) {
+ wsman_transport_set_proxy(cl, wsman_options_get_proxy());
+ if (wsman_options_get_proxy_upwd()) {
+ wsman_transport_set_proxyauth(cl, wsman_options_get_proxy_upwd());
+ }
+ }
+ if (wsman_options_get_cafile()) {
+ wsman_transport_set_cafile(cl, wsman_options_get_cafile());
+ }
+ wsman_transport_set_no_verify_peer(cl, wsman_options_get_no_verify_peer());
+ wsman_transport_set_timeout(cl, wsman_options_get_transport_timeout());
+
+ // library options
+ wsman_debug_set_level(wsman_options_get_debug_level());
/*
* Setup Resource URI and Selectors
*/
diff --git a/tests/interop/interop.c b/tests/interop/interop.c
index b1e31ec..5fea63f 100644
--- a/tests/interop/interop.c
+++ b/tests/interop/interop.c
@@ -240,13 +240,13 @@ int main(int argc, char** argv)
}
wsman_debug_set_level(debug_level);
- wsman_client_transport_init(NULL);
cl = wsman_create_client( uri->host,
uri->port,
uri->path,
uri->scheme,
uri->user,
uri->pwd);
+ wsman_client_transport_init(cl, NULL);
options = initialize_action_options();
if (file == NULL) {