Linux lionsclub 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.29 (Ubuntu)
: 161.35.52.75 | : 3.133.7.179
Cant Read [ /etc/named.conf ]
7.4.28
www-data
shells.trxsecurity.org
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
Backdoor Scanner
Backdoor Create
Alfa Webshell
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
src /
linux-headers-4.15.0-210 /
samples /
pktgen /
[ HOME SHELL ]
Name
Size
Permission
Action
functions.sh
4.06
KB
-rw-r--r--
parameters.sh
2.89
KB
-rw-r--r--
pktgen_bench_xmit_mode_netif_r...
2.72
KB
-rwxr-xr-x
pktgen_bench_xmit_mode_queue_x...
1.92
KB
-rwxr-xr-x
pktgen_sample01_simple.sh
1.94
KB
-rwxr-xr-x
pktgen_sample02_multiqueue.sh
2.23
KB
-rwxr-xr-x
pktgen_sample03_burst_single_f...
2.63
KB
-rwxr-xr-x
pktgen_sample04_many_flows.sh
2.55
KB
-rwxr-xr-x
pktgen_sample05_flow_per_threa...
2.31
KB
-rwxr-xr-x
pktgen_sample06_numa_awared_qu...
3.05
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : functions.sh
# # Common functions used by pktgen scripts # - Depending on bash 3 (or higher) syntax # # Author: Jesper Dangaaard Brouer # License: GPL set -o errexit ## -- General shell logging cmds -- function err() { local exitcode=$1 shift echo "ERROR: $@" >&2 exit $exitcode } function warn() { echo "WARN : $@" >&2 } function info() { if [[ -n "$VERBOSE" ]]; then echo "INFO : $@" >&2 fi } ## -- Pktgen proc config commands -- ## export PROC_DIR=/proc/net/pktgen # # Three different shell functions for configuring the different # components of pktgen: # pg_ctrl(), pg_thread() and pg_set(). # # These functions correspond to pktgens different components. # * pg_ctrl() control "pgctrl" (/proc/net/pktgen/pgctrl) # * pg_thread() control the kernel threads and binding to devices # * pg_set() control setup of individual devices function pg_ctrl() { local proc_file="pgctrl" proc_cmd ${proc_file} "$@" } function pg_thread() { local thread=$1 local proc_file="kpktgend_${thread}" shift proc_cmd ${proc_file} "$@" } function pg_set() { local dev=$1 local proc_file="$dev" shift proc_cmd ${proc_file} "$@" } # More generic replacement for pgset(), that does not depend on global # variable for proc file. function proc_cmd() { local result local proc_file=$1 local status=0 # after shift, the remaining args are contained in $@ shift local proc_ctrl=${PROC_DIR}/$proc_file if [[ ! -e "$proc_ctrl" ]]; then err 3 "proc file:$proc_ctrl does not exists (dev added to thread?)" else if [[ ! -w "$proc_ctrl" ]]; then err 4 "proc file:$proc_ctrl not writable, not root?!" fi fi if [[ "$DEBUG" == "yes" ]]; then echo "cmd: $@ > $proc_ctrl" fi # Quoting of "$@" is important for space expansion echo "$@" > "$proc_ctrl" || status=$? if [[ "$proc_file" != "pgctrl" ]]; then result=$(grep "Result: OK:" $proc_ctrl) || true if [[ "$result" == "" ]]; then grep "Result:" $proc_ctrl >&2 fi fi if (( $status != 0 )); then err 5 "Write error($status) occurred cmd: \"$@ > $proc_ctrl\"" fi } # Old obsolete "pgset" function, with slightly improved err handling function pgset() { local result if [[ "$DEBUG" == "yes" ]]; then echo "cmd: $1 > $PGDEV" fi echo $1 > $PGDEV local status=$? result=`cat $PGDEV | fgrep "Result: OK:"` if [[ "$result" == "" ]]; then cat $PGDEV | fgrep Result: fi if (( $status != 0 )); then err 5 "Write error($status) occurred cmd: \"$1 > $PGDEV\"" fi } [[ $EUID -eq 0 ]] && trap 'pg_ctrl "reset"' EXIT ## -- General shell tricks -- function root_check_run_with_sudo() { # Trick so, program can be run as normal user, will just use "sudo" # call as root_check_run_as_sudo "$@" if [ "$EUID" -ne 0 ]; then if [ -x $0 ]; then # Directly executable use sudo info "Not root, running with sudo" sudo "$0" "$@" exit $? fi err 4 "cannot perform sudo run of $0" fi } # Exact input device's NUMA node info function get_iface_node() { local node=$(</sys/class/net/$1/device/numa_node) if [[ $node == -1 ]]; then echo 0 else echo $node fi } # Given an Dev/iface, get its queues' irq numbers function get_iface_irqs() { local IFACE=$1 local queues="${IFACE}-.*TxRx" irqs=$(grep "$queues" /proc/interrupts | cut -f1 -d:) [ -z "$irqs" ] && irqs=$(grep $IFACE /proc/interrupts | cut -f1 -d:) [ -z "$irqs" ] && irqs=$(for i in `ls -Ux /sys/class/net/$IFACE/device/msi_irqs` ;\ do grep "$i:.*TxRx" /proc/interrupts | grep -v fdir | cut -f 1 -d : ;\ done) [ -z "$irqs" ] && err 3 "Could not find interrupts for $IFACE" echo $irqs } # Given a NUMA node, return cpu ids belonging to it. function get_node_cpus() { local node=$1 local node_cpu_list local node_cpu_range_list=`cut -f1- -d, --output-delimiter=" " \ /sys/devices/system/node/node$node/cpulist` for cpu_range in $node_cpu_range_list do node_cpu_list="$node_cpu_list "`seq -s " " ${cpu_range//-/ }` done echo $node_cpu_list }
Close