3 //==========================================================================
7 * @author Joe Hoffert <joeh@cs.wustl.edu>
9 //==========================================================================
12 #ifndef ACE_ATM_PARAMS_H
13 #define ACE_ATM_PARAMS_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "ace/config-all.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #if defined (ACE_HAS_ATM)
24 #include /**/ "ace/ACE_export.h"
26 #if defined (ACE_HAS_FORE_ATM_XTI)
28 #define ATM_PROTOCOL_DEFAULT 0
29 typedef struct t_info Param_Info
;
30 typedef struct netbuf Param_Udata
;
31 #elif defined (ACE_HAS_FORE_ATM_WS2)
33 #define ATM_PROTOCOL_DEFAULT ATMPROTO_AAL5
34 #define ACE_XTI_ATM_DEVICE ""
35 typedef int Param_Info
;
36 typedef int Param_Udata
;
37 #elif defined (ACE_HAS_LINUX_ATM)
39 #define AF_ATM PF_ATMSVC
40 #define ACE_XTI_ATM_DEVICE ""
41 #define ATM_PROTOCOL_DEFAULT ATM_AAL5
42 typedef int Param_Info
;
43 typedef int Param_Udata
;
45 #define ACE_XTI_ATM_DEVICE ""
46 typedef int Param_Info
;
47 typedef int Param_Udata
;
48 #endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */
50 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
53 * @class ACE_ATM_Params
55 * @brief Wrapper class that simplifies the information passed to the ATM
56 * enabled ACE_ATM_Connector class.
58 class ACE_Export ACE_ATM_Params
62 * Initialize the data members. This class combines options from
63 * ACE_SOCK_Connector (@a protocol_family, @a protocol, <type>,
64 * @a protocol_info, <group>, and @a flags) and
65 * ACE_TLI_Connector (<device>, <info>, <rw_flag>, <oflag>, and <udata>)
66 * so that either mechanism can be used transparently for ATM.
68 ACE_ATM_Params (int rw_flag
= 1,
69 const char device
[] = ACE_XTI_ATM_DEVICE
,
71 Param_Udata
*udata
= 0,
73 int protocol_family
= AF_ATM
,
74 int protocol
= ATM_PROTOCOL_DEFAULT
,
76 #if defined (ACE_HAS_LINUX_ATM)
80 #endif /* ACE_HAS_LINUX_ATM */
81 ACE_Protocol_Info
*protocol_info
= 0,
84 = ACE_FLAG_MULTIPOINT_C_ROOT
85 | ACE_FLAG_MULTIPOINT_D_ROOT
, // connector by default
91 /// Get protocol family.
92 int get_protocol_family () const;
94 /// Set protocol family.
95 void set_protocol_family (int);
98 int get_protocol () const;
101 void set_protocol (int);
104 int get_type () const;
109 /// Get protocol info.
110 ACE_Protocol_Info
*get_protocol_info();
112 /// Set protocol info.
113 void set_protocol_info( ACE_Protocol_Info
*);
115 /// Get socket group.
116 ACE_SOCK_GROUP
get_sock_group();
118 /// Set socket group.
119 void set_sock_group( ACE_SOCK_GROUP
);
121 /// Get socket flags.
124 /// Set socket flags.
125 void set_flags(u_long
);
127 /// Get reuse_addr flag.
128 int get_reuse_addr () const;
130 /// Set reuse_addr flag.
131 void set_reuse_addr (int);
134 const char* get_device () const;
137 Param_Info
* get_info () const;
140 void set_info (Param_Info
*);
143 int get_rw_flag () const;
146 void set_rw_flag (int);
149 Param_Udata
* get_user_data () const;
152 void set_user_data (Param_Udata
*);
155 int get_oflag () const;
158 void set_oflag (int);
160 /// Dump the state of an object.
163 /// Declare the dynamic allocation hooks.
164 ACE_ALLOC_HOOK_DECLARE
;
167 /// Protocol family for sockets connections.
168 int protocol_family_
;
170 /// Protocol for sockets connections.
173 /// Type for opening sockets.
176 /// Information about the protocol.
177 ACE_Protocol_Info
*protocol_info_
;
179 /// Socket group used (for sockets only).
180 ACE_SOCK_GROUP group_
;
182 /// Flags for sockets (for sockets only).
185 /// Flag for reusing address for opening sockets.
188 /// Device name for XTI/ATM connections.
191 /// Info for XTI/ATM connections.
194 /// R/W flag for XTI/ATM connections.
197 /// User data for XTI/ATM connections.
200 /// Open flag for XTI/ATM connections.
204 ACE_END_VERSIONED_NAMESPACE_DECL
206 #if defined (__ACE_INLINE__)
207 #include "ace/ATM_Params.inl"
208 #endif /* __ACE_INLINE__ */
210 #endif /* ACE_HAS_ATM */
211 #include /**/ "ace/post.h"
212 #endif /* ACE_ATM_PARAMS_H */