util-lib: add ether_addr_from_string()
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Tue, 17 May 2016 15:00:29 +0000 (11:00 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Tue, 17 May 2016 20:55:20 +0000 (16:55 -0400)
commitdd4d201ab1c9456e1bffc39f9dec00a4a4619084
treeca157d8ed22b9197380640af08b0785fdfacdcdf
parent1a7906ae914fd233305fff0acf4b9138ff944209
util-lib: add ether_addr_from_string()

This isn't quite symmetrical to in_addr_from_string() because it also returns
an offset indicating how much of the string was consumed by the matched
pattern.  This offset reporting is needed for either of the following use
cases:

 * verifying the lack of trailing garbage after such an address
 * parsing subsequent data from the same string
src/basic/ether-addr-util.c
src/basic/ether-addr-util.h