Created
December 1, 2015 13:26
-
-
Save rightson/c9f6ebe43a498d8623b1 to your computer and use it in GitHub Desktop.
An overview of ping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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