Hi
All needet is in the R5 Release of Olegs Custom Firmware, namely QoS and Wondershaper. For general, read the Wondershaper part on Olegs Homepage, it covers many situations out of the box. For maximum flexibility you have to write your own QoS scripts i think.