/*
+ * Copyright (c) 2020 Cisco and/or its affiliates.
* Copyright (c) 2020 Doc.ai and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
wg_if_create_cli (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
+ wg_main_t *wmp = &wg_main;
unformat_input_t _line_input, *line_input = &_line_input;
u8 private_key[NOISE_PUBLIC_KEY_LEN];
u32 instance, sw_if_index;
private_key_64 = 0;
port = 0;
+ wg_feature_init (wmp);
+
if (unformat_user (input, unformat_line_input, line_input))
{
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
wg_if_delete_cli (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
+ wg_main_t *wmp = &wg_main;
vnet_main_t *vnm;
u32 sw_if_index;
int rv;
+ wg_feature_init (wmp);
+
vnm = vnet_get_main ();
sw_if_index = ~0;
unformat_input_t * input, vlib_cli_command_t * cmd)
{
vnet_main_t *vnm = vnet_get_main ();
+ wg_main_t *wmp = &wg_main;
clib_error_t *error = NULL;
unformat_input_t _line_input, *line_input = &_line_input;
if (!unformat_user (input, unformat_line_input, line_input))
return 0;
+ wg_feature_init (wmp);
+
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (line_input, "public-key %s", &public_key_64))
wg_peer_remove_command_fn (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
+ wg_main_t *wmp = &wg_main;
clib_error_t *error = NULL;
u32 peer_index;
int rv;
if (!unformat_user (input, unformat_line_input, line_input))
return 0;
+ wg_feature_init (wmp);
+
if (unformat (line_input, "%d", &peer_index))
;
else
wg_show_if_command_fn (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
+ wg_main_t *wmp = &wg_main;
+
+ wg_feature_init (wmp);
+
wg_if_walk (wg_if_show_one, vm);
return NULL;