/*
 * Portions of this file Copyright 1999-2005 University of Chicago
 * Portions of this file Copyright 1999-2005 The University of Southern California.
 *
 * This file or a portion of this file is licensed under the
 * terms of the Globus Toolkit Public License, found at
 * http://www.globus.org/toolkit/download/license.html.
 * If you redistribute this file, with or without
 * modifications, you must include this notice in the file.
 */


#ifndef _GLOBUS_SOAP_MESSAGE_ATTRS_H_
#define _GLOBUS_SOAP_MESSAGE_ATTRS_H_

#include "globus_common.h"

EXTERN_C_BEGIN

#define GLOBUS_SOAP_MESSAGE_SERVICE_ENDPOINT_KEY \
        "GLOBUS_SOAP_MESSAGE_SERVICE_ENDPOINT"
#define GLOBUS_SOAP_MESSAGE_SOAP_ACTION_KEY \
        "GLOBUS_SOAP_MESSAGE_SOAP_ACTION"
#define GLOBUS_SOAP_MESSAGE_HTTP_VERSION_KEY \
        "GLOBUS_SOAP_MESSAGE_HTTP_VERSION"
#define GLOBUS_SOAP_MESSAGE_AUTHENTICATION_METHOD_KEY \
        "GLOBUS_SOAP_MESSAGE_AUTHENTICATION_METHOD"
#define GLOBUS_SOAP_MESSAGE_USER_CREDENTIAL_KEY \
        "GLOBUS_SOAP_MESSAGE_USER_CREDENTIAL"
#define GLOBUS_SOAP_MESSAGE_AUTH_PROTECTION_KEY \
        "GLOBUS_SOAP_MESSAGE_AUTH_PROTECTION"
#define GLOBUS_SOAP_MESSAGE_AUTHZ_METHOD_KEY \
        "GLOBUS_SOAP_MESSAGE_AUTHZ_METHOD"
#define GLOBUS_SOAP_MESSAGE_AUTHZ_TARGET_NAME_KEY \
        "GLOBUS_SOAP_MESSAGE_AUTHZ_TARGET_NAME"
#define GLOBUS_SOAP_MESSAGE_TIMEOUT_KEY \
        "GLOBUS_SOAP_MESSAGE_TIMEOUT"
#define GLOBUS_SOAP_MESSAGE_AUTH_ANONYMOUS_KEY \
        "GLOBUS_SOAP_MESSAGE_AUTH_ANONYMOUS"
#define GLOBUS_SOAP_MESSAGE_CONNECTION_KEY \
        "GLOBUS_SOAP_MESSAGE_CONNECTION"
#define GLOBUS_HANDLER_TRIGGER_ELEMENT_KEY \
        "GLOBUS_HANDLER_TRIGGER_ELEMENT_KEY"
#define GLOBUS_SOAP_MESSAGE_VERBOSE_ERRORS_KEY \
        "GLOBUS_SOAP_MESSAGE_VERBOSE_ERRORS_KEY"

typedef enum
{
    GLOBUS_SOAP_MESSAGE_AUTH_NONE,
    GLOBUS_SOAP_MESSAGE_AUTH_SECURE,
    GLOBUS_SOAP_MESSAGE_AUTH_SECURE_MESSAGE,
    GLOBUS_SOAP_MESSAGE_AUTH_SECURE_CONVERSATION
} globus_soap_message_auth_method_t;

typedef enum
{
    GLOBUS_SOAP_MESSAGE_AUTH_PROTECTION_NOT_SET = 0,
    GLOBUS_SOAP_MESSAGE_AUTH_PROTECTION_INTEGRITY,
    GLOBUS_SOAP_MESSAGE_AUTH_PROTECTION_PRIVACY
} globus_soap_message_auth_protection_level_t;

typedef enum
{
    GLOBUS_SOAP_MESSAGE_AUTHZ_SELF = 0,
    GLOBUS_SOAP_MESSAGE_AUTHZ_IDENTITY,
    GLOBUS_SOAP_MESSAGE_AUTHZ_HOST,
    GLOBUS_SOAP_MESSAGE_AUTHZ_NONE
} globus_soap_message_authz_method_t;

#include "globus_hashtable.h"

typedef globus_hashtable_t              globus_soap_message_attr_t;

typedef globus_result_t (* globus_soap_message_attr_copy_func_t) (
    void **                             new_attr,
    void *                              attr);

typedef globus_hashtable_destructor_func_t 
        globus_soap_message_attr_destroy_func_t;

globus_result_t
globus_soap_message_attr_init(
    globus_soap_message_attr_t *        attrs);

globus_result_t
globus_soap_message_attr_copy(
    globus_soap_message_attr_t *        new_attrs,
    globus_soap_message_attr_t          attrs);

void
globus_soap_message_attr_destroy(
    globus_soap_message_attr_t          attrs);

globus_result_t
globus_soap_message_attr_set(
    globus_soap_message_attr_t               properties,
    const char *                             name,
    globus_soap_message_attr_copy_func_t     copy,
    globus_soap_message_attr_destroy_func_t  destroy,
    void *                                   property);

void *
globus_soap_message_attr_remove(
    globus_soap_message_attr_t          properties,
    const char *                        property_name);

void *
globus_soap_message_attr_get(
    globus_soap_message_attr_t          properties,
    const char *                        property_name);

globus_result_t
globus_soap_message_attr_copy_string(
    void **                             new_str,
    void *                              str);

EXTERN_C_END

#endif
