Brad Parker
11 years ago
4 changed files with 126 additions and 20 deletions
@ -0,0 +1,23 @@ |
|||
#include <QtCore/QCoreApplication> |
|||
#include <iostream> |
|||
#include <QTimer> |
|||
#include <QStringList> |
|||
#include "ip.h" |
|||
|
|||
int main(int argc, char *argv[]) { |
|||
QCoreApplication app(argc, argv); |
|||
IP ip; |
|||
|
|||
std::cout << "MAC: " << qPrintable(ip.macOfIP("10.0.4.1")) << std::endl; |
|||
QStringList addresses = ip.addresses("wlp3s0"); |
|||
|
|||
foreach(QString address, addresses) { |
|||
std::cout << "Address: " << qPrintable(address) << std::endl; |
|||
} |
|||
|
|||
QTimer::singleShot(0, qApp, SLOT(quit())); |
|||
|
|||
int ret = app.exec(); |
|||
|
|||
return ret; |
|||
} |
@ -0,0 +1,18 @@ |
|||
###################################################################### |
|||
# Automatically generated by qmake (3.0) Wed Aug 14 06:49:17 2013 |
|||
###################################################################### |
|||
|
|||
QT += core |
|||
|
|||
TEMPLATE = app |
|||
TARGET = iptest |
|||
|
|||
SOURCES += iptest.cpp |
|||
|
|||
INCLUDEPATH += "../" |
|||
|
|||
LIBS += -L.. -lip |
|||
LIBS += -lnl-route-3 -lnl-3 -lnl-cli-3 |
|||
QMAKE_LFLAGS += -Wl,-rpath,/home/bp/libip |
|||
|
|||
# Directories |
Loading…
Reference in new issue