Reorder functions in packet.c