1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/comms-infras/es_protbinder.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,102 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// SS_PROTBINDER.H
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @publishedPartner
1.24 +*/
1.25 +
1.26 +#if !defined(SS_PROTBINDER_H_INCLUDED_)
1.27 +#define SS_PROTBINDER_H_INCLUDED_
1.28 +
1.29 +#include <es_sock.h>
1.30 +#include <in_sock.h>
1.31 +
1.32 +struct TBinderInfo
1.33 + {
1.34 + TUint iFeatures; /** Feature flags */
1.35 + TInt iMtu; /** Maximum transmission unit. */
1.36 + TInt iRMtu; /** Maximum transmission unit for receiving. */
1.37 + TInt iSpeedMetric; /** approximation of the interface speed in Kbps. */
1.38 + private:
1.39 + TInt iReserved1;
1.40 + TInt iReserved2;
1.41 + };
1.42 +
1.43 +class TBinderConfig : public Meta::SMetaData
1.44 + {
1.45 +public:
1.46 + TUint iFamily; /** KAfInet / KAfInet6 - selects TBinderConfig4/6 */
1.47 +
1.48 + template <class CONFIG>
1.49 + static CONFIG* Cast(TBinderConfig& aConfig)
1.50 + {
1.51 + if(aConfig.GetTypeId().iType == CONFIG::ETypeId && aConfig.GetTypeId().iUid == TUid::Uid(CONFIG::EUid))
1.52 + {
1.53 + CONFIG* config = &static_cast<CONFIG&>(aConfig);
1.54 + return config;
1.55 + }
1.56 + else
1.57 + {
1.58 + return NULL;
1.59 + }
1.60 + }
1.61 + };
1.62 +
1.63 +class TBinderConfig4 : public TBinderConfig
1.64 + {
1.65 +public:
1.66 + TBinderInfo iInfo;
1.67 + TInetAddr iAddress; /** Interface IP address. */
1.68 + TInetAddr iNetMask; /** IP netmask. */
1.69 + TInetAddr iBrdAddr; /** IP broadcast address. */
1.70 + TInetAddr iDefGate; /** IP default gateway or peer address (if known). */
1.71 + TInetAddr iNameSer1; /** IP primary name server (if any). */
1.72 + TInetAddr iNameSer2; /** IP secondary name server (if any). */
1.73 +
1.74 + enum
1.75 + {
1.76 + EUid = 0x101F7482,
1.77 + ETypeId = 1,
1.78 + };
1.79 +
1.80 +public:
1.81 + EXPORT_DATA_VTABLE_AND_FN
1.82 + };
1.83 +
1.84 +class TBinderConfig6 : public TBinderConfig
1.85 + {
1.86 +public:
1.87 + TBinderInfo iInfo;
1.88 + TSockAddr iLocalId;
1.89 + TSockAddr iRemoteId;
1.90 + TInetAddr iNameSer1;
1.91 + TInetAddr iNameSer2;
1.92 +
1.93 +
1.94 + enum
1.95 + {
1.96 + EUid = 0x101F7482,
1.97 + ETypeId = 2,
1.98 + };
1.99 +
1.100 +public:
1.101 + EXPORT_DATA_VTABLE_AND_FN
1.102 + };
1.103 +
1.104 +#endif // SS_PROTBINDER_H_INCLUDED_
1.105 +