- Build files cleanup
- Top level Makefile now has a 'release' target - pcap_set_direction() is no longer invoked in case of Win32 as older versions of WinPcap do not support this API - MyService::modifyPort() declaration modified to fix the error reported by newer gcc compiler
This commit is contained in:
parent
2581562ec5
commit
3281eb8f20
13
Makefile
13
Makefile
@ -1,4 +1,6 @@
|
||||
all:
|
||||
release: QMAKE_CONFIG=-config release
|
||||
|
||||
all release: qmake
|
||||
$(MAKE) -C rpc
|
||||
$(MAKE) -C common
|
||||
$(MAKE) -C server
|
||||
@ -17,7 +19,8 @@ distclean:
|
||||
$(MAKE) -C client $@
|
||||
|
||||
qmake:
|
||||
cd rpc && qmake && cd ..
|
||||
cd common && qmake && cd ..
|
||||
cd server && qmake && cd ..
|
||||
cd client && qmake && cd ..
|
||||
cd rpc && qmake $(QMAKE_CONFIG) && cd ..
|
||||
cd common && qmake $(QMAKE_CONFIG) && cd ..
|
||||
cd server && qmake $(QMAKE_CONFIG) && cd ..
|
||||
cd client && qmake $(QMAKE_CONFIG) && cd ..
|
||||
|
||||
|
@ -1,14 +1,27 @@
|
||||
TEMPLATE = app
|
||||
CONFIG += qt debug
|
||||
CONFIG += qt
|
||||
QT += network script
|
||||
INCLUDEPATH += "../rpc/" "../common/"
|
||||
LIBS += -lprotobuf
|
||||
win32:LIBS += -L"../common/debug" -lostproto
|
||||
unix: LIBS += -L"../common" -lostproto
|
||||
win32:LIBS += -L"../rpc/debug" -lpbrpc
|
||||
unix:LIBS += -L"../rpc" -lpbrpc
|
||||
win32:POST_TARGETDEPS += "../common/debug/libostproto.a" "../rpc/debug/libpbrpc.a"
|
||||
unix:POST_TARGETDEPS += "../common/libostproto.a" "../rpc/libpbrpc.a"
|
||||
win32 {
|
||||
CONFIG(debug, debug|release) {
|
||||
LIBS += -L"../common/debug" -lostproto
|
||||
LIBS += -L"../rpc/debug" -lpbrpc
|
||||
POST_TARGETDEPS += \
|
||||
"../common/debug/libostproto.a" \
|
||||
"../rpc/debug/libpbrpc.a"
|
||||
} else {
|
||||
LIBS += -L"../common/release" -lostproto
|
||||
LIBS += -L"../rpc/release" -lpbrpc
|
||||
POST_TARGETDEPS += \
|
||||
"../common/release/libostproto.a" \
|
||||
"../rpc/release/libpbrpc.a"
|
||||
}
|
||||
} else {
|
||||
LIBS += -L"../common" -lostproto
|
||||
LIBS += -L"../rpc" -lpbrpc
|
||||
POST_TARGETDEPS += "../common/libostproto.a" "../rpc/libpbrpc.a"
|
||||
}
|
||||
RESOURCES += ostinato.qrc
|
||||
HEADERS += \
|
||||
dumpview.h \
|
||||
|
@ -1,17 +1,30 @@
|
||||
TEMPLATE = app
|
||||
CONFIG += qt debug
|
||||
CONFIG += qt
|
||||
QT += network script
|
||||
DEFINES += HAVE_REMOTE WPCAP
|
||||
INCLUDEPATH += "../rpc"
|
||||
win32:LIBS += -lwpcap -lpacket
|
||||
unix:LIBS += -lpcap
|
||||
win32:LIBS += -L"../common/debug" -lostproto
|
||||
unix:LIBS += -L"../common" -lostproto
|
||||
win32:LIBS += -L"../rpc/debug" -lpbrpc
|
||||
unix:LIBS += -L"../rpc" -lpbrpc
|
||||
win32 {
|
||||
LIBS += -lwpcap -lpacket
|
||||
CONFIG(debug, debug|release) {
|
||||
LIBS += -L"../common/debug" -lostproto
|
||||
LIBS += -L"../rpc/debug" -lpbrpc
|
||||
POST_TARGETDEPS += \
|
||||
"../common/debug/libostproto.a" \
|
||||
"../rpc/debug/libpbrpc.a"
|
||||
} else {
|
||||
LIBS += -L"../common/release" -lostproto
|
||||
LIBS += -L"../rpc/release" -lpbrpc
|
||||
POST_TARGETDEPS += \
|
||||
"../common/release/libostproto.a" \
|
||||
"../rpc/release/libpbrpc.a"
|
||||
}
|
||||
} else {
|
||||
LIBS += -lpcap
|
||||
LIBS += -L"../common" -lostproto
|
||||
LIBS += -L"../rpc" -lpbrpc
|
||||
POST_TARGETDEPS += "../common/libostproto.a" "../rpc/libpbrpc.a"
|
||||
}
|
||||
LIBS += -lprotobuf
|
||||
win32:POST_TARGETDEPS += "../common/debug/libostproto.a" "../rpc/debug/libpbrpc.a"
|
||||
unix:POST_TARGETDEPS += "../common/libostproto.a" "../rpc/libpbrpc.a"
|
||||
RESOURCES += drone.qrc
|
||||
HEADERS += drone.h
|
||||
FORMS += drone.ui
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
const ::OstProto::PortIdList* request,
|
||||
::OstProto::PortConfigList* response,
|
||||
::google::protobuf::Closure* done);
|
||||
void MyService::modifyPort(::google::protobuf::RpcController* /*controller*/,
|
||||
virtual void modifyPort(::google::protobuf::RpcController* /*controller*/,
|
||||
const ::OstProto::PortConfigList* request,
|
||||
::OstProto::Ack* response,
|
||||
::google::protobuf::Closure* done);
|
||||
|
@ -97,7 +97,13 @@ PcapPort::PortMonitor::PortMonitor(const char *device, Direction direction,
|
||||
|
||||
if (handle_ == NULL)
|
||||
goto _open_error;
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
// pcap_setdirection() API is not supported in Windows.
|
||||
// NOTE: WinPcap 4.1.1 and above exports a dummy API that returns -1
|
||||
// but since we would like to work with previous versions of WinPcap
|
||||
// also, we assume the API does not exist
|
||||
ret = -1;
|
||||
#else
|
||||
switch (direction_)
|
||||
{
|
||||
case kDirectionRx:
|
||||
@ -109,6 +115,7 @@ PcapPort::PortMonitor::PortMonitor(const char *device, Direction direction,
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ret < 0)
|
||||
goto _set_direction_error;
|
||||
|
Loading…
Reference in New Issue
Block a user