networkcontrol/qoslib/include/qoslib_internal.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 /**
       
     2 * Copyright (c) 1997-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 * This file defines the generic QoS internal API interface.
       
    16 * 
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file qoslib_internal.h
       
    24  @internalTechnology
       
    25  @released
       
    26 
       
    27 */
       
    28 
       
    29 
       
    30 #ifndef __QOSLIB_INTERNAL_H__
       
    31 #define __QOSLIB_INTERNAL_H__
       
    32 #include <networking/qosparameters.h>
       
    33 
       
    34 /**
       
    35 This class contains the generic QoS parameters and optional extensions.
       
    36 
       
    37 */
       
    38 /* 
       
    39  * These methods are valid for Symbian OS 9.0 and onwards.
       
    40  */ 
       
    41 class CQoSParameters : public CBase
       
    42 {
       
    43 public:
       
    44     /**
       
    45      * Constructor.
       
    46      */
       
    47     IMPORT_C CQoSParameters();
       
    48 
       
    49     /**
       
    50      * Destructor.
       
    51      */
       
    52     IMPORT_C ~CQoSParameters();
       
    53 
       
    54     /**
       
    55      * Sets the bandwidth for uplink direction. Bandwidth defines the requested transfer rate that the
       
    56      * application requests. Bandwidth must be > 0.
       
    57      *
       
    58      * @param aBandwidth Value (bytes/second) to which to set the bandwidth for uplink direction.
       
    59      */
       
    60     IMPORT_C void SetUplinkBandwidth(TInt aBandwidth);
       
    61 
       
    62     /**
       
    63      * Sets the maximum burst size for uplink direction. Maximum burst size defines the burst size that the
       
    64      * application might send. Maximum burst size must be > 0.
       
    65      *
       
    66      * @param aSize Value (bytes) to which to set the maximum burst size for uplink direction.
       
    67      */
       
    68     IMPORT_C void SetUpLinkMaximumBurstSize(TInt aSize);
       
    69 
       
    70     /**
       
    71      * Sets the maximum packet size for uplink direction.
       
    72      *
       
    73      * @param aMaxSize Value (bytes) to which to set the maximum packet size for uplink direction.
       
    74      */
       
    75     IMPORT_C void SetUpLinkMaximumPacketSize(TInt aMaxSize);
       
    76 
       
    77     /**
       
    78      * Sets the average packet size for uplink direction. Average packet size is used 
       
    79      * when doing traffic policing and estimating effect of protocol headers.
       
    80      * The average packet size must be <= maximum packet size.
       
    81      *
       
    82      * @param aSize Value (bytes) to which to set the average packet size for uplink direction.
       
    83      */
       
    84     IMPORT_C void SetUpLinkAveragePacketSize(TInt aSize);
       
    85 
       
    86     /**
       
    87      * Sets the requested delay for uplink direction.
       
    88      *
       
    89      * @param aDelay Value (ms) to which to set the delay for uplink direction.
       
    90      */
       
    91     IMPORT_C void SetUpLinkDelay(TInt aDelay);
       
    92 
       
    93     /**
       
    94      * Sets the priority for uplink direction. Priority can be used to prioritise between traffic 
       
    95      * flows inside the terminal.
       
    96      *
       
    97      * @param aPriority Value (0-7) to which to set the priority for uplink direction. 0 is the highest priority, 
       
    98      * 7 is lowest.
       
    99      */
       
   100     IMPORT_C void SetUpLinkPriority(TInt aPriority);
       
   101 
       
   102     /**
       
   103      * Returns the bandwidth for uplink direction. Bandwidth defines the requested transfer rate that the
       
   104      * application requests.
       
   105      *
       
   106      * @return Current bandwidth for uplink direction (bytes/second).
       
   107      */
       
   108     IMPORT_C TInt GetUplinkBandwidth() const;
       
   109 
       
   110     /**
       
   111      * Returns the maximum burst size for uplink direction. Maximum burst size defines the burst size that the
       
   112      * application might send.
       
   113      *
       
   114      * @return Current maximum burst size for uplink direction (bytes).
       
   115      */
       
   116     IMPORT_C TInt GetUpLinkMaximumBurstSize() const;
       
   117 
       
   118     /**
       
   119      * Returns the maximum packet size for uplink direction.
       
   120      *
       
   121      * @return Current maximum packet size for uplink direction (bytes).
       
   122      */
       
   123     IMPORT_C TInt GetUpLinkMaximumPacketSize() const;
       
   124 
       
   125     /**
       
   126      * Returns the average packet size for uplink direction. Average packet size is used 
       
   127      * when doing traffic policing and estimating effect of protocol headers.
       
   128      *
       
   129      * @return Current average packet size for uplink direction (bytes).
       
   130      */
       
   131     IMPORT_C TInt GetUpLinkAveragePacketSize() const;
       
   132 
       
   133     /**
       
   134      * Returns the delay for uplink direction.
       
   135      *
       
   136      * @return Currrent delay for uplink direction (ms).
       
   137      */
       
   138     IMPORT_C TInt GetUpLinkDelay() const;
       
   139 
       
   140     /**
       
   141      * Returns the priority for uplink direction. Priority can be used to prioritise between traffic 
       
   142      * flows inside the terminal.
       
   143      *
       
   144      * @return Current priority for uplink direction. 0 is the highest priority, 7 is lowest.
       
   145      */
       
   146     IMPORT_C TInt GetUpLinkPriority() const;
       
   147 
       
   148     /**
       
   149      * Sets the bandwidth for downlink direction. Bandwidth defines the requested transfer rate that the
       
   150      * application requests. Bandwidth must be > 0.
       
   151      *
       
   152      * @param aBandwidth Value (bytes/second) to which to set the bandwidth for downlink direction.
       
   153      */
       
   154     IMPORT_C void SetDownlinkBandwidth(TInt aBandwidth);
       
   155 
       
   156     /**
       
   157      * Sets the maximum burst size for downlink direction. Maximum burst size defines the burst size that the
       
   158      * application might send. Maximum burst size must be > 0.
       
   159      *
       
   160      * @param aSize Value (bytes) to which to set the maximum burst size for downlink direction.
       
   161      */
       
   162     IMPORT_C void SetDownLinkMaximumBurstSize(TInt aSize);
       
   163 
       
   164     /**
       
   165      * Sets the maximum packet size for downlink direction.
       
   166      *
       
   167      * @param aMaxSize Value (bytes) to which to set the maximum packet size for downlink direction.
       
   168      */
       
   169     IMPORT_C void SetDownLinkMaximumPacketSize(TInt aMaxSize);
       
   170 
       
   171     /**
       
   172      * Sets the average packet size for downlink direction. Average packet size is used as the 
       
   173      * smallest packet size when doing traffic policing and estimating effect of protocol headers.
       
   174      * The average packet size must be <= maximum packet size.
       
   175      *
       
   176      * @param aSize Value (bytes) to which to set the average packet size for downlink direction.
       
   177      */
       
   178     IMPORT_C void SetDownLinkAveragePacketSize(TInt aSize);
       
   179 
       
   180     /**
       
   181      * Sets the requested delay for downlink direction.
       
   182      *
       
   183      * @param aDelay Value (ms) to which to set the delay for downlink direction.
       
   184      */
       
   185     IMPORT_C void SetDownLinkDelay(TInt aDelay);
       
   186 
       
   187     /**
       
   188      * Sets the priority for downlink direction. Priority can be used to prioritise between traffic 
       
   189      * flows inside the terminal.
       
   190      *
       
   191      * @param aPriority Value (0-7) to which to set the priority for downlink direction. 0 is the highest priority, 
       
   192      * 7 is lowest.
       
   193      */
       
   194     IMPORT_C void SetDownLinkPriority(TInt aPriority);
       
   195 
       
   196     /**
       
   197      * Returns the bandwidth for downlink direction. Bandwidth defines the requested transfer rate that the
       
   198      * application requests.
       
   199      *
       
   200      * @return Current bandwidth for downlink direction (bytes/second).
       
   201      */
       
   202     IMPORT_C TInt GetDownlinkBandwidth() const;
       
   203 
       
   204     /**
       
   205      * Returns the maximum burst size for downlink direction. Maximum burst size defines the burst size that the
       
   206      * application might send.
       
   207      *
       
   208      * @return Current maximum burst size for downlink direction (bytes).
       
   209      */
       
   210     IMPORT_C TInt GetDownLinkMaximumBurstSize() const;
       
   211 
       
   212     /**
       
   213      * Returns the maximum packet size for downlink direction.
       
   214      *
       
   215      * @return Current maximum packet size for downlink direction (bytes).
       
   216      */
       
   217     IMPORT_C TInt GetDownLinkMaximumPacketSize() const;
       
   218 
       
   219     /**
       
   220      * Returns the average packet size for downlink direction. Average packet size is used as the 
       
   221      * smallest packet size when doing traffic policing and estimating effect of protocol headers.
       
   222      *
       
   223      * @return Current average packet size for downlink direction (bytes).
       
   224      */
       
   225     IMPORT_C TInt GetDownLinkAveragePacketSize() const;
       
   226 
       
   227     /**
       
   228      * Returns the delay for downlink direction.
       
   229      *
       
   230      * @return Currrent delay for downlink direction (ms).
       
   231      */
       
   232     IMPORT_C TInt GetDownLinkDelay() const;
       
   233 
       
   234     /**
       
   235      * Returns the priority for downlink direction. Priority can be used to prioritise between traffic 
       
   236      * flows inside the terminal.
       
   237      *
       
   238      * @return Current priority for downlink direction. 0 is the highest priority, 7 is lowest.
       
   239      */
       
   240     IMPORT_C TInt GetDownLinkPriority() const;
       
   241 
       
   242     /**
       
   243      * Sets the name of the flowspec. This allows application to specify a user friendly name for a flowspec.
       
   244      *
       
   245      * @param aName The name for the flowspec. Maximum length for the name is KMaxName.
       
   246      * @return KErrNone if maximum length is <= KMaxName, otherwise KErrTooBig.
       
   247      */
       
   248     IMPORT_C void SetName(const TName& aName);
       
   249 
       
   250     /**
       
   251      * Sets the adaptation mode. If the application is willing to accept lower QoS than requested, 
       
   252      * it should set the adapt mode on. By default adapt mode is not set.
       
   253      *
       
   254      * @param aCanAdapt The value for adapt mode.
       
   255      */
       
   256     IMPORT_C void SetAdaptMode(TBool aCanAdapt);
       
   257 
       
   258     /**
       
   259      * Sets the header mode. If the application wants QoS Framework to include network and transport layer
       
   260      * header values in bitrate calcutaions or not. By default the mode is set to include the headers in
       
   261      * the calculations. Protocols such as RTSP or SIP, which already include the header sizes in their 
       
   262      * calculations will want to alter the mode so that header values are not included in calculations twice.
       
   263      *
       
   264      * @param aHeadersIncluded The value for the header mode.
       
   265      */
       
   266     IMPORT_C void SetHeaderMode(TBool aHeadersIncluded);
       
   267 
       
   268 
       
   269     /**
       
   270      * Returns the name of the flowspec.
       
   271      *
       
   272      * @return Current name of the flowspec.
       
   273      */
       
   274     IMPORT_C const TName& GetName() const;
       
   275 
       
   276     /**
       
   277      * Returns the adaptation mode.
       
   278      *
       
   279      * @return aCanAdapt Current value for adapt mode.
       
   280      */
       
   281     IMPORT_C TBool AdaptMode() const;
       
   282 
       
   283     /**
       
   284      * Returns the headers included mode.
       
   285      *
       
   286      * @return aHeadersIncluded Current value for header included mode.
       
   287      */
       
   288     IMPORT_C TBool GetHeaderMode() const;
       
   289 
       
   290     /**
       
   291      * Copies the parameters and extensions from aPolicy into this object.
       
   292      *
       
   293      * @param aPolicy Contains the CQoSParameters object that is copied into this object.
       
   294      * @exception Leaves if there is no memory available for extensions.
       
   295      */
       
   296     IMPORT_C void CopyL(CQoSParameters& aPolicy);
       
   297 
       
   298     /**
       
   299      * Copies the extension into the list of extensions. If there already exists an extension with the
       
   300      * same type, it is replaced.
       
   301      *
       
   302      * @param aExtension The extension that is added to the list of extenstions.
       
   303      * @exception Leaves if there is no memory available for the extension.
       
   304      */
       
   305     IMPORT_C TInt AddExtensionL(CExtensionBase& aExtension);
       
   306 
       
   307     /**
       
   308      * Removes the extension with extension type aType from the list of extensions.
       
   309      *
       
   310      * @param aType The type of extension that is removed from the list of extensions.
       
   311      * @return KErrNone if the extension is found, othewise KErrNotFound.
       
   312      */
       
   313     IMPORT_C TInt RemoveExtension(TInt aType);
       
   314 
       
   315     /**
       
   316      * Returns an extension with extension type aType.
       
   317      *
       
   318      * @param aType The type of extension that is searched from the list of extensions.
       
   319      * @return A pointer to an extension if the extension is found, othewise NULL.
       
   320      */
       
   321     IMPORT_C CExtensionBase* FindExtension(TInt aType);
       
   322 
       
   323     /**
       
   324      * Returns a list of extensions that have been added to this object.
       
   325      *
       
   326      * @return A list of extensions.
       
   327      */
       
   328     IMPORT_C TQoSExtensionQueue& Extensions();
       
   329 
       
   330     IMPORT_C TInt GetDownLinkDelayVariation() const; 
       
   331     
       
   332     IMPORT_C TInt GetUpLinkDelayVariation() const; 
       
   333     
       
   334     IMPORT_C void SetDownLinkDelayVariation(TInt aVariation);
       
   335     
       
   336     IMPORT_C void SetUpLinkDelayVariation(TInt aVariation);
       
   337 private:
       
   338     /** Generic QoS parameters. */
       
   339     TQoSParameters iQoS;
       
   340     /** A list of extensions. */
       
   341     TQoSExtensionQueue iExtensionList;
       
   342     // Member variable iName was taken into use temporarily
       
   343     TName iName;
       
   344     friend class CQoSMan;
       
   345     friend class CPolicy;
       
   346     friend class CQoSRequestBase;
       
   347 };
       
   348 
       
   349 
       
   350 
       
   351 #endif