summaryrefslogtreecommitdiff
path: root/ring.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-10-29 14:18:03 +0100
committerTobias Klauser <tklauser@distanz.ch>2015-10-29 14:20:46 +0100
commitdbd83f04dfb4b4265a290bad6a1813825f7ab3c6 (patch)
tree7565751ab618dcb5b130e990c1336614d878cdad /ring.h
parenta81b515484828e0cff848fb7689d4a4b77f020d8 (diff)
ring: Move generic code for ring layout setup to own function
Initialization of the ring->layout members is the same for RX and TX rings. Instead of duplicating the code in setup_rx_ring_layout() and setup_tx_ring_layout(), create a new function setup_ring_layout_generic() which is called from the former two. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'ring.h')
-rw-r--r--ring.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/ring.h b/ring.h
index a195f74..0ac72bb 100644
--- a/ring.h
+++ b/ring.h
@@ -1,6 +1,7 @@
/*
* netsniff-ng - the packet sniffing beast
* Copyright 2009, 2010 Daniel Borkmann.
+ * Copyright 2014, 2015 Tobias Klauser.
* Subject to the GPL, version 2.
*/
@@ -196,6 +197,8 @@ static inline int get_sockopt_tpacket(int sock)
return val;
}
+extern void setup_ring_layout_generic(int sock, struct ring *ring, size_t size,
+ bool jumbo_support);
extern void mmap_ring_generic(int sock, struct ring *ring);
extern void alloc_ring_frames_generic(struct ring *ring, int num, size_t size);
extern void bind_ring_generic(int sock, struct ring *ring, int ifindex, bool tx_only);