# rampart_credentials.h

Go to the documentation of this file.

    00001 /*
    00002 * Licensed to the Apache Software Foundation (ASF) under one or more
    00003 * contributor license agreements.  See the NOTICE file distributed with
    00004 * this work for additional information regarding copyright ownership.
    00005 * The ASF licenses this file to You under the Apache License, Version 2.0
    00006 * (the "License"); you may not use this file except in compliance with
    00007 * the License.  You may obtain a copy of the License at
    00008 *
    00009 *      http://www.apache.org/licenses/LICENSE-2.0
    00010 *
    00011 * Unless required by applicable law or agreed to in writing, software
    00012 * distributed under the License is distributed on an "AS IS" BASIS,
    00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00014 * See the License for the specific language governing permissions and
    00015 * limitations under the License.
    00016 */
    00017
    00018 #ifndef RAMPART_CREDENTIALS_H
    00019 #define RAMPART_CREDENTIALS_H
    00020
    00021 #include <axis2_defines.h>
    00022 #include <axutil_error.h>
    00023 #include <axutil_env.h>
    00024 #include <axutil_utils.h>
    00025 #include <axis2_msg_ctx.h>
    00026 #include <axutil_param.h>
    00037 #ifdef __cplusplus
    00038 extern "C"
    00039 {
    00040 #endif
    00041     enum rampart_credentials_status
    00042     {
    00043         RAMPART_CREDENTIALS_PW_FOUND = 0,
    00044         RAMPART_CREDENTIALS_PW_NOT_FOUND,
    00045         RAMPART_CREDENTIALS_USER_FOUND,
    00046         RAMPART_CREDENTIALS_USER_NOT_FOUND,
    00047         RAMPART_CREDENTIALS_GENERAL_ERROR
    00048     };
    00049
    00050     typedef enum rampart_credentials_status rampart_credentials_status_t;
    00051
    00056     typedef struct rampart_credentials_ops rampart_credentials_ops_t;
    00057     typedef struct rampart_credentials rampart_credentials_t;
    00058
    00059     struct rampart_credentials_ops
    00060     {
    00061
    00071         rampart_credentials_status_t (AXIS2_CALL*
    00072         rampart_credentials_username_get)(
    00073             rampart_credentials_t *credentials,
    00074             const axutil_env_t* env,
    00075             axis2_msg_ctx_t *msg_ctx,
    00076             axis2_char_t **username,
    00077             axis2_char_t **password);
    00078
    00085         axis2_status_t (AXIS2_CALL*
    00086         free)(
    00087             rampart_credentials_t *credentials,
    00088             const axutil_env_t* env);
    00089
    00090     };
    00091
    00092     struct rampart_credentials
    00093     {
    00094         rampart_credentials_ops_t *ops;
    00095         axutil_param_t *param;
    00096     };
    00097
    00098     /*************************** Function macros **********************************/
    00099 #define RAMPART_CREDENTIALS_FREE(credentials, env) \
    00100       ((credentials)->ops->free (credentials, env))
    00101
    00102 #define RAMPART_CREDENTIALS_USERNAME_GET(credentials, env, msg_ctx, username, password) \
    00103       ((credentials)->ops->rampart_credentials_username_get( \
    00104             credentials, env, msg_ctx, username, password))
    00105
    00106
    00107
    00109 #ifdef __cplusplus
    00110 }
    00111 #endif
    00112
    00113 #endif /* RAMPART_CREDENTIALS_H */
    00114