summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Hou <houliang@intel.com>2008-01-28 06:18:34 +0000
committerLiang Hou <houliang@intel.com>2008-01-28 06:18:34 +0000
commitc34a225f30b4e78133dbba02219f6b4c082a5350 (patch)
tree203465b0d8ff8924acf4f83f31ab6245bb1118be /src
parente13150135001e27f256748e7a21dc444412252f7 (diff)
downloadwsmancli-c34a225f30b4e78133dbba02219f6b4c082a5350.tar.gz
wsmancli-c34a225f30b4e78133dbba02219f6b4c082a5350.tar.xz
wsmancli-c34a225f30b4e78133dbba02219f6b4c082a5350.zip
add eventing secure deliery related options
Diffstat (limited to 'src')
-rw-r--r--src/wsman.c56
1 files changed, 53 insertions, 3 deletions
diff --git a/src/wsman.c b/src/wsman.c
index bf16b75..ca597a2 100644
--- a/src/wsman.c
+++ b/src/wsman.c
@@ -31,6 +31,7 @@
/**
* @author Anas Nashif
* @author Vadim Revyakin
+ * @author Liang Hou
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -91,12 +92,16 @@ static char *enum_mode = NULL;
static char *binding_enum_mode = NULL;
static char *enum_context = NULL;
static char *event_delivery_mode = NULL;
+static char *event_delivery_sec_mode = NULL;
static char *event_delivery_uri = NULL;
static int event_subscription_expire = 0;
static int event_heartbeat = 0;
static int event_sendbookmark =0;
static char *event_subscription_id = NULL;
static char *event_reference_properties = NULL;
+static char *event_username = NULL;
+static char *event_password = NULL;
+static char *event_thumbprint = NULL;
static char *cim_namespace = NULL;
static char *fragment = NULL;
@@ -146,6 +151,17 @@ WsActions delivery_mode[] = {
{NULL, 0}
};
+WsActions delivery_sec_mode[] = {
+ {"httpbasic", WSMAN_DELIVERY_SEC_HTTP_BASIC},
+ {"httpdigest", WSMAN_DELIVERY_SEC_HTTP_DIGEST},
+ {"httpsbasic", WSMAN_DELIVERY_SEC_HTTPS_BASIC},
+ {"httpsdigest", WSMAN_DELIVERY_SEC_HTTPS_DIGEST},
+ {"httpsmutual", WSMAN_DELIVERY_SEC_HTTPS_MUTUAL},
+ {"httpsmutualbasic", WSMAN_DELIVERY_SEC_HTTPS_MUTUAL_BASIC},
+ {"httpsmutualdigest", WSMAN_DELIVERY_SEC_HTTPS_MUTUAL_DIGEST},
+ {NULL, 0}
+};
+
static int wsman_options_get_action(void)
{
int op = 0;
@@ -252,6 +268,18 @@ static char wsman_parse_options(int argc, char **argv)
{"delivery-mode", 'G', U_OPTION_ARG_STRING, &event_delivery_mode,
"Four delivery modes available: push/pushwithack/events/pull",
"<mode>"},
+ {"delivery-sec-mode", 's', U_OPTION_ARG_STRING, &event_delivery_sec_mode,
+ "Four delivery modes available: httpbasic/httpdigest/httpsbasic/httpsdigest/httpsmutual/httpsmutualbasic/httpsmutualdigest",
+ "<mode>"},
+ {"delivery-username", 'n', U_OPTION_ARG_STRING, &event_username,
+ "username for the eventing receiver",
+ "<username>"},
+ {"delivery-password", 'z', U_OPTION_ARG_STRING, &event_password,
+ "password for the eventing receiver",
+ "<password>"},
+ {"delivery-thumbprint", 'Y', U_OPTION_ARG_STRING, &event_thumbprint,
+ "ceritificate thumbprint of the eventing receiver",
+ "<thumbprint>"},
{"notification-uri", 'Z', U_OPTION_ARG_STRING, &event_delivery_uri,
"Where notifications are sent",
"<uri>"},
@@ -266,9 +294,9 @@ static char wsman_parse_options(int argc, char **argv)
{"subscription-identifier", 'i', U_OPTION_ARG_STRING, &event_subscription_id,
"Used to specify which subscription",
"<uuid:XXX>"},
- {"notify-reference-properties", 'L', U_OPTION_ARG_STRING, &event_reference_properties,
- "Notify Reference Properties",
- "<xs:anyURI>"},
+ {"event-reference-properties", 'L', U_OPTION_ARG_STRING, &event_reference_properties,
+ "Event Reference Properties, correlation of Events with Subscription",
+ "<xml string>"},
{NULL}
};
@@ -476,6 +504,20 @@ static int wsman_options_get_delivery_mode(void)
return mode;
}
+static int wsman_options_get_delivery_sec_mode(void)
+{
+ int mode = 0;
+ int i;
+ for (i = 0; delivery_sec_mode[i].action != NULL; i++) {
+ if (strcmp(delivery_sec_mode[i].action, event_delivery_sec_mode) == 0) {
+ mode = delivery_sec_mode[i].value;
+ break;
+ }
+ }
+ return mode;
+}
+
+
static int wsman_read_client_config(dictionary * ini)
{
if (iniparser_find_entry(ini, "client")) {
@@ -804,6 +846,14 @@ int main(int argc, char **argv)
wsmc_set_action_option(options, FLAG_EVENT_SENDBOOKMARK);
if(event_delivery_mode)
options->delivery_mode = wsman_options_get_delivery_mode();
+ if(event_delivery_sec_mode)
+ options->delivery_sec_mode = wsman_options_get_delivery_sec_mode();
+ if(event_username)
+ options->delivery_username = event_username;
+ if(event_password)
+ options->delivery_password = event_password;
+ if(event_thumbprint)
+ options->delivery_certificatethumbprint = event_thumbprint;
if(event_delivery_uri)
options->delivery_uri = event_delivery_uri;
if(event_heartbeat)