tools/env: Add environment variable flags support

Currently just validates variable types as decimal, hexidecimal,
boolean, ip address, and mac address.  Call
env_acl_validate_setenv_params() from setenv() in fw_env.c.

If the entry is not found in the env .flags, then look in the static
one. This allows the env to override the static definitions, but prevents
the need to have every definition in the environment distracting you.

Need to build in _ctype for isdigit for Linux.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
Joe Hershberger
2012-12-11 22:16:32 -06:00
committed by Tom Rini
parent 2598090b7e
commit 30fd4fadb3
5 changed files with 113 additions and 0 deletions

View File

@@ -21,7 +21,14 @@
* MA 02111-1307 USA
*/
#ifdef USE_HOSTCC /* Eliminate "ANSI does not permit..." warnings */
#include <stdint.h>
#include <stdio.h>
#include <linux/linux_string.h>
#else
#include <common.h>
#endif
#include <env_attr.h>
#include <errno.h>
#include <linux/string.h>