/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 2003 Sam Leffler, Errno Consulting4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer,11* without modification.12* 2. Redistributions in binary form must reproduce at minimum a disclaimer13* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any14* redistribution must be conditioned upon including a substantially15* similar Disclaimer requirement for further binary redistribution.16* 3. Neither the names of the above-listed copyright holders nor the names17* of any contributors may be used to endorse or promote products derived18* from this software without specific prior written permission.19*20* NO WARRANTY21* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS22* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT23* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY24* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL25* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,26* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF27* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS28* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER29* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)30* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF31* THE POSSIBILITY OF SUCH DAMAGES.32*/3334#ifndef _NETINET_IP_DIVERT_H_35#define _NETINET_IP_DIVERT_H_36#include <sys/types.h>3738/*39* All communication occurs through a sockaddr_in socket where40*41* kernel-->userland42* sin_port = matching rule, host format;43* sin_addr = IN: first address of the incoming interface;44* OUT: INADDR_ANY45* sin_zero = if fits, the interface name (max 7 bytes + NUL)46*47* userland->kernel48* sin_port = restart-rule - 1, host order49* (we restart at sin_port + 1)50* sin_addr = IN: address of the incoming interface;51* OUT: INADDR_ANY52*/5354struct divstat {55uint64_t div_diverted; /* successfully diverted to userland */56uint64_t div_noport; /* failed due to no bound socket */57uint64_t div_outbound; /* re-injected as outbound */58uint64_t div_inbound; /* re-injected as inbound */59};60#endif /* _NETINET_IP_DIVERT_H_ */616263