fireperf
fireperf_SOURCES = \
+ src/client.c \
+ src/client.h \
src/logging.c \
src/logging.h \
src/main.c \
- src/main.h
+ src/main.h \
+ src/server.c \
+ src/server.h
# ------------------------------------------------------------------------------
--- /dev/null
+/*#############################################################################
+# #
+# fireperf - A network benchmarking tool #
+# Copyright (C) 2021 IPFire Development Team #
+# #
+# 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, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# 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/>. #
+# #
+#############################################################################*/
+
+#include "client.h"
+#include "logging.h"
+#include "main.h"
+
+int fireperf_client(struct fireperf_config* conf) {
+ DEBUG(conf, "Launching " PACKAGE_NAME " in client mode\n");
+
+ return 0;
+}
--- /dev/null
+/*#############################################################################
+# #
+# fireperf - A network benchmarking tool #
+# Copyright (C) 2021 IPFire Development Team #
+# #
+# 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, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# 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/>. #
+# #
+#############################################################################*/
+
+#ifndef FIREPERF_CLIENT_H
+#define FIREPERF_CLIENT_H
+
+#include "main.h"
+
+int fireperf_client(struct fireperf_config* conf);
+
+#endif /* FIREPERF_CLIENT_H */
#include <stdio.h>
#include <stdlib.h>
+#include "client.h"
#include "main.h"
#include "logging.h"
+#include "server.h"
static int parse_address(const char* string, struct in6_addr* address6) {
// Try parsing this address
int main(int argc, char* argv[]) {
struct fireperf_config conf = {
.loglevel = DEFAULT_LOG_LEVEL,
+ .mode = FIREPERF_MODE_NONE,
.port = DEFAULT_PORT,
};
int r;
if (r)
return r;
- // Check if a mode has been selected
- if (!conf.mode) {
- fprintf(stderr, "No mode selected\n");
- return 2;
- }
-
// Dump configuration
DEBUG(&conf, "Configuration:\n");
DEBUG(&conf, " Port = %d\n", conf.port);
- return 0;
+ switch (conf.mode) {
+ case FIREPERF_MODE_CLIENT:
+ return fireperf_client(&conf);
+
+ case FIREPERF_MODE_SERVER:
+ return fireperf_server(&conf);
+
+ case FIREPERF_MODE_NONE:
+ fprintf(stderr, "No mode selected\n");
+ r = 2;
+ break;
+ }
+
+ return r;
}
--- /dev/null
+/*#############################################################################
+# #
+# fireperf - A network benchmarking tool #
+# Copyright (C) 2021 IPFire Development Team #
+# #
+# 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, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# 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/>. #
+# #
+#############################################################################*/
+
+#include "logging.h"
+#include "main.h"
+#include "server.h"
+
+int fireperf_server(struct fireperf_config* conf) {
+ DEBUG(conf, "Launching " PACKAGE_NAME " in server mode\n");
+
+ return 0;
+}
--- /dev/null
+/*#############################################################################
+# #
+# fireperf - A network benchmarking tool #
+# Copyright (C) 2021 IPFire Development Team #
+# #
+# 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, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# 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/>. #
+# #
+#############################################################################*/
+
+#ifndef FIREPERF_SERVER_H
+#define FIREPERF_SERVER_H
+
+#include "main.h"
+
+int fireperf_server(struct fireperf_config* conf);
+
+#endif /* FIREPERF_SERVER_H */