Added code for heartbeat from port agent, as well as code to handle
other types of packets.