PPPOE bandwidth limiting question

Hello gurus,

I am willing to implement the following queueing rules scenario:

ppoe user_a may have 300Kbps download but

every packet from my localhost should come fullspeed

packets marked as TOS X (objects found in squid, in other server) should come fullspeed

p2p packets should have a global limit of 1Mbit, and that should be shared among pppoe users.

how should I set this up?

Thank you,

Chemichon