|
1 // Copyright (c) 2005-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 // SS_PROTBINDER.H |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @publishedPartner |
|
21 */ |
|
22 |
|
23 #if !defined(SS_PROTBINDER_H_INCLUDED_) |
|
24 #define SS_PROTBINDER_H_INCLUDED_ |
|
25 |
|
26 #include <es_sock.h> |
|
27 #include <in_sock.h> |
|
28 |
|
29 struct TBinderInfo |
|
30 { |
|
31 TUint iFeatures; /** Feature flags */ |
|
32 TInt iMtu; /** Maximum transmission unit. */ |
|
33 TInt iRMtu; /** Maximum transmission unit for receiving. */ |
|
34 TInt iSpeedMetric; /** approximation of the interface speed in Kbps. */ |
|
35 private: |
|
36 TInt iReserved1; |
|
37 TInt iReserved2; |
|
38 }; |
|
39 |
|
40 class TBinderConfig : public Meta::SMetaData |
|
41 { |
|
42 public: |
|
43 TUint iFamily; /** KAfInet / KAfInet6 - selects TBinderConfig4/6 */ |
|
44 |
|
45 template <class CONFIG> |
|
46 static CONFIG* Cast(TBinderConfig& aConfig) |
|
47 { |
|
48 if(aConfig.GetTypeId().iType == CONFIG::ETypeId && aConfig.GetTypeId().iUid == TUid::Uid(CONFIG::EUid)) |
|
49 { |
|
50 CONFIG* config = &static_cast<CONFIG&>(aConfig); |
|
51 return config; |
|
52 } |
|
53 else |
|
54 { |
|
55 return NULL; |
|
56 } |
|
57 } |
|
58 }; |
|
59 |
|
60 class TBinderConfig4 : public TBinderConfig |
|
61 { |
|
62 public: |
|
63 TBinderInfo iInfo; |
|
64 TInetAddr iAddress; /** Interface IP address. */ |
|
65 TInetAddr iNetMask; /** IP netmask. */ |
|
66 TInetAddr iBrdAddr; /** IP broadcast address. */ |
|
67 TInetAddr iDefGate; /** IP default gateway or peer address (if known). */ |
|
68 TInetAddr iNameSer1; /** IP primary name server (if any). */ |
|
69 TInetAddr iNameSer2; /** IP secondary name server (if any). */ |
|
70 |
|
71 enum |
|
72 { |
|
73 EUid = 0x101F7482, |
|
74 ETypeId = 1, |
|
75 }; |
|
76 |
|
77 public: |
|
78 EXPORT_DATA_VTABLE_AND_FN |
|
79 }; |
|
80 |
|
81 class TBinderConfig6 : public TBinderConfig |
|
82 { |
|
83 public: |
|
84 TBinderInfo iInfo; |
|
85 TSockAddr iLocalId; |
|
86 TSockAddr iRemoteId; |
|
87 TInetAddr iNameSer1; |
|
88 TInetAddr iNameSer2; |
|
89 |
|
90 |
|
91 enum |
|
92 { |
|
93 EUid = 0x101F7482, |
|
94 ETypeId = 2, |
|
95 }; |
|
96 |
|
97 public: |
|
98 EXPORT_DATA_VTABLE_AND_FN |
|
99 }; |
|
100 |
|
101 #endif // SS_PROTBINDER_H_INCLUDED_ |
|
102 |