From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 7/8] net: dns: export resolved ip to var resolved_ip
Date: Fri, 30 Mar 2012 06:31:52 +0200 [thread overview]
Message-ID: <1333081913-19168-7-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20120330042713.GX444@game.jcrosoft.org>
This will allow to use it in scripting.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
net/dns.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/net/dns.c b/net/dns.c
index 3c7aa5f..50d953b 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -27,6 +27,7 @@
#include <net.h>
#include <clock.h>
#include <environment.h>
+#include <magicvar.h>
#include <linux/err.h>
#define DNS_PORT 53
@@ -238,6 +239,8 @@ static int do_host(int argc, char *argv[])
{
IPaddr_t ip;
+ setenv("resolved_ip", "");
+
if (argc != 2)
return COMMAND_ERROR_USAGE;
@@ -248,6 +251,7 @@ static int do_host(int argc, char *argv[])
printf("%s is at ", argv[1]);
print_IPaddr(ip);
printf("\n");
+ setenv_ip("resolved_ip", ip);
}
return 0;
@@ -262,3 +266,4 @@ BAREBOX_CMD_START(host)
BAREBOX_CMD_HELP(cmd_host_help)
BAREBOX_CMD_END
+BAREBOX_MAGICVAR(resolved_ip, "Resolved IP");
--
1.7.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-03-30 4:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-30 4:27 [PATCH 0/8] Network update DHCP/BOOTP Jean-Christophe PLAGNIOL-VILLARD
2012-03-30 4:31 ` [PATCH 1/8] net: dhcp: reset env variable before do a dhcp request Jean-Christophe PLAGNIOL-VILLARD
2012-03-30 4:31 ` [PATCH 2/8] net: dhcp: add support of tftp name server Jean-Christophe PLAGNIOL-VILLARD
2012-03-30 4:31 ` [PATCH 3/8] net: dhcp: add support of tftp server ip or Etherboot file (option 150) Jean-Christophe PLAGNIOL-VILLARD
2012-03-30 9:21 ` Sascha Hauer
2012-03-30 10:14 ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-02 10:49 ` Sascha Hauer
2012-04-02 11:18 ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-30 4:31 ` [PATCH 4/8] net: dhcp: allow to set transmitted client id Jean-Christophe PLAGNIOL-VILLARD
2012-03-30 4:31 ` [PATCH 5/8] net: dhcp: allow to set transmitted client uuid Jean-Christophe PLAGNIOL-VILLARD
2012-03-30 4:31 ` [PATCH 6/8] net: dhcp: allow to set transmitted user class Jean-Christophe PLAGNIOL-VILLARD
2012-03-30 4:31 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-03-30 9:12 ` [PATCH 7/8] net: dns: export resolved ip to var resolved_ip Sascha Hauer
2012-03-30 10:16 ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-30 4:31 ` [PATCH 8/8] defaultenv: add support of etherboot_file Jean-Christophe PLAGNIOL-VILLARD
2012-03-30 10:39 ` [PATCH 7/8 v2] net: env: getenv_ip use resolv Jean-Christophe PLAGNIOL-VILLARD
2012-04-02 11:17 ` [PATCH 0/8] Network update DHCP/BOOTP Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1333081913-19168-7-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox