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