Implemented rpacket_init function