1*8370Ssam /* inet_makeaddr.c 4.2 82/10/07 */ 28359Ssam 38359Ssam #include <sys/types.h> 48359Ssam #include <net/in.h> 58359Ssam 68359Ssam /* 78359Ssam * Formulate an Internet address from network + host. Used in 88359Ssam * building addresses stored in the ifnet structure. 98359Ssam */ 108359Ssam struct in_addr 11*8370Ssam inet_makeaddr(net, host) 128359Ssam int net, host; 138359Ssam { 148359Ssam u_long addr; 158359Ssam 168359Ssam if (net < 128) 178359Ssam addr = (net << 24) | host; 188359Ssam else if (net < 65536) 198359Ssam addr = (net << 16) | host; 208359Ssam else 218359Ssam addr = (net << 8) | host; 228359Ssam addr = htonl(addr); 238359Ssam return (*(struct in_addr *)&addr); 248359Ssam } 25