From c285e91d4a8c3a2f5256d7c3bdb320c0fccd7ef0 Mon Sep 17 00:00:00 2001 From: Srivats P Date: Mon, 14 Nov 2022 17:23:20 +0530 Subject: [PATCH] Extract libostfile from libprotogui All .pro file changes only libostfile still has GUI dependency due to PCAP import options UI. Need to see if we can remove that - maybe extract into a separate libostfilegui. --- client/ostinato.pro | 9 ++-- common/ostfile.pro | 96 +----------------------------------------- common/ostprotogui.pro | 60 +------------------------- ost.pro | 7 ++- test/test.pro | 12 +++--- 5 files changed, 19 insertions(+), 165 deletions(-) diff --git a/client/ostinato.pro b/client/ostinato.pro index bee8308..615700c 100644 --- a/client/ostinato.pro +++ b/client/ostinato.pro @@ -8,24 +8,27 @@ INCLUDEPATH += "../rpc/" "../common/" win32 { QMAKE_LFLAGS += -static CONFIG(debug, debug|release) { - LIBS += -L"../common/debug" -lostprotogui -lostproto + LIBS += -L"../common/debug" -lostfile -lostprotogui -lostproto LIBS += -L"../rpc/debug" -lpbrpc POST_TARGETDEPS += \ + "../common/debug/libostfile.a" \ "../common/debug/libostprotogui.a" \ "../common/debug/libostproto.a" \ "../rpc/debug/libpbrpc.a" } else { - LIBS += -L"../common/release" -lostprotogui -lostproto + LIBS += -L"../common/release" -lostfile -lostprotogui -lostproto LIBS += -L"../rpc/release" -lpbrpc POST_TARGETDEPS += \ + "../common/release/libostfile.a" \ "../common/release/libostprotogui.a" \ "../common/release/libostproto.a" \ "../rpc/release/libpbrpc.a" } } else { - LIBS += -L"../common" -lostprotogui -lostproto + LIBS += -L"../common" -lostfile -lostprotogui -lostproto LIBS += -L"../rpc" -lpbrpc POST_TARGETDEPS += \ + "../common/libostfile.a" \ "../common/libostprotogui.a" \ "../common/libostproto.a" \ "../rpc/libpbrpc.a" diff --git a/common/ostfile.pro b/common/ostfile.pro index 1650af3..de7eef7 100644 --- a/common/ostfile.pro +++ b/common/ostfile.pro @@ -1,45 +1,17 @@ TEMPLATE = lib CONFIG += qt staticlib QT += widgets network xml script -INCLUDEPATH += "../extra/qhexedit2/src" LIBS += \ -lprotobuf FORMS = \ pcapfileimport.ui \ -FORMS += \ - mac.ui \ - vlan.ui \ - eth2.ui \ - dot3.ui \ - llc.ui \ - snap.ui \ - stp.ui \ - arp.ui \ - ip4.ui \ - ip6.ui \ - gmp.ui \ - gre.ui \ - icmp.ui \ - tcp.ui \ - udp.ui \ - textproto.ui \ - tosdscp.ui \ - hexdump.ui \ - payload.ui \ - sample.ui \ - sign.ui \ - userscript.ui - PROTOS = \ fileformat.proto -# TODO: Move fileformat related stuff into a different library - why? HEADERS = \ ostprotolib.h \ - ipv4addressdelegate.h \ - ipv6addressdelegate.h \ nativefileformat.h \ ossnfileformat.h \ ostmfileformat.h \ @@ -50,44 +22,7 @@ HEADERS = \ pdmlprotocols.h \ pdmlreader.h \ sessionfileformat.h \ - streamfileformat.h \ - spinboxdelegate.h - -HEADERS += \ - tosdscp.h - -HEADERS += \ - abstractprotocolconfig.h \ - comboprotocolconfig.h \ - protocolwidgetfactory.h \ - macconfig.h \ - vlanconfig.h \ - svlanconfig.h \ - vlanstackconfig.h \ - eth2config.h \ - dot3config.h \ - llcconfig.h \ - dot2llcconfig.h \ - snapconfig.h \ - dot2snapconfig.h \ - stpconfig.h \ - arpconfig.h \ - ip4config.h \ - ip6config.h \ - ip4over4config.h \ - gmpconfig.h \ - greconfig.h \ - icmpconfig.h \ - igmpconfig.h \ - mldconfig.h \ - tcpconfig.h \ - udpconfig.h \ - textprotoconfig.h \ - hexdumpconfig.h \ - payloadconfig.h \ - sampleconfig.h \ - signconfig.h \ - userscriptconfig.h + streamfileformat.h SOURCES += \ ostprotolib.cpp \ @@ -104,35 +39,6 @@ SOURCES += \ streamfileformat.cpp \ spinboxdelegate.cpp -SOURCES += \ - tosdscp.cpp - -SOURCES += \ - protocolwidgetfactory.cpp \ - macconfig.cpp \ - vlanconfig.cpp \ - eth2config.cpp \ - dot3config.cpp \ - llcconfig.cpp \ - snapconfig.cpp \ - stpconfig.cpp \ - arpconfig.cpp \ - ip4config.cpp \ - ip6config.cpp \ - gmpconfig.cpp \ - greconfig.cpp \ - icmpconfig.cpp \ - igmpconfig.cpp \ - mldconfig.cpp \ - tcpconfig.cpp \ - udpconfig.cpp \ - textprotoconfig.cpp \ - hexdumpconfig.cpp \ - payloadconfig.cpp \ - sampleconfig.cpp \ - signconfig.cpp \ - userscriptconfig.cpp - SOURCES += \ vlanpdml.cpp \ svlanpdml.cpp \ diff --git a/common/ostprotogui.pro b/common/ostprotogui.pro index 1650af3..1c8c059 100644 --- a/common/ostprotogui.pro +++ b/common/ostprotogui.pro @@ -2,11 +2,6 @@ TEMPLATE = lib CONFIG += qt staticlib QT += widgets network xml script INCLUDEPATH += "../extra/qhexedit2/src" -LIBS += \ - -lprotobuf - -FORMS = \ - pcapfileimport.ui \ FORMS += \ mac.ui \ @@ -32,28 +27,10 @@ FORMS += \ sign.ui \ userscript.ui -PROTOS = \ - fileformat.proto - -# TODO: Move fileformat related stuff into a different library - why? HEADERS = \ - ostprotolib.h \ ipv4addressdelegate.h \ ipv6addressdelegate.h \ - nativefileformat.h \ - ossnfileformat.h \ - ostmfileformat.h \ - pcapfileformat.h \ - pdmlfileformat.h \ - pythonfileformat.h \ - pdmlprotocol.h \ - pdmlprotocols.h \ - pdmlreader.h \ - sessionfileformat.h \ - streamfileformat.h \ - spinboxdelegate.h - -HEADERS += \ + spinboxdelegate.h \ tosdscp.h HEADERS += \ @@ -89,21 +66,6 @@ HEADERS += \ signconfig.h \ userscriptconfig.h -SOURCES += \ - ostprotolib.cpp \ - nativefileformat.cpp \ - ossnfileformat.cpp \ - ostmfileformat.cpp \ - pcapfileformat.cpp \ - pdmlfileformat.cpp \ - pythonfileformat.cpp \ - pdmlprotocol.cpp \ - pdmlprotocols.cpp \ - pdmlreader.cpp \ - sessionfileformat.cpp \ - streamfileformat.cpp \ - spinboxdelegate.cpp - SOURCES += \ tosdscp.cpp @@ -133,26 +95,6 @@ SOURCES += \ signconfig.cpp \ userscriptconfig.cpp -SOURCES += \ - vlanpdml.cpp \ - svlanpdml.cpp \ - stppdml.cpp \ - eth2pdml.cpp \ - llcpdml.cpp \ - arppdml.cpp \ - ip4pdml.cpp \ - ip6pdml.cpp \ - grepdml.cpp \ - icmppdml.cpp \ - icmp6pdml.cpp \ - igmppdml.cpp \ - mldpdml.cpp \ - tcppdml.cpp \ - udppdml.cpp \ - textprotopdml.cpp \ - samplepdml.cpp - QMAKE_DISTCLEAN += object_script.* -include(../protobuf.pri) include(../options.pri) diff --git a/ost.pro b/ost.pro index ae566fb..a174bc3 100644 --- a/ost.pro +++ b/ost.pro @@ -1,14 +1,17 @@ TEMPLATE = subdirs -SUBDIRS = client server ostproto ostprotogui rpc extra +SUBDIRS = client server ostfile ostproto ostprotogui rpc extra client.target = client client.file = client/ostinato.pro -client.depends = ostproto ostprotogui rpc extra +client.depends = ostfile ostproto ostprotogui rpc extra server.target = server server.file = server/drone.pro server.depends = ostproto rpc +ostfile.file = common/ostfile.pro +ostfile.depends = ostproto + ostproto.file = common/ostproto.pro ostprotogui.file = common/ostprotogui.pro diff --git a/test/test.pro b/test/test.pro index 971ab1e..1ba6bfb 100644 --- a/test/test.pro +++ b/test/test.pro @@ -5,26 +5,26 @@ INCLUDEPATH += "../rpc/" "../common/" "../client" win32 { LIBS += -lwpcap -lpacket CONFIG(debug, debug|release) { - LIBS += -L"../common/debug" -lostprotogui -lostproto + LIBS += -L"../common/debug" -lostfile -lostproto LIBS += -L"../rpc/debug" -lpbrpc POST_TARGETDEPS += \ - "../common/debug/libostprotogui.a" \ + "../common/debug/libostfile.a" \ "../common/debug/libostproto.a" \ "../rpc/debug/libpbrpc.a" } else { - LIBS += -L"../common/release" -lostprotogui -lostproto + LIBS += -L"../common/release" -lostfile -lostproto LIBS += -L"../rpc/release" -lpbrpc POST_TARGETDEPS += \ - "../common/release/libostprotogui.a" \ + "../common/release/libostfile.a" \ "../common/release/libostproto.a" \ "../rpc/release/libpbrpc.a" } } else { LIBS += -lpcap - LIBS += -L"../common" -lostprotogui -lostproto + LIBS += -L"../common" -lostfile -lostproto LIBS += -L"../rpc" -lpbrpc POST_TARGETDEPS += \ - "../common/libostprotogui.a" \ + "../common/libostfile.a" \ "../common/libostproto.a" \ "../rpc/libpbrpc.a" }