/* * Mausezahn - A fast versatile traffic generator * Copyright (C) 2008 Herbert Haas * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 2 as published by the * Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program; if not, see http://www.gnu.org/licenses/gpl-2.0.html * */ // *************************************************************************** // // This sections contains: // // - complexity() ... calculates and reports how many frames will // be generated. // - send_frame() ... the general and mighty SENDING FUNCTION. // // *************************************************************************** #include "mz.h" #include "cli.h" // Calculates the number of frames to be sent. // Should be used as standard output except the // 'quiet' option (-q) has been specified. int complexity(void) { unsigned long int nr_sqnr = 1, nr_dp = 1, nr_sp = 1, nr_da = 1, nr_sa = 1; u_int32_t sn1, sn2, delta; long double ref; if (tx.count==0) goto infinity; total_d = 1.0; // How many sequence numbers? if (tx.tcp_seq_delta) { sn1 = tx.tcp_seq_start; sn2 = tx.tcp_seq_stop; delta = tx.tcp_seq_delta; if (sn1ref) { fprintf(stderr, "You must be crazy...\n"); } else if (total_d>0xffffffff) { fprintf(stderr, "Do you REALLY know what you do?\n"); } else if (total_d>0xffffff) { fprintf(stderr, "Do you know what you do?\n"); } if (mz_port) { cli_print(gcli, "Mausezahn will send %.Lf frames...\r", total_d); } else { fprintf(stderr, "Mausezahn will send %.Lf frames... ", total_d); fflush(stderr); if (verbose) fprintf(stderr,"\n"); } mz_start = clock(); infinity: if (tx.count==0) { if (mz_port) { cli_print(gcli, "Mausezahn will send frames infinitly...\n"); } else { fprintf(stderr, "Mausezahn will send frames infinitly...\n"); } } return 0; } /////////////////////////////////////////////////////////////////////// // // Send complete frame (layers 2, 3, 4) multiple times if required // // int send_frame (libnet_t *l, libnet_ptag_t t3, libnet_ptag_t t4) { int i=0, count; int // local vars are faster ;-) tcp_seq_delta, dp_isrange, sp_isrange, ip_dst_isrange, ip_src_isrange, rtp_mode=0; count = tx.count; tcp_seq_delta = tx.tcp_seq_delta; dp_isrange = tx.dp_isrange; sp_isrange = tx.sp_isrange; ip_dst_isrange = tx.ip_dst_isrange; ip_src_isrange = tx.ip_src_isrange | tx.ip_src_rand; if (mode == RTP) rtp_mode = 1; if (count==0) goto AGAIN; for (i=0; idiff)
Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull smp hotplug updates from Thomas Gleixner: "This is the final round of converting the notifier mess to the state machine. The removal of the notifiers and the related infrastructure will happen around rc1, as there are conversions outstanding in other trees. The whole exercise removed about 2000 lines of code in total and in course of the conversion several dozen bugs got fixed. The new mechanism allows to test almost every hotplug step standalone, so usage sites can exercise all transitions extensively. There is more room for improvement, like integrating all the pointlessly different architecture mechanisms of synchronizing, setting cpus online etc into the core code" * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (60 commits) tracing/rb: Init the CPU mask on allocation soc/fsl/qbman: Convert to hotplug state machine soc/fsl/qbman: Convert to hotplug state machine zram: Convert to hotplug state machine KVM/PPC/Book3S HV: Convert to hotplug state machine arm64/cpuinfo: Convert to hotplug state machine arm64/cpuinfo: Make hotplug notifier symmetric mm/compaction: Convert to hotplug state machine iommu/vt-d: Convert to hotplug state machine mm/zswap: Convert pool to hotplug state machine mm/zswap: Convert dst-mem to hotplug state machine mm/zsmalloc: Convert to hotplug state machine mm/vmstat: Convert to hotplug state machine mm/vmstat: Avoid on each online CPU loops mm/vmstat: Drop get_online_cpus() from init_cpu_node_state/vmstat_cpu_dead() tracing/rb: Convert to hotplug state machine oprofile/nmi timer: Convert to hotplug state machine net/iucv: Use explicit clean up labels in iucv_init() x86/pci/amd-bus: Convert to hotplug state machine x86/oprofile/nmi: Convert to hotplug state machine ...