packet.c TODO: implement client and server