//
// C++ Interface: c6utils
//
// Description:
//
//
// Author: Giorgio A. <openc6@hotmail.com>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef C6UTILS_H
#define C6UTILS_H

/**
C6 helper functions class
 
@author Giorgio A.
*/
class C6Utils
  {
  public:
     /** Dump a packet data of a given lenght */
    static void dumpPacket(const char* origin,unsigned char *data,int len);
  
    static bool safeShortRead(unsigned char* ptr,int *value,const unsigned char* maxPtr);
    static bool safeByteRead(unsigned char* ptr,unsigned char *value,const unsigned char* maxPtr);
    static bool safeByteRead(unsigned char* ptr,int *value,const unsigned char* maxPtr);   
    static bool safeStringCopy(unsigned char* dest,unsigned char* source,int len,const unsigned char* maxPtr); 
    static bool safeIntRead(unsigned char* ptr,int *value,const unsigned char* maxPtr);    
    
private:
    C6Utils() {};
    ~C6Utils() {};
  };

#endif
