From 348495b5af3c83e41034e7cf675f49168c0f1e0e Mon Sep 17 00:00:00 2001 From: Amerigo Wang Date: Thu, 11 Oct 2012 21:06:17 +0000 Subject: [PATCH] --- yaml --- r: 334030 b: refs/heads/master c: 93ac0ef016a1b223d23fbb5e0397cab75a8f7d34 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/core/utils.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 41953e3839f7..a90f8459b783 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 28194fcdc150e4d5b418d01db3c29058f60ef32c +refs/heads/master: 93ac0ef016a1b223d23fbb5e0397cab75a8f7d34 diff --git a/trunk/net/core/utils.c b/trunk/net/core/utils.c index 30f3879faecc..e3487e461939 100644 --- a/trunk/net/core/utils.c +++ b/trunk/net/core/utils.c @@ -107,6 +107,18 @@ static inline int xdigit2bin(char c, int delim) return IN6PTON_UNKNOWN; } +/** + * in4_pton - convert an IPv4 address from literal to binary representation + * @src: the start of the IPv4 address string + * @srclen: the length of the string, -1 means strlen(src) + * @dst: the binary (u8[4] array) representation of the IPv4 address + * @delim: the delimiter of the IPv4 address in @src, -1 means no delimiter + * @end: A pointer to the end of the parsed string will be placed here + * + * Return one on success, return zero when any error occurs + * and @end will point to the end of the parsed string. + * + */ int in4_pton(const char *src, int srclen, u8 *dst, int delim, const char **end)