tcpmon_session.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004,2005 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016   
00017 #ifndef TCPMON_SESSION_H
00018 #define TCPMON_SESSION_H
00019 
00020 #include <axis2_env.h>
00021 #include <tcpmon_entry.h>
00022 #include <axis2_string.h>
00023  
00029 #ifdef __cplusplus
00030 extern "C"
00031 {
00032 #endif
00033    
00040 typedef struct tcpmon_session_ops tcpmon_session_ops_t;   
00041 typedef struct tcpmon_session tcpmon_session_t;
00042 
00046 typedef int (*TCPMON_SESSION_NEW_ENTRY_FUNCT) 
00047                  ( const axis2_env_t *env,
00048                    tcpmon_entry_t* entry,
00049                    int status);   /* 0-started, 1-finished */
00050 
00051 typedef int (*TCPMON_SESSION_TRANS_ERROR_FUNCT) 
00052                    ( const axis2_env_t *env,
00053                      axis2_char_t* error_message);
00054 
00055 
00056  struct tcpmon_session_ops
00057 {
00064     axis2_status_t (AXIS2_CALL * 
00065     free)(tcpmon_session_t *session,
00066             const axis2_env_t *env);
00067 
00068 
00069          axis2_status_t (AXIS2_CALL *
00070                                                   set_test_bit) (tcpmon_session_t *session,
00071                                                                                           const axis2_env_t *env,
00072                                                                                           int test_bit);
00073 
00074          axis2_status_t (AXIS2_CALL *
00075                                                   get_test_bit) (tcpmon_session_t *session,
00076                                                                                           axis2_env_t *env);
00077     
00085     axis2_status_t (AXIS2_CALL *
00086                                                   set_listen_port) (tcpmon_session_t *session,
00087                                                                 const axis2_env_t *env,
00088                                                                 int listen_port);
00089 
00095     int (AXIS2_CALL *
00096     get_listen_port) (tcpmon_session_t *session,
00097                         const axis2_env_t *env);
00098   
00106     axis2_status_t (AXIS2_CALL *
00107     set_target_port) (tcpmon_session_t *session,
00108                         const axis2_env_t *env,
00109                         int target_port);
00110 
00116     int (AXIS2_CALL *
00117     get_target_port) (tcpmon_session_t *session,
00118                         const axis2_env_t *env);
00119 
00127     axis2_status_t (AXIS2_CALL *
00128     set_target_host) (tcpmon_session_t *session,
00129                         const axis2_env_t *env,
00130                         axis2_char_t* target_host);
00131 
00137     axis2_char_t* (AXIS2_CALL *
00138     get_target_host) (tcpmon_session_t *session,
00139                         const axis2_env_t *env);
00140 
00146     axis2_status_t (AXIS2_CALL *
00147     start) (tcpmon_session_t *session,
00148                         const axis2_env_t *env);
00149 
00155     axis2_status_t (AXIS2_CALL *
00156     stop) (tcpmon_session_t *session,
00157                         const axis2_env_t *env);
00158  
00165     axis2_status_t (AXIS2_CALL *
00166     on_new_entry) (tcpmon_session_t *session,
00167                         const axis2_env_t *env,
00168                         TCPMON_SESSION_NEW_ENTRY_FUNCT on_new_entry_funct);
00169 
00176     axis2_status_t (AXIS2_CALL *
00177     on_trans_fault) (tcpmon_session_t *session,
00178                         const axis2_env_t *env,
00179                         TCPMON_SESSION_TRANS_ERROR_FUNCT on_trans_fault_funct);
00180 
00181 
00182 };
00183 
00184  struct tcpmon_session 
00185 {
00186     tcpmon_session_ops_t *ops;
00187 };
00188 
00194 AXIS2_EXTERN tcpmon_session_t * AXIS2_CALL
00195 tcpmon_session_create(const axis2_env_t *env );
00196 
00197 /*************************** Function macros **********************************/
00198 
00199 #define TCPMON_SESSION_FREE(session, env) \
00200         ((session)->ops->free (session, env))
00201 
00202 #define TCPMON_SESSION_SET_TEST_BIT(session, env, test_bit) \
00203         ((session)->ops->set_test_bit(session, env, test_bit))
00204 
00205 #define TCPMON_SESSION_GET_TEST_BIT(session, env) \
00206         ((session)->ops->get_test_bit(session, env))
00207 
00208 #define TCPMON_SESSION_SET_LISTEN_PORT(session, env, listen_port) \
00209         ((session)->ops->set_listen_port(session, env, listen_port))
00210 
00211 #define TCPMON_SESSION_GET_LISTEN_PORT(session, env) \
00212         ((session)->ops->get_listen_port(session, env))
00213 
00214 #define TCPMON_SESSION_SET_TARGET_PORT(session, env, target_port) \
00215         ((session)->ops->set_target_port(session, env, target_port))
00216 
00217 #define TCPMON_SESSION_GET_TARGET_PORT(session, env) \
00218         ((session)->ops->get_target_port(session, env))
00219 
00220 #define TCPMON_SESSION_SET_TARGET_HOST(session, env, target_host) \
00221         ((session)->ops->set_target_host(session, env, target_host))
00222 
00223 #define TCPMON_SESSION_GET_TARGET_HOST(session, env) \
00224         ((session)->ops->get_target_host(session, env))
00225 
00226 #define TCPMON_SESSION_START(session, env) \
00227         ((session)->ops->start(session, env))
00228 
00229 #define TCPMON_SESSION_STOP(session, env) \
00230         ((session)->ops->stop(session, env))
00231 
00232 #define TCPMON_SESSION_ON_TRANS_FAULT(session, env, funct) \
00233         ((session)->ops->on_trans_fault(session, env, funct))
00234 
00235 #define TCPMON_SESSION_ON_NEW_ENTRY(session, env, funct) \
00236         ((session)->ops->on_new_entry(session, env, funct))
00237 
00240 #ifdef __cplusplus
00241 }
00242 #endif
00243 
00244 #endif /* TCPMON_SESSION_H */

Generated on Thu Oct 26 21:11:24 2006 for Axis2/C by  doxygen 1.4.7