You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2007/09/28 12:29:43 UTC
svn commit: r580289 [9/20] - in /webservices/axis2/trunk/c:
guththila/include/ guththila/samples/ guththila/src/ guththila/tests/
neethi/include/ neethi/src/ neethi/src/secpolicy/builder/
neethi/src/secpolicy/model/ neethi/test/ samples/client/echo/ sa...
Modified: webservices/axis2/trunk/c/neethi/src/policy.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/policy.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/policy.c (original)
+++ webservices/axis2/trunk/c/neethi/src/policy.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -15,31 +16,31 @@
* limitations under the License.
*/
-
-
#include <neethi_policy.h>
#include <neethi_engine.h>
struct neethi_policy_t
{
axutil_array_list_t *policy_components;
+
/* axutil_hash_t *attributes_map;*/
axis2_char_t *name;
axis2_char_t *id;
axiom_node_t *root_node;
};
-AXIS2_EXTERN neethi_policy_t *AXIS2_CALL
-neethi_policy_create(const axutil_env_t *env)
+AXIS2_EXTERN neethi_policy_t *AXIS2_CALL
+neethi_policy_create(
+ const axutil_env_t * env)
{
neethi_policy_t *neethi_policy = NULL;
AXIS2_ENV_CHECK(env, NULL);
- neethi_policy = (neethi_policy_t *) AXIS2_MALLOC (env->allocator,
- sizeof (neethi_policy_t));
+ neethi_policy = (neethi_policy_t *) AXIS2_MALLOC(env->allocator,
+ sizeof(neethi_policy_t));
- if(neethi_policy == NULL)
+ if (neethi_policy == NULL)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
@@ -47,23 +48,23 @@
neethi_policy->policy_components = NULL;
neethi_policy->policy_components = axutil_array_list_create(env, 0);
- if (!(neethi_policy->policy_components) )
+ if (!(neethi_policy->policy_components))
{
neethi_policy_free(neethi_policy, env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
/*
- neethi_policy->attributes_map = NULL;
+ neethi_policy->attributes_map = NULL;
- neethi_policy->attributes_map = axutil_hash_make(env);
- if (!(neethi_policy->attributes_map))
- {
- neethi_policy_free(neethi_policy, env);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
- */
+ neethi_policy->attributes_map = axutil_hash_make(env);
+ if (!(neethi_policy->attributes_map))
+ {
+ neethi_policy_free(neethi_policy, env);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ */
neethi_policy->name = NULL;
neethi_policy->id = NULL;
neethi_policy->root_node = NULL;
@@ -71,60 +72,62 @@
return neethi_policy;
}
-AXIS2_EXTERN void AXIS2_CALL
-neethi_policy_free(neethi_policy_t *neethi_policy,
- const axutil_env_t *env)
+AXIS2_EXTERN void AXIS2_CALL
+neethi_policy_free(
+ neethi_policy_t * neethi_policy,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- if(neethi_policy)
+ if (neethi_policy)
{
- if(neethi_policy->policy_components)
+ if (neethi_policy->policy_components)
{
int i = 0;
- for (i = 0; i < axutil_array_list_size(neethi_policy->policy_components,
- env); i++)
+ for (i = 0;
+ i < axutil_array_list_size(neethi_policy->policy_components,
+ env); i++)
{
neethi_operator_t *operator = NULL;
- operator = (neethi_operator_t *)
- axutil_array_list_get(neethi_policy->policy_components,env, i);
+ operator =(neethi_operator_t *)
+ axutil_array_list_get(neethi_policy->policy_components, env,
+ i);
if (operator)
neethi_operator_free(operator, env);
operator = NULL;
}
- axutil_array_list_free(neethi_policy->policy_components , env);
+ axutil_array_list_free(neethi_policy->policy_components, env);
neethi_policy->policy_components = NULL;
}
- if(neethi_policy->id)
+ if (neethi_policy->id)
{
AXIS2_FREE(env->allocator, neethi_policy->id);
neethi_policy->id = NULL;
- }
- if(neethi_policy->name)
+ }
+ if (neethi_policy->name)
{
AXIS2_FREE(env->allocator, neethi_policy->name);
neethi_policy->name = NULL;
- }
- if(neethi_policy->root_node)
+ }
+ if (neethi_policy->root_node)
{
axiom_node_free_tree(neethi_policy->root_node, env);
neethi_policy->root_node = NULL;
- }
+ }
AXIS2_FREE(env->allocator, neethi_policy);
neethi_policy = NULL;
}
return;
}
-
/* Implementations */
AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
neethi_policy_get_policy_components(
- neethi_policy_t *neethi_policy,
- const axutil_env_t *env)
+ neethi_policy_t * neethi_policy,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, NULL);
@@ -133,34 +136,33 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
neethi_policy_add_policy_components(
- neethi_policy_t *neethi_policy,
- axutil_array_list_t *arraylist,
- const axutil_env_t *env)
+ neethi_policy_t * neethi_policy,
+ axutil_array_list_t * arraylist,
+ const axutil_env_t * env)
{
- int size = axutil_array_list_size(arraylist,env);
+ int size = axutil_array_list_size(arraylist, env);
int i = 0;
- if (axutil_array_list_ensure_capacity(neethi_policy->policy_components , env, size + 1) != AXIS2_SUCCESS)
- return AXIS2_FAILURE;
+ if (axutil_array_list_ensure_capacity
+ (neethi_policy->policy_components, env, size + 1) != AXIS2_SUCCESS)
+ return AXIS2_FAILURE;
- for(i=0; i<size; i++)
+ for (i = 0; i < size; i++)
{
void *value = NULL;
- value = axutil_array_list_get(arraylist ,env ,i);
- neethi_operator_increment_ref((neethi_operator_t *)value, env);
+ value = axutil_array_list_get(arraylist, env, i);
+ neethi_operator_increment_ref((neethi_operator_t *) value, env);
axutil_array_list_add(neethi_policy->policy_components, env, value);
}
return AXIS2_SUCCESS;
}
-
-
AXIS2_EXTERN axis2_status_t AXIS2_CALL
neethi_policy_add_operator(
- neethi_policy_t *neethi_policy,
- const axutil_env_t *env,
- neethi_operator_t *operator)
+ neethi_policy_t * neethi_policy,
+ const axutil_env_t * env,
+ neethi_operator_t * operator)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -171,83 +173,83 @@
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
neethi_policy_is_empty(
- neethi_policy_t *neethi_policy,
- const axutil_env_t *env)
-
+ neethi_policy_t * neethi_policy,
+ const axutil_env_t * env)
{
- return axutil_array_list_is_empty(neethi_policy->policy_components , env);
+ return axutil_array_list_is_empty(neethi_policy->policy_components, env);
}
-AXIS2_EXTERN neethi_exactlyone_t *AXIS2_CALL
+AXIS2_EXTERN neethi_exactlyone_t *AXIS2_CALL
neethi_policy_get_exactlyone(
- neethi_policy_t *normalized_neethi_policy,
- const axutil_env_t *env)
+ neethi_policy_t * normalized_neethi_policy,
+ const axutil_env_t * env)
{
neethi_exactlyone_t *exactlyone = NULL;
axutil_array_list_t *list = NULL;
- list = neethi_policy_get_policy_components(normalized_neethi_policy,env);
- if(list)
+ list = neethi_policy_get_policy_components(normalized_neethi_policy, env);
+ if (list)
{
- if(axutil_array_list_size(list,env)==1)
+ if (axutil_array_list_size(list, env) == 1)
{
neethi_operator_t *op = NULL;
- op = (neethi_operator_t *)axutil_array_list_get(list,env,0);
- if(!op)
+ op = (neethi_operator_t *) axutil_array_list_get(list, env, 0);
+ if (!op)
{
return NULL;
- }
- if(neethi_operator_get_type(op,env) != OPERATOR_TYPE_EXACTLYONE)
+ }
+ if (neethi_operator_get_type(op, env) != OPERATOR_TYPE_EXACTLYONE)
{
return NULL;
- }
- exactlyone = (neethi_exactlyone_t *)neethi_operator_get_value(op,env);
+ }
+ exactlyone =
+ (neethi_exactlyone_t *) neethi_operator_get_value(op, env);
return exactlyone;
- }
+ }
else
return NULL;
- }
+ }
else
return NULL;
}
AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
neethi_policy_get_alternatives(
- neethi_policy_t *neethi_policy,
- const axutil_env_t *env)
+ neethi_policy_t * neethi_policy,
+ const axutil_env_t * env)
{
- /*neethi_policy_t *normalized = NULL;*/
+ /*neethi_policy_t *normalized = NULL; */
neethi_exactlyone_t *exactlyone = NULL;
- /*normalized = neethi_engine_get_normalize(env, AXIS2_FALSE, neethi_policy);*/
+ /*normalized = neethi_engine_get_normalize(env, AXIS2_FALSE, neethi_policy); */
/*if(!normalized)
- return NULL;*/
+ return NULL; */
exactlyone = neethi_policy_get_exactlyone(neethi_policy, env);
- if(!exactlyone)
+ if (!exactlyone)
return NULL;
-
- return neethi_exactlyone_get_policy_components(exactlyone, env);
+
+ return neethi_exactlyone_get_policy_components(exactlyone, env);
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
neethi_policy_get_name(
- neethi_policy_t *neethi_policy,
- const axutil_env_t *env)
+ neethi_policy_t * neethi_policy,
+ const axutil_env_t * env)
{
-
+
AXIS2_ENV_CHECK(env, NULL);
- return neethi_policy->name;
+ return neethi_policy->name;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
neethi_policy_set_name(
- neethi_policy_t *neethi_policy,
- const axutil_env_t *env,
- axis2_char_t *name)
+ neethi_policy_t * neethi_policy,
+ const axutil_env_t * env,
+ axis2_char_t * name)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
neethi_policy->name = name;
@@ -256,33 +258,32 @@
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
neethi_policy_get_id(
- neethi_policy_t *neethi_policy,
- const axutil_env_t *env)
+ neethi_policy_t * neethi_policy,
+ const axutil_env_t * env)
{
-
+
AXIS2_ENV_CHECK(env, NULL);
- return neethi_policy->id;
+ return neethi_policy->id;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
neethi_policy_set_id(
- neethi_policy_t *neethi_policy,
- const axutil_env_t *env,
- axis2_char_t *id)
+ neethi_policy_t * neethi_policy,
+ const axutil_env_t * env,
+ axis2_char_t * id)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- /*neethi_policy->id = id;*/
+ /*neethi_policy->id = id; */
neethi_policy->id = axutil_strdup(env, id);
return AXIS2_SUCCESS;
}
-
/*This function is for serializing*/
AXIS2_EXTERN axiom_node_t *AXIS2_CALL
neethi_policy_serialize(
- neethi_policy_t *neethi_policy,
- axiom_node_t *parent,
- const axutil_env_t *env)
+ neethi_policy_t * neethi_policy,
+ axiom_node_t * parent,
+ const axutil_env_t * env)
{
axiom_node_t *policy_node = NULL;
@@ -291,44 +292,45 @@
axutil_array_list_t *components = NULL;
axis2_status_t status = AXIS2_FAILURE;
- policy_ns = axiom_namespace_create(env, NEETHI_NAMESPACE,
- NEETHI_PREFIX);
+ policy_ns = axiom_namespace_create(env, NEETHI_NAMESPACE, NEETHI_PREFIX);
- policy_ele = axiom_element_create(env, parent, NEETHI_POLICY, policy_ns, &policy_node);
+ policy_ele =
+ axiom_element_create(env, parent, NEETHI_POLICY, policy_ns,
+ &policy_node);
if (!policy_ele)
{
- /*printf("Policy element serialization failed.\n");*/
+ /*printf("Policy element serialization failed.\n"); */
return NULL;
}
components = neethi_policy_get_policy_components(neethi_policy, env);
- if(components)
+ if (components)
{
- int i=0;
- for (i = 0; i < axutil_array_list_size(components ,
- env); i++)
+ int i = 0;
+ for (i = 0; i < axutil_array_list_size(components, env); i++)
{
neethi_operator_t *operator = NULL;
- operator = (neethi_operator_t *)axutil_array_list_get(components, env, i);
- if(operator)
+ operator =(neethi_operator_t *) axutil_array_list_get(components,
+ env, i);
+ if (operator)
{
status = neethi_operator_serialize(operator, env, policy_node);
- if(status != AXIS2_SUCCESS)
+ if (status != AXIS2_SUCCESS)
{
- /*printf("Operator Serializing failed\n");*/
+ /*printf("Operator Serializing failed\n"); */
return NULL;
}
}
- }
- }
+ }
+ }
return policy_node;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
neethi_policy_set_components_null(
- neethi_policy_t *policy,
- const axutil_env_t *env)
+ neethi_policy_t * policy,
+ const axutil_env_t * env)
{
policy->policy_components = NULL;
return AXIS2_SUCCESS;
@@ -336,13 +338,10 @@
AXIS2_EXTERN axis2_status_t AXIS2_CALL
neethi_policy_set_root_node(
- neethi_policy_t *policy,
- const axutil_env_t *env,
- axiom_node_t *root_node)
+ neethi_policy_t * policy,
+ const axutil_env_t * env,
+ axiom_node_t * root_node)
{
policy->root_node = root_node;
return AXIS2_SUCCESS;
}
-
-
-
Modified: webservices/axis2/trunk/c/neethi/src/reference.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/reference.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/reference.c (original)
+++ webservices/axis2/trunk/c/neethi/src/reference.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -15,8 +16,6 @@
* limitations under the License.
*/
-
-
#include <neethi_reference.h>
struct neethi_reference_t
@@ -24,17 +23,19 @@
axis2_char_t *uri;
};
-AXIS2_EXTERN neethi_reference_t *AXIS2_CALL
-neethi_reference_create(const axutil_env_t *env)
+AXIS2_EXTERN neethi_reference_t *AXIS2_CALL
+neethi_reference_create(
+ const axutil_env_t * env)
{
neethi_reference_t *neethi_reference = NULL;
AXIS2_ENV_CHECK(env, NULL);
- neethi_reference = (neethi_reference_t *) AXIS2_MALLOC (env->allocator,
- sizeof (neethi_reference_t));
+ neethi_reference = (neethi_reference_t *) AXIS2_MALLOC(env->allocator,
+ sizeof
+ (neethi_reference_t));
- if(neethi_reference == NULL)
+ if (neethi_reference == NULL)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
@@ -44,38 +45,38 @@
return neethi_reference;
}
-AXIS2_EXTERN void AXIS2_CALL
-neethi_reference_free(neethi_reference_t *neethi_reference,
- const axutil_env_t *env)
+AXIS2_EXTERN void AXIS2_CALL
+neethi_reference_free(
+ neethi_reference_t * neethi_reference,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- if(neethi_reference)
- {
- AXIS2_FREE(env->allocator,neethi_reference);
+ if (neethi_reference)
+ {
+ AXIS2_FREE(env->allocator, neethi_reference);
neethi_reference = NULL;
}
return;
}
-
/* Implementations */
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
neethi_reference_get_uri(
- neethi_reference_t *neethi_reference,
- const axutil_env_t *env)
+ neethi_reference_t * neethi_reference,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
return neethi_reference->uri;
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
neethi_reference_set_uri(
- neethi_reference_t *neethi_reference,
- const axutil_env_t *env,
- axis2_char_t *uri)
+ neethi_reference_t * neethi_reference,
+ const axutil_env_t * env,
+ axis2_char_t * uri)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -83,34 +84,33 @@
return AXIS2_SUCCESS;
}
-
-
AXIS2_EXTERN axis2_status_t AXIS2_CALL
neethi_reference_serialize(
- neethi_reference_t *neethi_reference,
- axiom_node_t *parent,
- const axutil_env_t *env)
+ neethi_reference_t * neethi_reference,
+ axiom_node_t * parent,
+ const axutil_env_t * env)
{
axiom_node_t *ref_node = NULL;
axiom_element_t *ref_ele = NULL;
axiom_namespace_t *policy_ns = NULL;
axiom_attribute_t *att_uri = NULL;
-
- policy_ns = axiom_namespace_create(env, NEETHI_NAMESPACE,
- NEETHI_PREFIX);
+ policy_ns = axiom_namespace_create(env, NEETHI_NAMESPACE, NEETHI_PREFIX);
- ref_ele = axiom_element_create(env, parent, NEETHI_REFERENCE, policy_ns, &ref_node);
+ ref_ele =
+ axiom_element_create(env, parent, NEETHI_REFERENCE, policy_ns,
+ &ref_node);
if (!ref_node)
{
- /*printf("Reference serialization failed\n");*/
+ /*printf("Reference serialization failed\n"); */
return AXIS2_FAILURE;
}
-
- att_uri = axiom_attribute_create(env, NEETHI_URI, neethi_reference->uri, NULL);
+
+ att_uri =
+ axiom_attribute_create(env, NEETHI_URI, neethi_reference->uri, NULL);
axiom_element_add_attribute(ref_ele, env, att_uri, ref_node);
return AXIS2_SUCCESS;
-
+
}
Modified: webservices/axis2/trunk/c/neethi/src/registry.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/registry.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/registry.c (original)
+++ webservices/axis2/trunk/c/neethi/src/registry.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -15,8 +16,6 @@
* limitations under the License.
*/
-
-
#include <neethi_registry.h>
struct neethi_registry_t
@@ -25,17 +24,19 @@
neethi_registry_t *parent;
};
-AXIS2_EXTERN neethi_registry_t *AXIS2_CALL
-neethi_registry_create(const axutil_env_t *env)
+AXIS2_EXTERN neethi_registry_t *AXIS2_CALL
+neethi_registry_create(
+ const axutil_env_t * env)
{
neethi_registry_t *neethi_registry = NULL;
AXIS2_ENV_CHECK(env, NULL);
- neethi_registry = (neethi_registry_t *) AXIS2_MALLOC (env->allocator,
- sizeof (neethi_registry_t));
+ neethi_registry = (neethi_registry_t *) AXIS2_MALLOC(env->allocator,
+ sizeof
+ (neethi_registry_t));
- if(neethi_registry == NULL)
+ if (neethi_registry == NULL)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
@@ -56,79 +57,78 @@
AXIS2_EXTERN neethi_registry_t *AXIS2_CALL
neethi_registry_create_with_parent(
- const axutil_env_t *env,
- neethi_registry_t *parent)
+ const axutil_env_t * env,
+ neethi_registry_t * parent)
{
neethi_registry_t *neethi_registry = NULL;
-
+
neethi_registry = neethi_registry_create(env);
- if(!neethi_registry)
+ if (!neethi_registry)
return NULL;
-
+
neethi_registry->parent = parent;
return neethi_registry;
}
-
-AXIS2_EXTERN void AXIS2_CALL
-neethi_registry_free(neethi_registry_t *neethi_registry,
- const axutil_env_t *env)
+AXIS2_EXTERN void AXIS2_CALL
+neethi_registry_free(
+ neethi_registry_t * neethi_registry,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
+
if (neethi_registry->registry)
{
axutil_hash_index_t *hi = NULL;
void *val = NULL;
for (hi = axutil_hash_first(neethi_registry->registry, env); hi;
- hi = axutil_hash_next(env, hi))
+ hi = axutil_hash_next(env, hi))
{
neethi_policy_t *neethi_policy = NULL;
axutil_hash_this(hi, NULL, NULL, &val);
neethi_policy = (neethi_policy_t *) val;
if (neethi_policy)
- neethi_policy_free(neethi_policy, env);
+ neethi_policy_free(neethi_policy, env);
val = NULL;
neethi_policy = NULL;
}
- axutil_hash_free(neethi_registry->registry , env);
+ axutil_hash_free(neethi_registry->registry, env);
}
- if(neethi_registry->parent)
+ if (neethi_registry->parent)
{
- /*neethi_registry_free(neethi_registry->parent, env);*/
+ /*neethi_registry_free(neethi_registry->parent, env); */
neethi_registry->parent = NULL;
}
- AXIS2_FREE(env->allocator,neethi_registry);
+ AXIS2_FREE(env->allocator, neethi_registry);
}
-
/* Implementations */
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
neethi_registry_register(
- neethi_registry_t *neethi_registry,
- const axutil_env_t *env,
- axis2_char_t *key,
- neethi_policy_t *value)
-
+ neethi_registry_t * neethi_registry,
+ const axutil_env_t * env,
+ axis2_char_t * key,
+ neethi_policy_t * value)
{
- axutil_hash_set(neethi_registry->registry, key , AXIS2_HASH_KEY_STRING, value);
+ axutil_hash_set(neethi_registry->registry, key, AXIS2_HASH_KEY_STRING,
+ value);
return AXIS2_SUCCESS;
}
-AXIS2_EXTERN neethi_policy_t *AXIS2_CALL
+AXIS2_EXTERN neethi_policy_t *AXIS2_CALL
neethi_registry_lookup(
- neethi_registry_t *neethi_registry,
- const axutil_env_t *env,
- axis2_char_t *key)
+ neethi_registry_t * neethi_registry,
+ const axutil_env_t * env,
+ axis2_char_t * key)
{
neethi_policy_t *policy = NULL;
- policy = (neethi_policy_t *)axutil_hash_get(neethi_registry->registry,key ,
- AXIS2_HASH_KEY_STRING);
+ policy = (neethi_policy_t *) axutil_hash_get(neethi_registry->registry, key,
+ AXIS2_HASH_KEY_STRING);
- if(!policy && neethi_registry->parent)
+ if (!policy && neethi_registry->parent)
{
return neethi_registry_lookup(neethi_registry->parent, env, key);
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/algorithmsuite_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/algorithmsuite_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/algorithmsuite_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/algorithmsuite_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -22,13 +23,11 @@
#include <neethi_all.h>
#include <neethi_engine.h>
-
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
rp_algorithmsuite_builder_build(
- const axutil_env_t *env,
- axiom_node_t *node,
- axiom_element_t *element)
+ const axutil_env_t * env,
+ axiom_node_t * node,
+ axiom_element_t * element)
{
rp_algorithmsuite_t *algorithmsuite = NULL;
axiom_node_t *child_node = NULL;
@@ -37,40 +36,48 @@
neethi_assertion_t *assertion = NULL;
algorithmsuite = rp_algorithmsuite_create(env);
-
- child_node = axiom_node_get_first_element(node,env);
- if(child_node)
+ child_node = axiom_node_get_first_element(node, env);
+
+ if (child_node)
{
algo_node = axiom_node_get_first_element(child_node, env);
- if(!algo_node)
+ if (!algo_node)
{
return NULL;
- }
+ }
}
else
{
return NULL;
- }
+ }
- if(axiom_node_get_node_type(algo_node, env) == AXIOM_ELEMENT)
+ if (axiom_node_get_node_type(algo_node, env) == AXIOM_ELEMENT)
{
- algo_element = (axiom_element_t*)axiom_node_get_data_element(algo_node, env);
- if(algo_element)
+ algo_element =
+ (axiom_element_t *) axiom_node_get_data_element(algo_node, env);
+ if (algo_element)
{
axis2_char_t *algosuite_string = NULL;
algosuite_string = axiom_element_get_localname(algo_element, env);
- if(!algosuite_string)
- {
+ if (!algosuite_string)
+ {
return NULL;
- }
- rp_algorithmsuite_set_algosuite(algorithmsuite, env, algosuite_string);
- assertion = neethi_assertion_create_with_args(env, (void *)rp_algorithmsuite_free,
- algorithmsuite, ASSERTION_TYPE_ALGORITHM_SUITE);
+ }
+ rp_algorithmsuite_set_algosuite(algorithmsuite, env,
+ algosuite_string);
+ assertion =
+ neethi_assertion_create_with_args(env,
+ (void *)
+ rp_algorithmsuite_free,
+ algorithmsuite,
+ ASSERTION_TYPE_ALGORITHM_SUITE);
return assertion;
}
- else return NULL;
+ else
+ return NULL;
}
- else return NULL;
+ else
+ return NULL;
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/asymmetric_binding_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/asymmetric_binding_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/asymmetric_binding_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/asymmetric_binding_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -24,21 +25,18 @@
/*private functions*/
-axis2_status_t AXIS2_CALL
-asymmetric_binding_process_alternatives(
- const axutil_env_t *env,
- neethi_all_t *all,
- rp_asymmetric_binding_t *asymmetric_binding);
+axis2_status_t AXIS2_CALL asymmetric_binding_process_alternatives(
+ const axutil_env_t * env,
+ neethi_all_t * all,
+ rp_asymmetric_binding_t * asymmetric_binding);
/***********************************/
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
rp_asymmetric_binding_builder_build(
- const axutil_env_t *env,
- axiom_node_t *node,
- axiom_element_t *element)
-
+ const axutil_env_t * env,
+ axiom_node_t * node,
+ axiom_element_t * element)
{
rp_asymmetric_binding_t *asymmetric_binding = NULL;
neethi_policy_t *policy = NULL;
@@ -51,54 +49,66 @@
neethi_policy_t *normalized_policy = NULL;
asymmetric_binding = rp_asymmetric_binding_create(env);
-
- child_node = axiom_node_get_first_element(node,env);
- if(!child_node)
+
+ child_node = axiom_node_get_first_element(node, env);
+ if (!child_node)
{
return NULL;
- }
+ }
- if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+ if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
{
- child_element = (axiom_element_t*)axiom_node_get_data_element(child_node, env);
- if(child_element)
+ child_element =
+ (axiom_element_t *) axiom_node_get_data_element(child_node, env);
+ if (child_element)
{
policy = neethi_engine_get_policy(env, child_node, child_element);
- if(!policy)
+ if (!policy)
{
return NULL;
}
- normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
- alternatives = neethi_policy_get_alternatives(normalized_policy, env);
+ normalized_policy =
+ neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+ alternatives =
+ neethi_policy_get_alternatives(normalized_policy, env);
neethi_policy_free(policy, env);
policy = NULL;
- component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
- all = (neethi_all_t *)neethi_operator_get_value(component ,env);
- asymmetric_binding_process_alternatives(env, all, asymmetric_binding);
-
- assertion = neethi_assertion_create_with_args(env, (void *)rp_asymmetric_binding_free,
- asymmetric_binding, ASSERTION_TYPE_ASSYMMETRIC_BINDING);
+ component =
+ (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+ 0);
+ all = (neethi_all_t *) neethi_operator_get_value(component, env);
+ asymmetric_binding_process_alternatives(env, all,
+ asymmetric_binding);
+
+ assertion =
+ neethi_assertion_create_with_args(env,
+ (void *)
+ rp_asymmetric_binding_free,
+ asymmetric_binding,
+ ASSERTION_TYPE_ASSYMMETRIC_BINDING);
neethi_policy_free(normalized_policy, env);
normalized_policy = NULL;
return assertion;
}
- else return NULL;
+ else
+ return NULL;
}
- else return NULL;
+ else
+ return NULL;
}
axis2_status_t AXIS2_CALL
asymmetric_binding_process_alternatives(
- const axutil_env_t *env,
- neethi_all_t *all,
- rp_asymmetric_binding_t *asymmetric_binding)
+ const axutil_env_t * env,
+ neethi_all_t * all,
+ rp_asymmetric_binding_t * asymmetric_binding)
{
neethi_operator_t *operator = NULL;
axutil_array_list_t *arraylist = NULL;
neethi_assertion_t *assertion = NULL;
- neethi_assertion_type_t type;
+ neethi_assertion_type_t type;
void *value = NULL;
rp_binding_commons_t *commons = NULL;
rp_symmetric_asymmetric_binding_commons_t *as_commons = NULL;
@@ -106,115 +116,132 @@
int i = 0;
arraylist = neethi_all_get_policy_components(all, env);
- commons = rp_binding_commons_create(env);
+ commons = rp_binding_commons_create(env);
as_commons = rp_symmetric_asymmetric_binding_commons_create(env);
- for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+ for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
{
- operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
- assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
+ operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+ i);
+ assertion =
+ (neethi_assertion_t *) neethi_operator_get_value(operator, env);
value = neethi_assertion_get_value(assertion, env);
type = neethi_assertion_get_type(assertion, env);
- if(type == ASSERTION_TYPE_INITIATOR_TOKEN)
+ if (type == ASSERTION_TYPE_INITIATOR_TOKEN)
{
- rp_property_t *initiator_token = NULL;
- initiator_token = (rp_property_t *)neethi_assertion_get_value(assertion, env);
- if(initiator_token)
+ rp_property_t *initiator_token = NULL;
+ initiator_token =
+ (rp_property_t *) neethi_assertion_get_value(assertion, env);
+ if (initiator_token)
{
- rp_asymmetric_binding_set_initiator_token(asymmetric_binding,
- env, initiator_token);
+ rp_asymmetric_binding_set_initiator_token(asymmetric_binding,
+ env, initiator_token);
}
- else return AXIS2_FAILURE;
+ else
+ return AXIS2_FAILURE;
}
- else if(type == ASSERTION_TYPE_RECIPIENT_TOKEN)
+ else if (type == ASSERTION_TYPE_RECIPIENT_TOKEN)
{
- rp_property_t *recipient_token = NULL;
- recipient_token = (rp_property_t *)neethi_assertion_get_value(assertion, env);
- if(recipient_token)
+ rp_property_t *recipient_token = NULL;
+ recipient_token =
+ (rp_property_t *) neethi_assertion_get_value(assertion, env);
+ if (recipient_token)
{
- rp_asymmetric_binding_set_recipient_token(asymmetric_binding,
- env, recipient_token);
+ rp_asymmetric_binding_set_recipient_token(asymmetric_binding,
+ env, recipient_token);
}
- else return AXIS2_FAILURE;
+ else
+ return AXIS2_FAILURE;
}
- else if(type == ASSERTION_TYPE_ALGORITHM_SUITE)
+ else if (type == ASSERTION_TYPE_ALGORITHM_SUITE)
{
rp_algorithmsuite_t *algorithmsuite = NULL;
- algorithmsuite = (rp_algorithmsuite_t *)neethi_assertion_get_value(assertion, env);
- if(algorithmsuite)
+ algorithmsuite =
+ (rp_algorithmsuite_t *) neethi_assertion_get_value(assertion,
+ env);
+ if (algorithmsuite)
{
- rp_binding_commons_set_algorithmsuite(commons, env, algorithmsuite);
- }
- else return AXIS2_FAILURE;
+ rp_binding_commons_set_algorithmsuite(commons, env,
+ algorithmsuite);
+ }
+ else
+ return AXIS2_FAILURE;
}
- else if(type == ASSERTION_TYPE_INCLUDE_TIMESTAMP)
+ else if (type == ASSERTION_TYPE_INCLUDE_TIMESTAMP)
{
rp_binding_commons_set_include_timestamp(commons, env, AXIS2_TRUE);
}
- else if(type == ASSERTION_TYPE_LAYOUT)
+ else if (type == ASSERTION_TYPE_LAYOUT)
{
rp_layout_t *layout = NULL;
- layout = (rp_layout_t *)neethi_assertion_get_value(assertion, env);
- if(layout)
+ layout = (rp_layout_t *) neethi_assertion_get_value(assertion, env);
+ if (layout)
{
rp_binding_commons_set_layout(commons, env, layout);
- }
- else return AXIS2_FAILURE;
+ }
+ else
+ return AXIS2_FAILURE;
}
- else if(type == ASSERTION_TYPE_ENCRYPT_BEFORE_SIGNING)
+ else if (type == ASSERTION_TYPE_ENCRYPT_BEFORE_SIGNING)
{
- rp_symmetric_asymmetric_binding_commons_set_protection_order(
- as_commons, env, RP_ENCRYPT_BEFORE_SIGNING);
- }
- else if(type == ASSERTION_TYPE_SIGN_BEFORE_ENCRYPTING)
+ rp_symmetric_asymmetric_binding_commons_set_protection_order
+ (as_commons, env, RP_ENCRYPT_BEFORE_SIGNING);
+ }
+ else if (type == ASSERTION_TYPE_SIGN_BEFORE_ENCRYPTING)
{
- rp_symmetric_asymmetric_binding_commons_set_protection_order(
- as_commons, env, RP_SIGN_BEFORE_ENCRYPTING);
+ rp_symmetric_asymmetric_binding_commons_set_protection_order
+ (as_commons, env, RP_SIGN_BEFORE_ENCRYPTING);
}
- else if(type == ASSERTION_TYPE_ENCRYPT_SIGNATURE)
+ else if (type == ASSERTION_TYPE_ENCRYPT_SIGNATURE)
{
- rp_symmetric_asymmetric_binding_commons_set_signature_protection(
- as_commons, env, AXIS2_TRUE);
+ rp_symmetric_asymmetric_binding_commons_set_signature_protection
+ (as_commons, env, AXIS2_TRUE);
}
- else if(type == ASSERTION_TYPE_PROTECT_TOKENS)
+ else if (type == ASSERTION_TYPE_PROTECT_TOKENS)
{
- rp_symmetric_asymmetric_binding_commons_set_token_protection(
- as_commons, env, AXIS2_TRUE);
- }
- else if(type == ASSERTION_TYPE_ONLY_SIGN_ENTIRE_HEADERS_AND_BODY)
+ rp_symmetric_asymmetric_binding_commons_set_token_protection
+ (as_commons, env, AXIS2_TRUE);
+ }
+ else if (type == ASSERTION_TYPE_ONLY_SIGN_ENTIRE_HEADERS_AND_BODY)
{
- rp_symmetric_asymmetric_binding_commons_set_entire_headers_and_body_signatures(
- as_commons, env, AXIS2_TRUE);
+ rp_symmetric_asymmetric_binding_commons_set_entire_headers_and_body_signatures
+ (as_commons, env, AXIS2_TRUE);
}
- else if(type == ASSERTION_TYPE_SUPPORTING_TOKENS)
+ else if (type == ASSERTION_TYPE_SUPPORTING_TOKENS)
{
rp_supporting_tokens_t *supporting_tokens = NULL;
- supporting_tokens = (rp_supporting_tokens_t *)neethi_assertion_get_value(assertion, env);
- if(supporting_tokens)
+ supporting_tokens =
+ (rp_supporting_tokens_t *) neethi_assertion_get_value(assertion,
+ env);
+ if (supporting_tokens)
{
rp_property_type_t type;
type = rp_supporting_tokens_get_type(supporting_tokens, env);
- if(type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
+ if (type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
{
- rp_binding_commons_set_signed_supporting_tokens(
- commons, env, supporting_tokens);
- }
- else if(type == RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN)
+ rp_binding_commons_set_signed_supporting_tokens(commons,
+ env,
+ supporting_tokens);
+ }
+ else if (type == RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN)
{
- rp_binding_commons_set_signed_endorsing_supporting_tokens(
- commons, env, supporting_tokens);
- }
- else return AXIS2_FAILURE;
- }
- else return AXIS2_FAILURE;
+ rp_binding_commons_set_signed_endorsing_supporting_tokens
+ (commons, env, supporting_tokens);
+ }
+ else
+ return AXIS2_FAILURE;
+ }
+ else
+ return AXIS2_FAILURE;
}
- else return AXIS2_FAILURE;
+ else
+ return AXIS2_FAILURE;
}
- rp_symmetric_asymmetric_binding_commons_set_binding_commons(
- as_commons, env, commons);
- rp_asymmetric_binding_set_symmetric_asymmetric_binding_commons(
- asymmetric_binding, env, as_commons);
+ rp_symmetric_asymmetric_binding_commons_set_binding_commons(as_commons, env,
+ commons);
+ rp_asymmetric_binding_set_symmetric_asymmetric_binding_commons
+ (asymmetric_binding, env, as_commons);
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/https_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/https_token_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/https_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/https_token_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -22,13 +23,11 @@
#include <neethi_all.h>
#include <neethi_engine.h>
-
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
rp_https_token_builder_build(
- const axutil_env_t *env,
- axiom_node_t *node,
- axiom_element_t *element)
+ const axutil_env_t * env,
+ axiom_node_t * node,
+ axiom_element_t * element)
{
rp_https_token_t *https_token = NULL;
neethi_assertion_t *assertion = NULL;
@@ -36,25 +35,29 @@
https_token = rp_https_token_create(env);
- value = axiom_element_get_attribute_value_by_name(
- element, env, RP_REQUIRE_CLIENT_CERTIFICATE);
+ value =
+ axiom_element_get_attribute_value_by_name(element, env,
+ RP_REQUIRE_CLIENT_CERTIFICATE);
- if(value)
+ if (value)
{
- if(axutil_strcmp(value,"true")==0)
+ if (axutil_strcmp(value, "true") == 0)
{
- rp_https_token_set_require_client_certificate(
- https_token, env, AXIS2_TRUE);
+ rp_https_token_set_require_client_certificate(https_token, env,
+ AXIS2_TRUE);
}
- else if(axutil_strcmp(value,"false")==0)
+ else if (axutil_strcmp(value, "false") == 0)
{
- rp_https_token_set_require_client_certificate(
- https_token, env, AXIS2_FALSE);
+ rp_https_token_set_require_client_certificate(https_token, env,
+ AXIS2_FALSE);
}
- else return NULL;
+ else
+ return NULL;
}
- assertion = neethi_assertion_create_with_args(
- env, (void *)rp_https_token_free, https_token, ASSERTION_TYPE_HTTPS_TOKEN);
+ assertion =
+ neethi_assertion_create_with_args(env, (void *) rp_https_token_free,
+ https_token,
+ ASSERTION_TYPE_HTTPS_TOKEN);
return assertion;
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/initiator_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/initiator_token_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/initiator_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/initiator_token_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -25,21 +26,18 @@
/*private functions*/
-axis2_status_t AXIS2_CALL
-initiator_token_process_alternatives(
- const axutil_env_t *env,
- neethi_all_t *all,
- rp_property_t *initiator_token);
+axis2_status_t AXIS2_CALL initiator_token_process_alternatives(
+ const axutil_env_t * env,
+ neethi_all_t * all,
+ rp_property_t * initiator_token);
/***********************************/
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
rp_initiator_token_builder_build(
- const axutil_env_t *env,
- axiom_node_t *node,
- axiom_element_t *element)
-
+ const axutil_env_t * env,
+ axiom_node_t * node,
+ axiom_element_t * element)
{
rp_property_t *initiator_token = NULL;
neethi_policy_t *policy = NULL;
@@ -52,84 +50,101 @@
neethi_policy_t *normalized_policy = NULL;
initiator_token = rp_property_create(env);
-
+
child_node = axiom_node_get_first_element(node, env);
- if(!child_node)
+ if (!child_node)
{
return NULL;
- }
+ }
- if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+ if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
{
- child_element = (axiom_element_t*)axiom_node_get_data_element(child_node, env);
- if(child_element)
+ child_element =
+ (axiom_element_t *) axiom_node_get_data_element(child_node, env);
+ if (child_element)
{
policy = neethi_engine_get_policy(env, child_node, child_element);
- if(!policy)
+ if (!policy)
{
return NULL;
}
- normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+ normalized_policy =
+ neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
neethi_policy_free(policy, env);
policy = NULL;
- alternatives = neethi_policy_get_alternatives(normalized_policy, env);
- component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
- all = (neethi_all_t *)neethi_operator_get_value(component ,env);
+ alternatives =
+ neethi_policy_get_alternatives(normalized_policy, env);
+ component =
+ (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+ 0);
+ all = (neethi_all_t *) neethi_operator_get_value(component, env);
initiator_token_process_alternatives(env, all, initiator_token);
- assertion = neethi_assertion_create_with_args(
- env, (void *)rp_property_free, initiator_token, ASSERTION_TYPE_INITIATOR_TOKEN);
+ assertion =
+ neethi_assertion_create_with_args(env,
+ (void *) rp_property_free,
+ initiator_token,
+ ASSERTION_TYPE_INITIATOR_TOKEN);
neethi_policy_free(normalized_policy, env);
normalized_policy = NULL;
return assertion;
}
- else return NULL;
+ else
+ return NULL;
}
- else return NULL;
+ else
+ return NULL;
}
axis2_status_t AXIS2_CALL
initiator_token_process_alternatives(
- const axutil_env_t *env,
- neethi_all_t *all,
- rp_property_t *initiator_token)
+ const axutil_env_t * env,
+ neethi_all_t * all,
+ rp_property_t * initiator_token)
{
neethi_operator_t *operator = NULL;
axutil_array_list_t *arraylist = NULL;
neethi_assertion_t *assertion = NULL;
- neethi_assertion_type_t type;
+ neethi_assertion_type_t type;
void *value = NULL;
int i = 0;
arraylist = neethi_all_get_policy_components(all, env);
- for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+ for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
{
- operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
- assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
+ operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+ i);
+ assertion =
+ (neethi_assertion_t *) neethi_operator_get_value(operator, env);
value = neethi_assertion_get_value(assertion, env);
type = neethi_assertion_get_type(assertion, env);
- if(value)
+ if (value)
{
- if(type == ASSERTION_TYPE_X509_TOKEN)
+ if (type == ASSERTION_TYPE_X509_TOKEN)
{
- rp_x509_token_t *x509_token = NULL;
- x509_token = (rp_x509_token_t *)neethi_assertion_get_value(assertion, env);
- if(x509_token)
+ rp_x509_token_t *x509_token = NULL;
+ x509_token =
+ (rp_x509_token_t *) neethi_assertion_get_value(assertion,
+ env);
+ if (x509_token)
{
- rp_property_set_value(
- initiator_token, env, x509_token, RP_PROPERTY_X509_TOKEN);
+ rp_property_set_value(initiator_token, env, x509_token,
+ RP_PROPERTY_X509_TOKEN);
}
- else return AXIS2_FAILURE;
+ else
+ return AXIS2_FAILURE;
}
- else return AXIS2_FAILURE;
+ else
+ return AXIS2_FAILURE;
}
- else return AXIS2_FAILURE;
- }
+ else
+ return AXIS2_FAILURE;
+ }
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/layout_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/layout_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/layout_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/layout_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -22,14 +23,11 @@
#include <neethi_all.h>
#include <neethi_engine.h>
-
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
rp_layout_builder_build(
- const axutil_env_t *env,
- axiom_node_t *node,
- axiom_element_t *element)
-
+ const axutil_env_t * env,
+ axiom_node_t * node,
+ axiom_element_t * element)
{
rp_layout_t *layout = NULL;
axiom_node_t *child_node = NULL;
@@ -38,39 +36,43 @@
neethi_assertion_t *assertion = NULL;
layout = rp_layout_create(env);
-
+
child_node = axiom_node_get_first_element(node, env);
- if(child_node)
+ if (child_node)
{
layout_node = axiom_node_get_first_element(child_node, env);
- if(!layout_node)
+ if (!layout_node)
{
return NULL;
- }
- }
+ }
+ }
else
{
return NULL;
- }
+ }
- if(axiom_node_get_node_type(layout_node, env) == AXIOM_ELEMENT)
+ if (axiom_node_get_node_type(layout_node, env) == AXIOM_ELEMENT)
{
- layout_element = (axiom_element_t*)axiom_node_get_data_element(layout_node, env);
- if(layout_element)
+ layout_element =
+ (axiom_element_t *) axiom_node_get_data_element(layout_node, env);
+ if (layout_element)
{
axis2_char_t *local_name = NULL;
local_name = axiom_element_get_localname(layout_element, env);
- if(!local_name)
+ if (!local_name)
return NULL;
rp_layout_set_value(layout, env, local_name);
- assertion = neethi_assertion_create_with_args(
- env, (void *)rp_layout_free, layout, ASSERTION_TYPE_LAYOUT);
+ assertion =
+ neethi_assertion_create_with_args(env, (void *) rp_layout_free,
+ layout,
+ ASSERTION_TYPE_LAYOUT);
return assertion;
}
- else return NULL;
+ else
+ return NULL;
}
- else return NULL;
+ else
+ return NULL;
}
-
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/qname_matcher.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/qname_matcher.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/qname_matcher.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/qname_matcher.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -15,38 +16,37 @@
* limitations under the License.
*/
-
#include <rp_qname_matcher.h>
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
rp_match_secpolicy_qname(
- const axutil_env_t *env,
- const axis2_char_t *local_name,
- axiom_node_t *node,
- axiom_element_t *element)
+ const axutil_env_t * env,
+ const axis2_char_t * local_name,
+ axiom_node_t * node,
+ axiom_element_t * element)
{
-
- axutil_qname_t *qname = NULL;
+
+ axutil_qname_t *qname = NULL;
axutil_qname_t *node_qname = NULL;
-
- AXIS2_ENV_CHECK(env,AXIS2_FALSE);
+
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
node_qname = axiom_element_get_qname(element, env, node);
- if(!node_qname)
+ if (!node_qname)
{
axutil_qname_free(qname, env);
}
else
{
qname = axutil_qname_create(env, local_name, RP_SP_NS, RP_SP_PREFIX);
- if(!qname)
+ if (!qname)
return AXIS2_FALSE;
}
- if(axutil_qname_equals(qname, env, node_qname))
+ if (axutil_qname_equals(qname, env, node_qname))
{
- axutil_qname_free(qname,env);
- qname = NULL;
+ axutil_qname_free(qname, env);
+ qname = NULL;
return AXIS2_TRUE;
}
else
@@ -59,35 +59,38 @@
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
rp_match_policy_qname(
- const axutil_env_t *env,
- const axis2_char_t *local_name,
- axiom_node_t *node,
- axiom_element_t *element)
+ const axutil_env_t * env,
+ const axis2_char_t * local_name,
+ axiom_node_t * node,
+ axiom_element_t * element)
{
-
- axutil_qname_t *qname = NULL;
+
+ axutil_qname_t *qname = NULL;
axutil_qname_t *node_qname = NULL;
-
- AXIS2_ENV_CHECK(env,AXIS2_FALSE);
- qname = axutil_qname_create(env, local_name, RP_POLICY_NS, RP_POLICY_PREFIX);
- if(!qname)
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+ qname =
+ axutil_qname_create(env, local_name, RP_POLICY_NS, RP_POLICY_PREFIX);
+ if (!qname)
return AXIS2_FALSE;
node_qname = axiom_element_get_qname(element, env, node);
- if(!node_qname)
+ if (!node_qname)
{
return AXIS2_FALSE;
}
else
{
- qname = axutil_qname_create(env, local_name, RP_POLICY_NS, RP_POLICY_PREFIX);
- if(!qname)
+ qname =
+ axutil_qname_create(env, local_name, RP_POLICY_NS,
+ RP_POLICY_PREFIX);
+ if (!qname)
return AXIS2_FALSE;
}
- if(axutil_qname_equals(qname, env, node_qname))
- {
+ if (axutil_qname_equals(qname, env, node_qname))
+ {
axutil_qname_free(qname, env);
qname = NULL;
return AXIS2_TRUE;
@@ -100,42 +103,43 @@
}
}
-
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
rp_match_rampart_config_qname(
- const axutil_env_t *env,
- const axis2_char_t *local_name,
- axiom_node_t *node,
- axiom_element_t *element)
+ const axutil_env_t * env,
+ const axis2_char_t * local_name,
+ axiom_node_t * node,
+ axiom_element_t * element)
{
-
- axutil_qname_t *qname = NULL;
+
+ axutil_qname_t *qname = NULL;
axutil_qname_t *node_qname = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+ AXIS2_ENV_CHECK(env, AXIS2_FALSE);
node_qname = axiom_element_get_qname(element, env, node);
- if(!node_qname)
+ if (!node_qname)
{
return AXIS2_FALSE;
}
else
{
- qname = axutil_qname_create(env, local_name, RP_RAMPART_NS, RP_RAMPART_PREFIX);
- if(!qname)
- {
+ qname =
+ axutil_qname_create(env, local_name, RP_RAMPART_NS,
+ RP_RAMPART_PREFIX);
+ if (!qname)
+ {
return AXIS2_FALSE;
- }
- }
- if(axutil_qname_equals(qname, env, node_qname))
- {
+ }
+ }
+ if (axutil_qname_equals(qname, env, node_qname))
+ {
axutil_qname_free(qname, env);
qname = NULL;
return AXIS2_TRUE;
}
else
- {
+ {
axutil_qname_free(qname, env);
qname = NULL;
return AXIS2_FALSE;
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/rampart_config_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/rampart_config_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/rampart_config_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/rampart_config_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -15,30 +16,23 @@
* limitations under the License.
*/
-
#include <rp_rampart_config_builder.h>
#include <rp_qname_matcher.h>
/*private functions*/
-axis2_status_t AXIS2_CALL
-rp_rampart_config_builder_populate(
- const axutil_env_t *env,
- rp_rampart_config_t *rampart_config,
- axiom_node_t *node,
- axiom_element_t *element,
- axis2_char_t *local_name);
-
-
-
+axis2_status_t AXIS2_CALL rp_rampart_config_builder_populate(
+ const axutil_env_t * env,
+ rp_rampart_config_t * rampart_config,
+ axiom_node_t * node,
+ axiom_element_t * element,
+ axis2_char_t * local_name);
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
rp_rampart_config_builder_build(
- const axutil_env_t *env,
- axiom_node_t *config,
- axiom_element_t *config_ele)
-
+ const axutil_env_t * env,
+ axiom_node_t * config,
+ axiom_element_t * config_ele)
{
rp_rampart_config_t *rampart_config = NULL;
axis2_status_t status = AXIS2_SUCCESS;
@@ -48,60 +42,67 @@
AXIS2_ENV_CHECK(env, NULL);
rampart_config = rp_rampart_config_create(env);
- if(!rampart_config)
- {
+ if (!rampart_config)
+ {
return NULL;
}
children_iter = axiom_element_get_children(config_ele, env, config);
- if(children_iter)
+ if (children_iter)
{
- while(axiom_children_iterator_has_next(children_iter, env))
+ while (axiom_children_iterator_has_next(children_iter, env))
{
axiom_node_t *node = NULL;
axiom_element_t *ele = NULL;
axis2_char_t *local_name = NULL;
node = axiom_children_iterator_next(children_iter, env);
- if(node)
+ if (node)
{
- if(axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
+ if (axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
{
- ele = (axiom_element_t*)axiom_node_get_data_element(node, env);
- if(ele)
+ ele =
+ (axiom_element_t *) axiom_node_get_data_element(node,
+ env);
+ if (ele)
{
local_name = axiom_element_get_localname(ele, env);
- if(local_name)
+ if (local_name)
{
- status = rp_rampart_config_builder_populate(
- env, rampart_config, node, ele, local_name);
- if(status!=AXIS2_SUCCESS)
- {
+ status =
+ rp_rampart_config_builder_populate(env,
+ rampart_config,
+ node, ele,
+ local_name);
+ if (status != AXIS2_SUCCESS)
+ {
return NULL;
- }
+ }
}
}
}
}
}
}
- assertion = neethi_assertion_create_with_args(
- env, (void *)rp_rampart_config_free, rampart_config, ASSERTION_TYPE_RAMPART_CONFIG);
+ assertion =
+ neethi_assertion_create_with_args(env, (void *) rp_rampart_config_free,
+ rampart_config,
+ ASSERTION_TYPE_RAMPART_CONFIG);
return assertion;
}
axis2_status_t AXIS2_CALL
rp_rampart_config_builder_populate(
- const axutil_env_t *env,
- rp_rampart_config_t *rampart_config,
- axiom_node_t *node,
- axiom_element_t *element,
- axis2_char_t *local_name)
+ const axutil_env_t * env,
+ rp_rampart_config_t * rampart_config,
+ axiom_node_t * node,
+ axiom_element_t * element,
+ axis2_char_t * local_name)
{
- AXIS2_ENV_CHECK(env,AXIS2_FAILURE);
-
- if(axutil_strcmp(local_name, RP_USER)==0)
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if (axutil_strcmp(local_name, RP_USER) == 0)
{
- if(rp_match_rampart_config_qname(env, RP_USER, node, element))
+ if (rp_match_rampart_config_qname(env, RP_USER, node, element))
{
axis2_char_t *user = NULL;
user = axiom_element_get_text(element, env, node);
@@ -111,118 +112,131 @@
else
return AXIS2_FAILURE;
}
- else if(axutil_strcmp(local_name, RP_ENCRYPTION_USER)==0)
+ else if (axutil_strcmp(local_name, RP_ENCRYPTION_USER) == 0)
{
- if(rp_match_rampart_config_qname(env, RP_ENCRYPTION_USER, node, element))
+ if (rp_match_rampart_config_qname
+ (env, RP_ENCRYPTION_USER, node, element))
{
axis2_char_t *encryption_user = NULL;
encryption_user = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_encryption_user(
- rampart_config, env, encryption_user);
+ return rp_rampart_config_set_encryption_user(rampart_config, env,
+ encryption_user);
}
else
return AXIS2_FAILURE;
- }
- else if(axutil_strcmp(local_name, RP_PASSWORD_CALLBACK_CLASS)==0)
+ }
+ else if (axutil_strcmp(local_name, RP_PASSWORD_CALLBACK_CLASS) == 0)
{
- if(rp_match_rampart_config_qname(env, RP_PASSWORD_CALLBACK_CLASS, node, element))
+ if (rp_match_rampart_config_qname
+ (env, RP_PASSWORD_CALLBACK_CLASS, node, element))
{
axis2_char_t *password_callback_class = NULL;
- password_callback_class = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_password_callback_class(
- rampart_config, env, password_callback_class);
+ password_callback_class =
+ axiom_element_get_text(element, env, node);
+ return rp_rampart_config_set_password_callback_class(rampart_config,
+ env,
+ password_callback_class);
}
else
return AXIS2_FAILURE;
}
- else if(axutil_strcmp(local_name, RP_AUTHN_MODULE_NAME)==0)
+ else if (axutil_strcmp(local_name, RP_AUTHN_MODULE_NAME) == 0)
{
- if(rp_match_rampart_config_qname(env, RP_AUTHN_MODULE_NAME, node, element))
+ if (rp_match_rampart_config_qname
+ (env, RP_AUTHN_MODULE_NAME, node, element))
{
axis2_char_t *authenticate_module = NULL;
authenticate_module = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_authenticate_module(
- rampart_config, env, authenticate_module);
+ return rp_rampart_config_set_authenticate_module(rampart_config,
+ env,
+ authenticate_module);
}
else
return AXIS2_FAILURE;
}
- else if(axutil_strcmp(local_name, RP_PASSWORD_TYPE)==0)
+ else if (axutil_strcmp(local_name, RP_PASSWORD_TYPE) == 0)
{
- if(rp_match_rampart_config_qname(env, RP_PASSWORD_TYPE, node, element))
+ if (rp_match_rampart_config_qname(env, RP_PASSWORD_TYPE, node, element))
{
axis2_char_t *password_type = NULL;
password_type = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_password_type(
- rampart_config, env, password_type);
+ return rp_rampart_config_set_password_type(rampart_config, env,
+ password_type);
}
else
return AXIS2_FAILURE;
}
- else if(axutil_strcmp(local_name, RP_CERTIFICATE)==0)
+ else if (axutil_strcmp(local_name, RP_CERTIFICATE) == 0)
{
- if(rp_match_rampart_config_qname(env, RP_CERTIFICATE, node, element))
+ if (rp_match_rampart_config_qname(env, RP_CERTIFICATE, node, element))
{
axis2_char_t *certificate_file = NULL;
certificate_file = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_certificate_file(
- rampart_config, env, certificate_file);
+ return rp_rampart_config_set_certificate_file(rampart_config, env,
+ certificate_file);
}
else
return AXIS2_FAILURE;
}
- else if(axutil_strcmp(local_name, RP_RECEIVER_CERTIFICATE)==0)
+ else if (axutil_strcmp(local_name, RP_RECEIVER_CERTIFICATE) == 0)
{
- if(rp_match_rampart_config_qname(env, RP_RECEIVER_CERTIFICATE, node, element))
+ if (rp_match_rampart_config_qname
+ (env, RP_RECEIVER_CERTIFICATE, node, element))
{
axis2_char_t *receiver_certificate_file = NULL;
- receiver_certificate_file = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_receiver_certificate_file(
- rampart_config, env, receiver_certificate_file);
+ receiver_certificate_file =
+ axiom_element_get_text(element, env, node);
+ return
+ rp_rampart_config_set_receiver_certificate_file(rampart_config,
+ env,
+ receiver_certificate_file);
}
else
return AXIS2_FAILURE;
}
- else if(axutil_strcmp(local_name, RP_PRIVATE_KEY)==0)
+ else if (axutil_strcmp(local_name, RP_PRIVATE_KEY) == 0)
{
- if(rp_match_rampart_config_qname(env, RP_PRIVATE_KEY, node, element))
+ if (rp_match_rampart_config_qname(env, RP_PRIVATE_KEY, node, element))
{
axis2_char_t *private_key_file = NULL;
private_key_file = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_private_key_file(
- rampart_config, env, private_key_file);
+ return rp_rampart_config_set_private_key_file(rampart_config, env,
+ private_key_file);
}
else
return AXIS2_FAILURE;
}
- else if(axutil_strcmp(local_name, RP_TIME_TO_LIVE)==0)
+ else if (axutil_strcmp(local_name, RP_TIME_TO_LIVE) == 0)
{
- if(rp_match_rampart_config_qname(env, RP_TIME_TO_LIVE, node, element))
+ if (rp_match_rampart_config_qname(env, RP_TIME_TO_LIVE, node, element))
{
axis2_char_t *time_to_live = NULL;
time_to_live = axiom_element_get_text(element, env, node);
- return rp_rampart_config_set_time_to_live(
- rampart_config, env, time_to_live);
+ return rp_rampart_config_set_time_to_live(rampart_config, env,
+ time_to_live);
}
else
return AXIS2_FAILURE;
}
- else if(axutil_strcmp(local_name, RP_RD) == 0)
+ else if (axutil_strcmp(local_name, RP_RD) == 0)
{
- if(rp_match_rampart_config_qname(env, RP_RD, node, element))
+ if (rp_match_rampart_config_qname(env, RP_RD, node, element))
{
axis2_char_t *rd_val = NULL;
rd_val = axiom_element_get_text(element, env, node);
- /*printf("rd_val = %s", rd_val);*/
+ /*printf("rd_val = %s", rd_val); */
rp_rampart_config_set_rd_val(rampart_config, env, rd_val);
return AXIS2_SUCCESS;
- }else{
+ }
+ else
+ {
return AXIS2_FAILURE;
}
}
- else return AXIS2_FAILURE;
+ else
+ return AXIS2_FAILURE;
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/recipient_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/recipient_token_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/recipient_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/recipient_token_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -25,21 +26,18 @@
/*private functions*/
-axis2_status_t AXIS2_CALL
-recipient_token_process_alternatives(
- const axutil_env_t *env,
- neethi_all_t *all,
- rp_property_t *recipient_token);
+axis2_status_t AXIS2_CALL recipient_token_process_alternatives(
+ const axutil_env_t * env,
+ neethi_all_t * all,
+ rp_property_t * recipient_token);
/***********************************/
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
rp_recipient_token_builder_build(
- const axutil_env_t *env,
- axiom_node_t *node,
- axiom_element_t *element)
-
+ const axutil_env_t * env,
+ axiom_node_t * node,
+ axiom_element_t * element)
{
rp_property_t *recipient_token = NULL;
neethi_policy_t *policy = NULL;
@@ -52,85 +50,102 @@
neethi_policy_t *normalized_policy = NULL;
recipient_token = rp_property_create(env);
-
- child_node = axiom_node_get_first_element(node,env);
- if(!child_node)
+ child_node = axiom_node_get_first_element(node, env);
+
+ if (!child_node)
{
return NULL;
- }
+ }
- if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+ if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
{
- child_element = (axiom_element_t*)axiom_node_get_data_element(child_node, env);
- if(child_element)
+ child_element =
+ (axiom_element_t *) axiom_node_get_data_element(child_node, env);
+ if (child_element)
{
policy = neethi_engine_get_policy(env, child_node, child_element);
- if(!policy)
+ if (!policy)
{
return NULL;
}
- normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+ normalized_policy =
+ neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
neethi_policy_free(policy, env);
policy = NULL;
- alternatives =neethi_policy_get_alternatives(normalized_policy, env);
- component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
- all = (neethi_all_t *)neethi_operator_get_value(component ,env);
+ alternatives =
+ neethi_policy_get_alternatives(normalized_policy, env);
+ component =
+ (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+ 0);
+ all = (neethi_all_t *) neethi_operator_get_value(component, env);
recipient_token_process_alternatives(env, all, recipient_token);
- assertion = neethi_assertion_create_with_args(
- env, (void *)rp_property_free, recipient_token, ASSERTION_TYPE_RECIPIENT_TOKEN);
+ assertion =
+ neethi_assertion_create_with_args(env,
+ (void *) rp_property_free,
+ recipient_token,
+ ASSERTION_TYPE_RECIPIENT_TOKEN);
neethi_policy_free(normalized_policy, env);
normalized_policy = NULL;
return assertion;
}
- else return NULL;
+ else
+ return NULL;
}
- else return NULL;
+ else
+ return NULL;
}
axis2_status_t AXIS2_CALL
recipient_token_process_alternatives(
- const axutil_env_t *env,
- neethi_all_t *all,
- rp_property_t *recipient_token)
+ const axutil_env_t * env,
+ neethi_all_t * all,
+ rp_property_t * recipient_token)
{
neethi_operator_t *operator = NULL;
axutil_array_list_t *arraylist = NULL;
neethi_assertion_t *assertion = NULL;
- neethi_assertion_type_t type;
+ neethi_assertion_type_t type;
void *value = NULL;
int i = 0;
arraylist = neethi_all_get_policy_components(all, env);
- for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+ for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
{
- operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
- assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
+ operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+ i);
+ assertion =
+ (neethi_assertion_t *) neethi_operator_get_value(operator, env);
value = neethi_assertion_get_value(assertion, env);
type = neethi_assertion_get_type(assertion, env);
- if(value)
+ if (value)
{
- if(type == ASSERTION_TYPE_X509_TOKEN)
+ if (type == ASSERTION_TYPE_X509_TOKEN)
{
- rp_x509_token_t *x509_token = NULL;
- x509_token = (rp_x509_token_t *)neethi_assertion_get_value(assertion, env);
- if(x509_token)
+ rp_x509_token_t *x509_token = NULL;
+ x509_token =
+ (rp_x509_token_t *) neethi_assertion_get_value(assertion,
+ env);
+ if (x509_token)
{
- rp_property_set_value(recipient_token, env, x509_token,
- RP_PROPERTY_X509_TOKEN);
+ rp_property_set_value(recipient_token, env, x509_token,
+ RP_PROPERTY_X509_TOKEN);
}
- else return AXIS2_FAILURE;
+ else
+ return AXIS2_FAILURE;
}
- else return AXIS2_FAILURE;
+ else
+ return AXIS2_FAILURE;
}
- else return AXIS2_FAILURE;
- }
+ else
+ return AXIS2_FAILURE;
+ }
return AXIS2_SUCCESS;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org