/***************************************************************************
 *   Copyright (C) 2004-2010 by Giovanni Venturi                           *
 *   giovanni@ksniffer.org                                                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   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.,                                       *
 *   51 Franklin Steet, Fifth Floor, Boston, MA  02110-1301, USA.          *
 ***************************************************************************/

#include "NetworkDevice.h"

NetworkDevice::NetworkDevice()
{
}


/*QString NetworkDevice::HWaddr2String( char *hwaddr )
{
  QString ret;
  int i;

  for (i=0; i<6; i++, hwaddr++) {
    int v = (*hwaddr & 0xff);
    QString num = QString("%1").arg(v,0,16).upper();
    if (num.length() < 2)
      num.prepend("0");
    if (i>0)
      ret.append(":");
    ret.append(num);
  }
  return ret;
}*/

NetworkDevice::NetworkDevice(const QString &name, const QString &address, const QString &netmask,
  const QString &state, /*const QString &type,*/ const QString &mac)
{
  m_strName = name;
  m_strAddress = address;
  m_strNetmask = netmask;
  m_strState = state;
  //m_strType = type;
  m_strHWaddr = mac;
}


// getting functions
QString NetworkDevice::name() const
{
  return m_strName;
}


QString NetworkDevice::ipAddress() const
{
  return m_strAddress;
}


QString NetworkDevice::netmask() const
{
  return m_strNetmask;
}


QString NetworkDevice::state() const
{
  return m_strState;
}


QString NetworkDevice::hwAddress() const
{
  return m_strHWaddr;
}
