|
@@ -41,53 +41,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
41
|
41
|
*
|
42
|
42
|
*/
|
43
|
43
|
|
44
|
|
-/** "dhcp" options */
|
45
|
|
-struct dhcp_options {};
|
46
|
|
-
|
47
|
|
-/** "dhcp" option list */
|
48
|
|
-static struct option_descriptor dhcp_opts[] = {};
|
49
|
|
-
|
50
|
|
-/**
|
51
|
|
- * Execute "dhcp" command for a network device
|
52
|
|
- *
|
53
|
|
- * @v netdev Network device
|
54
|
|
- * @v opts Command options
|
55
|
|
- * @ret rc Return status code
|
56
|
|
- */
|
57
|
|
-static int dhcp_payload ( struct net_device *netdev,
|
58
|
|
- struct dhcp_options *opts __unused ) {
|
59
|
|
- int rc;
|
60
|
|
-
|
61
|
|
- if ( ( rc = dhcp ( netdev ) ) != 0 ) {
|
62
|
|
- printf ( "Could not configure %s: %s\n",
|
63
|
|
- netdev->name, strerror ( rc ) );
|
64
|
|
-
|
65
|
|
- /* Close device on failure, to avoid memory exhaustion */
|
66
|
|
- netdev_close ( netdev );
|
67
|
|
-
|
68
|
|
- return rc;
|
69
|
|
- }
|
70
|
|
-
|
71
|
|
- return 0;
|
72
|
|
-}
|
73
|
|
-
|
74
|
|
-/** "dhcp" command descriptor */
|
75
|
|
-static struct ifcommon_command_descriptor dhcp_cmd =
|
76
|
|
- IFCOMMON_COMMAND_DESC ( struct dhcp_options, dhcp_opts,
|
77
|
|
- 0, MAX_ARGUMENTS, "[<interface>...]",
|
78
|
|
- dhcp_payload, 1 );
|
79
|
|
-
|
80
|
|
-/**
|
81
|
|
- * The "dhcp" command
|
82
|
|
- *
|
83
|
|
- * @v argc Argument count
|
84
|
|
- * @v argv Argument list
|
85
|
|
- * @ret rc Return status code
|
86
|
|
- */
|
87
|
|
-static int dhcp_exec ( int argc, char **argv ) {
|
88
|
|
- return ifcommon_exec ( argc, argv, &dhcp_cmd );
|
89
|
|
-}
|
90
|
|
-
|
91
|
44
|
/** "pxebs" options */
|
92
|
45
|
struct pxebs_options {};
|
93
|
46
|
|
|
@@ -138,7 +91,7 @@ static int pxebs_exec ( int argc, char **argv ) {
|
138
|
91
|
struct command dhcp_commands[] __command = {
|
139
|
92
|
{
|
140
|
93
|
.name = "dhcp",
|
141
|
|
- .exec = dhcp_exec,
|
|
94
|
+ .exec = ifconf_exec, /* synonym for "ifconf" */
|
142
|
95
|
},
|
143
|
96
|
{
|
144
|
97
|
.name = "pxebs",
|