2019-10-12 13:06:21 +01:00
|
|
|
/*
|
2020-03-01 05:44:49 +00:00
|
|
|
* This file is part of the Aaru Remote Server.
|
2020-01-03 17:42:13 +00:00
|
|
|
* Copyright (c) 2019-2020 Natalia Portillo.
|
2019-10-12 13:06:21 +01:00
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, version 3.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2020-03-01 05:46:10 +00:00
|
|
|
#include <errno.h>
|
2019-10-12 13:06:21 +01:00
|
|
|
#include <stdio.h>
|
2020-10-24 04:23:01 +01:00
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
|
|
#include "win32/win32.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "aaruremote.h"
|
2019-10-12 23:52:48 +01:00
|
|
|
|
2019-10-12 13:06:21 +01:00
|
|
|
int main()
|
|
|
|
|
{
|
2020-03-01 17:02:54 +00:00
|
|
|
AaruPacketHello* pkt_server_hello;
|
|
|
|
|
int ret;
|
2019-10-12 13:31:54 +01:00
|
|
|
|
2019-10-20 21:50:25 +01:00
|
|
|
Initialize();
|
|
|
|
|
|
2020-03-01 05:50:46 +00:00
|
|
|
printf("Aaru Remote Server %s\n", AARUREMOTE_VERSION);
|
2020-01-03 17:42:13 +00:00
|
|
|
printf("Copyright (C) 2019-2020 Natalia Portillo\n");
|
2019-10-12 13:06:21 +01:00
|
|
|
|
2019-10-20 20:08:06 +01:00
|
|
|
pkt_server_hello = GetHello();
|
2019-10-12 17:28:09 +01:00
|
|
|
|
2019-10-20 20:08:06 +01:00
|
|
|
if(!pkt_server_hello)
|
2019-10-12 17:28:09 +01:00
|
|
|
{
|
|
|
|
|
printf("Error %d getting system version.\n", errno);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-20 20:08:06 +01:00
|
|
|
printf(
|
|
|
|
|
"Running under %s %s (%s).\n", pkt_server_hello->sysname, pkt_server_hello->release, pkt_server_hello->machine);
|
2019-10-12 17:28:09 +01:00
|
|
|
|
2019-10-20 21:38:14 +01:00
|
|
|
ret = PrintNetworkAddresses();
|
|
|
|
|
|
|
|
|
|
if(ret)
|
|
|
|
|
{
|
|
|
|
|
printf("Error %d enumerating interfaces\n", errno);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-20 21:50:25 +01:00
|
|
|
PlatformLoop(pkt_server_hello);
|
2019-10-12 13:06:21 +01:00
|
|
|
}
|