Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/pf/pf_mtag.h
Show All 30 Lines | |||||
* | * | ||||
*/ | */ | ||||
#ifndef _NET_PF_MTAG_H_ | #ifndef _NET_PF_MTAG_H_ | ||||
#define _NET_PF_MTAG_H_ | #define _NET_PF_MTAG_H_ | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* 0x01 unused. */ | #define PF_TAG_ROUTE_TO 0x01 | ||||
#define PF_TAG_DUMMYNET 0x02 | #define PF_TAG_DUMMYNET 0x02 | ||||
#define PF_TAG_TRANSLATE_LOCALHOST 0x04 | #define PF_TAG_TRANSLATE_LOCALHOST 0x04 | ||||
#define PF_PACKET_LOOPED 0x08 | #define PF_PACKET_LOOPED 0x08 | ||||
#define PF_FASTFWD_OURS_PRESENT 0x10 | #define PF_FASTFWD_OURS_PRESENT 0x10 | ||||
#define PF_REASSEMBLED 0x20 | #define PF_REASSEMBLED 0x20 | ||||
#define PF_DUPLICATED 0x40 | #define PF_DUPLICATED 0x40 | ||||
#define PF_TAG_SYNCOOKIE_RECREATED 0x80 | #define PF_TAG_SYNCOOKIE_RECREATED 0x80 | ||||
struct pf_mtag { | struct pf_mtag { | ||||
void *hdr; /* saved hdr pos in mbuf, for ECN */ | void *hdr; /* saved hdr pos in mbuf, for ECN */ | ||||
u_int16_t qid; /* queue id */ | u_int16_t qid; /* queue id */ | ||||
u_int32_t qid_hash; /* queue hashid used by WFQ like algos */ | u_int32_t qid_hash; /* queue hashid used by WFQ like algos */ | ||||
u_int16_t tag; /* tag id */ | u_int16_t tag; /* tag id */ | ||||
u_int8_t flags; | u_int8_t flags; | ||||
u_int8_t routed; | u_int8_t routed; | ||||
u_int16_t dnpipe; | u_int16_t dnpipe; | ||||
u_int32_t dnflags; | u_int32_t dnflags; | ||||
u_int16_t if_index; /* For ROUTE_TO */ | |||||
u_int16_t if_idxgen; /* For ROUTE_TO */ | |||||
struct sockaddr_storage dst; /* For ROUTE_TO */ | |||||
}; | }; | ||||
static __inline struct pf_mtag * | static __inline struct pf_mtag * | ||||
pf_find_mtag(struct mbuf *m) | pf_find_mtag(struct mbuf *m) | ||||
{ | { | ||||
struct m_tag *mtag; | struct m_tag *mtag; | ||||
if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) == NULL) | if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) == NULL) | ||||
return (NULL); | return (NULL); | ||||
return ((struct pf_mtag *)(mtag + 1)); | return ((struct pf_mtag *)(mtag + 1)); | ||||
} | } | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* _NET_PF_MTAG_H_ */ | #endif /* _NET_PF_MTAG_H_ */ |