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
#!/bin/bash | |
# Basic QoS script that uses OpenDPI (http://www.opendpi.org/) | |
# Netfilter wrapper to identify packets by the protocol. | |
# | |
# This script enqueues packets in three queues, each one | |
# with a different priority: | |
# | |
# The first queue has the higher priority and gets the TCP SYN | |
# packets, ACKs, ICMPs and packets with Minimize-Delay TOS. |
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
require 'yajl' | |
require 'json' | |
require 'oj' | |
def digit_pattern | |
digit_pattern ||= rand(10000).to_s | |
end | |
def integer_part | |
digit_pattern |
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
require 'java' | |
require 'jnetpcap.jar' | |
require 'ipaddr' | |
require 'json' | |
class PacketHandler | |
include Java::org::jnetpcap::packet::PcapPacketHandler | |
def initialize | |
@tcp_header = Java::org::jnetpcap::protocol::tcpip::Tcp.new |