npt66: network prefix translation for ipv6
[vpp.git] / src / plugins / npt66 / npt66.h
1 // SPDX-License-Identifier: Apache-2.0
2 // Copyright(c) 2023 Cisco Systems, Inc.
3
4 #include <vlib/vlib.h>
5 #include <vnet/ip/ip6_packet.h>
6
7 typedef struct
8 {
9   u32 sw_if_index;
10   ip6_address_t internal;
11   ip6_address_t external;
12   u8 internal_plen;
13   u8 external_plen;
14   uword delta;
15 } npt66_binding_t;
16 typedef struct
17 {
18   u32 *interface_by_sw_if_index;
19   npt66_binding_t *bindings;
20   u16 msg_id_base;
21 } npt66_main_t;
22
23 extern npt66_main_t npt66_main;
24
25 int npt66_binding_add_del (u32 sw_if_index, ip6_address_t *internal,
26                            int internal_plen, ip6_address_t *external,
27                            int external_plen, bool is_add);
28 npt66_binding_t *npt66_interface_by_sw_if_index (u32 sw_if_index);