This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _LINUX_LIST_H | |
#define _LINUX_LIST_H | |
#include <stdio.h> | |
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) | |
/** | |
* container_of - cast a member of a structure out to the containing structure | |
* @ptr: the pointer to the member. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <net/if.h> | |
#include <net/if_dl.h> | |
#include <net/ethernet.h> | |
#include <netinet/in.h> | |
#include <netinet/if_ether.h> | |
#include <ifaddrs.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <netinet/in.h> | |
#include <net/if.h> | |
#include <ifaddrs.h> | |
#define FORMAT_IP4_ADDR "%u.%u.%u.%u" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
done = function(summary, latency, requests) | |
-- open output file | |
f = io.open("result.csv", "a+") | |
-- write below results to file | |
-- minimum latency | |
-- max latency | |
-- mean of latency | |
-- standard deviation of latency | |
-- 50percentile latency |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obj-m:=tcp_monitor.o | |
all: | |
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules | |
clean: | |
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# You can find the container image for each release from here. Please rewrite below url to your nearest one. | |
# https://admin.fedoraproject.org/mirrormanager/ | |
CONTAINER_IMAGE="http://mirror.crucial.com.au/fedora/linux/releases/30/Container/x86_64/images/Fedora-Container-Base-30-1.2.x86_64.tar.xz" | |
function setup() { | |
local CHROOT=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import click | |
import socket | |
import ipaddress | |
import dataclasses | |
from bcc import BPF | |
from ctypes import * | |
from jinja2 import Template | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <stddef.h> | |
#include <net/if.h> | |
#include <linux/if_tun.h> | |
#include <sys/ioctl.h> | |
#include <errno.h> | |
#include <assert.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-2.0-or-later | |
/* | |
* TUN - Universal TUN/TAP device driver. | |
* Copyright (C) 1999-2002 Maxim Krasnyansky <[email protected]> | |
* | |
* $Id: tun.c,v 1.15 2002/03/01 02:44:24 maxk Exp $ | |
*/ | |
/* | |
* Changes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BPF = {} | |
local emit = function (code, dst, src, off, imm) | |
return string.pack("=I1I1I2I4", code, dst << 4 | src, off, imm) | |
end | |
-- Register | |
BPF.R0 = 0 | |
BPF.R1 = 1 | |
BPF.R2 = 2 |
OlderNewer