|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 */ |
|
20 |
|
21 #ifndef L2CAPSIGPACKETCOMMANDREJECT_H |
|
22 #define L2CAPSIGPACKETCOMMANDREJECT_H |
|
23 |
|
24 #include "l2capCommand.h" |
|
25 |
|
26 NONSHARABLE_CLASS(HCommandReject) : public HL2CapCommand |
|
27 { |
|
28 public: |
|
29 HCommandReject(); |
|
30 static HCommandReject* New(TL2CAPCommandRejectData aRejectData, TUint8 aId); |
|
31 static TInt NewCommandIfValid(RMBufChain& aBuffer, HL2CapCommand*& aCommand); |
|
32 ~HCommandReject(); |
|
33 |
|
34 TBool ProcessCommand(CL2CapSignalHandler& aSignalHandler); |
|
35 |
|
36 TInt RejectData(TL2CAPCommandRejectData& aRejectData) const; |
|
37 void SetRejectData(TL2CAPCommandRejectData aRejectData); |
|
38 |
|
39 private: |
|
40 HCommandReject(RMBufChain& aCommand); |
|
41 static TBool VerifyStructure(const RMBufChain& aBuffer); |
|
42 |
|
43 private: |
|
44 const static TUint8 KReasonOffset = HL2CapCommand::KL2CapCommandHeaderLength; |
|
45 const static TUint8 KDataOffset = 6; |
|
46 |
|
47 const static TUint8 KMTUExceededLength = 2; |
|
48 const static TUint8 KMTUExceededOffset = 6; |
|
49 |
|
50 const static TUint8 KInvalidRequestedCIDLength = 4; |
|
51 const static TUint8 KLocalEndpointOffset = 6; |
|
52 const static TUint8 KRemoteEndpointOffset = 8; |
|
53 |
|
54 const static TUint8 KL2CapCommandRejectMinLength = HL2CapCommand::KL2CapCommandHeaderLength + 2; |
|
55 const static TUint8 KL2CapCommandRejectMaxLength = KL2CapCommandRejectMinLength + KInvalidRequestedCIDLength; |
|
56 }; |
|
57 |
|
58 #endif |