|
|
1.1 root 1: /* inet_makeaddr.c 4.3 82/11/14 */
2:
3: #include <sys/types.h>
4: #include <netinet/in.h>
5:
6: /*
7: * Formulate an Internet address from network + host. Used in
8: * building addresses stored in the ifnet structure.
9: */
10: struct in_addr
11: inet_makeaddr(net, host)
12: int net, host;
13: {
14: u_long addr;
15:
16: if (net < 128)
17: addr = (net << IN_CLASSA_NSHIFT) | host;
18: else if (net < 65536)
19: addr = (net << IN_CLASSB_NSHIFT) | host;
20: else
21: addr = (net << IN_CLASSC_NSHIFT) | host;
22: addr = htonl(addr);
23: return (*(struct in_addr *)&addr);
24: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.