Skip to content

Instantly share code, notes, and snippets.

View slankdev's full-sized avatar
🏠
Working from home

Hiroki SHIROKURA slankdev

🏠
Working from home
View GitHub Profile
@slankdev
slankdev / .gitignore
Last active November 7, 2017 08:33
ws API Doc
.out
.o
.html
@slankdev
slankdev / Makefile
Created November 6, 2017 13:57
crow テスト
LIBSLANKDEV := $(HOME)/git/libslankdev
CXXFLAGS += -I$(LIBSLANKDEV) -std=c++11 -I$(HOME)
LDFLAGS += -lboost_system
all:
$(CXX) $(CXXFLAGS) main.cc $(LDFLAGS)
@slankdev
slankdev / dpdk_nic_bind.py
Created October 14, 2017 15:43
dpdk_nic_bind
#! /usr/bin/python
#
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@slankdev
slankdev / main.cc
Created June 17, 2017 08:10
autotools sample
#include <stdio.h>
#include <slankdev/extra/pcap.h>
#include <slankdev/hexdump.h>
void callback(uint8_t* user, const struct pcap_pkthdr* h, const uint8_t* byte)
{
slankdev::hexdump(stdout, byte, h->len);
}
int main()
#include <slankdev/socketfd.h>
#include <slankdev/hexdump.h>
const char* ifname = "lo";
uint8_t packet[] = {
/* arp packet */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x06, 0x00, 0x01,
0x08, 0x00, 0x06, 0x04, 0x00, 0x01, 0x00, 0x00,
@slankdev
slankdev / test_jit_int_ubpf.cc
Last active April 26, 2017 11:11
JITとインタプリタの性能計測
/*
* 動作環境
* CPU: Intel Core i5 6200 @2.30GHz
* RAM: 16GB
*
* 出力結果
* ret: 1
* int latency: 1840760982
* jit latency: 113407004