Move raw socket stuff into libpacket