Skip to content

Instantly share code, notes, and snippets.

@upa
upa / ifc.c
Last active August 29, 2015 14:06
linux interface counter for bps pps
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <linux/rtnetlink.h>
@upa
upa / ml2_conf.ini
Last active August 29, 2015 14:07
sflow patch for neutron 2.3.4.83 openvswitch agent
# openvswitch sflow settings
[ovs]
sflow_port = 6343
sflow_rate = 2048
sflow_dstip = 10.0.0.10
local_ip = 10.0.2.15
@upa
upa / .gitignore
Last active August 29, 2015 14:07
flowgen: simple traffic generator to create flows with some throughput distribution patterns
*.o
*.out
flowgen
@upa
upa / Kconfig.patch
Created January 20, 2015 19:35
hashbase-mpath-select-patch
*** linux-source-3.13.0-original/net/ipv4/Kconfig Mon Jan 20 11:40:07 2014
--- linux-source-3.13.0/net/ipv4/Kconfig Wed Jan 21 01:05:44 2015
*************** config IP_ROUTE_MULTIPATH
*** 90,95 ****
--- 90,106 ----
equal "cost" and chooses one of them in a non-deterministic fashion
if a matching packet arrives.
+ config IP_ROUTE_MULTIPATH_HASHONLY
+ bool "IP: equal cost multipath without load balancing for flows"
--- a/helper/quagga-helper.cc Mon Sep 15 00:35:15 2014 +0900
+++ b/helper/quagga-helper.cc Fri Jan 23 05:01:04 2015 +0900
@@ -102,6 +102,7 @@
class OspfConfig : public Object
{
private:
+ std::string router_id;
std::map<std::string, uint32_t> *networks;
public:
OspfConfig ()
@upa
upa / srcgen.c
Last active August 29, 2015 14:14
multiple source traffic generator using netmap
/*
* multiple source address traffic generator using netmap
*/
#include <stdio.h>
#define NETMAP_WITH_LIBS
#include <net/netmap_user.h>
#include <unistd.h>
"""
Water Fall NFV
"""
import types
import logging
import struct
from ryu.base import app_manager
from ryu.controller import mac_to_port
@upa
upa / cgrep.py
Created February 5, 2015 10:14
to get command ouput from ns-3-dce sim node stdout
#!/usr/bin/env python
# cgrep, dce cmdline grep
import re
import os
import sys
e_flag = False
s_flag = True
@upa
upa / ofpather.py
Created February 7, 2015 11:38
OpenFlow Patch(er)
"""
OpenFlow Patcher
"""
import json
import types
import logging
import struct
from ryu.base import app_manager
@upa
upa / trackslack.py
Last active August 29, 2015 14:17
track slack
#!/usr/bin/python
# Send Trac ticket updates to Slack
#
# Written by Gregor Dorfbauer / [email protected]
# http://usersnap.com - Show, don't tell.
#
#
# Setup Steps:
# update your trac.ini