Title: icmp_putdata()


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 the ip_open() call 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.

The two most significant places that icmp_getdata() is called are in packet2user(). The first time that packet2user() calls icmp_getdata(), icmp_getdata() simply calls process_data() to process the icmp packet that the system received and that packet2user() was processing. The second time that packet2user() calls icmp_getdata(), icmp_getdata() calls icmp_read() to retry any previously suspended icmp read operations.