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 ma...@apache.org on 2007/07/26 05:09:35 UTC
svn commit: r559678 - in /webservices/axis2/trunk/c/neethi: include/
src/secpolicy/builder/ src/secpolicy/model/
Author: manjula
Date: Wed Jul 25 20:09:34 2007
New Revision: 559678
URL: http://svn.apache.org/viewvc?view=rev&rev=559678
Log:
Changing the rp_property type to a enum.
Modified:
webservices/axis2/trunk/c/neethi/include/rp_defines.h
webservices/axis2/trunk/c/neethi/include/rp_property.h
webservices/axis2/trunk/c/neethi/src/secpolicy/builder/asymmetric_binding_builder.c
webservices/axis2/trunk/c/neethi/src/secpolicy/builder/initiator_token_builder.c
webservices/axis2/trunk/c/neethi/src/secpolicy/builder/recipient_token_builder.c
webservices/axis2/trunk/c/neethi/src/secpolicy/builder/secpolicy_builder.c
webservices/axis2/trunk/c/neethi/src/secpolicy/builder/supporting_tokens_builder.c
webservices/axis2/trunk/c/neethi/src/secpolicy/builder/token_identifier.c
webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_binding_builder.c
webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_token_builder.c
webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c
Modified: webservices/axis2/trunk/c/neethi/include/rp_defines.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_defines.h?view=diff&rev=559678&r1=559677&r2=559678
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_defines.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_defines.h Wed Jul 25 20:09:34 2007
@@ -30,25 +30,6 @@
#define RP_EXACTLY_ONE "ExactlyOne"
#define RP_ALL "All"
-#define RP_TOKEN_USERNAME 1
-#define RP_TOKEN_X509 2
-#define RP_TOKEN_SECURITY_CONTEXT 3
-#define RP_TOKEN_HTTPS 4
-
-#define RP_BINDING_SYMMETRIC 5
-#define RP_BINDING_ASYMMETRIC 6
-#define RP_BINDING_TRANSPORT 7
-
-#define RP_SUPPORTING_SIGNED_SUPPORTING 8
-#define RP_SUPPORTING_SIGNED_ENDORSING_SUPPORTING 9
-#define RP_SUPPORTING_SUPPORTING 10
-#define RP_SUPPORTING_ENDORSING_SUPPORTING 11
-
-#define RP_WSS_WSS10 12
-#define RP_WSS_WSS11 13
-
-#define RP_SUPPORTING_TOKEN 14
-
#define RP_SYMMETRIC_BINDING "SymmetricBinding"
#define RP_ASYMMETRIC_BINDING "AsymmetricBinding"
#define RP_TRANSPORT_BINDING "TransportBinding"
Modified: webservices/axis2/trunk/c/neethi/include/rp_property.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_property.h?view=diff&rev=559678&r1=559677&r2=559678
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_property.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_property.h Wed Jul 25 20:09:34 2007
@@ -33,8 +33,26 @@
{
#endif
- typedef struct rp_property_t rp_property_t;
+ typedef enum {
+ RP_PROPERTY_USERNAME_TOKEN = 0,
+ RP_PROPERTY_X509_TOKEN,
+ RP_PROPERTY_SECURITY_CONTEXT_TOKEN,
+ RP_PROPERTY_HTTPS_TOKEN,
+ RP_PROPERTY_SYMMETRIC_BINDING,
+ RP_PROPERTY_ASYMMETRIC_BINDING,
+ RP_PROPERTY_TRANSPORT_BINDING,
+ RP_PROPERTY_SIGNED_SUPPORTING_TOKEN,
+ RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN,
+ RP_PROPERTY_SUPPORTING_SUPPORTING_TOKEN,
+ RP_PROPERTY_ENDORSING_SUPPORTING_TOKEN,
+ RP_PROPERTY_WSS10,
+ RP_PROPERTY_WSS11,
+ RP_PROPERTY_SUPPORTING_TOKEN,
+ RP_PROPERTY_UNKNOWN
+ }rp_property_type_t;
+
+ typedef struct rp_property_t rp_property_t;
AXIS2_EXTERN rp_property_t *AXIS2_CALL
rp_property_create(const axutil_env_t *env);
@@ -49,14 +67,14 @@
rp_property_t *property,
const axutil_env_t *env,
void *value,
- int type);
+ rp_property_type_t type);
AXIS2_EXTERN void *AXIS2_CALL
rp_property_get_value(
rp_property_t *property,
const axutil_env_t *env);
- AXIS2_EXTERN int AXIS2_CALL
+ AXIS2_EXTERN rp_property_type_t AXIS2_CALL
rp_property_get_type(
rp_property_t *property,
const axutil_env_t *env);
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?view=diff&rev=559678&r1=559677&r2=559678
==============================================================================
--- 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 Wed Jul 25 20:09:34 2007
@@ -182,13 +182,13 @@
supporting_tokens = (rp_supporting_tokens_t *)neethi_assertion_get_value(assertion, env);
if(supporting_tokens)
{
- int type = 0;
+ rp_property_type_t type;
type = rp_supporting_tokens_get_type(supporting_tokens, env);
- if(type == RP_SUPPORTING_SIGNED_SUPPORTING)
+ if(type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
{
rp_binding_commons_set_signed_supporting_tokens(commons, env, supporting_tokens);
}
- else if(type == RP_SUPPORTING_SIGNED_ENDORSING_SUPPORTING)
+ else if(type == RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN)
{
rp_binding_commons_set_signed_endorsing_supporting_tokens(commons, env, supporting_tokens);
}
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?view=diff&rev=559678&r1=559677&r2=559678
==============================================================================
--- 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 Wed Jul 25 20:09:34 2007
@@ -117,7 +117,7 @@
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_TOKEN_X509);
+ rp_property_set_value(initiator_token, env, x509_token, RP_PROPERTY_X509_TOKEN);
}
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?view=diff&rev=559678&r1=559677&r2=559678
==============================================================================
--- 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 Wed Jul 25 20:09:34 2007
@@ -117,7 +117,7 @@
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_TOKEN_X509);
+ rp_property_set_value(recipient_token, env, x509_token, RP_PROPERTY_X509_TOKEN);
}
else return AXIS2_FAILURE;
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/secpolicy_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/secpolicy_builder.c?view=diff&rev=559678&r1=559677&r2=559678
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/secpolicy_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/secpolicy_builder.c Wed Jul 25 20:09:34 2007
@@ -100,7 +100,7 @@
return AXIS2_FAILURE;
}
binding = rp_property_create(env);
- rp_property_set_value(binding, env, transport_binding, RP_BINDING_TRANSPORT);
+ rp_property_set_value(binding, env, transport_binding, RP_PROPERTY_TRANSPORT_BINDING);
rp_secpolicy_set_binding(secpolicy, env, binding);
}
else if(type == ASSERTION_TYPE_ASSYMMETRIC_BINDING)
@@ -115,7 +115,7 @@
return AXIS2_FAILURE;
}
binding = rp_property_create(env);
- rp_property_set_value(binding, env, asymmetric_binding, RP_BINDING_ASYMMETRIC);
+ rp_property_set_value(binding, env, asymmetric_binding, RP_PROPERTY_ASYMMETRIC_BINDING);
rp_secpolicy_set_binding(secpolicy, env, binding);
}
else if(type == ASSERTION_TYPE_SUPPORTING_TOKENS)
@@ -124,13 +124,13 @@
supporting_tokens = (rp_supporting_tokens_t *)neethi_assertion_get_value(assertion, env);
if(supporting_tokens)
{
- int type = 0;
+ rp_property_type_t type;
type = rp_supporting_tokens_get_type(supporting_tokens, env);
- if(type == RP_SUPPORTING_SIGNED_SUPPORTING)
+ if(type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
{
rp_secpolicy_set_signed_supporting_tokens(secpolicy, env, supporting_tokens);
}
- else if(type == RP_SUPPORTING_SIGNED_ENDORSING_SUPPORTING)
+ else if(type == RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN)
{
rp_secpolicy_set_endorsing_supporting_tokens(secpolicy, env, supporting_tokens);
}
@@ -149,7 +149,7 @@
return AXIS2_FAILURE;
}
wss = rp_property_create(env);
- rp_property_set_value(wss, env, wss10, RP_WSS_WSS10);
+ rp_property_set_value(wss, env, wss10, RP_PROPERTY_WSS10);
rp_secpolicy_set_wss(secpolicy, env, wss);
}
else if(type == ASSERTION_TYPE_SIGNED_ENCRYPTED_PARTS)
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/supporting_tokens_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/supporting_tokens_builder.c?view=diff&rev=559678&r1=559677&r2=559678
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/supporting_tokens_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/supporting_tokens_builder.c Wed Jul 25 20:09:34 2007
@@ -64,11 +64,11 @@
{
if(axutil_strcmp(local_name, RP_SIGNED_SUPPORTING_TOKENS) == 0)
{
- rp_supporting_tokens_set_type(supporting_tokens, env, RP_SUPPORTING_SIGNED_SUPPORTING);
+ rp_supporting_tokens_set_type(supporting_tokens, env, RP_PROPERTY_SIGNED_SUPPORTING_TOKEN);
}
else if(axutil_strcmp(local_name, RP_SIGNED_ENDORSING_SUPPORTING_TOKENS)==0)
{
- rp_supporting_tokens_set_type(supporting_tokens, env, RP_SUPPORTING_SIGNED_ENDORSING_SUPPORTING);
+ rp_supporting_tokens_set_type(supporting_tokens, env, RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN);
}
else return NULL;
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/token_identifier.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/token_identifier.c?view=diff&rev=559678&r1=559677&r2=559678
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/token_identifier.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/token_identifier.c Wed Jul 25 20:09:34 2007
@@ -47,14 +47,14 @@
{
rp_username_token_t *username_token = NULL;
username_token = (rp_username_token_t *)value;
- rp_property_set_value(token, env, username_token, RP_TOKEN_USERNAME);
+ rp_property_set_value(token, env, username_token, RP_PROPERTY_USERNAME_TOKEN);
return AXIS2_SUCCESS;
}
else if(type == ASSERTION_TYPE_X509_TOKEN)
{
rp_x509_token_t *x509_token = NULL;
x509_token = (rp_x509_token_t *)value;
- rp_property_set_value(token, env, x509_token, RP_TOKEN_X509);
+ rp_property_set_value(token, env, x509_token, RP_PROPERTY_X509_TOKEN);
return AXIS2_SUCCESS;
}
else
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_binding_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_binding_builder.c?view=diff&rev=559678&r1=559677&r2=559678
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_binding_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_binding_builder.c Wed Jul 25 20:09:34 2007
@@ -150,13 +150,13 @@
supporting_tokens = (rp_supporting_tokens_t *)neethi_assertion_get_value(assertion, env);
if(supporting_tokens)
{
- int type = 0;
+ rp_property_type_t type;
type = rp_supporting_tokens_get_type(supporting_tokens, env);
- if(type == RP_SUPPORTING_SIGNED_SUPPORTING)
+ if(type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
{
rp_binding_commons_set_signed_supporting_tokens(commons, env, supporting_tokens);
}
- else if(type == RP_SUPPORTING_SIGNED_ENDORSING_SUPPORTING)
+ else if(type == RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN)
{
rp_binding_commons_set_signed_endorsing_supporting_tokens(commons, env, supporting_tokens);
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_token_builder.c?view=diff&rev=559678&r1=559677&r2=559678
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_token_builder.c Wed Jul 25 20:09:34 2007
@@ -116,7 +116,7 @@
https_token = (rp_https_token_t *)neethi_assertion_get_value(assertion, env);
if(https_token)
{
- rp_property_set_value(transport_token, env, https_token, RP_TOKEN_HTTPS);
+ rp_property_set_value(transport_token, env, https_token, RP_PROPERTY_HTTPS_TOKEN);
}
else return AXIS2_FAILURE;
}
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c?view=diff&rev=559678&r1=559677&r2=559678
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c Wed Jul 25 20:09:34 2007
@@ -26,7 +26,7 @@
struct rp_property_t
{
- int type;
+ rp_property_type_t type;
void *value;
int ref;
};
@@ -47,7 +47,7 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- property->type = 0;
+ property->type = RP_PROPERTY_UNKNOWN;
property->value = NULL;
property->ref = 0;
@@ -72,60 +72,78 @@
{
switch(property->type)
{
- case RP_TOKEN_USERNAME:
+ case RP_PROPERTY_USERNAME_TOKEN:
rp_username_token_free((rp_username_token_t *)property->value, env);
property->value = NULL;
break;
- case RP_TOKEN_X509:
+ case RP_PROPERTY_X509_TOKEN:
rp_x509_token_free((rp_x509_token_t *)property->value, env);
property->value = NULL;
break;
- case RP_TOKEN_SECURITY_CONTEXT:
+ case RP_PROPERTY_SECURITY_CONTEXT_TOKEN:
rp_security_context_token_free((rp_security_context_token_t *)property->value, env);
property->value = NULL;
break;
- case RP_TOKEN_HTTPS:
+ case RP_PROPERTY_HTTPS_TOKEN:
rp_https_token_free((rp_https_token_t *)property->value, env);
property->value = NULL;
break;
- case RP_BINDING_SYMMETRIC:
+ case RP_PROPERTY_SYMMETRIC_BINDING:
rp_symmetric_binding_free((rp_symmetric_binding_t *)property->value, env);
property->value = NULL;
break;
- case RP_BINDING_ASYMMETRIC:
+ case RP_PROPERTY_ASYMMETRIC_BINDING:
rp_asymmetric_binding_free((rp_asymmetric_binding_t *)property->value, env);
property->value = NULL;
break;
- case RP_BINDING_TRANSPORT:
+ case RP_PROPERTY_TRANSPORT_BINDING:
rp_transport_binding_free((rp_transport_binding_t *)property->value, env);
property->value = NULL;
break;
- case RP_SUPPORTING_SIGNED_SUPPORTING:
+ case RP_PROPERTY_SIGNED_SUPPORTING_TOKEN:
rp_supporting_tokens_free((rp_supporting_tokens_t *)property->value, env);
property->value = NULL;
break;
- case RP_SUPPORTING_SIGNED_ENDORSING_SUPPORTING:
+ case RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN:
+ rp_supporting_tokens_free((rp_supporting_tokens_t *)property->value, env);
+ property->value = NULL;
+ break;
+
+ case RP_PROPERTY_SUPPORTING_SUPPORTING_TOKEN:
+ rp_supporting_tokens_free((rp_supporting_tokens_t *)property->value, env);
+ property->value = NULL;
+ break;
+
+ case RP_PROPERTY_ENDORSING_SUPPORTING_TOKEN:
rp_supporting_tokens_free((rp_supporting_tokens_t *)property->value, env);
property->value = NULL;
break;
- case RP_WSS_WSS10:
+ case RP_PROPERTY_SUPPORTING_TOKEN:
+ rp_supporting_tokens_free((rp_supporting_tokens_t *)property->value, env);
+ property->value = NULL;
+ break;
+
+ case RP_PROPERTY_WSS10:
rp_wss10_free((rp_wss10_t *)property->value, env);
property->value = NULL;
break;
- case RP_WSS_WSS11:
+ case RP_PROPERTY_WSS11:
rp_wss11_free((rp_wss11_t *)property->value, env);
property->value = NULL;
break;
+
+ case RP_PROPERTY_UNKNOWN:
+ break;
}
}
AXIS2_FREE(env->allocator, property);
@@ -151,38 +169,38 @@
rp_property_t *property,
const axutil_env_t *env,
void *value,
- int type)
+ rp_property_type_t type)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
property->type = type;
- if(type == RP_TOKEN_X509)
+ if(type == RP_PROPERTY_X509_TOKEN)
{
rp_x509_token_increment_ref((rp_x509_token_t *)value, env);
}
- if(type == RP_WSS_WSS10)
+ if(type == RP_PROPERTY_WSS10)
{
rp_wss10_increment_ref((rp_wss10_t *)value, env);
}
- if(type == RP_TOKEN_USERNAME)
+ if(type == RP_PROPERTY_USERNAME_TOKEN)
{
rp_username_token_increment_ref((rp_username_token_t *)value, env);
}
- if(type == RP_SUPPORTING_SIGNED_SUPPORTING)
+ if(type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
{
rp_supporting_tokens_increment_ref((rp_supporting_tokens_t *)value, env);
}
- if(type == RP_BINDING_ASYMMETRIC)
+ if(type == RP_PROPERTY_ASYMMETRIC_BINDING)
{
rp_asymmetric_binding_increment_ref((rp_asymmetric_binding_t *)value, env);
}
- if(type == RP_BINDING_TRANSPORT)
+ if(type == RP_PROPERTY_TRANSPORT_BINDING)
{
rp_transport_binding_increment_ref((rp_transport_binding_t *)value, env);
}
- if(type == RP_BINDING_SYMMETRIC)
+ if(type == RP_PROPERTY_SYMMETRIC_BINDING)
{
rp_symmetric_binding_increment_ref((rp_symmetric_binding_t *)value, env);
}
@@ -192,7 +210,7 @@
}
-AXIS2_EXTERN int AXIS2_CALL
+AXIS2_EXTERN rp_property_type_t AXIS2_CALL
rp_property_get_type(
rp_property_t *property,
const axutil_env_t *env)
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org