Create and print activation hash on request
To request, pass option -a on the command-line
This commit is contained in:
parent
46a54fd56b
commit
4be8a2969d
@ -86,7 +86,11 @@ int main(int argc, char *argv[])
|
||||
app.applicationName().toLower());
|
||||
qDebug("Settings: %s", qPrintable(appSettings->fileName()));
|
||||
|
||||
initTurbo();
|
||||
if (!initTurbo())
|
||||
{
|
||||
exitCode = 1;
|
||||
goto _exit2;
|
||||
}
|
||||
|
||||
drone = new Drone();
|
||||
OstProtocolManager = new ProtocolManager();
|
||||
@ -116,6 +120,7 @@ _exit:
|
||||
delete drone;
|
||||
delete OstProtocolManager;
|
||||
|
||||
_exit2:
|
||||
google::protobuf::ShutdownProtobufLibrary();
|
||||
|
||||
fprintf(stderr, "done.\n");
|
||||
|
@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
#include "params.h"
|
||||
#include "pcapextra.h"
|
||||
#include "turbo.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
@ -55,6 +56,10 @@ int Params::parseCommandLine(int argc, char* argv[])
|
||||
exit(0);
|
||||
case 'h':
|
||||
default:
|
||||
if (c != 'h') {
|
||||
if (processTurboOption(optopt))
|
||||
continue;
|
||||
}
|
||||
printf("usage: %s [-dhv] [-p <port-number>]\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
#include "turbo.h"
|
||||
|
||||
void initTurbo()
|
||||
bool initTurbo()
|
||||
{
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isTurboPort(const char* device)
|
||||
@ -34,5 +34,9 @@ AbstractPort* createTurboPort(int id, const char* device)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool processTurboOption(int /*opt*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -22,9 +22,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
class AbstractPort;
|
||||
|
||||
void initTurbo();
|
||||
bool initTurbo();
|
||||
bool isTurboPort(const char* device);
|
||||
AbstractPort* createTurboPort(int id, const char* device);
|
||||
bool processTurboOption(int opt);
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user