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
| xdp3.o: file format ELF64-BPF | |
| Disassembly of section prog: | |
| ebpf_filter: | |
| ; int ebpf_filter(struct xdp_md* skb){ | |
| 0: r6 = r1 | |
| ; void* ebpf_packetEnd = ((void*)(long)skb->data_end); | |
| 1: r4 = *(u32 *)(r6 + 4) | |
| ; void* ebpf_packetStart = ((void*)(long)skb->data); |
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
| #define KBUILD_MODNAME "xdptest" | |
| #include <linux/bpf.h> | |
| #include "bpf_helpers.h" | |
| #define load_byte(data, b) (*(u8 *)(data + (b))) | |
| #define load_half(data, b) __constant_ntohs(*(u16 *)(data + (b))) | |
| #define load_word(data, b) __constant_ntohl(*(u32 *)(data + (b))) | |
| #define htonl(d) __constant_htonl(d) | |
| #define htons(d) __constant_htons(d) | |
| enum ebpf_errorCodes { |
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 curses | |
| import sys, os, time, optparse, ctypes | |
| from ctypes import * | |
| class DebugfsProvider(object): | |
| def __init__(self): | |
| self.base = '/sys/kernel/debug/kvm' | |
| self._fields = os.listdir(self.base) | |
| def fields(self): | |
| return self._fields |
NewerOlder