2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
6 * Various kernel-resident INET utility functions; mainly
7 * for format conversion and debugging output.
9 * Version: $Id: utils.c,v 1.1.1.1 2005/04/11 02:51:13 jack Exp $
11 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
14 * Alan Cox : verify_area check.
15 * Alan Cox : removed old debugging.
16 * Andi Kleen : add net_ratelimit()
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version
21 * 2 of the License, or (at your option) any later version.
24 #include <asm/uaccess.h>
25 #include <asm/system.h>
26 #include <linux/types.h>
27 #include <linux/kernel.h>
28 #include <linux/sched.h>
29 #include <linux/string.h>
31 #include <linux/socket.h>
33 #include <linux/errno.h>
34 #include <linux/stat.h>
36 #include <linux/inet.h>
37 #include <linux/netdevice.h>
38 #include <linux/etherdevice.h>
40 #include <net/protocol.h>
42 #include <linux/skbuff.h>
46 * Convert an ASCII string to binary IP.
49 __u32 in_aton(const char *str)
56 for (i = 0; i < 4; i++)
62 while (*str != '\0' && *str != '.')