# 2.11BSD#431 - /usr/src/lib/libc/net/getpname.c

##### Functions

    getprotobyname    X

       1: /*
       2:  * Copyright (c) 1983 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #if defined(LIBC_SCCS) && !defined(lint)
       8: static char sccsid[] = "@(#)getprotoname.c	5.3 (Berkeley) 5/19/86";
       9: #endif LIBC_SCCS and not lint
      10:
      11: #include <netdb.h>
      12:
      13: extern int _proto_stayopen;
      14:
      15: struct protoent *
      16: getprotobyname(name)
      17:     register char *name;
      18: {
      19:     register struct protoent *p;
      20:     register char **cp;
      21:
      22:     setprotoent(_proto_stayopen);
      23:     while (p = getprotoent()) {
      24:         if (strcmp(p->p_name, name) == 0)
      25:             break;
      26:         for (cp = p->p_aliases; *cp != 0; cp++)
      27:             if (strcmp(*cp, name) == 0)
      28:                 goto found;
      29:     }
      30: found:
      31:     if (!_proto_stayopen)
      32:         endprotoent();
      33:     return (p);
      34: }

#### Defined functions

getprotobyname defined in line 15; used 7 times

- in /usr/include/netdb.h line 60
- in /usr/src/bin/ping/ping.c line 279
- in /usr/src/include/netdb.h line 58
- in /usr/src/libexec/rlogind/rlogind.c line 211
- in /usr/src/libexec/rshd/rshd.c line 160
- in /usr/src/libexec/tcpd/fix_options.c line 33
- in /usr/src/usr.sbin/traceroute/traceroute.c line 395

#### Defined variables

sccsid defined in line 8; never used

Last modified: 1987-08-06 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 508 |