1171173Smlaier/* $FreeBSD$ */ 2171173Smlaier/* 3171173Smlaier * Copyright (c) 2001 Daniel Hartmeier 4171173Smlaier * All rights reserved. 5171173Smlaier * 6171173Smlaier * Redistribution and use in source and binary forms, with or without 7171173Smlaier * modification, are permitted provided that the following conditions 8171173Smlaier * are met: 9171173Smlaier * 10171173Smlaier * - Redistributions of source code must retain the above copyright 11171173Smlaier * notice, this list of conditions and the following disclaimer. 12171173Smlaier * - Redistributions in binary form must reproduce the above 13171173Smlaier * copyright notice, this list of conditions and the following 14171173Smlaier * disclaimer in the documentation and/or other materials provided 15171173Smlaier * with the distribution. 16171173Smlaier * 17171173Smlaier * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18171173Smlaier * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19171173Smlaier * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 20171173Smlaier * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 21171173Smlaier * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 22171173Smlaier * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 23171173Smlaier * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24171173Smlaier * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25171173Smlaier * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26171173Smlaier * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 27171173Smlaier * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28171173Smlaier * POSSIBILITY OF SUCH DAMAGE. 29171173Smlaier * 30171173Smlaier */ 31171173Smlaier 32171173Smlaier#ifndef _NET_PF_MTAG_H_ 33171173Smlaier#define _NET_PF_MTAG_H_ 34171173Smlaier 35171173Smlaier#ifdef _KERNEL 36171173Smlaier 37171173Smlaier#define PF_TAG_GENERATED 0x01 38171173Smlaier#define PF_TAG_FRAGCACHE 0x02 39171173Smlaier#define PF_TAG_TRANSLATE_LOCALHOST 0x04 40223637Sbz#define PF_PACKET_LOOPED 0x08 41223637Sbz#define PF_FASTFWD_OURS_PRESENT 0x10 42284571Skp#define PF_REASSEMBLED 0x20 43171173Smlaier 44171173Smlaierstruct pf_mtag { 45171173Smlaier void *hdr; /* saved hdr pos in mbuf, for ECN */ 46223637Sbz u_int32_t qid; /* queue id */ 47298091Sloos u_int32_t qid_hash; /* queue hashid used by WFQ like algos */ 48171173Smlaier u_int16_t tag; /* tag id */ 49171173Smlaier u_int8_t flags; 50171173Smlaier u_int8_t routed; 51171173Smlaier}; 52171173Smlaier 53171173Smlaierstatic __inline struct pf_mtag * 54171173Smlaierpf_find_mtag(struct mbuf *m) 55171173Smlaier{ 56171173Smlaier struct m_tag *mtag; 57171173Smlaier 58171173Smlaier if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) == NULL) 59171173Smlaier return (NULL); 60171173Smlaier 61171173Smlaier return ((struct pf_mtag *)(mtag + 1)); 62171173Smlaier} 63171173Smlaier#endif /* _KERNEL */ 64171173Smlaier#endif /* _NET_PF_MTAG_H_ */ 65