Title: icmp_getdata()


During the initialization of the network service, the icmp code calls ip_open() to acquire an ip file descriptor. The third and fourth arguments to ip_open() are pointers to icmp_getdata() and icmp_putdata(). These two values set the if_get_userdata and if_put_userdata fields of the ip file descriptor.

icmp_getdata() is (indirectly) called by ip_ioctl() to configure the ip file descriptor that the icmp code opened and is called by ip_write() to assist in sending out the next icmp packet (e.g., an icmp echo request packet) in the queue of icmp packets waiting to be sent out.