# my internet link is using dsl0 (pppX, renamed)
DEVICE=dsl0

# my speed is 12200kbit down, 890 up
# I use only 85% of down and 95% of up
INPUT_SPEED="$((12200 * 85 / 100))kbit"
OUTPUT_SPEED="$((890  * 95 / 100))kbit"

# adsl = ATM overheads calculation
# local = I run pppoe on this linux box
# pppoe-llc = ADSL encapsulation as reported by ADSL modem
LINKTYPE="adsl local pppoe-llc"


# ------------- CUSTOM SERVICES -------------
# unlike FireHOL, only server ports are needed.
# all the services used but not defined here, are defined internally in FireQOS.

# VoIP RTP ports.
# As configured in /etc/asterisk/rtp.conf
server_rtp_ports="udp/10000:10100"

# League of Legends match, for my kids
server_lol_ports="udp/5000:5500 tcp/8393:8400,2099,5223,5222,8088"

# My OpenVPN servers
server_openvpn_ports="any/1195:1198"

# Torrent client configured to listen at a fixed port
server_mytorrent_ports="any/51414"


# ------------- INTERFACES -------------

interface $DEVICE world bidirectional $LINKTYPE input rate $INPUT_SPEED output rate $OUTPUT_SPEED
	
	class voip commit 100kbit pfifo
		# 1st priority: VoIP
		
		server sip
		client sip
		server rtp
		client stun
	
	class interactive input commit 20% output commit 10%
		# 2nd priority: ICMP, DNS, SSH
		
		server icmp
		
		server dns
		client dns
		
		server ssh
		client ssh
		
		client teamviewer
		client lol
	
	class chat input commit 1000kbit output commit 440kbit
		# 3rd priority: chat and conferencing
		
		client facetime
		
		server hangouts
		client hangouts
		
		client gtalk
		client jabber
	
	class vpns input commit 20% output commit 10%
		# 4th priority: my VPNs
		
		server pptp
		server GRE
		server openvpn
	
	class servers
		# 5th priority: the servers I run
		
		server http
	
	class surfing prio keep commit 10%
		# Again 5th priority (prio keep): Internet Surfing
		
		client surfing
		client rsync
   	
	class synacks
		# 6th priority: SYNs and small ACKs for the rest of the traffic
		
		match tcp syn
		match tcp ack
		
	class default
		# 7th priority: default
		# unclassified traffic ends up in the 'default' class
		# no need to match anything here
	
	class torrents
		# 8th priority: torrents
		
		client torrents
		server mytorrent prio 1
		match sports 16384:65535 dports 16384:65535

