include/PacketReader.h
author Markus Bröker <mbroeker@largo.homelinux.org>
Fri, 10 Apr 2009 21:21:11 +0200
changeset 5 70980306fd61
parent 4 fdf04a93faeb
permissions -rw-r--r--
lintian checks minimized the lintian warnings, QoS

/*
 *  $Id: PacketReader.h 2 2007-12-22 14:15:30Z mbroeker $
 * $URL: http://localhost/svn/cpp/qMonitor/trunk/include/PacketReader.h $
 */

#ifndef PacketReader_H
#define PacketReader_H

#include <string>
#include <stdexcept>
#include <iostream>

extern "C" {
#include <sys/socket.h>
#include <netinet/if_ether.h>
#include <netinet/ip.h>
#include <sys/poll.h>
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>
};

class PacketReader {
  protected:
    int p_socket;
  private:
    int timeout;
  public:
      PacketReader (int tm = 500);
      PacketReader (std::string);
     ~PacketReader ();
      std::string read ();
    bool ready ();
    bool dataAvailable ();
};
#endif