pkt-gen.c (257529) | pkt-gen.c (257906) |
---|---|
1/* 2 * Copyright (C) 2011-2013 Matteo Landi, Luigi Rizzo. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26/* | 1/* 2 * Copyright (C) 2011-2013 Matteo Landi, Luigi Rizzo. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26/* |
27 * $FreeBSD: head/tools/tools/netmap/pkt-gen.c 257529 2013-11-01 21:21:14Z luigi $ | 27 * $FreeBSD: head/tools/tools/netmap/pkt-gen.c 257906 2013-11-10 02:43:09Z hiren $ |
28 * $Id: pkt-gen.c 12346 2013-06-12 17:36:25Z luigi $ 29 * 30 * Example program to show how to build a multithreaded packet 31 * source/sink using the netmap device. 32 * 33 * In this example we create a programmable number of threads 34 * to take care of all the queues of the interface used to 35 * send or receive traffic. --- 236 unchanged lines hidden (view full) --- 272#include <net/if_utun.h> 273#define TAP_CLONEDEV "/dev/tap" 274#endif /* __APPLE__ */ 275 276 277/* 278 * parse the vale configuration in conf and put it in nmr. 279 * The configuration may consist of 0 to 4 numbers separated | 28 * $Id: pkt-gen.c 12346 2013-06-12 17:36:25Z luigi $ 29 * 30 * Example program to show how to build a multithreaded packet 31 * source/sink using the netmap device. 32 * 33 * In this example we create a programmable number of threads 34 * to take care of all the queues of the interface used to 35 * send or receive traffic. --- 236 unchanged lines hidden (view full) --- 272#include <net/if_utun.h> 273#define TAP_CLONEDEV "/dev/tap" 274#endif /* __APPLE__ */ 275 276 277/* 278 * parse the vale configuration in conf and put it in nmr. 279 * The configuration may consist of 0 to 4 numbers separated |
280 * by commas: #tx-slots,#rx-slots,#tx-rinzgs,#rx-rings. | 280 * by commas: #tx-slots,#rx-slots,#tx-rings,#rx-rings. |
281 * Missing numbers or zeroes stand for default values. 282 * As an additional convenience, if exactly one number | 281 * Missing numbers or zeroes stand for default values. 282 * As an additional convenience, if exactly one number |
283 * is specified, then this is assigned to bot #tx-slots and #rx-slots. 284 * If there is no 4th number, then the 3rd is assigned to bot #tx-rings | 283 * is specified, then this is assigned to both #tx-slots and #rx-slots. 284 * If there is no 4th number, then the 3rd is assigned to both #tx-rings |
285 * and #rx-rings. 286 */ 287void parse_nmr_config(const char* conf, struct nmreq *nmr) 288{ 289 char *w, *tok; 290 int i, v; 291 292 nmr->nr_tx_rings = nmr->nr_rx_rings = 0; --- 1521 unchanged lines hidden --- | 285 * and #rx-rings. 286 */ 287void parse_nmr_config(const char* conf, struct nmreq *nmr) 288{ 289 char *w, *tok; 290 int i, v; 291 292 nmr->nr_tx_rings = nmr->nr_rx_rings = 0; --- 1521 unchanged lines hidden --- |