equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Name : Crc.h |
|
16 * Part of : SigComp / misc |
|
17 * Interface : |
|
18 * Implementation of the CRC (PPP Frame Check Sequence) |
|
19 * Version : 1.0 |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 /** |
|
27 @internalComponent |
|
28 */ |
|
29 |
|
30 |
|
31 #ifndef CRC_H |
|
32 #define CRC_H |
|
33 |
|
34 // INCLUDES |
|
35 #include <e32base.h> |
|
36 |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * @brief This class mplements Fast Frame Check computation, |
|
42 * as described in RFC 1662, APPENDIX C.2 |
|
43 * |
|
44 * @lib sigcomp |
|
45 */ |
|
46 |
|
47 class Crc |
|
48 { |
|
49 |
|
50 public: |
|
51 |
|
52 enum |
|
53 { |
|
54 /** initial value of crc sum */ |
|
55 KFcsInit = 0xffff |
|
56 }; |
|
57 |
|
58 /** |
|
59 * Calculate crc sum. |
|
60 * |
|
61 * @param aBuffer buffer with input data |
|
62 * @param aLength length of input data |
|
63 * @param aFcs initial value of sum |
|
64 * |
|
65 * @returns crc sum |
|
66 */ |
|
67 |
|
68 static TUint16 Calc(const TUint8* aBuffer, |
|
69 TUint aLength, |
|
70 TUint16 aFcs = KFcsInit); |
|
71 |
|
72 }; |
|
73 |
|
74 #endif |
|
75 |
|
76 // End of File |