From patchwork Fri Jan 18 01:35:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,RFC,v2,5/5] common.h: add getenv_IP6addr Date: Thu, 17 Jan 2013 15:35:32 -0000 From: Chris Packham X-Patchwork-Id: 213421 Message-Id: <1358472932-32083-6-git-send-email-judge.packham@gmail.com> To: u-boot@lists.denx.de Cc: Chris Packham From: Chris Packham Analogous to getenv_IPaddr but for IPv6. This allows the caller to get an IP6addr_t from an environment variable. Signed-off-by: Chris Packham --- Changes in v2: None include/common.h | 6 ++++++ lib/net_utils.c | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/common.h b/include/common.h index 2f2578b..41c5fb2 100644 --- a/include/common.h +++ b/include/common.h @@ -833,6 +833,12 @@ static inline IPaddr_t getenv_IPaddr(char *var) return string_to_ip(getenv(var)); } +#include +static inline int getenv_IP6addr(char *var, IP6addr_t *a) +{ + return string_to_ip6(getenv(var), a); +} + /* * CONSOLE multiplexing. */ diff --git a/lib/net_utils.c b/lib/net_utils.c index a8de103..44c414f 100644 --- a/lib/net_utils.c +++ b/lib/net_utils.c @@ -27,7 +27,6 @@ */ #include -#include #include IPaddr_t string_to_ip(const char *s)