linux/include
Alexey Dobriyan 4940fc889e net: add mac_pton() for parsing MAC address
mac_pton() parses MAC address in form XX:XX:XX:XX:XX:XX and only in that form.

mac_pton() doesn't dirty result until it's sure string representation is valid.

mac_pton() doesn't care about characters _after_ last octet,
it's up to caller to deal with it.

mac_pton() diverges from 0/-E return value convention.
Target usage:

	if (!mac_pton(str, whatever->mac))
		return -EINVAL;
	/* ->mac being u8 [ETH_ALEN] is filled at this point. */
	/* optionally check str[3 * ETH_ALEN - 1] for termination */

Use mac_pton() in pktgen and netconsole for start.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-05-09 12:10:49 -07:00
..
acpi Fix common misspellings 2011-03-31 11:26:23 -03:00
asm-generic Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6 2011-04-07 11:14:49 -07:00
crypto crypto: padlock - Move padlock.h into include/crypto 2011-01-07 14:52:00 +11:00
drm Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6 2011-04-07 11:14:49 -07:00
keys libceph: Create a new key type "ceph". 2011-03-29 12:11:24 -07:00
linux net: add mac_pton() for parsing MAC address 2011-05-09 12:10:49 -07:00
math-emu
media Fix common misspellings 2011-03-31 11:26:23 -03:00
mtd
net garp: remove one synchronize_rcu() call 2011-05-09 11:41:40 -07:00
pcmcia pcmcia: re-enable Zoomed Video support 2011-02-20 12:47:34 +01:00
rdma ethtool: Call ethtool's get/set_settings callbacks with cleaned data 2011-04-29 14:01:30 -07:00
rxrpc Fix common misspellings 2011-03-31 11:26:23 -03:00
scsi Fix common misspellings 2011-03-31 11:26:23 -03:00
sound Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6 2011-04-07 11:14:49 -07:00
staging [media] Altera FPGA firmware download module 2011-03-21 20:32:16 -03:00
target Fix common misspellings 2011-03-31 11:26:23 -03:00
trace Merge branch 'for-linus-unmerged' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable 2011-03-28 15:31:05 -07:00
video Fix common misspellings 2011-03-31 11:26:23 -03:00
xen Fix common misspellings 2011-03-31 11:26:23 -03:00
Kbuild