mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 21:41:43 +03:00
[Settings] Remove assumption that all settings have DHCP tag values
Allow for settings to be described by something other than a DHCP option
tag if desirable. Currently used only for the MAC address setting.
Separate out fake DHCP packet creation code from dhcp.c to fakedhcp.c.
Remove notion of settings from dhcppkt.c.
Rationalise dhcp.c to use settings API only for final registration of the
DHCP options, rather than using {store,fetch}_setting throughout.
This commit is contained in:
@@ -16,8 +16,8 @@ static int show_exec ( int argc, char **argv ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( ( rc = fetch_named_setting ( argv[1], buf,
|
||||
sizeof ( buf ) ) ) < 0 ){
|
||||
if ( ( rc = fetchf_named_setting ( argv[1], buf,
|
||||
sizeof ( buf ) ) ) < 0 ){
|
||||
printf ( "Could not find \"%s\": %s\n",
|
||||
argv[1], strerror ( rc ) );
|
||||
return 1;
|
||||
@@ -35,7 +35,7 @@ static int set_exec ( int argc, char **argv ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( ( rc = store_named_setting ( argv[1], argv[2] ) ) != 0 ) {
|
||||
if ( ( rc = storef_named_setting ( argv[1], argv[2] ) ) != 0 ) {
|
||||
printf ( "Could not set \"%s\"=\"%s\": %s\n",
|
||||
argv[1], argv[2], strerror ( rc ) );
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user