summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJon Loeliger <jdl@netgate.com>2019-05-14 15:02:39 -0500
committerOle Trøan <otroan@employees.org>2019-05-15 06:47:12 +0000
commit93248789fb892c3a0f37ec790293344efd860081 (patch)
tree40f37656bfe07563f1298f3d69d5b5268434dc93 /src/plugins
parent38404db183620385279f599ee8841d3a35d6c868 (diff)
Remove unused function nat44_ha_resync() and error IN_PROGRESS.
The unused function nat44_ha_resync() was the only function that used the error message VNET_API_ERROR_IN_PROGRESS. The error was the only error code that was positive, and didn't really play well with the other error codes. Change-Id: I7d03c2ee915094b635f6efdca7427f71e4d19f2b Signed-off-by: Jon Loeliger <jdl@netgate.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/nat/nat_ha.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/plugins/nat/nat_ha.c b/src/plugins/nat/nat_ha.c
index a7eaf6ec5d0..e81e916e389 100644
--- a/src/plugins/nat/nat_ha.c
+++ b/src/plugins/nat/nat_ha.c
@@ -821,44 +821,6 @@ nat_ha_get_resync_status (u8 * in_resync, u32 * resync_ack_missed)
*resync_ack_missed = ha->resync_ack_missed;
}
-int
-nat44_ha_resync (u32 client_index, u32 pid,
- nat_ha_resync_event_cb_t event_callback)
-{
- nat_ha_main_t *ha = &nat_ha_main;
- snat_main_t *sm = &snat_main;
- snat_session_t *ses;
- snat_main_per_thread_data_t *tsm;
-
- if (ha->in_resync)
- return VNET_API_ERROR_IN_PROGRESS;
-
- ha->in_resync = 1;
- ha->resync_ack_count = 0;
- ha->resync_ack_missed = 0;
- ha->event_callback = event_callback;
- ha->client_index = client_index;
- ha->pid = pid;
-
- /* *INDENT-OFF* */
- vec_foreach (tsm, sm->per_thread_data)
- {
- pool_foreach (ses, tsm->sessions, ({
- nat_ha_sadd (&ses->in2out.addr, ses->in2out.port,
- &ses->out2in.addr, ses->out2in.port,
- &ses->ext_host_addr, ses->ext_host_port,
- &ses->ext_host_nat_addr, ses->ext_host_nat_port,
- ses->in2out.protocol, ses->in2out.fib_index,
- ses->flags, 0, 1);
- }));
- }
- /* *INDENT-ON* */
-
- nat_ha_flush (1);
-
- return 0;
-}
-
typedef struct
{
ip4_address_t addr;
eight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Wireguard vpp-plugin  {#wireguard_plugin_doc}

## Overview
This plugin is an implementation of [wireguard protocol](https://www.wireguard.com/) for VPP. It allows one to create secure VPN tunnels.
This implementation is based on [wireguard-openbsd](https://git.zx2c4.com/wireguard-openbsd/).

## Crypto

The crypto protocols:

- blake2s [[Source]](https://github.com/BLAKE2/BLAKE2)

OpenSSL:

- curve25519
- chachapoly1305

## Plugin usage example

### Create wireguard interface

```
> vpp# wireguard create listen-port <port> private-key <priv_key> src <src_ip4> [generate-key]
> *wg_interface*
> vpp# set int state <wg_interface> up
> vpp# set int ip address <wg_interface> <wg_ip4>
```

### Add a peer configuration:
```
> vpp# wireguard peer add <wg_interface> public-key <pub_key_other> endpoint <ip4_dst> allowed-ip <prefix> dst-port <port_dst> persistent-keepalive [keepalive_interval]
> vpp# *peer_idx*
```

### Show config
```
> vpp# show wireguard interface
> vpp# show wireguard peer
```

### Remove peer
```
> vpp# wireguard peer remove <peer_idx>
```


### Delete interface 
```
> vpp# wireguard delete <wg_interface>
```

## Main next steps for improving this implementation
1. Use all benefits of VPP-engine.
2. Add IPv6 support (currently only supports IPv4)
3. Add DoS protection as in original protocol (using cookie)