tcpmon_session.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 TCPMON_SESSION_H
00019 #define TCPMON_SESSION_H
00020 
00021 #include <axutil_env.h>
00022 #include <tcpmon_entry.h>
00023 #include <axutil_string.h>
00024  
00030 #ifdef __cplusplus
00031 extern "C"
00032 {
00033 #endif
00034    
00041 typedef struct tcpmon_session_ops tcpmon_session_ops_t;   
00042 typedef struct tcpmon_session tcpmon_session_t;
00043 
00047 typedef int (*TCPMON_SESSION_NEW_ENTRY_FUNCT) 
00048                  ( const axutil_env_t *env,
00049                    tcpmon_entry_t* entry,
00050                    int status);   /* 0-started, 1-finished */
00051 
00052 typedef int (*TCPMON_SESSION_TRANS_ERROR_FUNCT) 
00053                    ( const axutil_env_t *env,
00054                      axis2_char_t* error_message);
00055 
00056 
00057  struct tcpmon_session_ops
00058 {
00065     axis2_status_t (AXIS2_CALL * 
00066     free)(tcpmon_session_t *session,
00067             const axutil_env_t *env);
00068 
00069 
00070          axis2_status_t (AXIS2_CALL *
00071                                                   set_test_bit) (tcpmon_session_t *session,
00072                                                                                           const axutil_env_t *env,
00073                                                                                           int test_bit);
00074 
00075          axis2_status_t (AXIS2_CALL *
00076                                                   get_test_bit) (tcpmon_session_t *session,
00077                                                                                           const axutil_env_t *env);
00078     axis2_status_t (AXIS2_CALL *
00079                           set_format_bit) (tcpmon_session_t *session,
00080                                               const axutil_env_t *env,
00081                                               int format_bit);
00082 
00083     int (AXIS2_CALL *
00084                     get_format_bit) (tcpmon_session_t *session,
00085                                               const axutil_env_t *env);
00093     axis2_status_t (AXIS2_CALL *
00094                                                   set_listen_port) (tcpmon_session_t *session,
00095                                                                 const axutil_env_t *env,
00096                                                                 int listen_port);
00097 
00103     int (AXIS2_CALL *
00104     get_listen_port) (tcpmon_session_t *session,
00105                         const axutil_env_t *env);
00106   
00114     axis2_status_t (AXIS2_CALL *
00115     set_target_port) (tcpmon_session_t *session,
00116                         const axutil_env_t *env,
00117                         int target_port);
00118 
00124     int (AXIS2_CALL *
00125     get_target_port) (tcpmon_session_t *session,
00126                         const axutil_env_t *env);
00127 
00135     axis2_status_t (AXIS2_CALL *
00136     set_target_host) (tcpmon_session_t *session,
00137                         const axutil_env_t *env,
00138                         axis2_char_t* target_host);
00139 
00145     axis2_char_t* (AXIS2_CALL *
00146     get_target_host) (tcpmon_session_t *session,
00147                         const axutil_env_t *env);
00148 
00154     axis2_status_t (AXIS2_CALL *
00155     start) (tcpmon_session_t *session,
00156                         const axutil_env_t *env);
00157 
00163     axis2_status_t (AXIS2_CALL *
00164     stop) (tcpmon_session_t *session,
00165                         const axutil_env_t *env);
00166  
00173     axis2_status_t (AXIS2_CALL *
00174     on_new_entry) (tcpmon_session_t *session,
00175                         const axutil_env_t *env,
00176                         TCPMON_SESSION_NEW_ENTRY_FUNCT on_new_entry_funct);
00177 
00184     axis2_status_t (AXIS2_CALL *
00185     on_trans_fault) (tcpmon_session_t *session,
00186                         const axutil_env_t *env,
00187                         TCPMON_SESSION_TRANS_ERROR_FUNCT on_trans_fault_funct);
00188 
00189 
00190 };
00191 
00192  struct tcpmon_session 
00193 {
00194     tcpmon_session_ops_t *ops;
00195 };
00196 
00202 tcpmon_session_t * AXIS2_CALL
00203 tcpmon_session_create(const axutil_env_t *env );
00204 
00205 /*************************** Function macros **********************************/
00206 
00207 #define TCPMON_SESSION_FREE(session, env) \
00208         ((session)->ops->free (session, env))
00209 
00210 #define TCPMON_SESSION_SET_TEST_BIT(session, env, test_bit) \
00211         ((session)->ops->set_test_bit(session, env, test_bit))
00212 
00213 #define TCPMON_SESSION_GET_TEST_BIT(session, env) \
00214         ((session)->ops->get_test_bit(session, env))
00215 
00216 #define TCPMON_SESSION_SET_FORMAT_BIT(session, env, format_bit) \
00217         ((session)->ops->set_format_bit(session, env, format_bit))
00218 
00219 #define TCPMON_SESSION_GET_FORMAT_BIT(session, env) \
00220         ((session)->ops->get_format_bit(session, env))
00221 
00222 #define TCPMON_SESSION_SET_LISTEN_PORT(session, env, listen_port) \
00223         ((session)->ops->set_listen_port(session, env, listen_port))
00224 
00225 #define TCPMON_SESSION_GET_LISTEN_PORT(session, env) \
00226         ((session)->ops->get_listen_port(session, env))
00227 
00228 #define TCPMON_SESSION_SET_TARGET_PORT(session, env, target_port) \
00229         ((session)->ops->set_target_port(session, env, target_port))
00230 
00231 #define TCPMON_SESSION_GET_TARGET_PORT(session, env) \
00232         ((session)->ops->get_target_port(session, env))
00233 
00234 #define TCPMON_SESSION_SET_TARGET_HOST(session, env, target_host) \
00235         ((session)->ops->set_target_host(session, env, target_host))
00236 
00237 #define TCPMON_SESSION_GET_TARGET_HOST(session, env) \
00238         ((session)->ops->get_target_host(session, env))
00239 
00240 #define TCPMON_SESSION_START(session, env) \
00241         ((session)->ops->start(session, env))
00242 
00243 #define TCPMON_SESSION_STOP(session, env) \
00244         ((session)->ops->stop(session, env))
00245 
00246 #define TCPMON_SESSION_ON_TRANS_FAULT(session, env, funct) \
00247         ((session)->ops->on_trans_fault(session, env, funct))
00248 
00249 #define TCPMON_SESSION_ON_NEW_ENTRY(session, env, funct) \
00250         ((session)->ops->on_new_entry(session, env, funct))
00251 
00254 #ifdef __cplusplus
00255 }
00256 #endif
00257 
00258 #endif /* TCPMON_SESSION_H */

Generated on Wed Sep 26 09:54:19 2007 for Axis2/C by  doxygen 1.4.6