2 * Copyright (C) 2011 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 #include "tnc_ifmap_soap.h"
20 #include <axis2_util.h>
21 #include <axis2_client.h>
22 #include <axis2_http_transport.h>
23 #include <axis2_http_transport_sender.h>
24 #include <axiom_soap.h>
26 #define IFMAP_NS "http://www.trustedcomputinggroup.org/2010/IFMAP/2"
27 #define IFMAP_META_NS "http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2"
28 #define IFMAP_LOGFILE "strongswan_ifmap.log"
29 #define IFMAP_SERVER "https://localhost:8443/"
31 typedef struct private_tnc_ifmap_soap_t private_tnc_ifmap_soap_t
;
34 * Private data of an tnc_ifmap_soap_t object.
36 struct private_tnc_ifmap_soap_t
{
39 * Public tnc_ifmap_soap_t interface.
41 tnc_ifmap_soap_t
public;
49 * Axis2 service client
51 axis2_svc_client_t
* svc_client
;
61 char *ifmap_publisher_id
;
64 * PEP and PDP device name
71 * Send request and receive result via SOAP
73 static axiom_element_t
* send_receive(private_tnc_ifmap_soap_t
*this,
74 char *request_qname
, axiom_node_t
*request
,
75 char *receipt_qname
, axiom_node_t
**result
)
78 axiom_node_t
*parent
, *node
;
79 axiom_element_t
*parent_el
, *el
;
80 axutil_qname_t
*qname
;
82 /* send request and receive result */
83 DBG2(DBG_TNC
, "sending ifmap %s", request_qname
);
85 parent
= axis2_svc_client_send_receive(this->svc_client
, this->env
, request
);
88 DBG1(DBG_TNC
, "no ifmap %s received from MAP server", receipt_qname
);
91 DBG2(DBG_TNC
, "received ifmap %s", receipt_qname
);
93 /* extract the parent element */
94 parent_el
= (axiom_element_t
*)axiom_node_get_data_element(parent
, this->env
);
96 /* look for a child node with the given receipt qname */
97 qname
= axutil_qname_create_from_string(this->env
, strdup(receipt_qname
));
98 el
= axiom_element_get_first_child_with_qname(parent_el
, this->env
, qname
,
100 axutil_qname_free(qname
, this->env
);
110 /* no further processing requested */
111 axiom_node_free_tree(parent
, this->env
);
115 DBG1(DBG_TNC
, "child node with qname '%s' not found", receipt_qname
);
117 /* free parent in the error case */
118 axiom_node_free_tree(parent
, this->env
);
123 METHOD(tnc_ifmap_soap_t
, newSession
, bool,
124 private_tnc_ifmap_soap_t
*this)
126 axiom_node_t
*request
, *result
;
128 axiom_namespace_t
*ns
;
132 /* build newSession request */
133 ns
= axiom_namespace_create(this->env
, IFMAP_NS
, "ifmap");
134 el
= axiom_element_create(this->env
, NULL
, "newSession", ns
, &request
);
136 /* send newSession request and receive newSessionResult */
137 el
= send_receive(this, "newSession", request
, "newSessionResult", &result
);
144 value
= axiom_element_get_attribute_value_by_name(el
, this->env
,
146 this->session_id
= strdup(value
);
148 /* get ifmap-publisher-id */
149 value
= axiom_element_get_attribute_value_by_name(el
, this->env
,
150 "ifmap-publisher-id");
151 this->ifmap_publisher_id
= strdup(value
);
153 DBG1(DBG_TNC
, "session-id: %s, ifmap-publisher-id: %s",
154 this->session_id
, this->ifmap_publisher_id
);
156 /* set PEP and PDP device name (defaults to IF-MAP Publisher ID) */
157 this->device_name
= lib
->settings
->get_str(lib
->settings
,
158 "%s.plugins.tnc-ifmap.device_name",
159 this->ifmap_publisher_id
, charon
->name
);
160 this->device_name
= strdup(this->device_name
);
163 axiom_node_free_tree(result
, this->env
);
165 return this->session_id
&& this->ifmap_publisher_id
;
168 METHOD(tnc_ifmap_soap_t
, purgePublisher
, bool,
169 private_tnc_ifmap_soap_t
*this)
171 axiom_node_t
*request
;
173 axiom_namespace_t
*ns
;
174 axiom_attribute_t
*attr
;
176 /* build purgePublisher request */
177 ns
= axiom_namespace_create(this->env
, IFMAP_NS
, "ifmap");
178 el
= axiom_element_create(this->env
, NULL
, "purgePublisher", ns
, &request
);
179 attr
= axiom_attribute_create(this->env
, "session-id",
180 this->session_id
, NULL
);
181 axiom_element_add_attribute(el
, this->env
, attr
, request
);
182 attr
= axiom_attribute_create(this->env
, "ifmap-publisher-id",
183 this->ifmap_publisher_id
, NULL
);
184 axiom_element_add_attribute(el
, this->env
, attr
, request
);
186 /* send purgePublisher request and receive purgePublisherReceived */
187 return send_receive(this, "purgePublisher", request
,
188 "purgePublisherReceived", NULL
);
192 * Create an access-request based on device_name and ike_sa_id
194 static axiom_node_t
* create_access_request(private_tnc_ifmap_soap_t
*this,
199 axiom_attribute_t
*attr
;
202 el
= axiom_element_create(this->env
, NULL
, "access-request", NULL
, &node
);
204 snprintf(buf
, BUF_LEN
, "%s:%d", this->device_name
, id
);
205 attr
= axiom_attribute_create(this->env
, "name", buf
, NULL
);
206 axiom_element_add_attribute(el
, this->env
, attr
, node
);
214 static axiom_node_t
* create_identity(private_tnc_ifmap_soap_t
*this,
215 identification_t
*id
, bool is_user
)
219 axiom_attribute_t
*attr
;
220 char buf
[BUF_LEN
], *id_type
;
222 el
= axiom_element_create(this->env
, NULL
, "identity", NULL
, &node
);
224 snprintf(buf
, BUF_LEN
, "%Y", id
);
225 attr
= axiom_attribute_create(this->env
, "name", buf
, NULL
);
226 axiom_element_add_attribute(el
, this->env
, attr
, node
);
228 switch (id
->get_type(id
))
232 attr
= axiom_attribute_create(this->env
, "other-type-definition",
233 "36906:ipv4-address", NULL
);
234 axiom_element_add_attribute(el
, this->env
, attr
, node
);
237 id_type
= is_user ?
"username" : "dns-name";
240 id_type
= "email-address";
244 attr
= axiom_attribute_create(this->env
, "other-type-definition",
245 "36906:ipv6-address", NULL
);
246 axiom_element_add_attribute(el
, this->env
, attr
, node
);
249 id_type
= "distinguished-name";
253 attr
= axiom_attribute_create(this->env
, "other-type-definition",
254 "36906:key-id", NULL
);
255 axiom_element_add_attribute(el
, this->env
, attr
, node
);
259 attr
= axiom_attribute_create(this->env
, "other-type-definition",
260 "36906:other", NULL
);
261 axiom_element_add_attribute(el
, this->env
, attr
, node
);
263 attr
= axiom_attribute_create(this->env
, "type", id_type
, NULL
);
264 axiom_element_add_attribute(el
, this->env
, attr
, node
);
270 * Create an ip-address
272 static axiom_node_t
* create_ip_address(private_tnc_ifmap_soap_t
*this,
277 axiom_attribute_t
*attr
;
280 el
= axiom_element_create(this->env
, NULL
, "ip-address", NULL
, &node
);
282 if (host
->get_family(host
) == AF_INET6
)
289 /* output IPv6 address in canonical IF-MAP 2.0 format */
290 address
= host
->get_address(host
);
294 for (i
= 0; i
< address
.len
; i
= i
+ 2)
296 written
= snprintf(pos
, len
, "%s%x", first ?
"" : ":",
297 256*address
.ptr
[i
] + address
.ptr
[i
+1]);
298 if (written
< 0 || written
> len
)
309 snprintf(buf
, BUF_LEN
, "%H", host
);
311 attr
= axiom_attribute_create(this->env
, "value", buf
, NULL
);
312 axiom_element_add_attribute(el
, this->env
, attr
, node
);
314 attr
= axiom_attribute_create(this->env
, "type",
315 host
->get_family(host
) == AF_INET ?
"IPv4" : "IPv6", NULL
);
316 axiom_element_add_attribute(el
, this->env
, attr
, node
);
324 static axiom_node_t
* create_device(private_tnc_ifmap_soap_t
*this)
327 axiom_node_t
*node
, *node2
, *node3
;
330 el
= axiom_element_create(this->env
, NULL
, "device", NULL
, &node
);
331 el
= axiom_element_create(this->env
, NULL
, "name", NULL
, &node2
);
332 axiom_node_add_child(node
, this->env
, node2
);
333 text
= axiom_text_create(this->env
, node2
, this->device_name
, &node3
);
341 static axiom_node_t
* create_metadata(private_tnc_ifmap_soap_t
*this,
345 axiom_node_t
*node
, *node2
;
346 axiom_attribute_t
*attr
;
347 axiom_namespace_t
*ns_meta
;
349 el
= axiom_element_create(this->env
, NULL
, "metadata", NULL
, &node
);
350 ns_meta
= axiom_namespace_create(this->env
, IFMAP_META_NS
, "meta");
352 el
= axiom_element_create(this->env
, NULL
, metadata
, ns_meta
, &node2
);
353 axiom_node_add_child(node
, this->env
, node2
);
354 attr
= axiom_attribute_create(this->env
, "ifmap-cardinality", "singleValue",
356 axiom_element_add_attribute(el
, this->env
, attr
, node2
);
362 * Create capability metadata
364 static axiom_node_t
* create_capability(private_tnc_ifmap_soap_t
*this,
365 identification_t
*name
)
368 axiom_node_t
*node
, *node2
, *node3
;
369 axiom_namespace_t
*ns_meta
;
370 axiom_attribute_t
*attr
;
374 ns_meta
= axiom_namespace_create(this->env
, IFMAP_META_NS
, "meta");
375 el
= axiom_element_create(this->env
, NULL
, "capability", ns_meta
, &node
);
376 attr
= axiom_attribute_create(this->env
, "ifmap-cardinality", "multiValue",
378 axiom_element_add_attribute(el
, this->env
, attr
, node
);
380 el
= axiom_element_create(this->env
, NULL
, "name", NULL
, &node2
);
381 axiom_node_add_child(node
, this->env
, node2
);
382 snprintf(buf
, BUF_LEN
, "%Y", name
);
383 text
= axiom_text_create(this->env
, node2
, buf
, &node3
);
385 el
= axiom_element_create(this->env
, NULL
, "administrative-domain", NULL
, &node2
);
386 axiom_node_add_child(node
, this->env
, node2
);
387 text
= axiom_text_create(this->env
, node2
, "strongswan", &node3
);
393 * Create enforcement-report metadata
395 static axiom_node_t
* create_enforcement_report(private_tnc_ifmap_soap_t
*this,
396 char *action
, char *reason
)
399 axiom_node_t
*node
, *node2
, *node3
, *node4
;
400 axiom_namespace_t
*ns_meta
;
401 axiom_attribute_t
*attr
;
404 el
= axiom_element_create(this->env
, NULL
, "metadata", NULL
, &node
);
406 ns_meta
= axiom_namespace_create(this->env
, IFMAP_META_NS
, "meta");
407 el
= axiom_element_create(this->env
, NULL
, "enforcement-report", ns_meta
,
409 attr
= axiom_attribute_create(this->env
, "ifmap-cardinality",
411 axiom_element_add_attribute(el
, this->env
, attr
, node2
);
412 axiom_node_add_child(node
, this->env
, node2
);
414 el
= axiom_element_create(this->env
, NULL
, "enforcement-action", NULL
,
416 axiom_node_add_child(node2
, this->env
, node3
);
417 text
= axiom_text_create(this->env
, node3
, action
, &node4
);
419 el
= axiom_element_create(this->env
, NULL
, "enforcement-reason", NULL
,
421 axiom_node_add_child(node2
, this->env
, node3
);
422 text
= axiom_text_create(this->env
, node3
, reason
, &node4
);
428 * Create delete filter
430 static axiom_node_t
* create_delete_filter(private_tnc_ifmap_soap_t
*this,
435 axiom_attribute_t
*attr
;
438 el
= axiom_element_create(this->env
, NULL
, "delete", NULL
, &node
);
440 snprintf(buf
, BUF_LEN
, "meta:%s[@ifmap-publisher-id='%s']",
441 metadata
, this->ifmap_publisher_id
);
442 attr
= axiom_attribute_create(this->env
, "filter", buf
, NULL
);
443 axiom_element_add_attribute(el
, this->env
, attr
, node
);
449 * Create a publish request
451 static axiom_node_t
* create_publish_request(private_tnc_ifmap_soap_t
*this)
454 axiom_node_t
*request
;
455 axiom_namespace_t
*ns
, *ns_meta
;
456 axiom_attribute_t
*attr
;
458 ns
= axiom_namespace_create(this->env
, IFMAP_NS
, "ifmap");
459 el
= axiom_element_create(this->env
, NULL
, "publish", ns
, &request
);
460 ns_meta
= axiom_namespace_create(this->env
, IFMAP_META_NS
, "meta");
461 axiom_element_declare_namespace(el
, this->env
, request
, ns_meta
);
462 attr
= axiom_attribute_create(this->env
, "session-id", this->session_id
,
464 axiom_element_add_attribute(el
, this->env
, attr
, request
);
469 METHOD(tnc_ifmap_soap_t
, publish_ike_sa
, bool,
470 private_tnc_ifmap_soap_t
*this, ike_sa_t
*ike_sa
, bool up
)
472 axiom_node_t
*request
, *node
, *node2
;
475 enumerator_t
*e1
, *e2
;
477 identification_t
*id
, *eap_id
, *group
;
481 bool is_user
= FALSE
, first
= TRUE
;
483 /* extract relevant data from IKE_SA*/
484 ike_sa_id
= ike_sa
->get_unique_id(ike_sa
);
485 id
= ike_sa
->get_other_id(ike_sa
);
486 eap_id
= ike_sa
->get_other_eap_id(ike_sa
);
487 host
= ike_sa
->get_other_host(ike_sa
);
489 /* in the presence of an EAP Identity, treat it as a username */
490 if (!id
->equals(id
, eap_id
))
496 /* build publish request */
497 request
= create_publish_request(this);
499 /* delete any existing enforcement reports */
502 node
= create_delete_filter(this, "enforcement-report");
503 axiom_node_add_child(request
, this->env
, node
);
504 axiom_node_add_child(node
, this->env
,
505 create_ip_address(this, host
));
506 axiom_node_add_child(node
, this->env
,
507 create_device(this));
511 * update or delete authenticated-as metadata
515 el
= axiom_element_create(this->env
, NULL
, "update", NULL
, &node
);
519 node
= create_delete_filter(this, "authenticated-as");
521 axiom_node_add_child(request
, this->env
, node
);
523 /* add access-request, identity and [if up] metadata */
524 axiom_node_add_child(node
, this->env
,
525 create_access_request(this, ike_sa_id
));
526 axiom_node_add_child(node
, this->env
,
527 create_identity(this, id
, is_user
));
530 axiom_node_add_child(node
, this->env
,
531 create_metadata(this, "authenticated-as"));
535 * update or delete access-request-ip metadata
539 el
= axiom_element_create(this->env
, NULL
, "update", NULL
, &node
);
543 node
= create_delete_filter(this, "access-request-ip");
545 axiom_node_add_child(request
, this->env
, node
);
547 /* add access-request, ip-address and [if up] metadata */
548 axiom_node_add_child(node
, this->env
,
549 create_access_request(this, ike_sa_id
));
550 axiom_node_add_child(node
, this->env
,
551 create_ip_address(this, host
));
554 axiom_node_add_child(node
, this->env
,
555 create_metadata(this, "access-request-ip"));
559 * update or delete authenticated-by metadata
563 el
= axiom_element_create(this->env
, NULL
, "update", NULL
, &node
);
567 node
= create_delete_filter(this, "authenticated-by");
569 axiom_node_add_child(request
, this->env
, node
);
571 /* add access-request, device and [if up] metadata */
572 axiom_node_add_child(node
, this->env
,
573 create_access_request(this, ike_sa_id
));
574 axiom_node_add_child(node
, this->env
,
575 create_device(this));
578 axiom_node_add_child(node
, this->env
,
579 create_metadata(this, "authenticated-by"));
583 * update or delete capability metadata
585 e1
= ike_sa
->create_auth_cfg_enumerator(ike_sa
, FALSE
);
586 while (e1
->enumerate(e1
, &auth
))
588 e2
= auth
->create_enumerator(auth
);
589 while (e2
->enumerate(e2
, &type
, &group
))
591 /* look for group memberships */
592 if (type
== AUTH_RULE_GROUP
)
600 el
= axiom_element_create(this->env
, NULL
, "update",
605 node
= create_delete_filter(this, "capability");
607 axiom_node_add_child(request
, this->env
, node
);
609 /* add access-request */
610 axiom_node_add_child(node
, this->env
,
611 create_access_request(this, ike_sa_id
));
616 el
= axiom_element_create(this->env
, NULL
, "metadata", NULL
,
618 axiom_node_add_child(node
, this->env
, node2
);
620 axiom_node_add_child(node2
, this->env
,
621 create_capability(this, group
));
632 /* send publish request and receive publishReceived */
633 return send_receive(this, "publish", request
, "publishReceived", NULL
);
636 METHOD(tnc_ifmap_soap_t
, publish_device_ip
, bool,
637 private_tnc_ifmap_soap_t
*this, host_t
*host
)
639 axiom_node_t
*request
, *node
;
642 /* build publish update request */
643 request
= create_publish_request(this);
644 el
= axiom_element_create(this->env
, NULL
, "update", NULL
, &node
);
645 axiom_node_add_child(request
, this->env
, node
);
647 /* add device, ip-address and metadata */
648 axiom_node_add_child(node
, this->env
,
649 create_device(this));
650 axiom_node_add_child(node
, this->env
,
651 create_ip_address(this, host
));
652 axiom_node_add_child(node
, this->env
,
653 create_metadata(this, "device-ip"));
655 /* send publish request and receive publishReceived */
656 return send_receive(this, "publish", request
, "publishReceived", NULL
);
659 METHOD(tnc_ifmap_soap_t
, publish_enforcement_report
, bool,
660 private_tnc_ifmap_soap_t
*this, host_t
*host
, char *action
, char *reason
)
662 axiom_node_t
*request
, *node
;
665 /* build publish update request */
666 request
= create_publish_request(this);
667 el
= axiom_element_create(this->env
, NULL
, "update", NULL
, &node
);
668 axiom_node_add_child(request
, this->env
, node
);
670 /* add ip-address and metadata */
671 axiom_node_add_child(node
, this->env
,
672 create_ip_address(this, host
));
673 axiom_node_add_child(node
, this->env
,
674 create_device(this));
675 axiom_node_add_child(node
, this->env
,
676 create_enforcement_report(this, action
, reason
));
678 /* send publish request and receive publishReceived */
679 return send_receive(this, "publish", request
, "publishReceived", NULL
);
682 METHOD(tnc_ifmap_soap_t
, endSession
, bool,
683 private_tnc_ifmap_soap_t
*this)
685 axiom_node_t
*request
;
687 axiom_namespace_t
*ns
;
688 axiom_attribute_t
*attr
;
690 /* build endSession request */
691 ns
= axiom_namespace_create(this->env
, IFMAP_NS
, "ifmap");
692 el
= axiom_element_create(this->env
, NULL
, "endSession", ns
, &request
);
693 attr
= axiom_attribute_create(this->env
, "session-id", this->session_id
, NULL
);
694 axiom_element_add_attribute(el
, this->env
, attr
, request
);
696 /* send endSession request and receive end SessionResult */
697 return send_receive(this, "endSession", request
, "endSessionResult", NULL
);
700 METHOD(tnc_ifmap_soap_t
, destroy
, void,
701 private_tnc_ifmap_soap_t
*this)
703 if (this->session_id
)
706 free(this->session_id
);
707 free(this->ifmap_publisher_id
);
708 free(this->device_name
);
710 if (this->svc_client
)
712 axis2_svc_client_free(this->svc_client
, this->env
);
716 axutil_env_free(this->env
);
721 static bool axis2c_init(private_tnc_ifmap_soap_t
*this)
723 axis2_char_t
*server
, *server_cert
, *key_file
, *client_home
;
724 axis2_char_t
*ssl_passphrase
, *username
, *password
;
725 axis2_endpoint_ref_t
* endpoint_ref
= NULL
;
726 axis2_options_t
*options
= NULL
;
727 axis2_transport_in_desc_t
*transport_in
;
728 axis2_transport_out_desc_t
*transport_out
;
729 axis2_transport_sender_t
*transport_sender
;
730 axutil_property_t
* property
;
732 /* Getting configuration parameters from strongswan.conf */
733 client_home
= lib
->settings
->get_str(lib
->settings
,
734 "%s.plugins.tnc-ifmap.client_home",
735 AXIS2_GETENV("AXIS2C_HOME"), charon
->name
);
736 server
= lib
->settings
->get_str(lib
->settings
,
737 "%s.plugins.tnc-ifmap.server", IFMAP_SERVER
, charon
->name
);
738 server_cert
= lib
->settings
->get_str(lib
->settings
,
739 "%s.plugins.tnc-ifmap.server_cert", NULL
, charon
->name
);
740 key_file
= lib
->settings
->get_str(lib
->settings
,
741 "%s.plugins.tnc-ifmap.key_file", NULL
, charon
->name
);
742 ssl_passphrase
= lib
->settings
->get_str(lib
->settings
,
743 "%s.plugins.tnc-ifmap.ssl_passphrase", NULL
, charon
->name
);
744 username
= lib
->settings
->get_str(lib
->settings
,
745 "%s.plugins.tnc-ifmap.username", NULL
, charon
->name
);
746 password
= lib
->settings
->get_str(lib
->settings
,
747 "%s.plugins.tnc-ifmap.password", NULL
, charon
->name
);
751 DBG1(DBG_TNC
, "MAP server certificate not defined");
755 if (!key_file
&& (!username
|| !password
))
757 DBG1(DBG_TNC
, "MAP client keyfile or %s%s%s not defined",
758 (!username
) ?
"username" : "",
759 (!username
&& ! password
) ?
" and " : "",
760 (!password
) ?
"password" : "");
764 /* Create Axis2/C environment and options */
765 this->env
= axutil_env_create_all(IFMAP_LOGFILE
, AXIS2_LOG_LEVEL_TRACE
);
766 options
= axis2_options_create(this->env
);
768 /* Set path to the MAP server certificate */
769 property
=axutil_property_create_with_args(this->env
, 0, 0, 0,
771 axis2_options_set_property(options
, this->env
,
772 AXIS2_SSL_SERVER_CERT
, property
);
776 /* Set path to the MAP client certificate */
777 property
=axutil_property_create_with_args(this->env
, 0, 0, 0,
779 axis2_options_set_property(options
, this->env
,
780 AXIS2_SSL_KEY_FILE
, property
);
783 /* Provide SSL passphrase */
784 property
=axutil_property_create_with_args(this->env
, 0, 0, 0,
786 axis2_options_set_property(options
, this->env
,
787 AXIS2_SSL_PASSPHRASE
, property
);
792 /* Set up HTTP Basic MAP client authentication */
793 axis2_options_set_http_auth_info(options
, this->env
,
794 username
, password
, "Basic");
797 /* Define the MAP server as the to endpoint reference */
798 endpoint_ref
= axis2_endpoint_ref_create(this->env
, server
);
799 axis2_options_set_to(options
, this->env
, endpoint_ref
);
801 /* Set up https transport */
802 transport_in
= axis2_transport_in_desc_create(this->env
,
803 AXIS2_TRANSPORT_ENUM_HTTPS
);
804 transport_out
= axis2_transport_out_desc_create(this->env
,
805 AXIS2_TRANSPORT_ENUM_HTTPS
);
806 transport_sender
= axis2_http_transport_sender_create(this->env
);
807 axis2_transport_out_desc_set_sender(transport_out
, this->env
,
809 axis2_options_set_transport_in(options
, this->env
, transport_in
);
810 axis2_options_set_transport_out(options
, this->env
, transport_out
);
812 /* Create the axis2 service client */
813 this->svc_client
= axis2_svc_client_create(this->env
, client_home
);
814 if (!this->svc_client
)
816 DBG1(DBG_TNC
, "could not create axis2 service client");
817 AXIS2_LOG_ERROR(this->env
->log
, AXIS2_LOG_SI
,
818 "Stub invoke FAILED: Error code: %d :: %s",
819 this->env
->error
->error_number
,
820 AXIS2_ERROR_GET_MESSAGE(this->env
->error
));
825 axis2_svc_client_set_options(this->svc_client
, this->env
, options
);
826 DBG1(DBG_TNC
, "connecting as MAP client '%s' to MAP server at '%s'",
835 tnc_ifmap_soap_t
*tnc_ifmap_soap_create()
837 private_tnc_ifmap_soap_t
*this;
841 .newSession
= _newSession
,
842 .purgePublisher
= _purgePublisher
,
843 .publish_ike_sa
= _publish_ike_sa
,
844 .publish_device_ip
= _publish_device_ip
,
845 .publish_enforcement_report
= _publish_enforcement_report
,
846 .endSession
= _endSession
,
851 if (!axis2c_init(this))
857 return &this->public;