3 //==========================================================================
7 * $Id: ATM_Params.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Joe Hoffert <joeh@cs.wustl.edu>
11 //==========================================================================
14 #ifndef ACE_ATM_PARAMS_H
15 #define ACE_ATM_PARAMS_H
16 #include /**/ "ace/pre.h"
18 #include /**/ "ace/config-all.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #if defined (ACE_HAS_ATM)
26 #include /**/ "ace/ACE_export.h"
28 #if defined (ACE_HAS_FORE_ATM_XTI)
30 #define ATM_PROTOCOL_DEFAULT 0
31 typedef struct t_info Param_Info
;
32 typedef struct netbuf Param_Udata
;
33 #elif defined (ACE_HAS_FORE_ATM_WS2)
35 #define ATM_PROTOCOL_DEFAULT ATMPROTO_AAL5
36 #define ACE_XTI_ATM_DEVICE ""
37 typedef int Param_Info
;
38 typedef int Param_Udata
;
39 #elif defined (ACE_HAS_LINUX_ATM)
41 #define AF_ATM PF_ATMSVC
42 #define ACE_XTI_ATM_DEVICE ""
43 #define ATM_PROTOCOL_DEFAULT ATM_AAL5
44 typedef int Param_Info
;
45 typedef int Param_Udata
;
47 #define ACE_XTI_ATM_DEVICE ""
48 typedef int Param_Info
;
49 typedef int Param_Udata
;
50 #endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */
52 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
55 * @class ACE_ATM_Params
57 * @brief Wrapper class that simplifies the information passed to the ATM
58 * enabled ACE_ATM_Connector class.
60 class ACE_Export ACE_ATM_Params
64 * Initialize the data members. This class combines options from
65 * ACE_SOCK_Connector (@a protocol_family, @a protocol, <type>,
66 * @a protocol_info, <group>, and @a flags) and
67 * ACE_TLI_Connector (<device>, <info>, <rw_flag>, <oflag>, and <udata>)
68 * so that either mechanism can be used transparently for ATM.
70 ACE_ATM_Params (int rw_flag
= 1,
71 const char device
[] = ACE_XTI_ATM_DEVICE
,
73 Param_Udata
*udata
= 0,
75 int protocol_family
= AF_ATM
,
76 int protocol
= ATM_PROTOCOL_DEFAULT
,
78 #if defined (ACE_HAS_LINUX_ATM)
82 #endif /* ACE_HAS_LINUX_ATM */
83 ACE_Protocol_Info
*protocol_info
= 0,
86 = ACE_FLAG_MULTIPOINT_C_ROOT
87 | ACE_FLAG_MULTIPOINT_D_ROOT
, // connector by default
93 /// Get protocol family.
94 int get_protocol_family (void) const;
96 /// Set protocol family.
97 void set_protocol_family (int);
100 int get_protocol (void) const;
103 void set_protocol (int);
106 int get_type (void) const;
111 /// Get protocol info.
112 ACE_Protocol_Info
*get_protocol_info( void );
114 /// Set protocol info.
115 void set_protocol_info( ACE_Protocol_Info
*);
117 /// Get socket group.
118 ACE_SOCK_GROUP
get_sock_group( void );
120 /// Set socket group.
121 void set_sock_group( ACE_SOCK_GROUP
);
123 /// Get socket flags.
124 u_long
get_flags( void );
126 /// Set socket flags.
127 void set_flags( u_long
);
129 /// Get reuse_addr flag.
130 int get_reuse_addr (void) const;
132 /// Set reuse_addr flag.
133 void set_reuse_addr (int);
136 const char* get_device (void) const;
139 Param_Info
* get_info (void) const;
142 void set_info (Param_Info
*);
145 int get_rw_flag (void) const;
148 void set_rw_flag (int);
151 Param_Udata
* get_user_data (void) const;
154 void set_user_data (Param_Udata
*);
157 int get_oflag (void) const;
160 void set_oflag (int);
162 /// Dump the state of an object.
163 void dump (void) const;
165 /// Declare the dynamic allocation hooks.
166 ACE_ALLOC_HOOK_DECLARE
;
169 /// Protocol family for sockets connections.
170 int protocol_family_
;
172 /// Protocol for sockets connections.
175 /// Type for opening sockets.
178 /// Information about the protocol.
179 ACE_Protocol_Info
*protocol_info_
;
181 /// Socket group used (for sockets only).
182 ACE_SOCK_GROUP group_
;
184 /// Flags for sockets (for sockets only).
187 /// Flag for reusing address for opening sockets.
190 /// Device name for XTI/ATM connections.
193 /// Info for XTI/ATM connections.
196 /// R/W flag for XTI/ATM connections.
199 /// User data for XTI/ATM connections.
202 /// Open flag for XTI/ATM connections.
206 ACE_END_VERSIONED_NAMESPACE_DECL
208 #if defined (__ACE_INLINE__)
209 #include "ace/ATM_Params.inl"
210 #endif /* __ACE_INLINE__ */
212 #endif /* ACE_HAS_ATM */
213 #include /**/ "ace/post.h"
214 #endif /* ACE_ATM_PARAMS_H */