Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: add doc for in4_pton()

It is not easy to use in4_pton() correctly without reading
its definition, so add some doc for it.

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Amerigo Wang and committed by
David S. Miller
93ac0ef0 28194fcd

+12
+12
net/core/utils.c
··· 107 107 return IN6PTON_UNKNOWN; 108 108 } 109 109 110 + /** 111 + * in4_pton - convert an IPv4 address from literal to binary representation 112 + * @src: the start of the IPv4 address string 113 + * @srclen: the length of the string, -1 means strlen(src) 114 + * @dst: the binary (u8[4] array) representation of the IPv4 address 115 + * @delim: the delimiter of the IPv4 address in @src, -1 means no delimiter 116 + * @end: A pointer to the end of the parsed string will be placed here 117 + * 118 + * Return one on success, return zero when any error occurs 119 + * and @end will point to the end of the parsed string. 120 + * 121 + */ 110 122 int in4_pton(const char *src, int srclen, 111 123 u8 *dst, 112 124 int delim, const char **end)