From a070b0de9f9e9cbca150eea4eda74757ca588bed Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Wed, 23 Sep 2020 17:50:52 +0200 Subject: [HICN-645] Control plane (WIP) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4be6a40b690b62f22f57de6d8c10b01a1be42a6d Signed-off-by: Jordan Augé Signed-off-by: Enrico Loparco (eloparco) Signed-off-by: Mauro Sardara --- hicn-light/src/hicn/config/command_punting.c | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 hicn-light/src/hicn/config/command_punting.c (limited to 'hicn-light/src/hicn/config/command_punting.c') diff --git a/hicn-light/src/hicn/config/command_punting.c b/hicn-light/src/hicn/config/command_punting.c new file mode 100644 index 000000000..ad969e3d2 --- /dev/null +++ b/hicn-light/src/hicn/config/command_punting.c @@ -0,0 +1,36 @@ +#include "command.h" + +/* Parameters */ + +static const command_parameter_t symbolic_or_id = { + .name = "symbolic_or_id", + .help = "The symbolic name for an egress, or the egress punting id (see 'help list puntings')", + .type = TYPE_SYMBOLIC_OR_ID, + .offset = offsetof(hc_punting_t, face_id), +}; + +static const command_parameter_t prefix = { + .name = "prefix", + .help = "Prefix to add as a punting rule. (example 1234::0/64)", + .type = TYPE_IP_PREFIX, + .offset = offsetof(hc_punting_t, prefix), + .offset2 = offsetof(hc_punting_t, prefix_len), + .offset3 = offsetof(hc_punting_t, family), +}; + +/* Commands */ + +static const command_parser_t command_punting_create = { + .action = ACTION_CREATE, + .object = OBJECT_PUNTING, + .nparams = 2, + .parameters = { symbolic_or_id, prefix }, +}; +COMMAND_REGISTER(command_punting_create); + +static const command_parser_t command_punting_list = { + .action = ACTION_LIST, + .object = OBJECT_PUNTING, + .nparams = 0, +}; +COMMAND_REGISTER(command_punting_list); -- cgit 1.2.3-korg