check for publishReceived response
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 7 Aug 2011 20:40:21 +0000 (22:40 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 10 Aug 2011 07:29:34 +0000 (09:29 +0200)
src/libcharon/plugins/tnc_ifmap/tnc_ifmap_listener.c

index 339df43..ed1f04e 100644 (file)
@@ -178,7 +178,9 @@ static bool publish(private_tnc_ifmap_listener_t *this, u_int32_t ike_sa_id,
        axiom_namespace_t *ns, *ns_meta;
        axiom_attribute_t *attr;
        axiom_text_t *text;
+       axutil_qname_t *qname;
        char buf[BUF_LEN], *id_type;
+       bool success = FALSE;
 
        /* build publish request */
        ns = axiom_namespace_create(this->env, IFMAP_NS, "ifmap");
@@ -365,6 +367,17 @@ static bool publish(private_tnc_ifmap_listener_t *this, u_int32_t ike_sa_id,
 
        /* process publishReceived */
        node = axiom_node_get_first_child(result, this->env);
+       if (node && axiom_node_get_node_type(node, this->env) == AXIOM_ELEMENT)
+       {
+               el = (axiom_element_t *)axiom_node_get_data_element(node, this->env);
+               qname = axiom_element_get_qname(el, this->env, node);
+               success = streq("publishReceived",
+                                               axutil_qname_to_string(qname, this->env));
+               if (!success)
+               {
+                       DBG1(DBG_TNC, "%s", axiom_element_to_string(el, this->env, node));
+               }
+       }
        axiom_node_free_tree(result, this->env);
 
    return TRUE;