summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_var.h
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2004-02-13 19:14:16 +0000
committermlaier <mlaier@FreeBSD.org>2004-02-13 19:14:16 +0000
commitda4d773b129fb1339d7b5fc23b93388b18952d3b (patch)
tree75fdee3c73dd1369e60e6348343749bdf159313a /sys/netinet/ip_var.h
parent09ad0862e6acad72dd0217846a1c16d5bea5c454 (diff)
downloadFreeBSD-src-da4d773b129fb1339d7b5fc23b93388b18952d3b.zip
FreeBSD-src-da4d773b129fb1339d7b5fc23b93388b18952d3b.tar.gz
This set of changes eliminates the use of MT_TAG "pseudo mbufs", replacing
them mostly with packet tags (one case is handled by using an mbuf flag since the linkage between "caller" and "callee" is direct and there's no need to incur the overhead of a packet tag). This is (mostly) work from: sam Silence from: -arch Approved by: bms(mentor), sam, rwatson
Diffstat (limited to 'sys/netinet/ip_var.h')
-rw-r--r--sys/netinet/ip_var.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h
index 4bd600d..23d1d00 100644
--- a/sys/netinet/ip_var.h
+++ b/sys/netinet/ip_var.h
@@ -65,8 +65,6 @@ struct ipq {
struct mbuf *ipq_frags; /* to ip headers of fragments */
struct in_addr ipq_src,ipq_dst;
u_char ipq_nfrags; /* # frags in this packet */
- u_int32_t ipq_div_info; /* ipfw divert port & flags */
- u_int16_t ipq_div_cookie; /* ipfw divert cookie */
struct label *ipq_label; /* MAC label */
};
#endif /* _KERNEL */
@@ -197,14 +195,23 @@ extern int (*ip_rsvp_vif)(struct socket *, struct sockopt *);
extern void (*ip_rsvp_force_done)(struct socket *);
extern void (*rsvp_input_p)(struct mbuf *m, int off);
+#define M_FASTFWD_OURS M_PROTO1 /* sent by ip_fastforward to ip_input */
-#ifdef IPDIVERT
-void div_init(void);
-void div_input(struct mbuf *, int);
-void div_ctlinput(int, struct sockaddr *, void *);
-void divert_packet(struct mbuf *m, int incoming, int port, int rule);
-extern struct pr_usrreqs div_usrreqs;
-#endif
+/*
+ * Return the next hop address associated with the mbuf; if any.
+ * If a tag is present it is also removed.
+ */
+static __inline struct sockaddr_in *
+ip_claim_next_hop(struct mbuf *m)
+{
+ struct m_tag *mtag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL);
+ if (mtag) {
+ struct sockaddr_in *sin = *(struct sockaddr_in **)(mtag+1);
+ m_tag_delete(m, mtag);
+ return sin;
+ } else
+ return NULL;
+}
#ifdef PFIL_HOOKS
extern struct pfil_head inet_pfil_hook;
OpenPOWER on IntegriCloud