mirror of
https://github.com/ipxe/ipxe
synced 2025-12-19 02:50:25 +03:00
[settings] Add the notion of a "tag magic" to numbered settings
Settings can be constructed using a dotted-decimal notation, to allow for access to unnamed settings. The default interpretation is as a DHCP option number (with encapsulated options represented as "<encapsulating option>.<encapsulated option>". In several contexts (e.g. SMBIOS, Phantom CLP), it is useful to interpret the dotted-decimal notation as referring to non-DHCP options. In this case, it becomes necessary for these contexts to ignore standard DHCP options, otherwise we end up trying to, for example, retrieve the boot filename from SMBIOS. Allow settings blocks to specify a "tag magic". When dotted-decimal notation is used to construct a setting, the tag magic value of the originating settings block will be ORed in to the tag number. Store/fetch methods can then check for the magic number before interpreting arbitrarily-numbered settings.
This commit is contained in:
@@ -203,7 +203,7 @@ void nvo_init ( struct nvo_block *nvo, struct nvs_device *nvs,
|
||||
nvo->nvs = nvs;
|
||||
nvo->fragments = fragments;
|
||||
settings_init ( &nvo->settings, &nvo_settings_operations, refcnt,
|
||||
"nvo" );
|
||||
"nvo", 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -665,6 +665,7 @@ static int parse_setting_name ( const char *name, struct settings **settings,
|
||||
}
|
||||
tmp++;
|
||||
}
|
||||
setting->tag |= (*settings)->tag_magic;
|
||||
}
|
||||
|
||||
/* Identify setting type, if specified */
|
||||
|
||||
Reference in New Issue
Block a user