Packet handling and stuff

Not compilable.