|
1 // Copyright (c) 1997-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 // Implementation CLanxBearer class, a derived from CNifIfBase. |
|
15 // History |
|
16 // 15/11/01 Started by Julian Skidmore. |
|
17 // 00572 RMBufPktInfo* info = RMBufPacket::PeekInfoInChain(aPacket); |
|
18 // 00573 TUint prot = TPppAddr::Cast(info->iDstAddr).GetProtocol(); |
|
19 // 00574 |
|
20 // |
|
21 // |
|
22 |
|
23 /** |
|
24 @file |
|
25 */ |
|
26 |
|
27 #include <in_sock.h> // Header is retained, but in_sock.h is modified for ipv6 |
|
28 #include <in_iface.h> // Gone. |
|
29 #include "CLanxBearer.h" |
|
30 #include "EthProto.h" |
|
31 |
|
32 using namespace ESock; |
|
33 |
|
34 /** |
|
35 Constructor. Initialises the link layer object iLink and the notifier iNotify (inherited |
|
36 from CNIfIfBase) to aLink and aNotify respectively. |
|
37 @param aLink A pointer to the Link Layer object. |
|
38 @param aNotify A pointer to the notifier. |
|
39 */ |
|
40 CLanxBearer::CLanxBearer(CLANLinkCommon* aLink):iLink(aLink), iSoIfConnectionInfoCached(false) |
|
41 { |
|
42 } |
|
43 |
|
44 /** |
|
45 ConstructL method. Does nothing (CLanxBearer has no memory allocating objects). |
|
46 */ |
|
47 void CLanxBearer::ConstructL() |
|
48 { |
|
49 } |
|
50 |
|
51 /** |
|
52 StartSending notifies the protocol that this object is ready to transmit and process data. |
|
53 CLanxBearer provides a default implementation which calls the iProtocol's StartSending method, |
|
54 passing this as input. |
|
55 @param aProtocol A pointer to the object which signalled it is ready to StartSending. |
|
56 */ |
|
57 void CLanxBearer::StartSending(CProtocolBase* /*aProtocol*/) |
|
58 { |
|
59 // Default implementation. |
|
60 iUpperControl->StartSending(); |
|
61 } |
|
62 |
|
63 void CLanxBearer::UpdateMACAddr() |
|
64 { |
|
65 } // default implementation |
|
66 |
|
67 // MLowerControl methods |
|
68 |
|
69 TInt CLanxBearer::GetName(TDes& aName) |
|
70 /** |
|
71 Return the interface name |
|
72 |
|
73 @param aName Out parameter to return the name |
|
74 @return KErrNone |
|
75 */ |
|
76 { |
|
77 aName.Copy(iIfName); |
|
78 return KErrNone; |
|
79 } |
|
80 |
|
81 |
|
82 TInt CLanxBearer::BlockFlow(MLowerControl::TBlockOption /*aOption*/) |
|
83 { |
|
84 return KErrNotSupported; |
|
85 } |
|
86 |
|
87 // |
|
88 // Utilities |
|
89 // |
|
90 |
|
91 void CLanxBearer::SetUpperPointers(MUpperDataReceiver* aReceiver, MUpperControl* aControl) |
|
92 { |
|
93 ASSERT(iUpperReceiver == NULL && iUpperControl == NULL); |
|
94 iUpperReceiver = aReceiver; |
|
95 iUpperControl = aControl; |
|
96 } |
|
97 |
|
98 TBool CLanxBearer::MatchesUpperControl(const ESock::MUpperControl* aUpperControl) const |
|
99 /** |
|
100 Check whether the passed MUpperControl matches that associated with the current instance |
|
101 */ |
|
102 { |
|
103 ASSERT(iUpperControl); |
|
104 return iUpperControl == aUpperControl; |
|
105 } |
|
106 |