# 2.11BSD#431 - /usr/src/lib/libc/inet/inet_maddr.c

##### Functions

    inet_makeaddr     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[] = "@(#)inet_makeaddr.c	5.1 (Berkeley) 3/11/86";
       9: #endif LIBC_SCCS and not lint
      10:
      11: #include <sys/types.h>
      12: #include <netinet/in.h>
      13:
      14: /*
      15:  * Formulate an Internet address from network + host.  Used in
      16:  * building addresses stored in the ifnet structure.
      17:  */
      18: struct in_addr
      19: inet_makeaddr(net, host)
      20:     long net, host;
      21: {
      22:     u_long addr;
      23:
      24:     if (net < 128)
      25:         addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
      26:     else if (net < 65536L)
      27:         addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
      28:     else
      29:         addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
      30:     addr = htonl(addr);
      31:     return (*(struct in_addr *)&addr);
      32: }

#### Defined functions

inet_makeaddr defined in line 18; used 15 times

- in /usr/include/arpa/inet.h line 26
- in /usr/src/include/arpa/inet.h line 26
- in /usr/src/new/crash/if.c line 77, 115
- in /usr/src/new/kermit5.188/ckcnet.h line 254
- in /usr/src/sbin/ifconfig/ifconfig.c line 422, 448
- in /usr/src/sbin/route/route.c line 35, 486, 501, 508
- in /usr/src/sbin/routed/tools/query.c line 187-189(2)
- in /usr/src/ucb/netstat/if.c line 87, 125

#### Defined variables

sccsid defined in line 8; never used

Last modified: 1988-12-26 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 982 |