--- fwsync/driver/fwsync.h 2022/07/11 15:59:42 1.4 +++ fwsync/driver/fwsync.h 2022/08/18 13:02:13 1.10 @@ -1,7 +1,29 @@ -/************************************************************************* -* (C) 2022 CloudSigma AG - Sofia/Bulgaria -* by Michael Pounov -**************************************************************************/ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2022 Michael Pounov , CloudSigma AG + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ #ifndef __FWSYNC_H #define __FWSYNC_H @@ -28,6 +50,11 @@ #include #include #include + +#include +#include +#include + #include #include #include @@ -35,18 +62,12 @@ #include #include #include -#include -#include -#include - -#define IPFW_INTERNAL - #include + #include #include "fwsync_proto.h" #include "fwsync_workers.h" -#include "fwsync_utils.h" #define IFT_FWSYNC 0xfc @@ -168,9 +189,10 @@ extern struct fwsync_context fws_ctx; extern struct cfg_sync fws_cfg; extern struct task fws_sndpkt_task; extern struct taskqueue *fws_tq; -extern struct mtx fws_mtx_c, fws_mtx_e; +extern struct callout fws_co; +extern struct mtx fws_mtx_c, fws_mtx_e, fws_mtx_u, fws_mtx_n; extern struct mbuf *fws_sndpkt; -extern fwsync_sndpkt_t fwsync_sndpkt; +extern fwsync_sndpkt_t fwsync_sndpkt, fwsync_updpkt, fwsync_natpkt; int fwsync_cfg(struct ip_fw_chain *ch, ip_fw3_opheader *op3, struct sockopt_data *sd); int fwsync_destroy(struct ip_fw_chain *ch, ip_fw3_opheader *op3, struct sockopt_data *sd);