00001 // -*- C++ -*- 00002 00003 //========================================================================== 00004 /** 00005 * @file SPIPE_Addr.h 00006 * 00007 * $Id: SPIPE_Addr.h 80826 2008-03-04 14:51:23Z wotte $ 00008 * 00009 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> 00010 */ 00011 //========================================================================== 00012 00013 #ifndef ACE_SPIPE_ADDR_H 00014 #define ACE_SPIPE_ADDR_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include /**/ "ace/ACE_export.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "ace/Addr.h" 00025 #include "ace/os_include/sys/os_types.h" 00026 #include "ace/os_include/os_dirent.h" 00027 00028 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00029 00030 /** 00031 * @class ACE_SPIPE_Addr 00032 * 00033 * @brief Defines the SVR4 STREAM pipe address family address format. 00034 */ 00035 class ACE_Export ACE_SPIPE_Addr : public ACE_Addr 00036 { 00037 public: 00038 // = Initialization methods. 00039 /// Default constructor. 00040 ACE_SPIPE_Addr (void); 00041 00042 /// Copy constructor. 00043 ACE_SPIPE_Addr (const ACE_SPIPE_Addr &sa); 00044 00045 /// Create a ACE_SPIPE_Addr from a rendezvous point in the file 00046 /// system. 00047 ACE_SPIPE_Addr (const ACE_TCHAR *rendezvous_point, gid_t = 0, uid_t = 0); 00048 00049 /// Acts like a copy constructor... 00050 int set (const ACE_SPIPE_Addr &sa); 00051 00052 /// Create a ACE_SPIPE_Addr from a rendezvous point in the file 00053 /// system. 00054 int set (const ACE_TCHAR *rendezvous_point, gid_t = 0, uid_t = 0); 00055 00056 /// Return a pointer to the address. 00057 virtual void *get_addr (void) const; 00058 00059 /// Set a pointer to the underlying network address. 00060 virtual void set_addr (void *addr, int len); 00061 00062 /// Transform the current address into string format. 00063 virtual int addr_to_string (ACE_TCHAR *addr, size_t) const; 00064 00065 /// Transform the string into the current addressing format. 00066 virtual int string_to_addr (const ACE_TCHAR *addr); 00067 00068 // = Equality/inequality tests 00069 /// Check for equality. 00070 bool operator == (const ACE_SPIPE_Addr &SAP) const; 00071 00072 /// Check for inequality 00073 bool operator != (const ACE_SPIPE_Addr &SAP) const; 00074 00075 // = SPIPE-specific address operations 00076 /// Pathname of rendezvous point in file system. 00077 const ACE_TCHAR *get_path_name (void) const; 00078 00079 /// Get user id. 00080 uid_t user_id (void) const; 00081 00082 /// Set user id. 00083 void user_id (uid_t uid); 00084 00085 /// Set group ids. 00086 void group_id (gid_t gid); 00087 00088 /// Get group ids. 00089 gid_t group_id (void) const; 00090 00091 /// Dump the state of an object. 00092 void dump (void) const; 00093 00094 /// Declare the dynamic allocation hooks. 00095 ACE_ALLOC_HOOK_DECLARE; 00096 00097 private: 00098 /// Contains security attributes. 00099 struct SPIPE_Addr 00100 { 00101 /// Group id. 00102 gid_t gid_; 00103 00104 /// User id. 00105 uid_t uid_; 00106 00107 /// Pathname in the file system. 00108 ACE_TCHAR rendezvous_[MAXPATHLEN + 1]; 00109 00110 } SPIPE_addr_; 00111 // Contents of an SPIPE address. 00112 }; 00113 00114 ACE_END_VERSIONED_NAMESPACE_DECL 00115 00116 #if defined (__ACE_INLINE__) 00117 #include "ace/SPIPE_Addr.inl" 00118 #endif /* __ACE_INLINE__ */ 00119 00120 #include /**/ "ace/post.h" 00121 00122 #endif /* ACE_SPIPE_ADDR_H */