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     
00075     axis2_status_t (AXIS2_CALL *
00076     set_listen_port) (tcpmon_session_t *session,
00077                         const axis2_env_t *env,
00078                         int listen_port);
00079 
00085     int (AXIS2_CALL *
00086     get_listen_port) (tcpmon_session_t *session,
00087                         const axis2_env_t *env);
00088   
00096     axis2_status_t (AXIS2_CALL *
00097     set_target_port) (tcpmon_session_t *session,
00098                         const axis2_env_t *env,
00099                         int target_port);
00100 
00106     int (AXIS2_CALL *
00107     get_target_port) (tcpmon_session_t *session,
00108                         const axis2_env_t *env);
00109 
00117     axis2_status_t (AXIS2_CALL *
00118     set_target_host) (tcpmon_session_t *session,
00119                         const axis2_env_t *env,
00120                         axis2_char_t* target_host);
00121 
00127     axis2_char_t* (AXIS2_CALL *
00128     get_target_host) (tcpmon_session_t *session,
00129                         const axis2_env_t *env);
00130 
00136     axis2_status_t (AXIS2_CALL *
00137     start) (tcpmon_session_t *session,
00138                         const axis2_env_t *env);
00139 
00145     axis2_status_t (AXIS2_CALL *
00146     stop) (tcpmon_session_t *session,
00147                         const axis2_env_t *env);
00148  
00155     axis2_status_t (AXIS2_CALL *
00156     on_new_entry) (tcpmon_session_t *session,
00157                         const axis2_env_t *env,
00158                         TCPMON_SESSION_NEW_ENTRY_FUNCT on_new_entry_funct);
00159 
00166     axis2_status_t (AXIS2_CALL *
00167     on_trans_fault) (tcpmon_session_t *session,
00168                         const axis2_env_t *env,
00169                         TCPMON_SESSION_TRANS_ERROR_FUNCT on_trans_fault_funct);
00170 
00171 
00172 };
00173 
00174  struct tcpmon_session 
00175 {
00176     tcpmon_session_ops_t *ops;
00177 };
00178 
00184 AXIS2_EXTERN tcpmon_session_t * AXIS2_CALL
00185 tcpmon_session_create(const axis2_env_t *env );
00186 
00187 /*************************** Function macros **********************************/
00188 
00189 #define TCPMON_SESSION_FREE(session, env) \
00190         ((session)->ops->free (session, env))
00191 
00192 #define TCPMON_SESSION_SET_LISTEN_PORT(session, env, listen_port) \
00193         ((session)->ops->set_listen_port(session, env, listen_port))
00194 
00195 #define TCPMON_SESSION_GET_LISTEN_PORT(session, env) \
00196         ((session)->ops->get_listen_port(session, env))
00197 
00198 #define TCPMON_SESSION_SET_TARGET_PORT(session, env, target_port) \
00199         ((session)->ops->set_target_port(session, env, target_port))
00200 
00201 #define TCPMON_SESSION_GET_TARGET_PORT(session, env) \
00202         ((session)->ops->get_target_port(session, env))
00203 
00204 #define TCPMON_SESSION_SET_TARGET_HOST(session, env, target_host) \
00205         ((session)->ops->set_target_host(session, env, target_host))
00206 
00207 #define TCPMON_SESSION_GET_TARGET_HOST(session, env) \
00208         ((session)->ops->get_target_host(session, env))
00209 
00210 #define TCPMON_SESSION_START(session, env) \
00211         ((session)->ops->start(session, env))
00212 
00213 #define TCPMON_SESSION_STOP(session, env) \
00214         ((session)->ops->stop(session, env))
00215 
00216 #define TCPMON_SESSION_ON_TRANS_FAULT(session, env, funct) \
00217         ((session)->ops->on_trans_fault(session, env, funct))
00218 
00219 #define TCPMON_SESSION_ON_NEW_ENTRY(session, env, funct) \
00220         ((session)->ops->on_new_entry(session, env, funct))
00221 
00224 #ifdef __cplusplus
00225 }
00226 #endif
00227 
00228 #endif /* TCPMON_SESSION_H */

Generated on Tue Oct 3 22:35:48 2006 for Axis2/C by  doxygen 1.4.7