00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ACE_OS_QOS_H
00016 #define ACE_OS_QOS_H
00017 #include "ace/pre.h"
00018
00019 #include "ace/OS.h"
00020
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif
00024
00025 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
00026 #if defined (ACE_HAS_WINSOCK2_GQOS)
00027 typedef SERVICETYPE ACE_SERVICE_TYPE;
00028 #else
00029 typedef u_long ACE_SERVICE_TYPE;
00030 #endif
00031
00032
00033 #define ACE_OVERLAPPED_SOCKET_FLAG WSA_FLAG_OVERLAPPED
00034
00035 #define ACE_XP1_QOS_SUPPORTED XP1_QOS_SUPPORTED
00036 #define ACE_XP1_SUPPORT_MULTIPOINT XP1_SUPPORT_MULTIPOINT
00037
00038 #define ACE_BASEERR WSABASEERR
00039 #define ACE_ENOBUFS WSAENOBUFS
00040 #define ACE_FROM_PROTOCOL_INFO FROM_PROTOCOL_INFO
00041 #define ACE_FLAG_MULTIPOINT_C_ROOT WSA_FLAG_MULTIPOINT_C_ROOT
00042 #define ACE_FLAG_MULTIPOINT_C_LEAF WSA_FLAG_MULTIPOINT_C_LEAF
00043 #define ACE_FLAG_MULTIPOINT_D_ROOT WSA_FLAG_MULTIPOINT_D_ROOT
00044 #define ACE_FLAG_MULTIPOINT_D_LEAF WSA_FLAG_MULTIPOINT_D_LEAF
00045
00046 #define ACE_QOS_NOT_SPECIFIED QOS_NOT_SPECIFIED
00047 #define ACE_SERVICETYPE_NOTRAFFIC SERVICETYPE_NOTRAFFIC
00048 #define ACE_SERVICETYPE_CONTROLLEDLOAD SERVICETYPE_CONTROLLEDLOAD
00049 #define ACE_SERVICETYPE_GUARANTEED SERVICETYPE_GUARANTEED
00050
00051 #define ACE_JL_SENDER_ONLY JL_SENDER_ONLY
00052 #define ACE_JL_BOTH JL_BOTH
00053
00054 #define ACE_SIO_GET_QOS SIO_GET_QOS
00055 #define ACE_SIO_MULTIPOINT_LOOPBACK SIO_MULTIPOINT_LOOPBACK
00056 #define ACE_SIO_MULTICAST_SCOPE SIO_MULTICAST_SCOPE
00057 #define ACE_SIO_SET_QOS SIO_SET_QOS
00058
00059 #else
00060 typedef u_long ACE_SERVICE_TYPE;
00061
00062 #define ACE_OVERLAPPED_SOCKET_FLAG 0
00063 #define ACE_XP1_QOS_SUPPORTED 0x00002000
00064 #define ACE_XP1_SUPPORT_MULTIPOINT 0x00000400
00065
00066 #define ACE_BASEERR 10000
00067 #define ACE_ENOBUFS (ACE_BASEERR+55)
00068
00069 #define ACE_FROM_PROTOCOL_INFO (-1)
00070
00071 #define ACE_FLAG_MULTIPOINT_C_ROOT 0x02
00072 #define ACE_FLAG_MULTIPOINT_C_LEAF 0x04
00073 #define ACE_FLAG_MULTIPOINT_D_ROOT 0x08
00074 #define ACE_FLAG_MULTIPOINT_D_LEAF 0x10
00075
00076 #define ACE_QOS_NOT_SPECIFIED 0xFFFFFFFF
00077 #define ACE_SERVICETYPE_NOTRAFFIC 0x00000000
00078
00079 #define ACE_SERVICETYPE_CONTROLLEDLOAD 0x00000001
00080 #define ACE_SERVICETYPE_GUARANTEED 0x00000003
00081
00082 #define ACE_JL_SENDER_ONLY 0x01
00083 #define ACE_JL_BOTH 0x04
00084
00085 #define ACE_SIO_GET_QOS (0x40000000 | 0x08000000 | 7)
00086 #define ACE_SIO_MULTIPOINT_LOOPBACK (0x08000000 | 9)
00087 #define ACE_SIO_MULTICAST_SCOPE (0x08000000 | 10)
00088 #define ACE_SIO_SET_QOS (0x08000000 | 11)
00089
00090 #endif
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 class ACE_OS_Export ACE_Flow_Spec
00102 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
00103 : public FLOWSPEC
00104 #endif
00105 {
00106 public:
00107
00108 ACE_Flow_Spec (void);
00109
00110
00111 ACE_Flow_Spec (u_long token_rate,
00112 u_long token_bucket_size,
00113 u_long peak_bandwidth,
00114 u_long latency,
00115 u_long delay_variation,
00116 ACE_SERVICE_TYPE service_type,
00117 u_long max_sdu_size,
00118 u_long minimum_policed_size,
00119 int ttl,
00120 int priority);
00121
00122
00123 u_long token_rate (void) const;
00124
00125
00126 void token_rate (u_long tr);
00127
00128
00129 u_long token_bucket_size (void) const;
00130
00131
00132 void token_bucket_size (u_long tbs);
00133
00134
00135 u_long peak_bandwidth (void) const;
00136
00137
00138 void peak_bandwidth (u_long pb);
00139
00140
00141 u_long latency (void) const;
00142
00143
00144 void latency (u_long l);
00145
00146
00147 u_long delay_variation (void) const;
00148
00149
00150 void delay_variation (u_long dv);
00151
00152
00153 ACE_SERVICE_TYPE service_type (void) const;
00154
00155
00156 void service_type (ACE_SERVICE_TYPE st);
00157
00158
00159 u_long max_sdu_size (void) const;
00160
00161
00162 void max_sdu_size (u_long mss);
00163
00164
00165 u_long minimum_policed_size (void) const;
00166
00167
00168 void minimum_policed_size (u_long mps);
00169
00170
00171 int ttl (void) const;
00172
00173
00174 void ttl (int t);
00175
00176
00177 int priority (void) const;
00178
00179
00180 void priority (int p);
00181
00182 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) && \
00183 defined (ACE_HAS_WINSOCK2_GQOS)
00184 #else
00185 private:
00186 u_long token_rate_;
00187 u_long token_bucket_size_;
00188 u_long peak_bandwidth_;
00189 u_long latency_;
00190 u_long delay_variation_;
00191 ACE_SERVICE_TYPE service_type_;
00192 u_long max_sdu_size_;
00193 u_long minimum_policed_size_;
00194 int ttl_;
00195 int priority_;
00196 #endif
00197
00198 };
00199
00200
00201
00202
00203
00204
00205
00206 class ACE_OS_Export ACE_QoS
00207 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
00208 : public QOS
00209 #endif
00210 {
00211 public:
00212
00213 ACE_QoS (void);
00214
00215
00216 ACE_Flow_Spec *sending_flowspec (void) const;
00217
00218
00219 void sending_flowspec (ACE_Flow_Spec *fs);
00220
00221
00222 ACE_Flow_Spec *receiving_flowspec (void) const;
00223
00224
00225 void receiving_flowspec (ACE_Flow_Spec *fs);
00226
00227
00228 iovec provider_specific (void) const;
00229
00230
00231 void provider_specific (const iovec &ps);
00232
00233 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
00234 #else
00235 private:
00236
00237 ACE_Flow_Spec *sending_flowspec_;
00238 ACE_Flow_Spec *receiving_flowspec_;
00239 #endif
00240
00241 };
00242
00243
00244
00245
00246
00247
00248
00249 class ACE_OS_Export ACE_QoS_Params
00250 {
00251 public:
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263 ACE_QoS_Params (iovec *caller_data = 0,
00264 iovec *callee_data = 0,
00265 ACE_QoS *socket_qos = 0,
00266 ACE_QoS *group_socket_qos = 0,
00267 u_long flags = 0);
00268
00269
00270 iovec *caller_data (void) const;
00271
00272
00273 void caller_data (iovec *);
00274
00275
00276 iovec *callee_data (void) const;
00277
00278
00279 void callee_data (iovec *);
00280
00281
00282 ACE_QoS *socket_qos (void) const;
00283
00284
00285 void socket_qos (ACE_QoS *);
00286
00287
00288 ACE_QoS *group_socket_qos (void) const;
00289
00290
00291 void group_socket_qos (ACE_QoS *);
00292
00293
00294 u_long flags (void) const;
00295
00296
00297 void flags (u_long);
00298
00299 private:
00300
00301
00302 iovec *caller_data_;
00303
00304
00305
00306 iovec *callee_data_;
00307
00308
00309
00310 ACE_QoS *socket_qos_;
00311
00312
00313
00314 ACE_QoS *group_socket_qos_;
00315
00316
00317 u_long flags_;
00318 };
00319
00320
00321
00322 typedef int (*ACE_QOS_CONDITION_FUNC) (iovec *caller_id,
00323 iovec *caller_data,
00324 ACE_QoS *socket_qos,
00325 ACE_QoS *group_socket_qos,
00326 iovec *callee_id,
00327 iovec *callee_data,
00328 ACE_SOCK_GROUP *g,
00329 u_long callbackdata);
00330
00331
00332
00333
00334
00335
00336
00337
00338 class ACE_OS_Export ACE_Accept_QoS_Params
00339 {
00340 public:
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351 ACE_Accept_QoS_Params (ACE_QOS_CONDITION_FUNC qos_condition_callback = 0,
00352 u_long callback_data = 0);
00353
00354
00355 ACE_QOS_CONDITION_FUNC qos_condition_callback (void) const;
00356
00357
00358 void qos_condition_callback (ACE_QOS_CONDITION_FUNC qcc);
00359
00360
00361 u_long callback_data (void) const;
00362
00363
00364 void callback_data (u_long cd);
00365
00366 private:
00367
00368
00369
00370
00371
00372
00373
00374 ACE_QOS_CONDITION_FUNC qos_condition_callback_;
00375
00376
00377
00378
00379
00380
00381 u_long callback_data_;
00382 };
00383
00384
00385 #include "ace/post.h"
00386 #endif