Skip to content

Instantly share code, notes, and snippets.

@rightson
Created December 1, 2015 13:26
Show Gist options
  • Save rightson/c9f6ebe43a498d8623b1 to your computer and use it in GitHub Desktop.
Save rightson/c9f6ebe43a498d8623b1 to your computer and use it in GitHub Desktop.
An overview of ping
// ping.c
int main()
{
// ...
main_loop(icmp_sock, packet, packlen);
}
// ping_common.c
void main_loop(int icmp_sock, __u8 *packet, int packlen)
{
// ...
for (;;) {
// ...
if (poll(&pset, 1, next) < 1 || !(pset.revents&(POLLIN|POLLERR)))
continue;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment