TLI.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    TLI.h
00006  *
00007  *  TLI.h,v 4.20 2005/10/28 16:14:56 ossama Exp
00008  *
00009  *  @author Doug Schmidt
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_TLI_H
00015 #define ACE_TLI_H
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "ace/config-lite.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "ace/OS_TLI.h"
00025 
00026 #if defined (ACE_HAS_TLI)
00027 
00028 #include "ace/IPC_SAP.h"
00029 #include "ace/Addr.h"
00030 #include "ace/os_include/os_fcntl.h"
00031 
00032 // There's not a universal device name for TLI devices.  If the platform
00033 // needs something other than /dev/tcp, it needs to be set up in the config.h
00034 // file as ACE_TLI_TCP_DEVICE.
00035 #ifndef ACE_TLI_TCP_DEVICE
00036 #define ACE_TLI_TCP_DEVICE "/dev/tcp"
00037 #endif
00038 
00039 // There's not a universal device name for XTI/ATM devices.  If the platform
00040 // needs something other than /dev/xtisvc0, it needs to be set up in the
00041 // config.h file as ACE_XTI_ATM_DEVICE. This may be FORE vendor specific and
00042 // there may be no good default.
00043 #ifndef ACE_XTI_ATM_DEVICE
00044 #define ACE_XTI_ATM_DEVICE "/dev/xtisvc0"
00045 #endif
00046 
00047 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00048 
00049 /**
00050  * @class ACE_TLI
00051  *
00052  * @brief Defines the member functions for the base class of the
00053  * ACE_TLI  abstraction.
00054  */
00055 class ACE_Export ACE_TLI : public ACE_IPC_SAP
00056 {
00057 public:
00058   // = Initialization and termination methods.
00059   /// Initialize a TLI endpoint.
00060   ACE_HANDLE open (const char device[],
00061                    int oflag = O_RDWR,
00062                    struct t_info *info = 0);
00063 
00064   /// Close a TLI endpoint and release resources.
00065   int close (void);
00066 
00067   /// Set underlying protocol options.
00068   int set_option (int level, int option, void *optval, int optlen);
00069 
00070   /// Get underlying protocol options.
00071   int get_option (int level, int option, void *optval, int &optlen);
00072 
00073   // = Calls to underlying TLI operations.
00074   int look (void) const;
00075   int rcvdis (struct t_discon * = 0) const;
00076   int snddis (struct t_call * = 0) const;
00077   int sndrel (void) const;
00078   int rcvrel (void) const;
00079 
00080   /// Return our local endpoint address.
00081   int get_local_addr (ACE_Addr &) const;
00082 
00083   /// Dump the state of an object.
00084   void dump (void) const;
00085 
00086   /// Declare the dynamic allocation hooks.
00087   ACE_ALLOC_HOOK_DECLARE;
00088 
00089 protected:
00090   // = Ensure we are an abstract class.
00091   /// Default constructor.
00092   ACE_TLI (void);
00093 
00094   /// Destructor.
00095   ~ACE_TLI (void);
00096 
00097   /// Initialize a TLI endpoint.
00098   ACE_TLI (const char device[], int oflag = O_RDWR, struct t_info *info = 0);
00099 
00100 private:
00101 #if defined (ACE_HAS_SVR4_TLI)
00102   // XTI/TLI option management.
00103   struct t_optmgmt so_opt_req;
00104   struct t_optmgmt so_opt_ret;
00105 #endif /* ACE_HAS_SVR4_TLI */
00106 };
00107 
00108 ACE_END_VERSIONED_NAMESPACE_DECL
00109 
00110 #if defined (__ACE_INLINE__)
00111 #include "ace/TLI.inl"
00112 #endif /* __ACE_INLINE__ */
00113 
00114 #endif /* ACE_HAS_TLI */
00115 #include /**/ "ace/post.h"
00116 #endif /* ACE_TLI_H */

Generated on Thu Nov 9 09:42:07 2006 for ACE by doxygen 1.3.6