Source: internetflow.h


Annotated List
Files
Globals
Hierarchy
Index
// ##########################################################################
// ####                                                                  ####
// ####                      RTP Audio Server Project                    ####
// ####                    ============================                  ####
// ####                                                                  ####
// #### Internet Flow                                                    ####
// ####                                                                  ####
// #### Version 1.00  --  February 04, 2001                              ####
// ####                                                                  ####
// #### Copyright (C) 1999  Thomas Dreibholz                             ####
// ####               2000  Universität Bonn, Abt. IV                    ####
// ####               2001  EMail: Dreibholz@bigfoot.com                 ####
// ####                     WWW:   http://www.bigfoot.com/~dreibholz     ####
// ####                                                                  ####
// ##########################################################################


#ifndef INTERNETFLOW_H
#define INTERNETFLOW_H


#include "system.h"
#include "internetaddress.h"


namespace Coral {


/** 
  * This class inherits InternetAddress and contains an additional flow label
  * for IPv6 support.
  *
  * @short   Internet Flow
  * @author  Thomas Dreibholz (Dreibholz@bigfoot.com)
  * @version 1.0
  */            
class InternetFlow : public InternetAddress
{
   // ====== Constructors/Destructor ========================================
   public:
   /**
     * Constructor for a new InternetFlow.
     *
     */
   InternetFlow();

   /**
     * Constructor for a new InternetFlow.
     *
     * @param flow InternetFlow to be copied.
     */
   InternetFlow(const InternetFlow& flow);

   /**
     * Constructor for a new InternetFlow.
     *
     * @param address InternetAddress.
     * @param flowLabel Flow label (20 bits).
     * @param trafficClass Traffic class (8 bits).
     */
   InternetFlow(const InternetAddress& address,
                const card32           flowLabel,
                const card8            trafficClass);


   // ====== Initialization =================================================
   /**
     * Reset flow info.
     */
   void reset();


   // ====== Address functions ==============================================
   /**
     * Get address string.
     *
     * @return Address string.
     */
   String getAddressString() const;


   // ====== Get/set system sockaddr structure ==============================
   /**
     * getSystemAddress() implementation of SocketAddressInterface.
     *
     * @see SocketAddressInterface#getSystemAddress
     */            
   cardinal getSystemAddress(sockaddr*       buffer,
                             const socklen_t length,
                             const cardinal  type) const;

   /**
     * setSystemAddress() implementation of SocketAddressInterface.
     *
     * @see SocketAddressInterface#setSystemAddress
     */
   bool setSystemAddress(sockaddr* address, socklen_t length);


   // ====== Status functions ===============================================
   /**
     * Get IPv6 flow info: (flowLabel | (trafficClass << 20)).
     *
     * @return Flow info.
     */
   inline card32 getFlowInfo() const;


   /**
     * Get flow label.
     *
     * @return Flow label.
     */
   inline card32 getFlowLabel() const;

   /**
     * Set flow label.
     *
     * @param flowLabel Flow label.
     */
   inline void setFlowLabel(const card32 flowLabel);


   /**
     * Get traffic class.
     *
     * @return Traffic class.
     */
   inline card8 getTrafficClass() const;

   /**
     * Set traffic class.
     *
     * @param trafficClass New traffic class.
     */
   inline void setTrafficClass(const card8 trafficClass);


   // ====== Private data ===================================================
   private:
   card32 FlowInfo;
};


#include "internetflow.icc"


}


#endif

Generated by: viper@odin on Sun Feb 4 18:54:51 2001, using kdoc 2.0a22.