diff options
author | Michael Brown <mcb30@ipxe.org> | 2013-11-04 17:05:16 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2013-11-05 17:30:20 +0000 |
commit | 3a67224c622332c4e75484b4510780e7818ac2e4 (patch) | |
tree | ae96f681efc1368e0636369cb31bf421ff1eae57 /src/core/parseopt.c | |
parent | 759dcf5a9b0cd8db08838becebb5586a82fdf74d (diff) | |
download | ipxe-3a67224c622332c4e75484b4510780e7818ac2e4.tar.gz |
[parseopt] Add parse_netdev_configurator()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/parseopt.c')
-rw-r--r-- | src/core/parseopt.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/core/parseopt.c b/src/core/parseopt.c index 51450835..334ffb2c 100644 --- a/src/core/parseopt.c +++ b/src/core/parseopt.c @@ -140,6 +140,29 @@ int parse_netdev ( char *text, struct net_device **netdev ) { } /** + * Parse network device configurator name + * + * @v text Text + * @ret configurator Network device configurator + * @ret rc Return status code + */ +int parse_netdev_configurator ( char *text, + struct net_device_configurator **configurator ){ + + /* Sanity check */ + assert ( text != NULL ); + + /* Find network device configurator */ + *configurator = find_netdev_configurator ( text ); + if ( ! *configurator ) { + printf ( "\"%s\": no such configurator\n", text ); + return -ENOTSUP; + } + + return 0; +} + +/** * Parse menu name * * @v text Text |