From 0d789ed8d938cc342c8f2138280795a1d5a61e3d Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 28 Jun 2016 16:11:19 +0200 Subject: lib, irmd, ipcpd: Change of IRM API This changes the IRM API after discussions with Dimitri. The register operation is now split into a bind and register operation. The same for unregister; unbind and unregister. PIDs are now used as the application instance name. A name for a PID is only provided for scriptability in bash. It is therefore also no longer passed down to the IPCP. Every operation on an IPCP through the IRM API has to use the PID. Quering of the PIDs by name is possible. The IRM tool has been updated to use this new API as well. A subcommand 'ipcp' has been added for operations that take effect on IPCPs only. Fixes #12 --- src/tools/irm/irm_ipcp_bootstrap.c | 200 +++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 src/tools/irm/irm_ipcp_bootstrap.c (limited to 'src/tools/irm/irm_ipcp_bootstrap.c') diff --git a/src/tools/irm/irm_ipcp_bootstrap.c b/src/tools/irm/irm_ipcp_bootstrap.c new file mode 100644 index 00000000..c2b696e4 --- /dev/null +++ b/src/tools/irm/irm_ipcp_bootstrap.c @@ -0,0 +1,200 @@ +/* + * Ouroboros - Copyright (C) 2016 + * + * Bootstrap IPC Processes + * + * Sander Vrijders + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include + +#include +#include + +#include "irm_ops.h" +#include "irm_utils.h" + +#define NORMAL "normal" +#define SHIM_UDP "shim-udp" +#define SHIM_ETH_LLC "shim-eth-llc" +#define LOCAL "local" + +#define DEFAULT_ADDR_SIZE 4 +#define DEFAULT_CEP_ID_SIZE 2 +#define DEFAULT_PDU_LEN_SIZE 2 +#define DEFAULT_QOS_ID_SIZE 1 +#define DEFAULT_SEQ_NO_SIZE 4 +#define DEFAULT_TTL_SIZE 1 +#define DEFAULT_CHK_SIZE 2 +#define DEFAULT_MIN_PDU_SIZE 0 +#define DEFAULT_MAX_PDU_SIZE 9000 +#define DEFAULT_DDNS 0 + +static void usage() +{ + /* FIXME: Add dif_config stuff */ + printf("Usage: irm ipcp bootstrap\n" + " name \n" + " dif \n" + " type [TYPE]\n\n" + "where TYPE = {" NORMAL " " LOCAL " " + SHIM_UDP " " SHIM_ETH_LLC"}\n\n" + "if TYPE == " NORMAL "\n" + " [addr
(default: %d)]\n" + " [cep_id (default: %d)]\n" + " [pdu_len (default: %d)]\n" + " [qos_id (default: %d)]\n" + " [seqno (default: %d)]\n" + " [ttl