|
1 /* |
|
2 * Copyright (c) 2004-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 : 6to4_flow.h |
|
16 * Part of : 6to4 plugin / 6to4.prt |
|
17 * Implements 6to4 automatic and configured tunnels, see |
|
18 * RFC 3056 & RFC 2893 |
|
19 * Version : 0.2 |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 /** |
|
27 @internalComponent |
|
28 */ |
|
29 |
|
30 |
|
31 #ifndef __6TO4_FLOW_H |
|
32 #define __6TO4_FLOW_H |
|
33 |
|
34 // INCLUDES |
|
35 #include <e32base.h> |
|
36 #include <ip6_hook.h> |
|
37 |
|
38 #include "6to4.h" |
|
39 #include "6to4_tunnel.h" |
|
40 |
|
41 // CONSTANTS |
|
42 // MACROS |
|
43 // DATA TYPES |
|
44 // FUNCTION PROTOTYPES |
|
45 // FORWARD DECLARATIONS |
|
46 // CLASS DECLARATION |
|
47 |
|
48 class MNetworkService; |
|
49 |
|
50 /** |
|
51 * 6to4 flow hook |
|
52 * Keeps information on a 6to4 flow. |
|
53 * |
|
54 * @lib |
|
55 * @since |
|
56 */ |
|
57 class C6to4FlowInfo : public CBase, public MFlowHook |
|
58 { |
|
59 public: // Constructors & destructors |
|
60 |
|
61 C6to4FlowInfo(const TPacketHead &aHead); |
|
62 ~C6to4FlowInfo(); |
|
63 |
|
64 public: // New functions |
|
65 |
|
66 public: // Functions from base classes |
|
67 |
|
68 /** |
|
69 * From MFlowHook Open and Close implements reference counting system. |
|
70 * @since |
|
71 * @param |
|
72 * @return void |
|
73 */ |
|
74 void Open (); |
|
75 |
|
76 /** |
|
77 * From MFlowHook Informs stack if the hook is ready. Can update address |
|
78 * information. |
|
79 * @since |
|
80 * @param aHead Address information of the flow. |
|
81 * @return TInt 0 => ready, >0 => pending, <0 => error. |
|
82 */ |
|
83 TInt ReadyL (TPacketHead & aHead); |
|
84 |
|
85 /** |
|
86 * Called by IP when processing outbound packet. |
|
87 * @since |
|
88 * @param aPacket Complete packet |
|
89 * @param aInfo Information block associated with the packet |
|
90 * @return TInt 0 => processed, <0 => discarded, >0 => restart processing |
|
91 */ |
|
92 TInt ApplyL (RMBufSendPacket & aPacket, RMBufSendInfo & aInfo); |
|
93 |
|
94 /** |
|
95 * From MFlowHook Open and Close implements reference counting system. |
|
96 * @since |
|
97 * @param |
|
98 * @return void |
|
99 */ |
|
100 void Close (); |
|
101 |
|
102 private: // Data |
|
103 |
|
104 // Reference count |
|
105 TInt iRefs; |
|
106 |
|
107 // Inner interface index |
|
108 const TUint32 iInterfaceIndex; |
|
109 |
|
110 TInet6HeaderIP iInnerIp; |
|
111 TUint32 iSrcId; // inner only |
|
112 TUint32 iDstId; // inner only |
|
113 TInet6HeaderIP iOuterIp; |
|
114 |
|
115 TUint16 iSrcPort; |
|
116 TUint16 iDstPort; |
|
117 TUint8 iIcmpType; |
|
118 TUint8 iIcmpCode; |
|
119 TUint8 iProtocol; |
|
120 |
|
121 // Fixed packet content. Hooks may add in their ReadyL some fixed |
|
122 // packet content (extension headers in IPv6) into (TPacketHead::iOffset, |
|
123 // TPacketHead::iPacket). The ReadyL of a tunneling hook *MUST* save |
|
124 // and remove this information from the TPacketHead, because it belongs |
|
125 // under the outer IP header (which the tunneling hook inserts). The |
|
126 // tunneling hook, in addition to adding the outer IP header in ApplyL, |
|
127 // must also copy the fixed packet content, if any is present. |
|
128 TInt iOffset; // > 0, if there is fixed packet content. |
|
129 RMBufChain iPacket; |
|
130 |
|
131 // TODO |
|
132 TUint16 iPacketID; |
|
133 }; |
|
134 |
|
135 #endif // __6TO4_FLOW_H |
|
136 |
|
137 // End of File |