|
|
1.1 root 1: /* getprotoname.c 4.2 82/10/05 */
2:
3: #include <netdb.h>
4:
5: struct protoent *
6: getprotobyname(name)
7: register char *name;
8: {
9: register struct protoent *p;
10: register char **cp;
11:
12: setprotoent(0);
13: while (p = getprotoent()) {
14: if (strcmp(p->p_name, name) == 0)
15: break;
16: for (cp = p->p_aliases; *cp != 0; cp++)
17: if (strcmp(*cp, name) == 0)
18: goto found;
19: }
20: found:
21: endprotoent();
22: return (p);
23: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.