1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
10 #include <anna/diameter/app/dcca/Message.hpp>
13 using namespace anna::diameter::app::dcca;
16 const qosProfile_t & Message::decode3GPPGPRSNegQoSProfile() throw(anna::RuntimeException) {
17 const std::string & utf8 = get3GPPGPRSNegQoSProfile()->getValue();
25 // 5 - 3GPP-GPRS Negotiated QoS profile
28 // Octets 8 7 6 5 4 3 2 1
31 // 3 - L UTF-8 encoded QoS profile
34 // Length: For GGSN, L ? 37 (release 7 or higher) or L ? 33 (release 6 or release 5) or L ? 27 (release 4 or release 99) or L = 11 (release 98). For P-GW, the length varies depending on the value of QCI. See below for details.
35 // QoS profile value: Text type
36 // UTF-8 encoded QoS profile syntax:
37 // "<Release indicator>
\96 <release specific QoS IE UTF-8 encoding>"
38 // <Release indicator> = UTF-8 encoded number (two characters) :
41 // "99"= Release 99 or release 4
42 // "05"= Release 5 or release 6
43 // "07"= Release 7 or higher
45 // "08"= Release 8 or higher
46 // <release specific QoS profile UTF-8 encoding> = UTF-8 encoded QoS profile for the release indicated by the release indicator.
47 // The UTF-8 encoding of a QoS IE is defined as follows: each octet is described by 2 UTF-8 encoded characters, defining its hexadecimal representation.
49 // The QoS profile definition is in 3GPP TS 24.008 [54].
50 // The release 98 QoS profile data is 3 octets long, which then results in a 6 octets UTF-8 encoded string.
51 // The release 99 and release 4 QoS profile data is 11 octets long, which results in a 22 octets UTF-8 encoded string.
52 // The release 5 and release 6 QoS profile data is 14 octets long, which results in a 28 octets UTF-8 encoded string.
53 // The release 7 (and higher) QoS profile data is 16 octets long, which results in a 32 octets UTF-8 encoded string.
55 // It contains the following QoS parameters associated with the EPS bearer:
58 // - GBR QoS information (UL/DL MBR, UL/DL GBR) or UL/DL APN-AMBR. In other words if the value of QCI indicates a GBR bearer, the GBR QoS information shall be present. If the value of QCI indicates a non-GBR bearer, the APN-AMBR information shall be present.
59 // The encoding of the EPS bearer QoS profile parameters is specified in 3GPP TS 29.274 [81]: ARP is specified in Bearer QoS IE; QCI, UL MBR, DL MBR, UL MBR and DL MBR are specified in Flow QoS IE; UL APN-AMBR and DL APN-AMBR are specified in AMBR IE.
60 // For GBR QCIs, the encoding of UTF-8 encoded QoS Profile field shall be as follows:
62 // 1-3 <Release indicator> -" = "08-" (UTF-8 encoded)
63 // 4-5 ARP (UTF-8 encoded)
64 // 6-7 QCI (UTF-8 encoded)
65 // 8-m UL MBR (UTF-8 encoded)
66 // (m+1)-n DL MBR (UTF-8 encoded)
67 // (n+1)-o UL GBR (UTF-8 encoded)
68 // (o+1)-p DL GBR (UTF-8 encoded)
70 // For non-GBR QCIs, the UL/DL MBR and UL/DL GBR fields shall not be present; UL APN-AMBR and DL APN-AMBR fields shall be encoded (in UTF-8 encoded format) respectively after the QCI field.
75 // // Obtiene los parametros trafficClass y handlingPriority a partir de la cadena de entrada(proviene del AVP de la peticion) y según la release
76 // std::string analisisQoS::obtenerParamQoS(const char * GPRS_Neg_QoS_Profile)
78 // TRACEAR_OPERACION (TrazarMetodoEx("analisisQoS","obtenerParamQoS", FILE_LOCATION));
80 // // Nos llega una cadena de caracteres
81 // // Los dos primeros octetos son la release y el tercer octeto es un '-' ,
82 // // el resto de octetos dependen de la release, se describen segun el caso
84 // char str_release[2];
85 // strncpy( str_release,GPRS_Neg_QoS_Profile,2);
86 // //qosProfile será el resto de la cadena ( a partir del guión)
87 // char qosProfile[MAX_CADENA_QOS+1]="";
88 // char cadena[MAX_CADENA_QOS+1]="";
89 // // convierte el formato UTF8 a string,
90 // strncpy(cadena,GPRS_Neg_QoS_Profile,MAX_CADENA_QOS+1);
94 // if (cadena [0] =='9' && cadena [1]=='9')
96 // 10.5.6.5 Quality of service
97 // The purpose of the quality of service information element is to specify the QoS parameters for a PDP context.
98 // The QoS IE is defined to allow backward compatibility to earlier version of Session Management Protocol.
99 // The quality of service is a type 4 information element with a minimum length of 14 octets and a maximum length of 18 octets. The QoS requested by the MS shall be encoded both in the QoS attributes specified in octets 3-5 and in the QoS attributes specified in octets 6-14.
100 // In the MS to network direction and in the network to MS direction the following applies:
101 // - Octets 15-18 are optional. If octet 15 is included, then octet 16 shall also be included, and octets 17 and 18 may be included.
102 // - If octet 17 is included, then octet 18 shall also be included.
103 // - A QoS IE received without octets 6-18, without octets 14-18, without octets 15-18, or without octets 17-18 shall be accepted by the receiving entity.
104 // NOTE: This behavior is required for interworking with entities supporting an earlier version of the protocol, or when the Maximum bit rate for downlink or for downlink and uplink is negotiated to a value lower than 8700 kbps.
105 // The quality of service information element is coded as shown in figure 10.5.138/3GPP TS 24.008 and table 10.5.156/3GPP TS 24.008.
107 // Figure 10.5.138/3GPP TS 24.008: Quality of service information element
108 // // 8 7 6 5 4 3 2 1
109 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
110 // // + Quality of service IEI + Octet 1
111 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
112 // // + Length of quality of service IE + Octet 2
113 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
114 // // | spare(00) + Delay class + Reliability class + Octet 3
115 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
116 // // + Peak throughput + spare + Precedence class + Octet 4
117 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
118 // // + spare(000) + Mean throughput + Octet 5
119 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
120 // // + Traffic class + Delivery order + Delivery of erroneus SDU + Octet 6 <---
121 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
122 // // + Maximum SDU size + Octet 7
123 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
124 // // + Maximum bit rate for uplink + Octet 8
125 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
126 // // + Maximum bit rate for downlink + Octet 9
127 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
128 // // + Residual BER + SDU error ratio + Octet 10
129 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
130 // // + Transfer delay + Traffic Handling + Octet 11 <--
132 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
133 // // + Guaranteed bit rate for uplink + Octet 12
134 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
135 // // + Guaranteed bit rate for downlink + Octet 13
136 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
137 // // + spare(000) +Signalling + Source Statistics Descriptor + Octet 14
138 // // + +Indication + +
139 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
140 // // + Maximum bit rate for downlink (extended) + Octet 15
141 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
142 // // + Guaranteed bit rate for downlink (extended) + Octet 16
143 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
144 // // + Maximum bit rate for uplink (extended) + Octet 17
145 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
146 // // + Guaranteed bit rate for uplink (extended) + Octet 18
147 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
149 // Reliability class, octet 3 (see 3GPP TS 23.107 [81])
152 // In MS to network direction:
153 // 0 0 0 Subscribed reliability class
154 // In network to MS direction:
156 // In MS to network direction and in network to MS direction:
157 // 0 0 1 Unused. If received, it shall be interpreted as '010' (Note)
158 // 0 1 0 Unacknowledged GTP; Acknowledged LLC and RLC, Protected data
159 // 0 1 1 Unacknowledged GTP and LLC; Acknowledged RLC, Protected data
160 // 1 0 0 Unacknowledged GTP, LLC, and RLC, Protected data
161 // 1 0 1 Unacknowledged GTP, LLC, and RLC, Unprotected data
164 // All other values are interpreted as Unacknowledged GTP and LLC; Acknowledged RLC, Protected data in this version of the protocol.
166 // If network supports EPS, then it should not assign Reliability class value
\91010
\92.
168 // NOTE: this value was allocated in earlier versions of the protocol.
170 // Delay class, octet 3 (see 3GPP TS 22.060 [73] and 3GPP TS 23.107 [81])
173 // In MS to network direction:
174 // 0 0 0 Subscribed delay class
175 // In network to MS direction:
177 // In MS to network direction and in network to MS direction:
178 // 0 0 1 Delay class 1
179 // 0 1 0 Delay class 2
180 // 0 1 1 Delay class 3
181 // 1 0 0 Delay class 4 (best effort)
186 // All other values are interpreted as Delay class 4 (best effort) in this version
188 // Bit 7 and 8 of octet 3 are spare and shall be coded all 0.
189 // Precedence class, octet 4 (see 3GPP TS 23.107 [81])
192 // In MS to network direction:
193 // 0 0 0 Subscribed precedence
194 // In network to MS direction:
196 // In MS to network direction and in network to MS direction:
197 // 0 0 1 High priority
198 // 0 1 0 Normal priority
199 // 0 1 1 Low priority
203 // All other values are interpreted as Normal priority in this version of the protocol.
205 // Bit 4 of octet 4 is spare and shall be coded as 0.
207 // Peak throughput, octet 4 (see 3GPP TS 23.107 [81])
208 // This field is the binary representation of the Peak Throughput Class (1 to 9). The corresponding peak throughput to each peak throughput class is indicated.
211 // In MS to network direction:
212 // 0 0 0 0 Subscribed peak throughput
213 // In network to MS direction:
215 // In MS to network direction and in network to MS direction:
216 // 0 0 0 1 Up to 1 000 octet/s
217 // 0 0 1 0 Up to 2 000 octet/s
218 // 0 0 1 1 Up to 4 000 octet/s
219 // 0 1 0 0 Up to 8 000 octet/s
220 // 0 1 0 1 Up to 16 000 octet/s
221 // 0 1 1 0 Up to 32 000 octet/s
222 // 0 1 1 1 Up to 64 000 octet/s
223 // 1 0 0 0 Up to 128 000 octet/s
224 // 1 0 0 1 Up to 256 000 octet/s
227 // All other values are interpreted as Up to 1 000 octet/s in this
228 // version of the protocol.
229 // Mean throughput, octet 5 (see 3GPP TS 23.107 [81])
230 // This field is the binary representation of the Mean Throughput Class (1 to 18; mean throughput class 30 is reserved and 31 is best effort). The corresponding mean throughput to each mean throughput class is indicated.
236 // In MS to network direction:
237 // 0 0 0 0 0 Subscribed mean throughput
238 // In network to MS direction:
239 // 0 0 0 0 0 Reserved
240 // In MS to network direction and in network to MS direction:
241 // 0 0 0 0 1 100 octet/h
242 // 0 0 0 1 0 200 octet/h
243 // 0 0 0 1 1 500 octet/h
244 // 0 0 1 0 0 1 000 octet/h
245 // 0 0 1 0 1 2 000 octet/h
246 // 0 0 1 1 0 5 000 octet/h
247 // 0 0 1 1 1 10 000 octet/h
248 // 0 1 0 0 0 20 000 octet/h
249 // 0 1 0 0 1 50 000 octet/h
250 // 0 1 0 1 0 100 000 octet/h
251 // 0 1 0 1 1 200 000 octet/h
252 // 0 1 1 0 0 500 000 octet/h
253 // 0 1 1 0 1 1 000 000 octet/h
254 // 0 1 1 1 0 2 000 000 octet/h
255 // 0 1 1 1 1 5 000 000 octet/h
256 // 1 0 0 0 0 10 000 000 octet/h
257 // 1 0 0 0 1 20 000 000 octet/h
258 // 1 0 0 1 0 50 000 000 octet/h
259 // 1 1 1 1 0 Reserved
260 // 1 1 1 1 1 Best effort
261 // The value Best effort indicates that throughput shall be made available to the MS on a per need and availability basis.
262 // All other values are interpreted as Best effort in this
263 // version of the protocol.
265 // Bits 8 to 6 of octet 5 are spare and shall be coded all 0.
268 // Delivery of erroneous SDUs, octet 6 (see 3GPP TS 23.107 [81])
271 // In MS to network direction:
272 // 0 0 0 Subscribed delivery of erroneous SDUs
273 // In network to MS direction:
275 // In MS to network direction and in network to MS direction:
276 // 0 0 1 No detect ('-')
277 // 0 1 0 Erroneous SDUs are delivered ('yes')
278 // 0 1 1 Erroneous SDUs are not delivered ('no')
282 // The network shall map all other values not explicitly defined onto one of the values defined in this version of the protocol. The network shall return a negotiated value which is explicitly defined in this version of this protocol.
284 // The MS shall consider all other values as reserved.
286 // Delivery order, octet 6 (see 3GPP TS 23.107 [81])
289 // In MS to network direction:
290 // 0 0 Subscribed delivery order
291 // In network to MS direction:
293 // In MS to network direction and in network to MS direction:
294 // 0 1 With delivery order ('yes')
295 // 1 0 Without delivery order ('no')
301 // Traffic class, octet 6 (see 3GPP TS 23.107 [81])
304 // In MS to network direction:
305 // 0 0 0 Subscribed traffic class
306 // In network to MS direction:
308 // In MS to network direction and in network to MS direction:
309 // 0 0 1 Conversational class
310 // 0 1 0 Streaming class
311 // 0 1 1 Interactive class
312 // 1 0 0 Background class
315 // The network shall map all other values not explicitly defined onto one of the values defined in this version of the protocol. The network shall return a negotiated value which is explicitly defined in this version of this protocol.
318 // The MS shall consider all other values as reserved.
320 // Maximum SDU size, octet 7 (see 3GPP TS 23.107 [81])
321 // In MS to network direction:
322 // 0 0 0 0 0 0 0 0 Subscribed maximum SDU size
323 // 1 1 1 1 1 1 1 1 Reserved
324 // In network to MS direction:
325 // 0 0 0 0 0 0 0 0 Reserved
326 // 1 1 1 1 1 1 1 1 Reserved
327 // In MS to network direction and in network to MS direction:
329 // For values in the range 00000001 to 10010110 the Maximum SDU size value is binary coded in 8 bits, using a granularity of 10 octets, giving a range of values from 10 octets to 1500 octets.
330 // Values above 10010110 are as below:
331 // 1 0 0 1 0 1 1 1 1502 octets
332 // 1 0 0 1 1 0 0 0 1510 octets
333 // 1 0 0 1 1 0 0 1 1520 octets
336 // The network shall map all other values not explicitly defined onto one of the values defined in this version of the protocol. The network shall return a negotiated value which is explicitly defined in this version of this protocol.
338 // The MS shall consider all other values as reserved.
341 // Maximum bit rate for uplink, octet 8
344 // In MS to network direction:
345 // 0 0 0 0 0 0 0 0 Subscribed maximum bit rate for uplink
346 // In network to MS direction:
347 // 0 0 0 0 0 0 0 0 Reserved
348 // In MS to network direction and in network to MS direction:
349 // 0 0 0 0 0 0 0 1 The maximum bit rate is binary coded in 8 bits, using a granularity of 1 kbps
350 // 0 0 1 1 1 1 1 1 giving a range of values from 1 kbps to 63 kbps in 1 kbps increments.
352 // 0 1 0 0 0 0 0 0 The maximum bit rate is 64 kbps + ((the binary coded value in 8 bits
\9601000000) * 8 kbps)
353 // 0 1 1 1 1 1 1 1 giving a range of values from 64 kbps to 568 kbps in 8 kbps increments.
355 // 1 0 0 0 0 0 0 0 The maximum bit rate is 576 kbps + ((the binary coded value in 8 bits
\9610000000) * 64 kbps)
356 // 1 1 1 1 1 1 1 0 giving a range of values from 576 kbps to 8640 kbps in 64 kbps increments.
358 // 1 1 1 1 1 1 1 1 0kbps
360 // If the sending entity wants to indicate a Maximum bit rate for uplink higher than 8640 kbps, it shall set octet 8 to
\9411111110
\94, i.e. 8640 kbps, and shall encode the value for the Maximum bit rate in octet 17.
363 // Maximum bit rate for downlink, octet 9 (see 3GPP TS 23.107 [81])
365 // Coding is identical to that of Maximum bit rate for uplink.
367 // If the sending entity wants to indicate a Maximum bit rate for downlink higher than 8640 kbps, it shall set octet 9 to
\9411111110
\94, i.e. 8640 kbps, and shall encode the value for the Maximum bit rate in octet 15.
369 // In this version of the protocol, for messages specified in the present document, the sending entity shall not request 0 kbps for both the Maximum bitrate for downlink and the Maximum bitrate for uplink at the same time. Any entity receiving a request for 0 kbps in both the Maximum bitrate for downlink and the Maximum bitrate for uplink shall consider that as a syntactical error (see clause 8).
373 // Residual Bit Error Rate (BER), octet 10 (see 3GPP TS 23.107 [81])
376 // In MS to network direction:
377 // 0 0 0 0 Subscribed residual BER
378 // In network to MS direction:
380 // In MS to network direction and in network to MS direction:
381 // The Residual BER value consists of 4 bits. The range is from 5*10-2 to 6*10-8.
393 // The network shall map all other values not explicitly defined onto one of the values defined in this version of the protocol. The network shall return a negotiated value which is explicitly defined in this version of the protocol.
395 // The MS shall consider all other values as reserved.
397 // SDU error ratio, octet 10 (see 3GPP TS 23.107 [81])
400 // In MS to network direction:
401 // 0 0 0 0 Subscribed SDU error ratio
402 // In network to MS direction:
404 // In MS to network direction and in network to MS direction:
405 // The SDU error ratio value consists of 4 bits. The range is is from 1*10-1 to 1*10-6.
415 // The network shall map all other values not explicitly defined onto one of the values defined in this version of the protocol. The network shall return a negotiated value which is explicitly defined in this version of the protocol.
417 // The MS shall consider all other values as reserved.
419 // Traffic handling priority, octet 11 (see 3GPP TS 23.107 [81])
422 // In MS to network direction:
423 // 0 0 Subscribed traffic handling priority
424 // In network to MS direction:
426 // In MS to network direction and in network to MS direction:
427 // 0 1 Priority level 1
428 // 1 0 Priority level 2
429 // 1 1 Priority level 3
431 // The Traffic handling priority value is ignored if the Traffic Class is Conversational class, Streaming class or Background class.
433 // Transfer delay, octet 11 (See 3GPP TS 23.107 [81])
439 // In MS to network direction:
440 // 0 0 0 0 0 0 Subscribed transfer delay
441 // In network to MS direction:
442 // 0 0 0 0 0 0 Reserved
443 // In MS to network direction and in network to MS direction:
446 // 0 0 0 0 0 1 The Transfer delay is binary coded in 6 bits, using a granularity of 10 ms
447 // 0 0 1 1 1 1 giving a range of values from 10 ms to 150 ms in 10 ms increments
449 // 0 1 0 0 0 0 The transfer delay is 200 ms + ((the binary coded value in 6 bits
\96 010000) * 50 ms)
450 // 0 1 1 1 1 1 giving a range of values from 200 ms to 950 ms in 50ms increments
452 // 1 0 0 0 0 0 The transfer delay is 1000 ms + ((the binary coded value in 6 bits
\96 100000) * 100 ms)
453 // 1 1 1 1 1 0 giving a range of values from 1000 ms to 4000 ms in 100ms increments
455 // 1 1 1 1 1 1 Reserved
457 // The Transfer delay value is ignored if the Traffic Class is Interactive class or Background class.
459 // Guaranteed bit rate for uplink, octet 12 (See 3GPP TS 23.107 [81])
461 // Coding is identical to that of Maximum bit rate for uplink.
463 // If the sending entity wants to indicate a Guaranteed bit rate for uplink higher than 8640 kbps, it shall set octet 12 to
\9411111110
\94, i.e. 8640 kbps, and shall encode the value for the Guaranteed bit rate in octet 18.
465 // The Guaranteed bit rate for uplink value is ignored if the Traffic Class is Interactive class or Background class, or Maximum bit rate for uplink is set to 0 kbps.
467 // Guaranteed bit rate for downlink, octet 13(See 3GPP TS 23.107 [81])
469 // Coding is identical to that of Maximum bit rate for uplink.
471 // If the sending entity wants to indicate a Guaranteed bit rate for downlink higher than 8640 kbps, it shall set octet 13 to
\9411111110
\94, i.e. 8640 kbps, and shall encode the value for the Guaranteed bit rate in octet 16.
473 // The Guaranteed bit rate for downlink value is ignored if the Traffic Class is Interactive class or Background class, or Maximum bit rate for downlink is set to 0 kbps.
475 // Source Statistics Descriptor, octet 14 (see 3GPP TS 23.107 [81])
478 // In MS to network direction
482 // The network shall consider all other values as unknown.
484 // In network to MS direction
485 // Bits 4 to 1 of octet 14 are spare and shall be coded all 0.
487 // The Source Statistics Descriptor value is ignored if the Traffic Class is Interactive class or Background class.
489 // Signalling Indication, octet 14 (see 3GPP TS 23.107 [81])
492 // In MS to network direction and in network to MS direction:
493 // 0 Not optimised for signalling traffic
494 // 1 Optimised for signalling traffic
496 // If set to '1' the QoS of the PDP context is optimised for signalling
498 // The Signalling Indication value is ignored if the Traffic Class is Conversational class, Streaming class or Background class.
500 // Bits 8 to 6 of octet 14 are spare and shall be coded all 0.
502 // Maximum bit rate for downlink (extended), octet 15
505 // In MS to network direction and in network to MS direction:
506 // 0 0 0 0 0 0 0 0 Use the value indicated by the Maximum bit rate for downlink in octet 9.
508 // For all other values: Ignore the value indicated by the Maximum bit rate for downlink in octet 9
509 // and use the following value:
510 // 0 0 0 0 0 0 0 1 The maximum bit rate is 8600 kbps + ((the binary coded value in 8 bits) * 100 kbps),
511 // 0 1 0 0 1 0 1 0 giving a range of values from 8700 kbps
512 // to 16000 kbps in 100 kbps increments.
514 // 0 1 0 0 1 0 1 1 The maximum bit rate is 16 Mbps + ((the binary coded value in 8 bits - 01001010) * 1 Mbps),
515 // 1 0 1 1 1 0 1 0 giving a range of values from 17 Mbps to 128 Mbps in 1 Mbps increments.
517 // 1 0 1 1 1 0 1 1 The maximum bit rate is 128 Mbps + ((the binary coded value in 8 bits - 10111010) * 2 Mbps),
518 // 1 1 1 1 1 0 1 0 giving a range of values from 130 Mbps to 256 Mbps in 2 Mbps increments.
520 // The network shall map all other values not explicitly defined onto one of the values defined in this version of the protocol. The network shall return a negotiated value which is explicitly defined in this version of the protocol.
522 // The MS shall map all other values not explicitly defined onto the maximum value defined in this version of the protocol.
524 // Guaranteed bit rate for downlink (extended), octet 16
527 // In MS to network direction and in network to MS direction:
528 // 0 0 0 0 0 0 0 0 Use the value indicated by the Guaranteed bit rate for downlink in octet 13.
530 // For all other values: Ignore the value indicated by the Guaranteed bit rate for downlink in octet 9
531 // and use the following value:
532 // 0 0 0 0 0 0 0 1 The guaranteed bit rate is 8600 kbps + ((the binary coded value in 8 bits) * 100 kbps),
533 // 0 1 0 0 1 0 1 0 giving a range of values from 8700 kbps to 16000 kbps in 100 kbps increments.
535 // 0 1 0 0 1 0 1 1 The guaranteed bit rate is 16 Mbps + ((the binary coded value in 8 bits - 01001010) * 1 Mbps),
536 // 1 0 1 1 1 0 1 0 giving a range of values from 17 Mbps to 128 Mbps in 1 Mbps increments.
538 // 1 0 1 1 1 0 1 1 The guaranteed bit rate is 128 Mbps + ((the binary coded value in 8 bits - 10111010) * 2 Mbps),
539 // 1 1 1 1 1 0 1 0 giving a range of values from 130 Mbps to 256 Mbps in 2 Mbps increments.
542 // The network shall map all other values not explicitly defined onto one of the values defined in this version of the protocol. The network shall return a negotiated value which is explicitly defined in this version of the protocol.
544 // The MS shall map all other values not explicitly defined onto the maximum value defined in this version of the protocol.
546 // Maximum bit rate for uplink (extended), octet 17
548 // This field is an extension of the Maximum bit rate for uplink in octet 8. The coding is identical to that of the Maximum bit rate for downlink (extended).
550 // The network shall map all other values not explicitly defined onto one of the values defined in this version of the protocol. The network shall return a negotiated value which is explicitly defined in this version of the protocol.
552 // The MS shall map all other values not explicitly defined onto the maximum value defined in this version of the protocol.
554 // Guaranteed bit rate for uplink (extended), octet 18
556 // This field is an extension of the Guaranteed bit rate for uplink in octet 12. The coding is identical to that of the Guaranteed bit rate for downlink (extended).
558 // The network shall map all other values not explicitly defined onto one of the values defined in this version of the protocol. The network shall return a negotiated value which is explicitly defined in this version of the protocol.
560 // The MS shall map all other values not explicitly defined onto the maximum value defined in this version of the protocol.
563 // //trafficClass: Octeto 4 , //strtok(cadena,"-");
564 // //--------------------------------------------------------------------
566 // char octeto4[3]= "\0";
567 // // CADENA: caracteres 0,1, release, caracter 2 " - ", car. 3,4: octeto1, 4,5: octeto2....12,13: octeto11
568 // //octetoi se obtiene de cadena[2i+1] , cadena[2i+2], dos caracteres en hexadecimal
570 // octeto4[0]=cadena[9];
571 // octeto4[1]=cadena[10];
574 // // pasamos de hexadecimal a decimal
575 // sscanf(octeto4,"%x",&i_octeto4);
576 // a_trafficClass = (i_octeto4 & 0xE0)>>5;
577 // TRACEAR_DEPURACION
579 // trazaDebInt("Parametro TrafficClass recibido", a_trafficClass);
581 // //trafficHandlingPriority : octeto 9, bits 1,2
582 // //------------------------------------------------------------------
583 // char octeto9[3]= "\0";
584 // octeto9[0]=cadena[19];
585 // octeto9[1]=cadena[20];
589 // // lo paso a decimal
590 // sscanf(octeto9,"%x",&i_octeto9);
591 // a_handlingPriority = (i_octeto9 & 0x03);
592 // TRACEAR_DEPURACION
594 // trazaDebInt("Parametro TrafficHandlingPriority recibido",a_handlingPriority);
597 // //Maximum bit rate for uplink : octeto 6 completo
598 // //------------------------------------------------------------------
600 // char octeto6[3]= "\0";
602 // octeto6[0]=cadena[13];
603 // octeto6[1]=cadena[14];
606 // a_maximumUplink = decodificaBitRate(octeto6);
608 // trazaDebInt("Parametro Maximum bit rate for uplink recibido(en Kbps)",a_maximumUplink);
610 // //Maximum bit rate for downlink : octeto 7 completo
611 // //------------------------------------------------------------------
613 // char octeto7[3]= "\0";
615 // octeto7[0]=cadena[15];
616 // octeto7[1]=cadena[16];
619 // a_maximumDownlink = decodificaBitRate(octeto7);
621 // trazaDebInt("Parametro Maximum bit rate for downlink recibido(en Kbps)",a_maximumDownlink);
625 // // qosProfile es la cadena a quitando la release (tres primeros caracteres) 98-qosProfile o 99-qosProfile
626 // //-----------------
627 // strncpy(qosProfile,cadena+3,MAX_CADENA_QOS-2);
628 // TRACEAR_DEPURACION
630 // trazaDebStr("Parametro qosProfile recibido",qosProfile);
633 // return std::string(qosProfile);
637 // else if (cadena [0] =='9' && cadena [1]=='8')
640 // // 8 7 6 5 4 3 2 1
641 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
642 // // | spare + Delay class + Reliability class + Octeto 1
643 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
644 // // + Peak throughput + spare + Precedence class + Octeto 2
645 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - +
646 // // + spare(000) + Mean throughput + Octeto 3
647 // // + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - +
649 // //Delay Class . Octeto 1 , bits 6,5,4
650 // //------------------
652 // char octeto1[3]= "\0";
653 // //octetoi es cadena[2i+1],cadena[2i+2] en hexadecimal
654 // octeto1[0]=cadena[3];
655 // octeto1[1]=cadena[4];
657 // // lo paso a decimal
659 // sscanf(octeto1,"%x",&i_octeto1);
660 // int delayClass = (i_octeto1 & 0x38)>>3;
661 // TRACEAR_DEPURACION
663 // trazaDebInt("Parametro DelayClass recibido",delayClass);
665 // a_trafficClass = delayClass; // Devolvemos el valor en la var trafficClass
666 // //Precedence Class . Octeto 2, bits 1,2,3
667 // //--------------------------
668 // char octeto2[3]= "\0";
669 // octeto2[0]=cadena[5];
670 // octeto2[1]=cadena[6];
674 // sscanf(octeto2,"%x",&i_octeto2);
676 // int precedenceClass = i_octeto2 & 0x07;
678 // TRACEAR_DEPURACION
680 // trazaDebInt("Parametro precedenceClass recibido: ",precedenceClass);
683 // a_handlingPriority = precedenceClass; // Devolvemos el valor en la var trafficHandPriority
685 // strcpy(qosProfile, cadena+3);// qosProfile, es la cadena quitandole la release, ->"98-qosProfile"
686 // TRACEAR_DEPURACION
688 // trazaDebStr( "Parametro qosProfile recibido",qosProfile);
691 // return std::string(qosProfile);
697 // trazaErrStr(TR("El parametro Release no es valido ( debe esr 98 o 99)"),str_release);
699 // return std::string("");
703 // int analisisQoS::decodificaBitRate(char * dato)
707 // char octeto[3]= "\0";
710 // strcpy(octeto,dato);
712 // /*Codificacion de los bits de maxima tasa de bit
713 // Maximum bit rate for uplink, octet 8
716 // In MS to network direction:
717 // 0 0 0 0 0 0 0 0 Subscribed maximum bit rate for uplink
718 // In network to MS direction:
719 // 0 0 0 0 0 0 0 0 Reserved
720 // In MS to network direction and in network to MS direction :
721 // 0 0 0 0 0 0 0 1 The maximum bit rate is binary coded in 8 bits, using a granularity of 1 kbps
722 // 0 0 1 1 1 1 1 1 giving a range of values from 1 kbps to 63 kbps in 1 kbps increments.
724 // 0 1 0 0 0 0 0 0 The maximum bit rate is 64 kbps + ((the binary coded value in 8 bits
\9601000000) * 8 kbps)
725 // 0 1 1 1 1 1 1 1 giving a range of values from 64 kbps to 568 kbps in 8 kbps increments.
727 // 1 0 0 0 0 0 0 0 The maximum bit rate is 576 kbps + ((the binary coded value in 8 bits
\9610000000) * 64 kbps)
728 // 1 1 1 1 1 1 1 0 giving a range of values from 576 kbps to 8640 kbps in 64 kbps increments.
730 // 1 1 1 1 1 1 1 1 0kbps
733 // Maximum bit rate for downlink, octet 9 (see 3GPP TS 23.107)
735 // Coding is identical to that of Maximum bit rate for uplink.
739 // // lo paso a decimal
740 // sscanf(octeto,"%x",&i_octeto);
741 // cabecera = (i_octeto & 0xC0)>>6;
743 // trazaDebStr("QoS, octeto: ", octeto);
744 // trazaDebInt("QoS, i_octeto: ", i_octeto);
745 // trazaDebInt("QoS, cabecera: ", cabecera);
747 // //Casos especiales: El caso 00000000 se considera 0, por no poder definir ninguno de los dos
748 // // casos de la especificacion(mirar codificacion arriba)
750 // if(i_octeto != 255 && i_octeto != 0)
755 // trazaDeb("Bitrate con granuralidad de 1 Kbps");
756 // salida = (i_octeto & 0x3F);
760 // trazaDeb("Bitrate con granuralidad de 8 Kbps");
761 // salida = 64 + (i_octeto & 0x3F) * 8;
766 // trazaDeb("Bitrate con granuralidad de 64 Kbps");
767 // salida = 576 + (i_octeto & 0x7E) * 64;
771 // trazaErr("Valor de bitrate no contemplado. Revisar codificacion");
778 // trazaDeb("Bitrate vale 255 o 0, valores no contemplados");