|
From: <f-r...@us...> - 2011-02-11 18:54:19
|
Revision: 238
http://netemul.svn.sourceforge.net/netemul/?rev=238&view=rev
Author: f-r-o-s-t
Date: 2011-02-11 18:54:11 +0000 (Fri, 11 Feb 2011)
Log Message:
-----------
Modified Paths:
--------------
trunk/basicnetlib/basicnetlib.pro
trunk/basicnetlib/packets/dhcppacket.h
trunk/netemul.pro
trunk/src/devices/deviceimpl.h
trunk/src/devices/smartdevice.cpp
trunk/src/devices/smartdevice.h
trunk/src/dialogs/adapterproperty.cpp
trunk/src/dialogs/computerproperty.cpp
trunk/src/dialogs/designerdialog.cpp
trunk/src/dialogs/dhcpclientproperty.cpp
trunk/src/dialogs/dhcpserverproperty.cpp
trunk/src/dialogs/dhcpserverproperty.h
trunk/src/dialogs/dialogs.pri
trunk/src/dialogs/installdialog.cpp
trunk/src/dialogs/ripproperty.cpp
trunk/src/dialogs/routeeditor.cpp
trunk/src/dialogs/spoofingproperty.cpp
trunk/src/dialogs/tablearp.cpp
trunk/src/factories/classfactory.cpp
trunk/src/forms/dhcpserverproperty.ui
trunk/src/forms/forms.pri
trunk/src/graphics/device.h
trunk/src/ipedit.cpp
trunk/src/ipedit.h
trunk/test/frame/frame.pro
trunk/test/frame/main.cpp
trunk/test/ipaddress/ipaddress.pro
trunk/test/ipaddress/main.cpp
trunk/test/ippacket/ippacket.pro
trunk/test/ippacket/main.cpp
trunk/test/mac/main.cpp
trunk/test/test.pro
Modified: trunk/basicnetlib/basicnetlib.pro
===================================================================
--- trunk/basicnetlib/basicnetlib.pro 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/basicnetlib/basicnetlib.pro 2011-02-11 18:54:11 UTC (rev 238)
@@ -28,3 +28,8 @@
frame.h \
basicnetlib_global.h
+ # install
+ #target.path =
+ #sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS basictools.pro
+ #sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaintplugins/basictools
+ #INSTALLS += target sources
Modified: trunk/basicnetlib/packets/dhcppacket.h
===================================================================
--- trunk/basicnetlib/packets/dhcppacket.h 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/basicnetlib/packets/dhcppacket.h 2011-02-11 18:54:11 UTC (rev 238)
@@ -39,9 +39,9 @@
int time;
IpAddress mask;
IpAddress gateway;
- IpAddress yiaddr;
- IpAddress siaddr;
- MacAddress chaddr;
+ IpAddress yiaddr; // proposed ip
+ IpAddress siaddr; // server's ip
+ MacAddress chaddr; // sender's mac-address
};
class BASICNETLIBSHARED_EXPORT DhcpPacket
Modified: trunk/netemul.pro
===================================================================
--- trunk/netemul.pro 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/netemul.pro 2011-02-11 18:54:11 UTC (rev 238)
@@ -1,5 +1,5 @@
include(src/chips/chips.pri)
-include(src/programms/programms.pri)
+include(src/programs/programs.pri)
include(src/controls/controls.pri)
include(src/devices/devices.pri)
include(src/models/models.pri)
@@ -23,7 +23,7 @@
src \
src/chips \
src/controls \
- src/programms \
+ src/programs \
src/devices \
src/models \
src/dialogs \
Modified: trunk/src/devices/deviceimpl.h
===================================================================
--- trunk/src/devices/deviceimpl.h 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/devices/deviceimpl.h 2011-02-11 18:54:11 UTC (rev 238)
@@ -66,7 +66,7 @@
virtual void showLogDialog(logDialog*) const = 0;
virtual void tableDialog() { qFatal("error not compatibility Table!"); }
virtual void adapterDialog() { qFatal("error not compatibility adapter!"); }
- virtual void programmsDialog() { qFatal("error not compatibility"); }
+ virtual void programsDialog() { qFatal("error not compatibility"); }
virtual void arpDialog() { qFatal("error not compatibility"); }
virtual void showDesignerDialog() { qFatal("Error designer!"); }
virtual void showVirtualNetworkDialog() { qFatal("Error virtual network"); }
Modified: trunk/src/devices/smartdevice.cpp
===================================================================
--- trunk/src/devices/smartdevice.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/devices/smartdevice.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -23,12 +23,12 @@
#include "routeeditor.h"
#include "adapterproperty.h"
#include "tablearp.h"
-#include "programmdialog.h"
+#include "programdialog.h"
#include "logdialog.h"
#include "routemodel.h"
#include "abstractsocket.h"
#include "socketfactory.h"
-#include "dhcpclientprogramm.h"
+#include "dhcpclientprogram.h"
SmartDevice::SmartDevice(QObject *parent) : DeviceImpl(parent) , myRouter(false) ,
@@ -205,7 +205,7 @@
/*!
Отправляет сообщение посланное из интерфейса программы.
@param a - Адрес назначения.
- @param size - \xD0 азмер сообщения в кб(на деле сколько пакетов).
+ @param size - азмер сообщения в кб(на деле сколько пакетов).
@param type - Протокол с помощью которого происходит отправка.
*/
void SmartDevice::sendMessage( const QString &a , int size ,int type)
@@ -301,9 +301,9 @@
d->show();
}
-void SmartDevice::programmsDialog()
+void SmartDevice::programsDialog()
{
- programmDialog *d = new programmDialog;
+ ProgramDialog *d = new ProgramDialog;
d->setDevice(this);
d->show();
}
@@ -501,7 +501,7 @@
return s;
}
-bool SmartDevice::hasProgramm(int id)
+bool SmartDevice::hasProgram(int id)
{
foreach ( Program *i , myPrograms )
if ( i->id() == id ) return true;
Modified: trunk/src/devices/smartdevice.h
===================================================================
--- trunk/src/devices/smartdevice.h 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/devices/smartdevice.h 2011-02-11 18:54:11 UTC (rev 238)
@@ -24,7 +24,7 @@
#include <QtGui/QIcon>
#include "deviceimpl.h"
#include "interface.h"
-#include "programmrep.h"
+#include "programrep.h"
class RouteModel;
class ArpModel;
@@ -49,7 +49,7 @@
QString tableName() const { return tr("Routing Table"); }
virtual void tableDialog();
virtual void adapterDialog();
- virtual void programmsDialog();
+ virtual void programsDialog();
virtual void arpDialog();
virtual void showLogDialog(logDialog *log) const;
@@ -101,7 +101,7 @@
void setRouter(bool n) { myRouter = n; }
bool isRouter() const { return myRouter; }
bool hasTable() const { return true; }
- bool hasProgramm(int id);
+ bool hasProgram(int id);
IpAddress gateway() const;
QString gatewayString() const { return gateway().toString(); }
AbstractSocket* openSocket(quint16 port , int type);
@@ -165,7 +165,7 @@
void setCheckedSocket(const QString &str) { sd->setCheckedSocket(str); }
QString statics() const { return sd->myInterfaces.at(cur)->statisticsString(); }
void sendArpRequest(IpAddress a) { sd->myInterfaces.at(cur)->sendArpRequest(a); }
- bool hasDhcpClient() const { return sd->hasProgramm( Program::DHCPClient ); }
+ bool hasDhcpClient() const { return sd->hasProgram( Program::DHCPClient ); }
bool isUnderDhcpControl() const;
void setUnderDhcpControl(bool isUnder);
bool canManageInterface() const { return sd->canManageInterface(); }
Modified: trunk/src/dialogs/adapterproperty.cpp
===================================================================
--- trunk/src/dialogs/adapterproperty.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/adapterproperty.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -147,14 +147,14 @@
void adapterProperty::apply()
{
sd->setMac( le_mac->text() );
- sd->setIp( le_ip->text() );
- sd->setMask( le_mask->text() );
+ sd->setIp( le_ip->ipText() );
+ sd->setMask( le_mask->ipText() );
sd->connectedNet();
sd->setCurrent( tab_interfaces->currentIndex() );
if ( sd->hasDhcpClient() ) {
sd->setUnderDhcpControl( cb_auto->isChecked() );
}
- if ( sd->isConnect() ) sd->sendArpRequest(le_ip->text());
+ if ( sd->isConnect() ) sd->sendArpRequest(le_ip->ipText());
if ( sender() == btn_ok ) accept();
}
//------------------------------------------------------------
Modified: trunk/src/dialogs/computerproperty.cpp
===================================================================
--- trunk/src/dialogs/computerproperty.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/computerproperty.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -59,7 +59,7 @@
void computerProperty::apply()
{
- comp->setGateway(gateway->text());
+ comp->setGateway(gateway->ipText());
comp->setRouter( cb_route->isChecked() );
if ( sender() == btn_ok ) accept();
}
Modified: trunk/src/dialogs/designerdialog.cpp
===================================================================
--- trunk/src/dialogs/designerdialog.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/designerdialog.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -262,7 +262,7 @@
Frame.setReceiver( le_receiverMac->text() );
if ( rb_ip->isChecked() ) {
Frame.setType( Frame::ip );
- IpPacket Packet( senderIp->ipText() , receiverIp->ipText() );
+ IpPacket Packet( senderIp->ipAddress() , receiverIp->ipAddress() );
if ( rb_tcp->isChecked() ) {
TcpPacket tcp;
tcp.setSender( sb_tcpSenderPort->value() );
@@ -289,8 +289,8 @@
Frame.setType( Frame::arp );
ArpPacket arp;
arp.setType( ( rb_request->isChecked() ) ? ArpPacket::request : ArpPacket::response );
- arp.setReceiverIp( arpReceiverIp->ipText() );
- arp.setSenderIp( arpSenderIp->ipText() );
+ arp.setReceiverIp( arpReceiverIp->ipAddress() );
+ arp.setSenderIp( arpSenderIp->ipAddress() );
arp.setReceiverMac( le_arpReceiverMac->text() );
arp.setSenderMac( le_arpSenderMac->text() );
Frame.pack(arp.toData());
Modified: trunk/src/dialogs/dhcpclientproperty.cpp
===================================================================
--- trunk/src/dialogs/dhcpclientproperty.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/dhcpclientproperty.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -18,7 +18,7 @@
** 02111-1307 USA.
****************************************************************************************/
#include "dhcpclientproperty.h"
-#include "dhcpclientprogramm.h"
+#include "dhcpclientprogram.h"
dhcpClientProperty::dhcpClientProperty(QWidget *parent) : QDialog(parent)
{
Modified: trunk/src/dialogs/dhcpserverproperty.cpp
===================================================================
--- trunk/src/dialogs/dhcpserverproperty.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/dhcpserverproperty.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -19,19 +19,29 @@
****************************************************************************************/
#include <QMessageBox>
#include "dhcpserverproperty.h"
-#include "dhcpserverprogramm.h"
#include "dhcpservermodel.h"
#include "smartdevice.h"
#include "macaddressdelegate.h"
#include "ipaddressdelegate.h"
-DhcpServerProperty::DhcpServerProperty(SmartDevice *dev,QWidget *parent /* = 0 */) : QDialog(parent)
+DhcpServerProperty::DhcpServerProperty(DhcpServerSetting *setting, QWidget *parent) : QDialog(parent)
{
setupUi(this);
- device = dev;
+ myPortMap = new QMap<int, Interface*>;
+ mySetting = setting;
+ SmartDevice *dev = mySetting->program()->device();
setAttribute(Qt::WA_DeleteOnClose);
- foreach ( Interface *i, device->interfaces() )
- if ( i->isConnect() ) cb_interface->addItem( QIcon(":im/images/ok.png"), i->name() );
+ port_tb = new QTabBar;
+ tab_lay->addWidget(port_tb);
+ foreach ( Interface *i, dev->interfaces() ) {
+ if ( i->isConnect() ) {
+ int index = port_tb->addTab(QIcon(":im/images/ok.png"), i->name() );
+ myPortMap->insert(index, i);
+ }
+ }
+ connect(port_tb, SIGNAL(currentChanged(int)), SLOT(onCurrentChanged(int)));
+ port_tb->setCurrentIndex(0);
+ onCurrentChanged(0);
macDelegate = new MacAddressDelegate(this);
ipDelegate = new IpAddressDelegate(this);
tv_static->setItemDelegateForColumn(0, macDelegate );
@@ -42,34 +52,66 @@
DhcpServerProperty::~DhcpServerProperty()
{
+ myPortMap->clear();
+ delete mySetting;
delete macDelegate;
+ delete ipDelegate;
}
-void DhcpServerProperty::setProgramm(DhcpServerProgram *prog)
+//----------Private functions--------------
+void DhcpServerProperty::clearForm()
{
-// myProgramm = prog;
-// myModel = myProgramm->dhcpModel();
-// tv_static->setModel( myModel );
-// QHeaderView *h = tv_static->horizontalHeader();
-// h->setResizeMode( QHeaderView::Stretch );
-// cb_dynamic->setChecked(myProgramm->dynamic());
-// sb_time->setValue(myProgramm->time());
-// ie_begin->setText(myProgramm->beginIp());
-// ie_end->setText(myProgramm->endIp());
-// ie_mask->setText(myProgramm->mask());
-// ie_gatew->setText(myProgramm->gateway());
-// cb_interface->setCurrentIndex( cb_interface->findText(myProgramm->interfaceName() ));
-// sb_waitingTime->setValue( myProgramm->waitingTime() );
-// le_name->setText(myProgramm->serverName());
+ tv_static->clearSpans();
+ cb_turnOn->setChecked(false);
+ cb_dynamic->setChecked(false);
+ sb_time->cleanText();
+ ie_begin->clear();
+ ie_end->clear();
+ ie_gatew->clear();
+ ie_mask->clear();
+ sb_waitingTime->cleanText();
}
+//----------Private slots--------------
+void DhcpServerProperty::onCurrentChanged(int index)
+{
+ myDaemon = mySetting->daemonOf(myPortMap->value(index));
+ if ( myDaemon == NULL ) clearForm();
+ myModel = myDaemon->dhcpModel();
+ cb_turnOn->setChecked(myDaemon->isTurnOn());
+ onTurnedOnOff(cb_turnOn->isChecked());
+ tv_static->setModel(myModel);
+ QHeaderView *h = tv_static->horizontalHeader();
+ h->setResizeMode( QHeaderView::Stretch );
+ cb_dynamic->setChecked(myDaemon->dynamic());
+ sb_time->setValue(myDaemon->time());
+ ie_begin->setText(myDaemon->beginIp());
+ ie_end->setText(myDaemon->endIp());
+ ie_gatew->setText(myDaemon->gateway());
+ ie_mask->setText(myDaemon->mask());
+ sb_waitingTime->setValue(myDaemon->waitingTime());
+}
+
+void DhcpServerProperty::onTurnedOnOff(bool b)
+{
+ static_lb->setEnabled(b);
+ tv_static->setEnabled(b);
+ btn_add->setEnabled(b);
+ btn_del->setEnabled(b);
+ waiting_lb->setEnabled(b);
+ sb_waitingTime->setEnabled(b);
+ cb_dynamic->setEnabled(b);
+}
+
void DhcpServerProperty::addRecord()
{
+ if ( myModel == NULL ) return;
myModel->insertRow( myModel->rowCount() );
}
void DhcpServerProperty::deleteRecord()
{
+ if ( myModel == NULL ) return;
myModel->removeRow( tv_static->currentIndex().row() );
}
@@ -85,21 +127,21 @@
void DhcpServerProperty::apply()
{
- if ( ie_begin->ipText() > ie_end->ipText() ) {
+ if ( ie_begin->ipAddress() > ie_end->ipAddress() ) {
QMessageBox::warning(0,tr("Wrong range"),tr("You have entered a wrong IP range."), QMessageBox::Ok, QMessageBox::Ok);
return;
}
-// myProgramm->setInterfaceName(cb_interface->currentText());
-// myProgramm->setBeginIp(ie_begin->ipText().toString());
-// myProgramm->setEndIp(ie_end->ipText().toString());
-// myProgramm->setMask(ie_mask->ipText().toString());
-// myProgramm->setGateway(ie_gatew->ipText().toString());
-// myProgramm->setTime(sb_time->value());
-// myProgramm->setDynamic(cb_dynamic->isChecked());
-// myProgramm->setWaitingTime(sb_waitingTime->value());
-// myProgramm->setServerName(le_name->text());
+ myDaemon->setTurnOn(cb_turnOn->isChecked());
+ myDaemon->setBeginIp(ie_begin->ipAddress());
+ myDaemon->setEndIp(ie_end->ipAddress());
+ myDaemon->setDynamic(cb_dynamic->isChecked());
+ myDaemon->setGateway(ie_gatew->ipAddress());
+ myDaemon->setMask(ie_mask->ipAddress());
+ myDaemon->setTime(sb_time->value());
+ myDaemon->setWaitingTime(sb_waitingTime->value());
accept();
}
+//-----------------------------------------
void DhcpServerProperty::changeEvent(QEvent *e)
{
Modified: trunk/src/dialogs/dhcpserverproperty.h
===================================================================
--- trunk/src/dialogs/dhcpserverproperty.h 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/dhcpserverproperty.h 2011-02-11 18:54:11 UTC (rev 238)
@@ -22,10 +22,9 @@
#include <ui_dhcpserverproperty.h>
#include "ipedit.h"
+#include "dhcpserverprogram.h"
-class DhcpServerProgram;
class DhcpServerModel;
-class SmartDevice;
class MacAddressDelegate;
class IpAddressDelegate;
@@ -33,22 +32,34 @@
{
Q_OBJECT
public:
- DhcpServerProperty(SmartDevice *dev, QWidget *parent = 0);
+ DhcpServerProperty(DhcpServerSetting *setting, QWidget *parent = 0);
~DhcpServerProperty();
- void setProgramm( DhcpServerProgram *prog );
-public slots:
+ void setProgram( DhcpServerProgram *prog );
+
+protected:
+ void changeEvent(QEvent *e);
+
+private slots:
+ void onCurrentChanged(int index);
+ void onTurnedOnOff(bool b);
void addRecord();
void deleteRecord();
void changeState(bool);
void apply();
-protected:
- void changeEvent(QEvent *e);
+
+private: // Functions
+ void clearForm();
+
+
private:
MacAddressDelegate *macDelegate;
IpAddressDelegate *ipDelegate;
- DhcpServerProgram *myProgramm;
DhcpServerModel *myModel;
- SmartDevice *device;
+ DhcpServerSetting* mySetting;
+ DhcpDaemon* myDaemon;
+ QMap<int, Interface*> *myPortMap;
+
+ QTabBar *port_tb;
};
#endif // DHCPSERVERPROPERTY_H
Modified: trunk/src/dialogs/dialogs.pri
===================================================================
--- trunk/src/dialogs/dialogs.pri 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/dialogs.pri 2011-02-11 18:54:11 UTC (rev 238)
@@ -4,7 +4,7 @@
src/dialogs/dialogtemplate.h \
src/dialogs/hubproperty.h \
src/dialogs/installdialog.h \
- src/dialogs/programmdialog.h \
+ src/dialogs/programdialog.h \
src/dialogs/routeeditor.h \
src/dialogs/routerproperty.h \
src/dialogs/senddialog.h \
@@ -29,7 +29,7 @@
src/dialogs/dialogtemplate.cpp \
src/dialogs/hubproperty.cpp \
src/dialogs/installdialog.cpp \
- src/dialogs/programmdialog.cpp \
+ src/dialogs/programdialog.cpp \
src/dialogs/routeeditor.cpp \
src/dialogs/routerproperty.cpp \
src/dialogs/senddialog.cpp \
Modified: trunk/src/dialogs/installdialog.cpp
===================================================================
--- trunk/src/dialogs/installdialog.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/installdialog.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -19,7 +19,7 @@
****************************************************************************************/
#include <QtGui/QMessageBox>
#include "installdialog.h"
-#include "ripprogramm.h"
+#include "ripprogram.h"
#include "smartdevice.h"
installDialog::installDialog(QWidget *parent) : QDialog(parent)
@@ -38,7 +38,7 @@
*/
void installDialog::install()
{
- if ( smart->hasProgramm( list->currentRow() ) ) {
+ if ( smart->hasProgram( list->currentRow() ) ) {
QMessageBox::warning(0,tr("Error") , tr("Program already installed.") ,
QMessageBox::Ok , QMessageBox::Ok );
return;
Modified: trunk/src/dialogs/ripproperty.cpp
===================================================================
--- trunk/src/dialogs/ripproperty.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/ripproperty.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -18,7 +18,7 @@
** 02111-1307 USA.
****************************************************************************************/
#include "ripproperty.h"
-#include "ripprogramm.h"
+#include "ripprogram.h"
ripProperty::ripProperty(QWidget *parent) : QDialog(parent)
{
Modified: trunk/src/dialogs/routeeditor.cpp
===================================================================
--- trunk/src/dialogs/routeeditor.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/routeeditor.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -108,7 +108,7 @@
void routeEditor::addRecord()
{
- model->addToTable( ip_dest->ipText() , ip_mask->ipText() , ip_gateway->ipText() , ipList.at( cb_out->currentIndex() )
+ model->addToTable( ip_dest->ipAddress() , ip_mask->ipAddress() , ip_gateway->ipAddress() , ipList.at( cb_out->currentIndex() )
, sp_metr->value(), RouteModel::staticMode );
ip_dest->clear();
ip_mask->clear();
Modified: trunk/src/dialogs/spoofingproperty.cpp
===================================================================
--- trunk/src/dialogs/spoofingproperty.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/spoofingproperty.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -1,5 +1,5 @@
#include "spoofingproperty.h"
-#include "spoofingprogramm.h"
+#include "spoofingprogram.h"
#include "ui_spoofingproperty.h"
spoofingProperty::spoofingProperty(QWidget *parent) :
@@ -25,8 +25,8 @@
void spoofingProperty::apply()
{
- pr->setClientIp( ui->clientEdit->ipText() );
- pr->setServerIp( ui->serverEdit->ipText() );
+ pr->setClientIp( ui->clientEdit->ipAddress() );
+ pr->setServerIp( ui->serverEdit->ipAddress() );
accept();
}
Modified: trunk/src/dialogs/tablearp.cpp
===================================================================
--- trunk/src/dialogs/tablearp.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/dialogs/tablearp.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -123,8 +123,8 @@
*/
void tableArp::addRecord()
{
- if ( le_mac->text() == "00:00:00:00:00:00" || ip->text() == "0.0.0.0" ) return;
- list.at(s.indexOf(cb_port->currentText()))->addToTable( ip->text(), le_mac->text(), ArpModel::staticMode );
+ if ( le_mac->text() == "00:00:00:00:00:00" || ip->ipText() == "0.0.0.0" ) return;
+ list.at(s.indexOf(cb_port->currentText()))->addToTable( ip->ipText(), le_mac->text(), ArpModel::staticMode );
updateTable();
ip->setText("0.0.0.0");
le_mac->setText("00:00:00:00:00:00");
Modified: trunk/src/factories/classfactory.cpp
===================================================================
--- trunk/src/factories/classfactory.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/factories/classfactory.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -8,11 +8,12 @@
#include "switchchip.h"
#include "routemodel.h"
#include "switchmodel.h"
-#include "ripprogramm.h"
+#include "ripprogram.h"
#include "arpmodel.h"
-#include "dhcpclientprogramm.h"
-#include "dhcpserverprogramm.h"
-#include "spoofingprogramm.h"
+#include "dhcpdaemon.h"
+#include "dhcpclientprogram.h"
+#include "dhcpserverprogram.h"
+#include "spoofingprogram.h"
#include "statistics.h"
#include "textitem.h"
@@ -66,7 +67,9 @@
return new ArpModel(parent);
} else if ( str == "ArpRecordObject" ) {
return new ArpRecordObject(parent);
- } else {
+ } else if ( str == "DhcpDaemon" ) {
+ return new DhcpDaemon(parent);
+ } else {
return 0;
}
}
Modified: trunk/src/forms/dhcpserverproperty.ui
===================================================================
--- trunk/src/forms/dhcpserverproperty.ui 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/forms/dhcpserverproperty.ui 2011-02-11 18:54:11 UTC (rev 238)
@@ -1,465 +1,428 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>dhspServerProperty</class>
- <widget class="QDialog" name="dhspServerProperty">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>800</width>
- <height>462</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>800</width>
- <height>0</height>
- </size>
- </property>
- <property name="windowTitle">
- <string>DHCP server's properties</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QCheckBox" name="cb_turnOn">
- <property name="text">
- <string>Turn on/off dhcp-server on this interface.</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Static:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTableView" name="tv_static">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="selectionMode">
- <enum>QAbstractItemView::SingleSelection</enum>
- </property>
- <property name="selectionBehavior">
- <enum>QAbstractItemView::SelectRows</enum>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="btn_add">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Add</string>
- </property>
- <property name="icon">
- <iconset resource="../../netemul.qrc">
- <normaloff>:/im/images/edit_add.png</normaloff>:/im/images/edit_add.png</iconset>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="btn_del">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Delete</string>
- </property>
- <property name="icon">
- <iconset resource="../../netemul.qrc">
- <normaloff>:/im/images/edit_remove.png</normaloff>:/im/images/edit_remove.png</iconset>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QCheckBox" name="cb_dynamic">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Dynamic:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="lb_term">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Lease term:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="sb_time">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>70</width>
- <height>0</height>
- </size>
- </property>
- <property name="suffix">
- <string> s</string>
- </property>
- <property name="minimum">
- <number>300</number>
- </property>
- <property name="maximum">
- <number>3600</number>
- </property>
- <property name="singleStep">
- <number>10</number>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <item>
- <widget class="IpEdit" name="ie_begin" native="true">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="toolTip">
- <string>Ip address</string>
- </property>
- <property name="whatsThis">
- <string>The field for ip-address.</string>
- </property>
- <property name="labelText" stdset="0">
- <string>From:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="IpEdit" name="ie_end" native="true">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="toolTip">
- <string>Ip address</string>
- </property>
- <property name="whatsThis">
- <string>The field for ip-address.</string>
- </property>
- <property name="labelText" stdset="0">
- <string>to:</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_4">
- <item>
- <widget class="IpEdit" name="ie_mask" native="true">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="toolTip">
- <string>Ip address</string>
- </property>
- <property name="whatsThis">
- <string>The field for ip-address.</string>
- </property>
- <property name="labelText" stdset="0">
- <string>Mask:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="IpEdit" name="ie_gatew" native="true">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="toolTip">
- <string>Ip address</string>
- </property>
- <property name="whatsThis">
- <string>The field for ip-address.</string>
- </property>
- <property name="labelText" stdset="0">
- <string>Gateway:</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLabel" name="label_2">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Wating time for request from dhcp-client:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="sb_waitingTime">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="maximumSize">
- <size>
- <width>70</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="minimum">
- <number>60</number>
- </property>
- <property name="maximum">
- <number>300</number>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>13</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_5">
- <item>
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="btn_ok">
- <property name="text">
- <string>Ok</string>
- </property>
- <property name="icon">
- <iconset resource="../../netemul.qrc">
- <normaloff>:/im/images/ok.png</normaloff>:/im/images/ok.png</iconset>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="btn_cancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- <property name="icon">
- <iconset resource="../../netemul.qrc">
- <normaloff>:/im/images/not.png</normaloff>:/im/images/not.png</iconset>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Choose interface:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="cb_interface">
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>Give server's name:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="le_name"/>
- </item>
- <item>
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <customwidgets>
- <customwidget>
- <class>IpEdit</class>
- <extends>QWidget</extends>
- <header>ipedit.h</header>
- </customwidget>
- </customwidgets>
- <resources>
- <include location="../../netemul.qrc"/>
- </resources>
- <connections>
- <connection>
- <sender>btn_cancel</sender>
- <signal>clicked()</signal>
- <receiver>dhspServerProperty</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>789</x>
- <y>451</y>
- </hint>
- <hint type="destinationlabel">
- <x>49</x>
- <y>284</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>btn_add</sender>
- <signal>clicked()</signal>
- <receiver>dhspServerProperty</receiver>
- <slot>addRecord()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>694</x>
- <y>214</y>
- </hint>
- <hint type="destinationlabel">
- <x>234</x>
- <y>228</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>btn_del</sender>
- <signal>clicked()</signal>
- <receiver>dhspServerProperty</receiver>
- <slot>deleteRecord()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>789</x>
- <y>214</y>
- </hint>
- <hint type="destinationlabel">
- <x>260</x>
- <y>234</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>cb_dynamic</sender>
- <signal>toggled(bool)</signal>
- <receiver>dhspServerProperty</receiver>
- <slot>changeState(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>42</x>
- <y>244</y>
- </hint>
- <hint type="destinationlabel">
- <x>114</x>
- <y>326</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>btn_ok</sender>
- <signal>clicked()</signal>
- <receiver>dhspServerProperty</receiver>
- <slot>apply()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>693</x>
- <y>451</y>
- </hint>
- <hint type="destinationlabel">
- <x>540</x>
- <y>364</y>
- </hint>
- </hints>
- </connection>
- </connections>
- <slots>
- <slot>addRecord()</slot>
- <slot>deleteRecord()</slot>
- <slot>changeState(bool)</slot>
- <slot>apply()</slot>
- </slots>
-</ui>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>dhspServerProperty</class>
+ <widget class="QDialog" name="dhspServerProperty">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>462</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>800</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>DHCP server's properties</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="tab_lay"/>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cb_turnOn">
+ <property name="text">
+ <string>Turn on/off dhcp-server on this interface.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="static_lb">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Static:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTableView" name="tv_static">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="selectionMode">
+ <enum>QAbstractItemView::SingleSelection</enum>
+ </property>
+ <property name="selectionBehavior">
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btn_add">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Add</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../../netemul.qrc">
+ <normaloff>:/im/images/edit_add.png</normaloff>:/im/images/edit_add.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btn_del">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Delete</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../../netemul.qrc">
+ <normaloff>:/im/images/edit_remove.png</normaloff>:/im/images/edit_remove.png</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cb_dynamic">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Dynamic:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="lb_term">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Lease term:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="sb_time">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>70</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="suffix">
+ <string> s</string>
+ </property>
+ <property name="minimum">
+ <number>300</number>
+ </property>
+ <property name="maximum">
+ <number>3600</number>
+ </property>
+ <property name="singleStep">
+ <number>10</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="IpEdit" name="ie_begin" native="true">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Ip address</string>
+ </property>
+ <property name="whatsThis">
+ <string>The field for ip-address.</string>
+ </property>
+ <property name="labelText" stdset="0">
+ <string>From:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="IpEdit" name="ie_end" native="true">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Ip address</string>
+ </property>
+ <property name="whatsThis">
+ <string>The field for ip-address.</string>
+ </property>
+ <property name="labelText" stdset="0">
+ <string>to:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="IpEdit" name="ie_mask" native="true">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Ip address</string>
+ </property>
+ <property name="whatsThis">
+ <string>The field for ip-address.</string>
+ </property>
+ <property name="labelText" stdset="0">
+ <string>Mask:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="IpEdit" name="ie_gatew" native="true">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Ip address</string>
+ </property>
+ <property name="whatsThis">
+ <string>The field for ip-address.</string>
+ </property>
+ <property name="labelText" stdset="0">
+ <string>Gateway:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="waiting_lb">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Wating time for request from dhcp-client:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="sb_waitingTime">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>70</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="minimum">
+ <number>60</number>
+ </property>
+ <property name="maximum">
+ <number>300</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btn_ok">
+ <property name="text">
+ <string>Ok</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../../netemul.qrc">
+ <normaloff>:/im/images/ok.png</normaloff>:/im/images/ok.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btn_cancel">
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../../netemul.qrc">
+ <normaloff>:/im/images/not.png</normaloff>:/im/images/not.png</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>IpEdit</class>
+ <extends>QWidget</extends>
+ <header>ipedit.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources>
+ <include location="../../netemul.qrc"/>
+ </resources>
+ <connections>
+ <connection>
+ <sender>btn_cancel</sender>
+ <signal>clicked()</signal>
+ <receiver>dhspServerProperty</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>789</x>
+ <y>451</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>49</x>
+ <y>284</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>btn_add</sender>
+ <signal>clicked()</signal>
+ <receiver>dhspServerProperty</receiver>
+ <slot>addRecord()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>704</x>
+ <y>263</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>234</x>
+ <y>228</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>btn_del</sender>
+ <signal>clicked()</signal>
+ <receiver>dhspServerProperty</receiver>
+ <slot>deleteRecord()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>789</x>
+ <y>263</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>260</x>
+ <y>234</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>cb_dynamic</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>dhspServerProperty</receiver>
+ <slot>changeState(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>51</x>
+ <y>292</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>114</x>
+ <y>326</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>btn_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>dhspServerProperty</receiver>
+ <slot>apply()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>693</x>
+ <y>451</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>540</x>
+ <y>364</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>cb_turnOn</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>dhspServerProperty</receiver>
+ <slot>onTurnedOnOff(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>144</x>
+ <y>15</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>248</x>
+ <y>3</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+ <slots>
+ <slot>addRecord()</slot>
+ <slot>deleteRecord()</slot>
+ <slot>changeState(bool)</slot>
+ <slot>apply()</slot>
+ <slot>onTurnedOnOff(bool)</slot>
+ </slots>
+</ui>
Modified: trunk/src/forms/forms.pri
===================================================================
--- trunk/src/forms/forms.pri 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/forms/forms.pri 2011-02-11 18:54:11 UTC (rev 238)
@@ -1,4 +1,4 @@
-FORMS += src/forms/programmdialog.ui \
+FORMS += src/forms/programdialog.ui \
src/forms/testdialog.ui \
src/forms/connectdialog.ui \
src/forms/tableswitch.ui \
Modified: trunk/src/graphics/device.h
===================================================================
--- trunk/src/graphics/device.h 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/graphics/device.h 2011-02-11 18:54:11 UTC (rev 238)
@@ -66,7 +66,7 @@
void dialog() { impl->dialog(); }
void tableDialog() const { impl->tableDialog(); }
void adapterDialog() const { impl->adapterDialog(); }
- void programmsDialog() const { impl->programmsDialog(); }
+ void programmsDialog() const { impl->programsDialog(); }
void arpDialog() const { impl->arpDialog(); }
void showLogDialog(logDialog *log) const { impl->showLogDialog(log); }
void showDesignerDialog() const { impl->showDesignerDialog(); }
Modified: trunk/src/ipedit.cpp
===================================================================
--- trunk/src/ipedit.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/ipedit.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -77,7 +77,7 @@
return QSize(label->width() + part[0]->width() * 4 + 50, part[0]->height() +10 );
}
-QString IpEdit::text() const
+QString IpEdit::ipText() const
{
QString s;
s = part[0]->text();
Modified: trunk/src/ipedit.h
===================================================================
--- trunk/src/ipedit.h 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/src/ipedit.h 2011-02-11 18:54:11 UTC (rev 238)
@@ -35,8 +35,8 @@
public:
IpEdit(QWidget *parent = 0, QString str = "");
void setText(QString str);
- IpAddress ipText() const { return IpAddress(text()); }
- QString text() const;
+ IpAddress ipAddress() const { return IpAddress(ipText()); }
+ QString ipText() const;
void setLabelText(const QString text);
QString labelText() const;
void clear();
Modified: trunk/test/frame/frame.pro
===================================================================
--- trunk/test/frame/frame.pro 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/test/frame/frame.pro 2011-02-11 18:54:11 UTC (rev 238)
@@ -1,20 +1,9 @@
-INCLUDEPATH += ../../src/packets \
- ../../src
-SOURCES += main.cpp \
- ../../src/frame.cpp \
- ../../src/macaddress.cpp \
- ../../src/packets/ippacket.cpp \
- ../../src/ipaddress.cpp \
- ../../src/packets/arppacket.cpp \
- ../../src/packets/udppacket.cpp \
- ../../src/packets/tcppacket.cpp
-HEADERS += ../../src/frame.h \
- ../../src/macaddress.h \
- ../../src/packets/ippacket.h \
- ../../src/ipaddress.h \
- ../../src/packets/arppacket.h \
- ../../src/packets/udppacket.h \
- ../../src/packets/tcppacket.h
+INCLUDEPATH += ../../basicnetlib/packets \
+ ../../basicnetlib
+SOURCES += main.cpp
+
+LIBS += -L../.. -lbasicnetlib
+
TARGET = frame
TEMPLATE = app
QT += testlib
Modified: trunk/test/frame/main.cpp
===================================================================
--- trunk/test/frame/main.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/test/frame/main.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -11,20 +11,20 @@
void saveLoadIp();
void creatingCopy();
private:
- frame arpFrame;
- frame ipFrame;
+ Frame arpFrame;
+ Frame ipFrame;
};
void TestFrame::saveLoadArp()
{
- arpPacket p;
- p.setType(arpPacket::response);
+ ArpPacket p;
+ p.setType(ArpPacket::response);
p.setReceiverIp(IpAddress("1.2.3.4"));
- p.setReceiverMac(macAddress("10:01:10:01:10:01"));
+ p.setReceiverMac(MacAddress("10:01:10:01:10:01"));
p.setSenderIp(IpAddress("4.3.2.1"));
- p.setSenderMac(macAddress("00:11:22:33:44:55"));
+ p.setSenderMac(MacAddress("00:11:22:33:44:55"));
arpFrame.pack(p.toData());
- arpPacket a(arpFrame.unpack() );
+ ArpPacket a(arpFrame.unpack() );
QCOMPARE( p.type() , a.type() );
QCOMPARE( p.receiverIp() , a.receiverIp() );
QCOMPARE( p.receiverMac() ,a.receiverMac() );
@@ -34,12 +34,12 @@
void TestFrame::saveLoadIp()
{
- ipPacket p;
+ IpPacket p;
p.setSender(IpAddress("1.2.3.4"));
p.setReceiver(IpAddress("4.3.2.1"));
- p.setUpProtocol(ipPacket::tcp);
+ p.setUpProtocol(IpPacket::tcp);
ipFrame.pack( p.toData() );
- ipPacket a( ipFrame.unpack() );
+ IpPacket a( ipFrame.unpack() );
QCOMPARE( p.sender() , a.sender() );
QCOMPARE( p.receiver() , a.receiver() );
QCOMPARE( p.upProtocol() , a.upProtocol() );
@@ -49,8 +49,8 @@
{
arpFrame.setSender(tr("09:09:09:09:09:09"));
ipFrame.setSender( arpFrame.sender() );
- frame a = arpFrame;
- frame b = ipFrame;
+ Frame a = arpFrame;
+ Frame b = ipFrame;
QCOMPARE( a.sender() , b.sender() );
}
Modified: trunk/test/ipaddress/ipaddress.pro
===================================================================
--- trunk/test/ipaddress/ipaddress.pro 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/test/ipaddress/ipaddress.pro 2011-02-11 18:54:11 UTC (rev 238)
@@ -10,6 +10,9 @@
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
-SOURCES += main.cpp \
- ../../src/ipaddress.cpp
-HEADERS += ../../src/ipaddress.h
+
+INCLUDEPATH += ../../basicnetlib
+
+LIBS += -L../.. -lbasicnetlib
+
+SOURCES += main.cpp
Modified: trunk/test/ipaddress/main.cpp
===================================================================
--- trunk/test/ipaddress/main.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/test/ipaddress/main.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -1,5 +1,5 @@
#include <QtTest>
-#include "../../src/ipaddress.h"
+#include "ipaddress.h"
class TestIpAddress : public QObject
{
Modified: trunk/test/ippacket/ippacket.pro
===================================================================
--- trunk/test/ippacket/ippacket.pro 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/test/ippacket/ippacket.pro 2011-02-11 18:54:11 UTC (rev 238)
@@ -5,15 +5,11 @@
TARGET = ippacket
CONFIG += console
TEMPLATE = app
-INCLUDEPATH += ../../src/packets \
- ../../src
-SOURCES += main.cpp \
- ../../src/packets/ippacket.cpp \
- ../../src/ipaddress.cpp \
- ../../src/packets/udppacket.cpp \
- ../../src/packets/tcppacket.cpp
-HEADERS += ../../src/packets/ippacket.h \
- ../../src/ipaddress.h \
- ../../src/packets/udppacket.h \
- ../../src/packets/tcppacket.h
+LIBS += -L../.. -lbasicnetlib
+
+INCLUDEPATH += ../../basicnetlib/packets \
+ ../../basicnetlib
+SOURCES += main.cpp
+
+
Modified: trunk/test/ippacket/main.cpp
===================================================================
--- trunk/test/ippacket/main.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/test/ippacket/main.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -15,8 +15,8 @@
void saveLoadTcp();
void saveLoadUdp();
private:
- ipPacket tcpIp;
- ipPacket udpIp;
+ IpPacket tcpIp;
+ IpPacket udpIp;
};
//---------------------------------------
/*!
@@ -24,7 +24,7 @@
*/
void TestIpPacket::setBroadcast()
{
- ipPacket p;
+ IpPacket p;
p.setReceiver(IpAddress("192.168.1.13"));
QCOMPARE(p.isBroadcast("255.255.0.0") , false );
p.setSender(IpAddress("192.168.1.2"));
@@ -33,20 +33,20 @@
p.setSender(IpAddress("192.168.1.255"));
p.setBroadcast("255.255.255.0");
QCOMPARE( p.isBroadcast("255.255.255.0") , true);
- ipPacket a = p;
- ipPacket b = p;
+ IpPacket a = p;
+ IpPacket b = p;
QCOMPARE( a.sender() , b.sender() );
}
//------------------------------------------
void TestIpPacket::saveLoadTcp()
{
- tcpPacket *p = new tcpPacket;
+ TcpPacket *p = new TcpPacket;
p->setSender(1024);
p->setReceiver(512);
tcpIp.pack(p->toData());
delete p;
- p = new tcpPacket( tcpIp.unpack() );
+ p = new TcpPacket( tcpIp.unpack() );
QCOMPARE( p->sender() , quint16(1024) );
QCOMPARE( p->receiver() ,quint16( 512 ));
delete p;
@@ -54,12 +54,12 @@
void TestIpPacket::saveLoadUdp()
{
- udpPacket *p = new udpPacket;
+ UdpPacket *p = new UdpPacket;
p->setSender(1024);
p->setReceiver(512);
udpIp.pack( p->toData() );
delete p;
- p = new udpPacket( udpIp.unpack() );
+ p = new UdpPacket( udpIp.unpack() );
QCOMPARE( p->sender() , quint16(1024) );
QCOMPARE( p->receiver() , quint16(512) );
delete p;
Modified: trunk/test/mac/main.cpp
===================================================================
--- trunk/test/mac/main.cpp 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/test/mac/main.cpp 2011-02-11 18:54:11 UTC (rev 238)
@@ -13,14 +13,14 @@
void TestmacAddress::toString()
{
- macAddress m;
+ MacAddress m;
m.setMac("01:03:00:00:00:00");
QCOMPARE(m.toString(), tr("01:03:00:00:00:00"));
}
void TestmacAddress::setBroadcast()
{
- macAddress m;
+ MacAddress m;
m.setBroadcast();
QCOMPARE( m.toString() , tr("FF:FF:FF:FF:FF:FF"));
QCOMPARE( m.isBroadcast() , true );
@@ -28,8 +28,8 @@
void TestmacAddress::saveAndLoad()
{
- macAddress m("01:02:03:04:05:06");
- macAddress t = m;
+ MacAddress m("01:02:03:04:05:06");
+ MacAddress t = m;
QFile f("test3");
if ( f.open(QIODevice::WriteOnly) ) {
QDataStream s(&f);
@@ -49,8 +49,8 @@
void TestmacAddress::operators()
{
- macAddress a("01:02:03:04:05:06");
- macAddress b("01:02:03:04:05:07");
+ MacAddress a("01:02:03:04:05:06");
+ MacAddress b("01:02:03:04:05:07");
QCOMPARE( a < b , true );
QCOMPARE( a >= b , false );
QCOMPARE( a++ == b++ , false );
Modified: trunk/test/test.pro
===================================================================
--- trunk/test/test.pro 2011-02-09 12:47:59 UTC (rev 237)
+++ trunk/test/test.pro 2011-02-11 18:54:11 UTC (rev 238)
@@ -2,12 +2,10 @@
# Automatically generated by qmake (2.01a) Sun Jun 28 01:51:25 2009
######################################################################
-DEFINES += __TESTING__
TEMPLATE = subdirs
SUBDIRS = mac \
ippacket \
ipaddress \
- frame \
- scenexmlreader \
- cable
+ frame
+# cable
# Input
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|