$ systool -v -m netmap
Module = "netmap"
Attributes:
coresize = "143360"
initsize = "0"
initstate = "live"
refcnt = "0"
srcversion = "5F4F49C43161A16E4F13BC0"
This file contains 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 <thread> | |
#include <functional> | |
class myclass { | |
public: | |
myclass() { | |
auto th = std::thread(std::bind(&myclass::print, this)); | |
th.join(); | |
} |
This file contains 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
# command: | |
# ansible-playbook -i /etc/ansible/hosts --ask-sudo-pass insmod_netmap.yaml | |
- hosts: netmap | |
sudo: yes | |
vars: | |
work_dir: /root/down | |
netmap_dir: "{{work_dir}}/netmap" | |
tasks: | |
- name: rmmod |
This file contains 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
# command: | |
# ansible-playbook -i /etc/ansible/hosts --ask-sudo-pass netmap.yaml | |
- hosts: netmap | |
sudo: yes | |
vars: | |
work_dir: /root/down | |
netmap_dir: "{{work_dir}}/netmap" | |
kernel_src_dir: /usr/src/linux-source | |
kernel_headers_dir: /usr/src/linux-headers |
This file contains 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 socket | |
import sys | |
class fabs_skel: | |
def openif(self, path): | |
self._path = path | |
self._session = {} | |
self.__sock = socket.socket(socket.AF_UNIX) |
This file contains 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 System.Random | |
import Data.Sequence (Seq) | |
import Data.Sequence as Seq | |
import Data.Word | |
import Data.IORef | |
import Control.Concurrent.STM.TVar | |
import Control.Concurrent.STM | |
import Control.Concurrent | |
data Session = Session { ip1 :: Word32, port1 :: Word16, |
This file contains 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
use Socket; | |
my @sessions; | |
# connect IF by UNIX domain socket | |
my $path = "/tmp/sf-tap/tcp/http"; | |
my $s; | |
socket($s, AF_UNIX, SOCK_STREAM, 0); | |
connect($s, pack_sockaddr_un($path)) or die "cannot connect to $path"; |
This file contains 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> | |
int main() | |
{ | |
volatile int i = 0; | |
while (i < 100000000) { | |
asm ("xbegin ABORT"); | |
i++; | |
asm ("xend"); | |
asm ("ABORT:"); |