Refactored Datagram Iterator to use Datagram_ptr