00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef ACE_ATM_PARAMS_H
00015 #define ACE_ATM_PARAMS_H
00016 #include "ace/pre.h"
00017
00018 #include "ace/config-all.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif
00023
00024 #if defined (ACE_HAS_ATM)
00025
00026 #include "ace/ACE_export.h"
00027
00028 #if defined (ACE_HAS_FORE_ATM_XTI)
00029 #include "ace/TLI.h"
00030 #define ATM_PROTOCOL_DEFAULT 0
00031 typedef struct t_info Param_Info;
00032 typedef struct netbuf Param_Udata;
00033 #elif defined (ACE_HAS_FORE_ATM_WS2)
00034 #include "ace/SOCK.h"
00035 #define ATM_PROTOCOL_DEFAULT ATMPROTO_AAL5
00036 #define ACE_XTI_ATM_DEVICE ""
00037 typedef int Param_Info;
00038 typedef int Param_Udata;
00039 #elif defined (ACE_HAS_LINUX_ATM)
00040 #include "atm.h"
00041 #define AF_ATM PF_ATMSVC
00042 #define ACE_XTI_ATM_DEVICE ""
00043 #define ATM_PROTOCOL_DEFAULT ATM_AAL5
00044 typedef int Param_Info;
00045 typedef int Param_Udata;
00046 #else
00047 #define ACE_XTI_ATM_DEVICE ""
00048 typedef int Param_Info;
00049 typedef int Param_Udata;
00050 #endif
00051
00052
00053
00054
00055
00056
00057
00058 class ACE_Export ACE_ATM_Params
00059 {
00060 public:
00061
00062
00063
00064
00065
00066
00067
00068 ACE_ATM_Params (int rw_flag = 1,
00069 const char device[] = ACE_XTI_ATM_DEVICE,
00070 Param_Info *info = 0,
00071 Param_Udata *udata = 0,
00072 int oflag = O_RDWR,
00073 int protocol_family = AF_ATM,
00074 int protocol = ATM_PROTOCOL_DEFAULT,
00075 int type =
00076 #if defined (ACE_HAS_LINUX_ATM)
00077 SOCK_DGRAM,
00078 #else
00079 SOCK_RAW,
00080 #endif
00081 ACE_Protocol_Info *protocol_info = 0,
00082 ACE_SOCK_GROUP g = 0,
00083 u_long flags
00084 = ACE_FLAG_MULTIPOINT_C_ROOT
00085 | ACE_FLAG_MULTIPOINT_D_ROOT,
00086 int reuse_addr = 0);
00087
00088
00089 ~ACE_ATM_Params ();
00090
00091
00092 int get_protocol_family (void) const;
00093
00094
00095 void set_protocol_family (int);
00096
00097
00098 int get_protocol (void) const;
00099
00100
00101 void set_protocol (int);
00102
00103
00104 int get_type (void) const;
00105
00106
00107 void set_type (int);
00108
00109
00110 ACE_Protocol_Info *get_protocol_info( void );
00111
00112
00113 void set_protocol_info( ACE_Protocol_Info *);
00114
00115
00116 ACE_SOCK_GROUP get_sock_group( void );
00117
00118
00119 void set_sock_group( ACE_SOCK_GROUP );
00120
00121
00122 u_long get_flags( void );
00123
00124
00125 void set_flags( u_long );
00126
00127
00128 int get_reuse_addr (void) const;
00129
00130
00131 void set_reuse_addr (int);
00132
00133
00134 const char* get_device (void) const;
00135
00136
00137 Param_Info* get_info (void) const;
00138
00139
00140 void set_info (Param_Info *);
00141
00142
00143 int get_rw_flag (void) const;
00144
00145
00146 void set_rw_flag (int);
00147
00148
00149 Param_Udata* get_user_data (void) const;
00150
00151
00152 void set_user_data (Param_Udata*);
00153
00154
00155 int get_oflag (void) const;
00156
00157
00158 void set_oflag (int);
00159
00160
00161 void dump (void) const;
00162
00163
00164 ACE_ALLOC_HOOK_DECLARE;
00165
00166 private:
00167
00168 int protocol_family_;
00169
00170
00171 int protocol_;
00172
00173
00174 int type_;
00175
00176
00177 ACE_Protocol_Info *protocol_info_;
00178
00179
00180 ACE_SOCK_GROUP group_;
00181
00182
00183 u_long flags_;
00184
00185
00186 int reuse_addr_;
00187
00188
00189 const char *device_;
00190
00191
00192 Param_Info *info_;
00193
00194
00195 int rw_flag_;
00196
00197
00198 Param_Udata *udata_;
00199
00200
00201 int oflag_;
00202 };
00203
00204 #if defined (__ACE_INLINE__)
00205 #include "ace/ATM_Params.i"
00206 #endif
00207
00208 #endif
00209 #include "ace/post.h"
00210 #endif