netcat.c
Humourous netcat implementation found by HN user metamusic on Apple's open-source website.
Continue Reading http://www.opensource.apple.comExcerpt 1
#ifdef ANAL
if (strcmp (poop->name, hp->h_name) != 0) { /* case-sensitive */
#else
if (strcasecmp (poop->name, hp->h_name) != 0) { /* normal */
#endif
Excerpt 2
/* comparehosts :
cross-check the host_poop we have so far against new gethostby*() info,
and holler about mismatches. Perhaps gratuitous, but it can't hurt to
point out when someone's DNS is fukt. Returns 1 if mismatch, in case
someone else wants to do something about it. */
Excerpt 3
/* now that we've dingdonged all our thingdings, send off the results.
Geez, why does this look an awful lot like the big loop in "rsh"? ...
not sure if the order of this matters, but write net -> stdout first. */
Join the Discussion