/* * Mausezahn - A fast versatile traffic generator * Copyright (C) 2008-2010 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 * */ #include "mz.h" #include "mops.h" #include "cli.h" // Calculates the number of TCP transmissions based on SQNR range u_int32_t mops_tcp_complexity_sqnr (struct mops * mp) { u_int32_t a,b,t,result; a = mp->tcp_seq_start; b = mp->tcp_seq_stop; t = mp->tcp_seq_delta; if (!t) return 1; // delta set to zero means no range if (atcp_ack_start; b = mp->tcp_ack_stop; t = mp->tcp_ack_delta; if (!t) return 1; // delta set to zero means no range if (atcp_ctrl_CWR) ? "CRW" : "---", (mp->tcp_ctrl_ECE) ? "ECE" : "---", (mp->tcp_ctrl_URG) ? "URG" : "---", (mp->tcp_ctrl_ACK) ? "ACK" : "---", (mp->tcp_ctrl_PSH) ? "PSH" : "---", (mp->tcp_ctrl_RST) ? "RST" : "---", (mp->tcp_ctrl_SYN) ? "SYN" : "---", (mp->tcp_ctrl_FIN) ? "FIN" : "---"); return 0; } // Add TCP options // // TODO: currently all params are ignored and a default option combination is added. // int mops_tcp_add_option (struct mops* mp, int mss, int sack, int scale, u_int32_t tsval, u_int32_t tsecr) { u_int8_t tcp_default_options[] = { 0x02, 0x04, 0x05, 0xac, // MSS 0x04, 0x02, // SACK permitted 0x08, 0x0a, 0x19, 0x35, 0x90, 0xc3, 0x00, 0x00, 0x00, 0x00, // Timestamps 0x01, // NOP 0x03, 0x03, 0x05 // Window Scale 5 }; /* Kind: 8 Length: 10 bytes +-------+-------+---------------------+---------------------+ |Kind=8 | 10 | TS Value (TSval) |TS Echo Reply (TSecr)| +-------+-------+---------------------+---------------------+ 1 1 4 4 * * The Timestamps option carries two four-byte timestamp fields. The * Timestamp Value field (TSval) contains the current value of the * timestamp clock of the TCP sending the option. * * The Timestamp Echo Reply field (TSecr) is only valid if the ACK bit * is set in the TCP header; if it is valid, it echos a times- tamp * value that was sent by the remote TCP in the TSval field of a * Timestamps option. When TSecr is not valid, its value must be zero. * The TSecr value will generally be from the most recent Timestamp * option that was received; however, there are exceptions that are * explained below. * * A TCP may send the Timestamps option (TSopt) in an initial * segment (i.e., segment containing a SYN bit and no ACK bit), and * may send a TSopt in other segments only if it re- ceived a TSopt in * the initial segment for the connection. * */ memcpy((void*) mp->tcp_option, (void*) tcp_default_options, 20); mp->tcp_option_s = 20; mp->tcp_option_used = 1; return 0; }
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-12 11:05:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-12 11:05:23 -0700
commit2d2474a194652f55c7af51068db3c1b851f16711 (patch)
tree82d197a2f5eb6a38979c61c27b45fe332a87a610 /Documentation
parent084165a3f8c8a88c83bdfa3941f897ae0f020211 (diff)
parent43720df96023b762843e7ddcc319fc99989ba3c2 (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal managament updates from Zhang Rui: - Enhance thermal "userspace" governor to export the reason when a thermal event is triggered and delivered to user space. From Srinivas Pandruvada - Introduce a single TSENS thermal driver for the different versions of the TSENS IP that exist, on different qcom msm/apq SoCs'. Support for msm8916, msm8960, msm8974 and msm8996 families is also added. From Rajendra Nayak - Introduce hardware-tracked trip points support to the device tree thermal sensor framework. The framework supports an arbitrary number of trip points. Whenever the current temperature is changed, the trip points immediately below and above the current temperature are found, driver callback is invoked to program the hardware to get notified when either of the two trip points are triggered. Hardware-tracked trip points support for rockchip thermal driver is also added at the same time. From Sascha Hauer, Caesar Wang - Introduce a new thermal driver, which enables TMU (Thermal Monitor Unit) on QorIQ platform. From Jia Hongtao - Introduce a new thermal driver for Maxim MAX77620. From Laxman Dewangan - Introduce a new thermal driver for Intel platforms using WhiskeyCove PMIC. From Bin Gao - Add mt2701 chip support to MTK thermal driver. From Dawei Chien - Enhance Tegra thermal driver to enable soctherm node and set "critical", "hot" trips, for Tegra124, Tegra132, Tegra210. From Wei Ni - Add resume support for tango thermal driver. From Marc Gonzalez - several small fixes and improvements for rockchip, qcom, imx, rcar, mtk thermal drivers and thermal core code. From Caesar Wang, Keerthy, Rocky Hao, Wei Yongjun, Peter Robinson, Bui Duc Phuc, Axel Lin, Hugh Kang * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (48 commits) thermal: int3403: Process trip change notification thermal: int340x: New Interface to read trip and notify thermal: user_space gov: Add additional information in uevent thermal: Enhance thermal_zone_device_update for events arm64: tegra: set hot trips for Tegra210 arm64: tegra: set critical trips for Tegra210 arm64: tegra: add soctherm node for Tegra210 arm64: tegra: set hot trips for Tegra132 arm64: tegra: set critical trips for Tegra132 arm64: tegra: use tegra132-soctherm for Tegra132 arm: tegra: set hot trips for Tegra124 arm: tegra: set critical trips for Tegra124 thermal: tegra: add hw-throttle for Tegra132 thermal: tegra: add hw-throttle function of: Add bindings of hw throttle for Tegra soctherm thermal: mtk_thermal: Check return value of devm_thermal_zone_of_sensor_register thermal: Add Mediatek thermal driver for mt2701. dt-bindings: thermal: Add binding document for Mediatek thermal controller thermal: max77620: Add thermal driver for reporting junction temp thermal: max77620: Add DT binding doc for thermal driver ...
Diffstat (limited to 'Documentation')