Re: [PATCH 7/8] net: dns: export resolved ip to var resolved_ip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 30, 2012 at 06:31:52AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> This will allow to use it in scripting.
> 
>  {
>  	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);

I smell complex environment scripts here. Maybe we should rather
integrate dns into getenv_ip. This will help all commands using ip
addresses instead of putting the burden of resolving a host name into
the environment.

Sascha

>  	}
>  
>  	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@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux