ng_ipfw.h revision 193859
138465Smsmith/*- 238465Smsmith * Copyright 2005, Gleb Smirnoff <glebius@FreeBSD.org> 338465Smsmith * All rights reserved. 438465Smsmith * 538465Smsmith * Redistribution and use in source and binary forms, with or without 638465Smsmith * modification, are permitted provided that the following conditions 738465Smsmith * are met: 838465Smsmith * 1. Redistributions of source code must retain the above copyright 938465Smsmith * notice, this list of conditions and the following disclaimer. 1038465Smsmith * 2. Redistributions in binary form must reproduce the above copyright 1138465Smsmith * notice, this list of conditions and the following disclaimer in the 1238465Smsmith * documentation and/or other materials provided with the distribution. 1338465Smsmith * 1438465Smsmith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1538465Smsmith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1638465Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1738465Smsmith * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1838465Smsmith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1938465Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2038465Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2138465Smsmith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2238465Smsmith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2338465Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2438465Smsmith * SUCH DAMAGE. 2538465Smsmith * 2638465Smsmith * $FreeBSD: head/sys/netgraph/ng_ipfw.h 193859 2009-06-09 21:27:11Z oleg $ 27119483Sobrien */ 28119483Sobrien 29119483Sobrien#define NG_IPFW_NODE_TYPE "ipfw" 3038465Smsmith#define NGM_IPFW_COOKIE 1105988990 3138465Smsmith 3238764Smsmith#ifdef _KERNEL 3338465Smsmith 3438465Smsmithtypedef int ng_ipfw_input_t(struct mbuf **, int, struct ip_fw_args *, int); 3538465Smsmithextern ng_ipfw_input_t *ng_ipfw_input_p; 3638465Smsmith#define NG_IPFW_LOADED (ng_ipfw_input_p != NULL) 3738465Smsmith 3838465Smsmithstruct ng_ipfw_tag { 3938465Smsmith struct m_tag mt; /* tag header */ 4038465Smsmith struct ip_fw *rule; /* matching rule */ 4138465Smsmith uint32_t rule_id; /* matching rule id */ 4238465Smsmith uint32_t chain_id; /* ruleset id */ 4338465Smsmith struct ifnet *ifp; /* interface, for ip_output */ 4438465Smsmith int dir; 45181278Scperciva#define NG_IPFW_OUT 0 4639968Smsmith#define NG_IPFW_IN 1 4738465Smsmith}; 4838465Smsmith 4938465Smsmith#define TAGSIZ (sizeof(struct ng_ipfw_tag) - sizeof(struct m_tag)) 5038465Smsmith 5138465Smsmith#endif /* _KERNEL */ 5238465Smsmith