00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ACE_ATM_ADDR_H
00014 #define ACE_ATM_ADDR_H
00015 #include "ace/pre.h"
00016
00017 #include "ace/config-all.h"
00018
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif
00022
00023 #if defined (ACE_HAS_ATM)
00024
00025 #include "ace/ACE_export.h"
00026 #include "ace/Addr.h"
00027
00028 #if defined (ACE_HAS_FORE_ATM_XTI)
00029 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00030 typedef ATMSAPAddress ATM_Addr;
00031 ACE_END_VERSIONED_NAMESPACE_DECL
00032 #elif defined (ACE_HAS_FORE_ATM_WS2)
00033 #define FORE_NAME_SPACE NS_ALL
00034 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00035 typedef struct sockaddr_atm ATM_Addr;
00036 ACE_END_VERSIONED_NAMESPACE_DECL
00037 #elif defined (ACE_HAS_LINUX_ATM)
00038
00039 #include "atm.h"
00040
00041
00042 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00043
00044
00045 typedef struct _linux_atm_addr
00046 {
00047 struct sockaddr_atmsvc sockaddratmsvc;
00048 struct atm_sap atmsap;
00049 } ATM_Addr;
00050 #else
00051 typedef int ATM_Addr;
00052 #endif
00053
00054
00055
00056
00057
00058
00059 class ACE_Export ACE_ATM_Addr : public ACE_Addr
00060 {
00061 public:
00062
00063 static const long LINE_RATE;
00064 static const int OPT_FLAGS_CPID;
00065 static const int OPT_FLAGS_PMP;
00066 static const int DEFAULT_SELECTOR;
00067
00068
00069
00070 ACE_ATM_Addr (u_char selector = DEFAULT_SELECTOR);
00071
00072
00073 ACE_ATM_Addr (const ACE_ATM_Addr &,
00074 u_char selector = DEFAULT_SELECTOR);
00075
00076
00077
00078
00079
00080
00081 ACE_ATM_Addr (const ATM_Addr *,
00082 u_char selector = DEFAULT_SELECTOR);
00083
00084
00085
00086
00087
00088
00089
00090 ACE_ATM_Addr (const ACE_TCHAR sap[],
00091 u_char selector = DEFAULT_SELECTOR);
00092
00093
00094 ~ACE_ATM_Addr (void);
00095
00096
00097
00098
00099 void init (u_char selector = DEFAULT_SELECTOR);
00100
00101
00102 int set (const ACE_ATM_Addr &,
00103 u_char selector = DEFAULT_SELECTOR);
00104
00105
00106
00107
00108
00109
00110 int set (const ATM_Addr *,
00111 u_char selector = DEFAULT_SELECTOR);
00112
00113
00114
00115
00116
00117
00118
00119 int set (const ACE_TCHAR sap[],
00120 u_char selector = DEFAULT_SELECTOR);
00121
00122
00123
00124
00125
00126
00127
00128 virtual int string_to_addr (const ACE_TCHAR sap[]);
00129
00130
00131
00132
00133
00134
00135
00136
00137 virtual int addr_to_string (ACE_TCHAR addr[],
00138 size_t addrlen) const;
00139
00140
00141
00142
00143
00144
00145
00146
00147 const ACE_TCHAR *addr_to_string (void) const;
00148
00149
00150 virtual void *get_addr (void) const;
00151
00152
00153 virtual void set_addr (void *, int);
00154
00155
00156 u_char get_selector (void) const;
00157
00158
00159 void set_selector (u_char selector);
00160
00161
00162
00163
00164
00165
00166 bool operator == (const ACE_ATM_Addr &SAP) const;
00167
00168
00169 bool operator != (const ACE_ATM_Addr &SAP) const;
00170
00171
00172 void dump (void) const;
00173
00174
00175 ACE_ALLOC_HOOK_DECLARE;
00176
00177
00178
00179
00180
00181
00182
00183 private:
00184 ATM_Addr atm_addr_;
00185 };
00186
00187
00188 ACE_END_VERSIONED_NAMESPACE_DECL
00189
00190
00191 #if defined (__ACE_INLINE__)
00192 #include "ace/ATM_Addr.inl"
00193 #endif
00194
00195 #endif
00196 #include "ace/post.h"
00197 #endif