net.c (84221) | net.c (90868) |
---|---|
1/* $NetBSD: net.c,v 1.20 1997/12/26 22:41:30 scottr Exp $ */ 2 3/* 4 * Copyright (c) 1992 Regents of the University of California. 5 * All rights reserved. 6 * 7 * This software was developed by the Computer Systems Engineering group 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and --- 26 unchanged lines hidden (view full) --- 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#) Header: net.c,v 1.9 93/08/06 19:32:15 leres Exp (LBL) 40 */ 41 42#include <sys/cdefs.h> | 1/* $NetBSD: net.c,v 1.20 1997/12/26 22:41:30 scottr Exp $ */ 2 3/* 4 * Copyright (c) 1992 Regents of the University of California. 5 * All rights reserved. 6 * 7 * This software was developed by the Computer Systems Engineering group 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and --- 26 unchanged lines hidden (view full) --- 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#) Header: net.c,v 1.9 93/08/06 19:32:15 leres Exp (LBL) 40 */ 41 42#include <sys/cdefs.h> |
43__FBSDID("$FreeBSD: head/lib/libstand/net.c 84221 2001-09-30 22:28:01Z dillon $"); | 43__FBSDID("$FreeBSD: head/lib/libstand/net.c 90868 2002-02-18 20:35:27Z mike $"); |
44 45#include <sys/param.h> 46#include <sys/socket.h> 47 48#include <string.h> 49 50#include <net/if.h> 51#include <netinet/in.h> --- 174 unchanged lines hidden (view full) --- 226intoa(addr) 227 register n_long addr; 228{ 229 register char *cp; 230 register u_int byte; 231 register int n; 232 static char buf[17]; /* strlen(".255.255.255.255") + 1 */ 233 | 44 45#include <sys/param.h> 46#include <sys/socket.h> 47 48#include <string.h> 49 50#include <net/if.h> 51#include <netinet/in.h> --- 174 unchanged lines hidden (view full) --- 226intoa(addr) 227 register n_long addr; 228{ 229 register char *cp; 230 register u_int byte; 231 register int n; 232 static char buf[17]; /* strlen(".255.255.255.255") + 1 */ 233 |
234 NTOHL(addr); | 234 addr = ntohl(addr); |
235 cp = &buf[sizeof buf]; 236 *--cp = '\0'; 237 238 n = 4; 239 do { 240 byte = addr & 0xff; 241 *--cp = byte % 10 + '0'; 242 byte /= 10; --- 51 unchanged lines hidden --- | 235 cp = &buf[sizeof buf]; 236 *--cp = '\0'; 237 238 n = 4; 239 do { 240 byte = addr & 0xff; 241 *--cp = byte % 10 + '0'; 242 byte /= 10; --- 51 unchanged lines hidden --- |