linklayerprotocols/ethernetnif/IRLAN/IRLANDAT.H
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2004-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 // IrLAN data model header file
       
    15 // Written by Mal September 1997
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent 
       
    22 */
       
    23 
       
    24 #if !defined (__IRLANDAT_H__)
       
    25 #define __IRLANDAT_H__
       
    26 
       
    27 #include <ir_sock.h>
       
    28 
       
    29 #define TINYTP_PROTOCOL			_L("IrTinyTP")  //< Defines Protocol Type.
       
    30 #define IRLAN_CLASSNAME			_L8("IrLAN")	//< Defines LAN Classname
       
    31 #define TINYTP_ATTRNAME			_L8("IrDA:TinyTP:LsapSel") //< Defines Attribute Name.
       
    32 
       
    33 //################# CLASS DEFINITIONS #############################
       
    34 
       
    35 enum TIrlanCmdNumber
       
    36 {
       
    37 
       
    38 	EGetProviderInfo,			//< Specifies the Provider info. 
       
    39 	EGetMediaCharacteristics,	//< Specifies Media Characteristics. 
       
    40 	EOpenDataChannel			//< Specifies Open data channel. 
       
    41 };
       
    42 
       
    43 // IrLAN register classes - the information model.  An instance of this
       
    44 // is initialised upon creation of the IrLAN driver and it holds info
       
    45 // regarding all the required command parameters.
       
    46 
       
    47 enum TIrlanQueryResult 
       
    48 {
       
    49 	EIrlanSuccess,					//< Specifies Success
       
    50 	EIrlanInsufficientResources,	//< Specifies Insufficient Resources.
       
    51 	EIrlanInvalidFormat,			//< Specifies Invalid format
       
    52 	EIrlanCommand,					//< Specifies command.
       
    53 	EIrlanParameter,				//< Specifies parameter
       
    54 	EIrlanValue,					//< Specifies parameter value
       
    55 	EIrlanNotOpen,					//< Specifies not open
       
    56 	EIrlanAuthentication,			//< Specifies Authentication
       
    57 	EIrlanPassword,					//< Specifies Password
       
    58 	EIrlanProtocol,					//< Specifies Protocol
       
    59 	EIrlanAsynch=255				//< Specifies Asynchronous.
       
    60 };
       
    61 
       
    62 /*
       
    63 class CIrlanCommand;
       
    64 class CIrlanParameter;
       
    65 class CIrlanRegister : public CBase
       
    66 	{
       
    67 public:
       
    68 	CIrlanRegister();
       
    69 	~CIrlanRegister();
       
    70 	static CIrlanRegister *NewL();
       
    71 	void RegisterEntryL(const TDesC8& aBuffer);		// Called from the CNetDatabaseServProvd
       
    72 	TInt UnregisterEntry(const TDesC8& aBuffer);	// Called from the CNetDatabaseServProvd
       
    73 	TIrlanQueryResult Lookup(const TUint aCode,
       
    74 	  const TDesC8& aParameter,TDesC8 &aValue);
       
    75 	void SetHostName(const TDesC8 &aName);
       
    76 	void GetHostName(TDes8 &aName);
       
    77 private:
       
    78 	CIrlanCommand *LookUpCommandCode(const TUint aCode);
       
    79    	void InitL();				// Registers the compulsory IAS entries.
       
    80 private:
       
    81 	TDblQue<CIrlanCommand> iCommandList;
       
    82 	};
       
    83 
       
    84 // eg. command GetProviderInformation with code 0 has two parameters 
       
    85 class CIrlanCommand : public CBase
       
    86 	{
       
    87 public:
       
    88 	CIrlanCommand();
       
    89 	~CIrlanCommand();
       
    90 	static CIrlanCommand *NewL(const TDesC8& aName,TUint aID);
       
    91 	CIrlanParameter* LookUpParameter(const TDesC8& aName);
       
    92 	void AddParameterL(const TDesC8& aName,const TDesC8& aValue);
       
    93 	TBool Match(const TDesC8& aName)const;
       
    94 	TUint GetCommandCode();
       
    95 	TInt RemoveParameter(const TDesC& aParameterName);
       
    96 private:
       
    97 	void InitL(const TDesC8& aName,TUint aID);
       
    98 public:
       
    99 	TDblQueLink iLink;
       
   100 private:
       
   101 	HBufC *iParameterName;
       
   102 	TUint iCommandCode;
       
   103 	TDblQue<CIrlanParameter> iIrlanParameterList;
       
   104 	};
       
   105 */
       
   106 
       
   107 /**
       
   108 @internalComponent
       
   109 */
       
   110 enum TIrlanParameterType 
       
   111 {
       
   112 	EIrlanParameterString,			//< Specifies parameter string.
       
   113 	EIrlanParameterOctetSeq,		//< Specifies parameter octet sequence.
       
   114 	EIrlanParameterInteger,			//< Specifies parameter integer.
       
   115 	EIrlanParameterByte				//< Specifies parameter byte.
       
   116 };
       
   117 
       
   118 class CIrlanParameterValue;
       
   119 /**
       
   120 Provides Irlan parameter data model fucntionality
       
   121 @internalComponent
       
   122 */
       
   123 NONSHARABLE_CLASS(CIrlanParameter) : public CBase
       
   124 {								 
       
   125 public:
       
   126 	CIrlanParameter();
       
   127 	~CIrlanParameter();
       
   128 	static CIrlanParameter *NewL(const TDesC8& aName,const TUint8 aID);
       
   129 	void AddParameterValueL(const TDesC8& aName,const TIrlanParameterType& aType);
       
   130 	TInt RemoveParameterValue(const TDesC8& aValue);
       
   131 	/** For single param value cases. */
       
   132 	CIrlanParameterValue* LookUpParameterValue();   
       
   133 	CIrlanParameterValue* LookUpParameterValue(const TDesC8& aName);
       
   134 	TBool Match(const TDesC8& aName)const;
       
   135 	TUint8 GetCommandCode();
       
   136 	TDblQueLink iLink;
       
   137 private:
       
   138 	void InitL(const TDesC8& aName,TUint8 aCode);
       
   139 private:
       
   140 	HBufC8* iParamName;
       
   141 	TUint8 iCommandCode;
       
   142 	TDblQue<CIrlanParameterValue> iIrlanParameterValueList;
       
   143 };
       
   144 
       
   145 /**
       
   146 @internalComponent
       
   147 */
       
   148 NONSHARABLE_CLASS(CIrlanParameterValue) : public CBase
       
   149 {
       
   150 public:
       
   151 	CIrlanParameterValue();
       
   152 	~CIrlanParameterValue();
       
   153 	static CIrlanParameterValue *NewL(const TDesC8& aValue,const TIrlanParameterType& aType);
       
   154 	TBool Match(const TDesC8& aValue) const;
       
   155 	void GetValue(TPtr8& aDes);
       
   156 	TUint16 GetValueLength();
       
   157 private:
       
   158 	void InitL(const TDesC8& aValue,const TIrlanParameterType& aType);
       
   159 public:
       
   160 	TDblQueLink iLink;
       
   161 private:
       
   162 	HBufC8* iParamValue;
       
   163 	TUint16 iParamValueLength;
       
   164 	TIrlanParameterType iParamValueType;
       
   165 };
       
   166 
       
   167 #endif