129 const void *
data,
size_t len ) {
193 len =
generic->data_len;
200 return generic->data_len;
250#define settings_root generic_settings_root.settings
270 free ( autovivified );
323 new_child =
zalloc (
sizeof ( *new_child ) );
325 DBGC ( parent,
"Settings %p could not create child %s\n",
329 memcpy ( new_child->name,
name, sizeof ( new_child->name ) );
330 ref_init ( &new_child->autovivified.refcnt,
333 &new_child->autovivified.refcnt );
334 settings = &new_child->autovivified.generic.settings;
348 char tmp[ 1 +
sizeof ( buf ) ];
382 remainder = name_copy;
385 while ( remainder ) {
387 remainder =
strchr ( subname,
'.' );
389 *(remainder++) =
'\0';
422 if ( (
rc = applicator->
apply() ) != 0 ) {
423 DBG (
"Could not apply settings using applicator "
591 const struct setting *applicable;
617 const void *
data,
size_t len ) {
670 const struct setting *applicable;
699 tmp.type = &setting_type_string;
707 memcpy ( fetched, &
tmp,
sizeof ( *fetched ) );
742 void * ( * alloc ) (
size_t len ) ) {
752 fetched = &tmp_fetched;
848 ( (
len > 0 ) ? (
len - 1 ) : 0 ) );
878 ( (
void ** )
data ),
897 (
sizeof ( *inp ) *
count ) );
900 if ( (
len %
sizeof ( *inp ) ) != 0 )
935 (
sizeof ( *inp ) *
count ) );
938 if ( (
len %
sizeof ( *inp ) ) != 0 )
968 unsigned long *
value ) {
977 is_negative = (
len && ( signed_bytes[0] < 0 ) );
978 *
value = ( ( is_signed && is_negative ) ? -1L : 0 );
980 for ( i = 0 ; i <
len ; i++ ) {
981 byte = unsigned_bytes[i];
983 if ( ( ( i +
sizeof ( *
value ) ) <
len ) && (
byte !=
pad ) )
1000 unsigned long *
value,
int is_signed ) {
1029 ( (
unsigned long * )
value ), 1 );
1042 unsigned long *
value ) {
1056 unsigned long value;
1071 unsigned long value;
1093 if (
len !=
sizeof ( *
uuid ) )
1156 if ( !
type->format )
1172 void *buf,
size_t len ) {
1175 if ( !
type->parse )
1194 if ( !
type->numerate )
1210 void *buf,
size_t len ) {
1213 if ( !
type->denumerate )
1232 char *buf,
size_t len ) {
1240 fetched = &tmp_fetched;
1247 goto err_fetch_copy;
1290 fetched = &tmp_fetched;
1321 const char *
value ) {
1375 unsigned long *
value ) {
1383 fetched = &tmp_fetched;
1390 goto err_fetch_copy;
1416 unsigned long value ) {
1484 char *
tmp = ( (
char * )
name );
1557 DBG (
"Unrecognised settings block \"%s\" in \"%s\"\n",
1580 DBG (
"Invalid setting type \"%s\" in \"%s\"\n",
1594 *( type_name - 1 ) =
':';
1608 char *buf,
size_t len ) {
1634 const char *
value,
void *buf,
size_t len ) {
1685 const char *
value,
void *buf,
size_t len ){
1702 char *buf,
size_t len ) {
1709 .name =
"uristring",
1828#define SETTING_TYPE_UINT_NAME( index ) setting_type_int_name[index]
1836#define SETTING_TYPE_INT_NAME( index ) ( setting_type_int_name[index] + 1 )
1881 unsigned long value,
void *buf,
1908 unsigned long *
value ) {
1914 if ( check_len < 0 )
1931 const char *
value,
void *buf,
size_t len ) {
1933 unsigned long num_value;
1940 return type->denumerate (
type, num_value, buf,
len );
1955 char *buf,
size_t len ) {
1956 unsigned long value;
1979 char *buf,
size_t len ) {
1980 unsigned long value;
1997#define SETTING_TYPE_INT( index ) { \
1998 .name = SETTING_TYPE_INT_NAME ( index ), \
1999 .parse = parse_int_setting, \
2000 .format = format_int_setting, \
2001 .denumerate = denumerate_int_setting, \
2002 .numerate = numerate_int_setting, \
2011#define SETTING_TYPE_UINT( index ) { \
2012 .name = SETTING_TYPE_UINT_NAME ( index ), \
2013 .parse = parse_int_setting, \
2014 .format = format_uint_setting, \
2015 .denumerate = denumerate_int_setting, \
2016 .numerate = numerate_int_setting, \
2054 const char *
value,
void *buf,
size_t len ) {
2070 char *buf,
size_t len ) {
2085 const char *
value,
void *buf,
2102 char *buf,
size_t len ) {
2117 const char *
value,
void *buf,
size_t len ) {
2133 char *buf,
size_t len ) {
2169 const char *
value,
void *buf,
size_t len ) {
2186 char *buf,
size_t len ) {
2209 const char *
value,
void *buf,
size_t len ) {
2218 if (
type == &setting_type_guid )
2226 return (
sizeof (
uuid ) );
2252 if (
type == &setting_type_guid )
2295 if ( check_len < 0 )
2346 expstr =
strdup (
string );
2359 if ( (
tmp[0] ==
'$' ) && (
tmp[1] ==
'{' ) )
2361 if (
start && (
tmp[0] ==
'}' ) ) {
2389 new_len =
asprintf ( &expstr,
"%s%s%s",
2410 .description =
"Host name",
2412 .type = &setting_type_string,
2418 .description =
"DNS domain",
2420 .type = &setting_type_string,
2425 .name =
"next-server",
2426 .description =
"TFTP server",
2428 .type = &setting_type_ipv4,
2434 .description =
"Boot filename",
2436 .type = &setting_type_string,
2441 .name =
"root-path",
2442 .description =
"SAN root path",
2444 .type = &setting_type_string,
2450 .name =
"san-filename",
2451 .description =
"SAN filename",
2453 .type = &setting_type_string,
2459 .description =
"User name",
2461 .type = &setting_type_string,
2467 .description =
"Password",
2469 .type = &setting_type_string,
2475 .description =
"Settings priority",
2477 .type = &setting_type_int8,
2483 .name =
"user-class",
2484 .description =
"DHCP user class",
2486 .type = &setting_type_string,
2492 .name =
"vendor-class",
2493 .description =
"DHCP vendor class",
2495 .type = &setting_type_string,
2520 if (
len >
sizeof ( content ) )
2521 len =
sizeof ( content );
2523 return sizeof ( content );
2529 .description =
"Last error",
2530 .type = &setting_type_uint32,
2536 .setting = &errno_setting,
2548 static const char buildarch[] =
_S2 ( ARCH );
2551 return (
sizeof ( buildarch ) - 1 );
2556 .name =
"buildarch",
2557 .description =
"Build architecture",
2558 .type = &setting_type_string,
2564 .setting = &buildarch_setting,
2576 static const char platform[] =
_S2 ( PLATFORM );
2579 return (
sizeof ( platform ) - 1 );
2585 .description =
"Platform",
2586 .type = &setting_type_string,
2592 .setting = &platform_setting,
2611 .description =
"Version",
2612 .type = &setting_type_string,
2618 .setting = &version_setting,
2634 if (
len >
sizeof ( content ) )
2635 len =
sizeof ( content );
2637 return sizeof ( content );
2643 .description =
"Seconds since the Epoch",
2644 .type = &setting_type_uint32,
2650 .setting = &unixtime_setting,
2690 if ( ! uristring ) {
2697 ret =
strlen ( uristring );
2736 .description =
"Current working URI",
2737 .type = &setting_type_string,
2744 .description =
"Current working directory URI",
2745 .type = &setting_type_string,
2751 .setting = &cwuri_setting,
2757 .setting = &cwduri_setting,
2814 "builtin" ) ) != 0 ) {
2815 DBG (
"Could not register built-in settings: %s\n",
#define NULL
NULL pointer (VOID *)
struct golan_mkey_seg seg
struct arbelprm_event_queue_entry generic
struct arbelprm_rc_send_wqe rc
pseudo_bit_t value[0x00020]
unsigned long long uint64_t
int asprintf(char **strp, const char *fmt,...)
Write a formatted string to newly allocated memory.
#define assert(condition)
Assert a condition at run-time.
u32 version
Driver version.
int hex_decode(char separator, const char *encoded, void *data, size_t len)
Decode hexadecimal string (with optional byte separator character)
size_t hex_encode(char separator, const void *raw, size_t raw_len, char *data, size_t len)
Encode hexadecimal string (with optional byte separator character)
size_t base64_encode(const void *raw, size_t raw_len, char *data, size_t len)
Base64-encode data.
int base64_decode(const char *encoded, void *data, size_t len)
Base64-decode string.
struct uri * cwuri
Current working URI.
static unsigned short vendor
union @104331263140136355135267063077374276003064103115 u
uint32_t next
Next descriptor address.
uint64_t tag
Identity tag.
uint32_t type
Operating system type.
uint8_t data[48]
Additional event data.
uint16_t busdevfn
PCI bus:dev.fn address.
int errno
Global "last error" number.
#define __unused
Declare a variable or data structure as unused.
#define DBG(...)
Print a debugging message.
#define DHCP_ROOT_PATH
Root path.
#define DHCP_DOMAIN_NAME
Domain name.
#define DHCP_EB_PASSWORD
Password.
#define DHCP_EB_PRIORITY
Priority of this options block.
#define DHCP_EB_SIADDR
"Server" IP address
#define DHCP_VENDOR_CLASS_ID
Vendor class identifier.
#define DHCP_EB_SAN_FILENAME
SAN filename.
#define DHCP_EB_USERNAME
Username.
#define DHCP_USER_CLASS_ID
User class identifier.
#define DHCP_BOOTFILE_NAME
Bootfile name.
#define DHCP_HOST_NAME
Host name.
#define INIT_NORMAL
Normal initialisation.
uint32_t start
Starting offset.
uint16_t size
Buffer size.
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ENOENT
No such file or directory.
#define EINVAL
Invalid argument.
#define ENOMEM
Not enough space.
#define ENOTSUP
Operation not supported.
#define ERANGE
Result too large.
#define ENODEV
No such device.
#define ENOTTY
Inappropriate I/O control operation.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define SETTING_HOST_EXTRA
Host identity additional settings.
#define SETTING_SANBOOT
SAN boot settings.
#define SETTING_BOOT
Generic boot settings.
#define SETTING_IP_EXTRA
IPv4 additional settings.
#define SETTING_HOST
Host identity settings.
#define SETTING_AUTH
Authentication settings.
#define SETTING_MISC
Miscellaneous settings.
#define __weak
Declare a function as weak (use before the definition)
#define _S2(x)
Stringify expanded argument.
Dynamic Host Configuration Protocol.
#define __setting(setting_order, name)
Declare a configuration setting.
#define SETTINGS_APPLICATORS
Settings applicator table.
static int delete_setting(struct settings *settings, const struct setting *setting)
Delete setting.
struct settings *(* get_child_settings_t)(struct settings *settings, const char *name)
A child settings block locator function.
#define __builtin_setting
Declare a built-in setting.
static void generic_settings_init(struct generic_settings *generics, struct refcnt *refcnt)
Initialise a settings block.
#define SETTINGS
Configuration setting table.
#define BUILTIN_SETTINGS
Built-in settings table.
#define SETTING_TYPES
Configuration setting type table.
#define __setting_type
Declare a configuration setting type.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
#define __init_fn(init_order)
Declare an initialisation functon.
#define list_first_entry(list, type, member)
Get the container of the first entry in a list.
#define LIST_HEAD_INIT(list)
Initialise a static list head.
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define list_del(list)
Delete an entry from a list.
#define list_empty(list)
Test whether a list is empty.
#define list_add(new, head)
Add a new entry to the head of a list.
static struct dynamic_item username
static struct dynamic_item password
void * zalloc(size_t size)
Allocate cleared memory.
void * malloc(size_t size)
Allocate memory.
uint32_t end
Ending offset.
#define PCI_SEG(busdevfn)
#define PCI_FUNC(busdevfn)
#define PCI_BUS(busdevfn)
#define PCI_SLOT(busdevfn)
static void(* free)(struct refcnt *refcnt))
#define ref_get(refcnt)
Get additional reference to object.
#define ref_put(refcnt)
Drop reference to object.
#define ref_init(refcnt, free)
Initialise a reference counter.
int setting_numerate(const struct setting_type *type, const void *raw, size_t raw_len, unsigned long *value)
Convert setting value to number.
int setting_format(const struct setting_type *type, const void *raw, size_t raw_len, char *buf, size_t len)
Format setting value as a string.
static int format_hex_raw_setting(const struct setting_type *type __unused, const void *raw, size_t raw_len, char *buf, size_t len)
Format hex string setting value (using no delimiter)
static int parse_uristring_setting(const struct setting_type *type __unused, const char *value, void *buf, size_t len)
Parse URI-encoded string setting value.
static struct settings_operations builtin_settings_operations
Built-in settings operations.
static int version_fetch(void *data, size_t len)
Fetch version setting.
int register_settings(struct settings *settings, struct settings *parent, const char *name)
Register settings block.
char * expand_settings(const char *string)
Expand variables within string.
static void reprioritise_settings(struct settings *settings)
Reprioritise settings.
struct settings * autovivify_child_settings(struct settings *parent, const char *name)
Find or create child settings block.
static int numerate_int_setting(const struct setting_type *type, const void *raw, size_t raw_len, unsigned long *value)
Convert setting value to number.
static struct settings * parse_settings_name(const char *name, get_child_settings_t get_child)
Parse settings block name.
int setting_name(struct settings *settings, const struct setting *setting, char *buf, size_t len)
Return full setting name.
__weak int format_ipv6_setting(const struct setting_type *type __unused, const void *raw __unused, size_t raw_len __unused, char *buf __unused, size_t len __unused)
Format IPv6 address setting value (when IPv6 support is not present)
int fetch_raw_setting_copy(struct settings *settings, const struct setting *setting, void **data)
Fetch value of setting.
static int parse_string_setting(const struct setting_type *type __unused, const char *value, void *buf, size_t len)
Parse string setting value.
static int platform_fetch(void *data, size_t len)
Fetch platform setting.
static int format_hex_colon_setting(const struct setting_type *type __unused, const void *raw, size_t raw_len, char *buf, size_t len)
Format hex string setting value (using colon delimiter)
static int format_uint_setting(const struct setting_type *type, const void *raw, size_t raw_len, char *buf, size_t len)
Format unsigned integer setting value.
int fetch_numeric_setting(struct settings *settings, const struct setting *setting, unsigned long *value, int is_signed)
Fetch value of numeric setting.
static int format_string_setting(const struct setting_type *type __unused, const void *raw, size_t raw_len, char *buf, size_t len)
Format string setting value.
static const struct setting_type * find_setting_type(const char *name)
Find setting type.
struct generic_settings generic_settings_root
Root generic settings block.
int fetch_ipv6_array_setting(struct settings *settings, const struct setting *setting, struct in6_addr *inp, unsigned int count)
Fetch value of IPv6 address setting.
const struct settings_scope dhcpv6_scope
IPv6 settings scope.
static int parse_base64_setting(const struct setting_type *type __unused, const char *value, void *buf, size_t len)
Parse Base64-encoded setting value.
__weak int parse_ipv6_setting(const struct setting_type *type __unused, const char *value __unused, void *buf __unused, size_t len __unused)
Parse IPv6 address setting value (when IPv6 support is not present)
int fetch_raw_setting(struct settings *settings, const struct setting *setting, void *data, size_t len)
Fetch value of setting.
static const char setting_type_int_name[][8]
Integer setting type names.
static struct generic_setting * find_generic_setting(struct generic_settings *generics, const struct setting *setting)
Find generic setting.
int fetch_setting(struct settings *settings, const struct setting *setting, struct settings **origin, struct setting *fetched, void *data, size_t len)
Fetch setting.
#define SETTING_TYPE_UINT(index)
Define an unsigned integer setting type.
struct settings * settings_target(struct settings *settings)
Redirect to target settings block.
int fetchn_setting(struct settings *settings, const struct setting *setting, struct settings **origin, struct setting *fetched, unsigned long *value)
Fetch numeric value of setting.
unsigned long fetch_uintz_setting(struct settings *settings, const struct setting *setting)
Fetch value of unsigned integer setting, or zero.
static void autovivified_settings_free(struct refcnt *refcnt)
Free autovivified settings block.
static void * fetch_string_setting_copy_alloc(size_t len)
Allocate memory for copy of string setting.
int setting_parse(const struct setting_type *type, const char *value, void *buf, size_t len)
Parse formatted string to setting value.
static int cwduri_fetch(void *data, size_t len)
Fetch current working directory URI setting.
static int format_base64_setting(const struct setting_type *type __unused, const void *raw, size_t raw_len, char *buf, size_t len)
Format Base64-encoded setting value.
static int format_uuid_setting(const struct setting_type *type, const void *raw, size_t raw_len, char *buf, size_t len)
Format UUID/GUID setting value.
int fetch_int_setting(struct settings *settings, const struct setting *setting, long *value)
Fetch value of signed integer setting.
static struct settings builtin_settings
Built-in settings.
static int fetch_setting_alloc(struct settings *settings, const struct setting *setting, struct settings **origin, struct setting *fetched, void **data, void *(*alloc)(size_t len))
Fetch allocated copy of setting.
static int parse_hex_raw_setting(const struct setting_type *type __unused, const char *value, void *buf, size_t len)
Parse hex string setting value (using no delimiter)
int fetch_setting_copy(struct settings *settings, const struct setting *setting, struct settings **origin, struct setting *fetched, void **data)
Fetch copy of setting.
int fetch_ipv4_array_setting(struct settings *settings, const struct setting *setting, struct in_addr *inp, unsigned int count)
Fetch value of IPv4 address setting.
static void builtin_init(void)
Initialise built-in settings.
static int builtin_applies(struct settings *settings __unused, const struct setting *setting)
Check applicability of built-in setting.
static unsigned int setting_type_int_width(const struct setting_type *type)
Get integer setting type width.
static int cwuri_fetch_uri(void *data, size_t len, const char *rel)
Fetch current working URI-related setting.
int fetch_string_setting(struct settings *settings, const struct setting *setting, char *data, size_t len)
Fetch value of string setting.
static int errno_fetch(void *data, size_t len)
Fetch error number setting.
int parse_setting_name(char *name, get_child_settings_t get_child, struct settings **settings, struct setting *setting)
Parse setting name.
struct setting * find_setting(const char *name)
Find predefined setting.
int setting_applies(struct settings *settings, const struct setting *setting)
Check applicability of setting.
static const struct setting * applicable_setting(struct settings *settings, const struct setting *setting)
Find setting applicable to settings block, if any.
static int parse_hex_setting(const struct setting_type *type __unused, const char *value, void *buf, size_t len)
Parse hex string setting value (using colon delimiter)
void clear_settings(struct settings *settings)
Clear settings block.
const struct settings_scope builtin_scope
Built-in setting scope.
int fetch_ipv6_setting(struct settings *settings, const struct setting *setting, struct in6_addr *inp)
Fetch value of IPv6 address setting.
static int parse_int_setting(const struct setting_type *type, const char *value, void *buf, size_t len)
Parse integer setting value.
int fetch_string_setting_copy(struct settings *settings, const struct setting *setting, char **data)
Fetch value of string setting.
void unregister_settings(struct settings *settings)
Unregister settings block.
int setting_cmp(const struct setting *a, const struct setting *b)
Compare two settings.
static int format_int_setting(const struct setting_type *type, const void *raw, size_t raw_len, char *buf, size_t len)
Format signed integer setting value.
static int builtin_fetch(struct settings *settings __unused, struct setting *setting, void *data, size_t len)
Fetch built-in setting.
int generic_settings_fetch(struct settings *settings, struct setting *setting, void *data, size_t len)
Fetch value of generic setting.
int fetch_ipv4_setting(struct settings *settings, const struct setting *setting, struct in_addr *inp)
Fetch value of IPv4 address setting.
struct settings * find_settings(const char *name)
Find settings block.
int fetch_uint_setting(struct settings *settings, const struct setting *setting, unsigned long *value)
Fetch value of unsigned integer setting.
int fetchf_setting(struct settings *settings, const struct setting *setting, struct settings **origin, struct setting *fetched, char *buf, size_t len)
Fetch formatted value of setting.
void generic_settings_clear(struct settings *settings)
Clear generic settings block.
#define SETTING_TYPE_INT(index)
Define a signed integer setting type.
#define settings_root
Root settings block.
struct settings * find_child_settings(struct settings *parent, const char *name)
Find child settings block.
static int denumerate_int_setting(const struct setting_type *type, unsigned long value, void *buf, size_t len)
Convert number to setting value.
__weak int format_ipv4_setting(const struct setting_type *type __unused, const void *raw __unused, size_t raw_len __unused, char *buf __unused, size_t len __unused)
Format IPv4 address setting value (when IPv4 support is not present)
int fetchf_setting_copy(struct settings *settings, const struct setting *setting, struct settings **origin, struct setting *fetched, char **value)
Fetch copy of formatted value of setting.
int generic_settings_store(struct settings *settings, const struct setting *setting, const void *data, size_t len)
Store value of generic setting.
static int buildarch_fetch(void *data, size_t len)
Fetch build architecture setting.
static void * generic_setting_data(struct generic_setting *generic)
Get generic setting data.
int storef_setting(struct settings *settings, const struct setting *setting, const char *value)
Store formatted value of setting.
long fetch_intz_setting(struct settings *settings, const struct setting *setting)
Fetch value of signed integer setting, or zero.
static int format_busdevfn_setting(const struct setting_type *type __unused, const void *raw, size_t raw_len, char *buf, size_t len)
Format PCI bus:dev.fn setting value.
static void * generic_setting_name(struct generic_setting *generic)
Get generic setting name.
int fetch_uuid_setting(struct settings *settings, const struct setting *setting, union uuid *uuid)
Fetch value of UUID setting.
static int parse_uuid_setting(const struct setting_type *type, const char *value, void *buf, size_t len)
Parse UUID/GUID setting value.
static int numeric_setting_value(int is_signed, const void *raw, size_t len, unsigned long *value)
Extract numeric value of setting.
static void apply_settings(void)
Apply all settings.
static int format_uristring_setting(const struct setting_type *type __unused, const void *raw, size_t raw_len, char *buf, size_t len)
Format URI-encoded string setting value.
int store_setting(struct settings *settings, const struct setting *setting, const void *data, size_t len)
Store value of setting.
__weak int parse_ipv4_setting(const struct setting_type *type __unused, const char *value __unused, void *buf __unused, size_t len __unused)
Parse IPv4 address setting value (when IPv4 support is not present)
int storen_setting(struct settings *settings, const struct setting *setting, unsigned long value)
Store numeric value of setting.
static int parse_hex_hyphen_setting(const struct setting_type *type __unused, const char *value, void *buf, size_t len)
Parse hex string setting value (using hyphen delimiter)
struct settings_operations generic_settings_operations
Generic settings operations.
const char * settings_name(struct settings *settings)
Return settings block name.
static int format_hex_hyphen_setting(const struct setting_type *type __unused, const void *raw, size_t raw_len, char *buf, size_t len)
Format hex string setting value (using hyphen delimiter)
setting_type_int_index
Integer setting type indices.
static uint64_t parse_setting_tag(const char *name)
Parse setting name as tag number.
static int cwuri_fetch(void *data, size_t len)
Fetch current working URI setting.
static int setting_type_int_is_signed(const struct setting_type *type)
Get integer setting type signedness.
int setting_denumerate(const struct setting_type *type, unsigned long value, void *buf, size_t len)
Convert number to setting value.
static int unixtime_fetch(void *data, size_t len)
Fetch current time setting.
#define container_of(ptr, type, field)
Get containing structure.
uint16_t priority
Priotity.
struct stp_switch root
Root switch.
char * strerror(int errno)
Retrieve string representation of error number.
unsigned long strtoul(const char *string, char **endp, int base)
Convert string to numeric value.
int strcmp(const char *first, const char *second)
Compare strings.
char * strchr(const char *src, int character)
Find character within a string.
char * strdup(const char *src)
Duplicate string.
size_t strlen(const char *src)
Get length of string.
char * strncpy(char *dest, const char *src, size_t max)
Copy string.
Autovivified settings block.
struct refcnt refcnt
Reference count.
struct generic_settings generic
Generic settings block.
const struct setting * setting
Setting.
int(* fetch)(void *data, size_t len)
Fetch setting value.
size_t name_len
Size of setting name.
struct list_head list
List of generic settings.
size_t data_len
Size of setting data.
struct setting setting
Setting.
A generic settings block.
struct list_head list
List of generic settings.
struct settings settings
Settings block.
An initialisation function.
A doubly-linked list entry (or list head)
const struct settings_scope * scope
Setting scope (or NULL)
const struct setting_type * type
Setting type.
uint64_t tag
Setting tag, if applicable.
int(* apply)(void)
Apply updated settings.
Settings block operations.
int(* applies)(struct settings *settings, const struct setting *setting)
Check applicability of setting.
int(* fetch)(struct settings *settings, struct setting *setting, void *data, size_t len)
Fetch value of setting.
int(* store)(struct settings *settings, const struct setting *setting, const void *data, size_t len)
Store value of setting.
void(* clear)(struct settings *settings)
Clear settings block.
struct settings *(* redirect)(struct settings *settings)
Redirect to underlying settings block (if applicable)
struct settings_operations * op
Settings block operations.
struct list_head children
Child settings blocks.
int order
Sibling ordering.
struct settings * parent
Parent settings block.
struct list_head siblings
Sibling settings blocks.
struct refcnt * refcnt
Reference counter.
A Uniform Resource Identifier.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
size_t uri_decode(const char *encoded, void *buf, size_t len)
Decode URI field.
struct uri * parse_uri(const char *uri_string)
Parse URI.
struct uri * resolve_uri(const struct uri *base_uri, struct uri *relative_uri)
Resolve base+relative URI.
size_t uri_encode(unsigned int field, const void *raw, size_t raw_len, char *buf, ssize_t len)
Encode URI field.
char * format_uri_alloc(const struct uri *uri)
Format URI.
Uniform Resource Identifiers.
static void uri_put(struct uri *uri)
Decrement URI reference count.
const char * uuid_ntoa(const union uuid *uuid)
Convert UUID to printable string.
int uuid_aton(const char *string, union uuid *uuid)
Parse UUID.
static void uuid_mangle(union uuid *uuid)
Change UUID endianness.
const char product_version[]
Product version string.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.