summaryrefslogtreecommitdiffstats
path: root/src/core/settings.c
Commit message (Collapse)AuthorAgeFilesLines
* [settings] Avoid overwriting the start of .text in fetch_string_setting()Michael Brown2008-08-141-1/+2
| | | | | | | | | | fetch_string_setting() was subtracting one from the length of the to-be-NUL-terminated buffer in order to obtain the length of the unterminated buffer to be passed to fetch_setting(). This works extremely well unless the length of the to-be-NUL-terminated buffer is zero, at which point we end up giving fetch_setting() a buffer of length -1UL, thereby inviting it to overwrite as much memory as it wants...
* [Settings] Expose SMBIOS via settings APIMichael Brown2008-03-281-4/+65
| | | | In particular, expose the system UUID as a setting ("smbios/uuid").
* [Settings] find_child_settings() accepts a NULL parentMichael Brown2008-03-271-0/+4
|
* [Settings] Remove assumption that all settings have DHCP tag valuesMichael Brown2008-03-251-273/+181Star
| | | | | | | | | | | | 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.
* [Settings] Add named setting for next-serverMichael Brown2008-03-241-0/+6
| | | | | It's probably easier to have a named setting for next-server, rather than to explain to people why they need to pretend it is option 175.3.
* [Settings] copy_settings() should not fail if some settings are missing!Michael Brown2008-03-241-39/+17Star
|
* [Settings] Bugfix: store_setting() now applies changes even on root blockMichael Brown2008-03-221-3/+2Star
|
* [Settings] Implement simple_settings backed with extensible DHCP optionsMichael Brown2008-03-221-18/+38
|
* [Settings] DHCP is now working using the new settings API.Michael Brown2008-03-211-8/+6Star
|
* [Settings] Migrate DHCP and NVO code to the new settings API (untested)Michael Brown2008-03-211-3/+98
|
* [Settings] Convert code in src/usr to use settings API.Michael Brown2008-03-211-4/+31
|
* [Settings] Introduce settings applicators.Michael Brown2008-03-211-9/+102
| | | | | | | Convert DHCP option applicators in dns.c and iscsi.c to settings applicators. Kill off DHCP option applicators.
* [Settings] Add settings hierarchyMichael Brown2008-03-201-154/+227
| | | | | | | | Add the notion of the settings hierarchy, complete with register/unregister routines. Rename set->store and get->fetch to avoid naming conflicts with get/put as used in reference counting.
* [Settings] Start revamping the configuration settings API.Michael Brown2008-03-201-301/+606
| | | | | | | | | | | | | | | | Add the concept of an abstract configuration setting, comprising a (DHCP) tag value and an associated byte sequence. Add the concept of a settings namespace. Add functions for extracting string, IPv4 address, and signed and unsigned integer values from configuration settings (analogous to dhcp_snprintf(), dhcp_ipv4_option(), etc.). Update functions for parsing and formatting named/typed options to work with new settings API. Update NVO commands and config UI to use new settings API.
* [Settings] Allow named settings to have their type specified explicitlyMichael Brown2008-03-181-45/+48
| | | | Allow setting names such as "ip:hex".
* [Settings] Allow encapsulated options to be specified as named settingsMichael Brown2008-03-181-4/+10
| | | | | | Allow encapsulated options to be specified as e.g. "175.3". As a side-effect, change the separator character for the type field from "." to ":"; for example, the IP address pseudo-option is now "175.3:ipv4".
* [Settings] Add int16, int32 and hex-string configuration setting typesMichael Brown2008-03-181-5/+131
| | | | | | | | | | Add parse and display routines for 16-bit and 32-bit integer configuration settings. Add parse and display routines for hex-string configuration settings. Assume hex-string as a configuration setting type if no type is explicitly specified.
* [Settings] show_setting() functions return snprintf()-style length.Michael Brown2008-03-181-10/+7Star
| | | | | | show_setting() and related functions now return an "actual length" in the style of snprintf(). This is to allow consumers to allocate buffers large enough to hold the formatted setting.
* Use stdio.h instead of vsprintf.hMichael Brown2007-01-191-1/+1
|
* Having forced __table() to natural structure alignment, it now seemsMichael Brown2007-01-101-41/+43
| | | | | | that we *can* place arrays in tables, which means we can force the order within a table without having to resort to explicitly numbered sections on everything.
* Add "name" field to struct device to allow human-readable hardware deviceMichael Brown2007-01-101-8/+8
| | | | | | | | | | | names. Add "dev" pointer in struct net_device to tie network interfaces back to a hardware device. Force natural alignment of data types in __table() macros. This seems to prevent gcc from taking the unilateral decision to occasionally increase their alignment (which screws up the table packing).
* Add iSCSI initiator IQN as a settingMichael Brown2006-12-211-0/+6
|
* 8-bit integers are 1 byte long, not 8...Michael Brown2006-12-201-1/+1
|
* Added descriptive text for settings and setting types, and display it inMichael Brown2006-12-201-2/+12
| | | | the option config UI.
* Move {show,set,clear}_setting() to {show,set,clear}_named_setting().Michael Brown2006-12-201-22/+18Star
| | | | | | | | Introduce new {show,set,clear}_setting() that take a struct setting * rather than a const char *. set_setting() handles calling clear_setting() when appropriate, so that individual setting types don't have to check for empty strings.
* Use -ENOSPC rather than -ENOMEM, to distinguish the cases "generic out ofMichael Brown2006-12-201-5/+5
| | | | memory" and "no space left for DHCP options"
* Added clear_setting()Michael Brown2006-12-121-2/+25
|
* Added "priority" and "root-path" optionsMichael Brown2006-12-081-2/+94
|
* inet_aton() has a non-traditional return valueMichael Brown2006-12-061-1/+1
|
* Tied NVO commands into the human-interactable settings code that IMichael Brown2006-12-051-37/+25Star
| | | | completely forgot I'd written ages ago.
* Added cmdl_show proof-of-conceptMichael Brown2006-08-111-0/+20
|
* Added "hostname" and "ip" as sample settingsMichael Brown2006-08-111-0/+13
|
* Added ipv4 configuration typeMichael Brown2006-08-111-0/+56
|
* Add string configuration typeMichael Brown2006-08-111-5/+54
|
* Added basic infrastructure for manipulating settings.Michael Brown2006-08-111-0/+148