15c04f73eSAndrey V. Elsukov /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 35c04f73eSAndrey V. Elsukov * 45c04f73eSAndrey V. Elsukov * Copyright (c) 2019 Yandex LLC 55c04f73eSAndrey V. Elsukov * Copyright (c) 2019 Andrey V. Elsukov <ae@FreeBSD.org> 65c04f73eSAndrey V. Elsukov * Copyright (c) 2019 Boris N. Lytochkin <lytboris@gmail.com> 75c04f73eSAndrey V. Elsukov * 85c04f73eSAndrey V. Elsukov * Redistribution and use in source and binary forms, with or without 95c04f73eSAndrey V. Elsukov * modification, are permitted provided that the following conditions 105c04f73eSAndrey V. Elsukov * are met: 115c04f73eSAndrey V. Elsukov * 125c04f73eSAndrey V. Elsukov * 1. Redistributions of source code must retain the above copyright 135c04f73eSAndrey V. Elsukov * notice, this list of conditions and the following disclaimer. 145c04f73eSAndrey V. Elsukov * 2. Redistributions in binary form must reproduce the above copyright 155c04f73eSAndrey V. Elsukov * notice, this list of conditions and the following disclaimer in the 165c04f73eSAndrey V. Elsukov * documentation and/or other materials provided with the distribution. 175c04f73eSAndrey V. Elsukov * 185c04f73eSAndrey V. Elsukov * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 195c04f73eSAndrey V. Elsukov * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 205c04f73eSAndrey V. Elsukov * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 215c04f73eSAndrey V. Elsukov * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 225c04f73eSAndrey V. Elsukov * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 235c04f73eSAndrey V. Elsukov * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 245c04f73eSAndrey V. Elsukov * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 255c04f73eSAndrey V. Elsukov * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 265c04f73eSAndrey V. Elsukov * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 275c04f73eSAndrey V. Elsukov * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 285c04f73eSAndrey V. Elsukov */ 295c04f73eSAndrey V. Elsukov 305c04f73eSAndrey V. Elsukov #ifndef _IP_FW_NAT64CLAT_H_ 315c04f73eSAndrey V. Elsukov #define _IP_FW_NAT64CLAT_H_ 325c04f73eSAndrey V. Elsukov 335c04f73eSAndrey V. Elsukov #include "ip_fw_nat64.h" 345c04f73eSAndrey V. Elsukov #include "nat64_translate.h" 355c04f73eSAndrey V. Elsukov 365c04f73eSAndrey V. Elsukov struct nat64clat_cfg { 375c04f73eSAndrey V. Elsukov struct named_object no; 385c04f73eSAndrey V. Elsukov 395c04f73eSAndrey V. Elsukov struct nat64_config base; 405c04f73eSAndrey V. Elsukov #define NAT64CLAT_FLAGSMASK \ 415c04f73eSAndrey V. Elsukov (NAT64_LOG | NAT64_ALLOW_PRIVATE) /* flags to pass to userland */ 425c04f73eSAndrey V. Elsukov char name[64]; 435c04f73eSAndrey V. Elsukov }; 445c04f73eSAndrey V. Elsukov 455c04f73eSAndrey V. Elsukov VNET_DECLARE(uint16_t, nat64clat_eid); 465c04f73eSAndrey V. Elsukov #define V_nat64clat_eid VNET(nat64clat_eid) 475c04f73eSAndrey V. Elsukov #define IPFW_TLV_NAT64CLAT_NAME IPFW_TLV_EACTION_NAME(V_nat64clat_eid) 485c04f73eSAndrey V. Elsukov 495c04f73eSAndrey V. Elsukov int ipfw_nat64clat(struct ip_fw_chain *chain, struct ip_fw_args *args, 505c04f73eSAndrey V. Elsukov ipfw_insn *cmd, int *done); 515c04f73eSAndrey V. Elsukov 525c04f73eSAndrey V. Elsukov #endif 53