Main Page   Class Hierarchy   Compound List   File List   Compound Members  

C_TransSCTP.hpp

00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00015  *
00016  * (c)Copyright 2006 Hewlett-Packard Development Company, LP.
00017  *
00018  */
00019 #ifndef _C_TRANS_SCTP_
00020 #define _C_TRANS_SCTP_
00021 
00022 #define NO_TRANS_IP_CONTEXT 0L
00023 
00024 #include <sys/time.h>
00025 
00026 #include "list_t.hpp"
00027 #include "C_Transport.hpp"
00028 #include "S_SCTPIpAddr.hpp"
00029 
00030 #include "C_SocketSCTP.hpp"
00031 #include "C_ProtocolBinaryFrame.hpp"
00032 
00033 class C_TransSCTP : public C_Transport {
00034 
00035 public:
00036 
00037    C_TransSCTP ();
00038   ~C_TransSCTP ();
00039 
00040   int         init       (char *P_buf,
00041                           T_logFunction P_logError,
00042                           T_logFunction P_logInfo) ;
00043 
00044   int         config (T_pConfigValueList P_config_param_list) ;
00045 
00046 
00047   int         open       (int              P_channel_id,
00048                           char            *P_buf, 
00049                           T_pOpenStatus    P_status,
00050                           C_ProtocolFrame *P_protocol);
00051 
00052   int         pre_select (int             P_n, 
00053                           fd_set         *P_readfds,  
00054                           fd_set         *P_writefds,
00055                           fd_set         *P_exceptfds, 
00056                           struct timeval *P_timeout, 
00057                           int            *P_cnx, 
00058                           size_t          P_nb) ;
00059 
00060   int         post_select (int                 P_n, 
00061                            fd_set             *P_readfds,  
00062                            fd_set             *P_writefds,
00063                            fd_set             *P_exceptfds, 
00064                            T_pC_TransportEvent P_eventTable,
00065                            size_t             *P_nb);
00066 
00067   size_t      send_buffer     (int             P_id, 
00068                                unsigned char  *P_data, 
00069                                size_t          P_size);
00070   size_t      send_buffer2    (int             P_id,
00071                                unsigned char  *P_data,
00072                                size_t          P_size);
00073 
00074   int         send_message    (int             P_id,
00075                                C_MessageFrame *P_msg);
00076 
00077   size_t received_buffer (int             P_id, 
00078                           unsigned char  *P_data,
00079                           size_t          P_size_buf);
00080 
00081   bool        get_message (int P_id, T_pReceiveMsgContext P_ctxt) ;
00082 
00083   int         set_channel_id (int P_id, int P_channel_id);
00084   
00085   int close (); 
00086   int close (int P_id);
00087 
00088   T_SelectDef select_definition() ;
00089 
00090 private:
00091 
00092   T_SocketType    m_trans_type ;
00093   T_SocketMap     m_socket_map ;
00094   T_IpAddrList    m_ip_addr_list  ;
00095   int             m_max_fd     ;
00096   
00097   bool            analyze_init_string (char *P_buf) ;
00098   bool            analyze_open_string (char *P_buf, T_pIpAddr P_addr) ;
00099   int             open                (int              P_channel_id,
00100                                        T_pIpAddr     P_Addr,
00101                                        T_pOpenStatus    P_status,
00102                                        C_ProtocolBinaryFrame *P_protocol) ;
00103   int             extract_ip_addr(T_pIpAddr P_pIpAddr);
00104   int             resolve_addr(T_pIpAddr P_pIpAddr);
00105   int             inet_addr   (char                   **P_addr, 
00106                                T_SockAddrStorage       *P_AddrS);;
00107 
00108   void            decode_from_protocol (C_SocketSCTP *P_socket);
00109   size_t                        m_buffer_size ;
00110   list_t<T_SocketMap::iterator> m_delete_list ;
00111   list_t<C_SocketSCTP *>        m_insert_list ;
00112 
00113 } ;
00114 
00115 typedef C_TransSCTP *T_pC_TransSCTP ;
00116 
00117 extern "C" T_pTransport create_cipio_instance () ;
00118 extern "C" void         delete_cipio_instance (T_ppTransport) ;
00119 
00120 #endif // _C_TRANS_SCTP_

Generated on Wed Mar 7 14:44:59 2007 for Seagull by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002