/*
 * Copyright (C) 2015 by the University of Southern California
 * $Id: net_msg.hh 24038 2015-05-17 03:00:48Z liangzhu $
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along           
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 
 * 
 */


#ifndef NET_MSG_HH
#define NET_MSG_HH

#include <stdint.h>
#include <netinet/in.h>

class net_msg{
public:
  uint8_t *data;
  size_t len;
  net_msg(uint8_t *, size_t);
  net_msg();
  net_msg(size_t);
  ~net_msg();
  void copy(uint8_t *, size_t, bool);
  void clean();
  void create(size_t);
  void append(uint8_t *, size_t);
};

#endif //NET_MSG_HH

