Skip to content

Instantly share code, notes, and snippets.

View bave's full-sized avatar

inoue.tomoya bave

View GitHub Profile
@bave
bave / tfo.py
Created August 19, 2013 14:41
A test program of TCP Fast Open. (supported by greater than or equal to linux 3.7 kernel )
#!/usr/bin/env python
# you must preset following command.
# sudo sysctl -w net.ipv4.tcp_fastopen=3
import sys
import socket
PORT = 10443
@bave
bave / dns_packet_parse.c
Last active March 18, 2020 00:46
How to use {libresolv, libbind}.
/*
* # Advance preparation are required.
* # ipfw add divert 10000 udp from me to [nameserver_ip] via [IF]
* # ipfw add divert 10000 udp from [nameserver_ip] to me via [IF]
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>