summaryrefslogtreecommitdiffstats
path: root/src/core/parseopt.c
diff options
context:
space:
mode:
authorMichael Brown2013-11-04 18:05:16 +0100
committerMichael Brown2013-11-05 18:30:20 +0100
commit3a67224c622332c4e75484b4510780e7818ac2e4 (patch)
treeae96f681efc1368e0636369cb31bf421ff1eae57 /src/core/parseopt.c
parent[dhcp] Add DHCP network device configurator (diff)
downloadipxe-3a67224c622332c4e75484b4510780e7818ac2e4.tar.gz
ipxe-3a67224c622332c4e75484b4510780e7818ac2e4.tar.xz
ipxe-3a67224c622332c4e75484b4510780e7818ac2e4.zip
[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.c23
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