//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / pf
//
//File: atmsockdev.h
//
//Version: $Revision: 1.3 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/10/19 08:46:02 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Juhana Räsänen
//
//Description:
//      OVOPS++ device class for Linux ATM AAL5 sockets.
//	Needs the linux kernel atm package:
//	    http://lrcwww.epfl.ch/linux-atm/.
//	Notice that the version 0.32 of this package is for kernel 2.1
//	which is a development version. The suggested combination is
//	atm package 0.31 and kernel 2.0.29.
//
//    Class that implements Linux ATM AAL5 socket functionality on top
//    of base socket device class. In addition to openDevice method also
//    callbackWrite() method needs to be defined as there are buffer
//    constraints specific to the ATM sockets.
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History: 
//
//

#ifndef __PF_ATMSOCKET_H__
#define __PF_ATMSOCKET_H__

#include "pf/device.h"
#include <atm.h>

class pfATMsocket : public pfDevice
{
    public:
        explicit pfATMsocket(pfUlong bufferSize_);
        virtual ~pfATMsocket(void);
        virtual bool openDevice(int port_, int vpi_, int vci_);
        virtual bool closeDevice(void);

    protected:
	void writeCallback(void);
        void freeBuffers(void);

    private:
        struct atm_buffconst _bc;
        char *_writeBufferStart;
        pfUlong _realBufferSize;
};

#endif  // __PF_ATMSOCKET_H__

