84 return ( ( (
void * )
generic ) +
sizeof ( *
generic ) );
94 return ( ( (
void * )
generic ) +
sizeof ( *
generic ) +
128 const void *
data,
size_t len ) {
192 len =
generic->data_len;
199 return generic->data_len;
249 #define settings_root generic_settings_root.settings 269 free ( autovivified );
322 new_child =
zalloc (
sizeof ( *new_child ) );
324 DBGC ( parent,
"Settings %p could not create child %s\n",
328 memcpy ( new_child->name,
name, sizeof ( new_child->name ) );
329 ref_init ( &new_child->autovivified.refcnt,
332 &new_child->autovivified.refcnt );
333 settings = &new_child->autovivified.generic.settings;
347 char tmp[ 1 +
sizeof ( buf ) ];
381 remainder = name_copy;
384 while ( remainder ) {
386 remainder =
strchr ( subname,
'.' );
388 *(remainder++) =
'\0';
421 if ( (
rc = applicator->
apply() ) != 0 ) {
422 DBG (
"Could not apply settings using applicator " 590 const struct setting *applicable;
616 const void *
data,
size_t len ) {
669 const struct setting *applicable;
698 tmp.type = &setting_type_string;
706 memcpy ( fetched, &
tmp,
sizeof ( *fetched ) );
741 void * ( * alloc ) (
size_t len ) ) {
751 fetched = &tmp_fetched;
847 ( (
len > 0 ) ? (
len - 1 ) : 0 ) );
877 ( (
void ** )
data ),
896 (
sizeof ( *inp ) *
count ) );
899 if ( (
len %
sizeof ( *inp ) ) != 0 )
934 (
sizeof ( *inp ) *
count ) );
937 if ( (
len %
sizeof ( *inp ) ) != 0 )
967 unsigned long *
value ) {
976 is_negative = (
len && ( signed_bytes[0] < 0 ) );
977 *
value = ( ( is_signed && is_negative ) ? -1L : 0 );
979 for ( i = 0 ; i <
len ; i++ ) {
980 byte = unsigned_bytes[i];
982 if ( ( ( i +
sizeof ( *
value ) ) <
len ) && (
byte !=
pad ) )
999 unsigned long *
value,
int is_signed ) {
1028 ( (
unsigned long * )
value ), 1 );
1041 unsigned long *
value ) {
1055 unsigned long value;
1070 unsigned long value;
1092 if (
len !=
sizeof ( *
uuid ) )
1155 if ( !
type->format )
1171 void *buf,
size_t len ) {
1174 if ( !
type->parse )
1193 if ( !
type->numerate )
1209 void *buf,
size_t len ) {
1212 if ( !
type->denumerate )
1231 char *buf,
size_t len ) {
1239 fetched = &tmp_fetched;
1246 goto err_fetch_copy;
1289 fetched = &tmp_fetched;
1320 const char *
value ) {
1374 unsigned long *
value ) {
1382 fetched = &tmp_fetched;
1389 goto err_fetch_copy;
1415 unsigned long value ) {
1483 char *
tmp = ( (
char * )
name );
1556 DBG (
"Unrecognised settings block \"%s\" in \"%s\"\n",
1579 DBG (
"Invalid setting type \"%s\" in \"%s\"\n",
1593 *( type_name - 1 ) =
':';
1607 char *buf,
size_t len ) {
1633 const char *
value,
void *buf,
size_t len ) {
1684 const char *
value,
void *buf,
size_t len ){
1701 char *buf,
size_t len ) {
1708 .
name =
"uristring",
1827 #define SETTING_TYPE_UINT_NAME( index ) setting_type_int_name[index] 1835 #define SETTING_TYPE_INT_NAME( index ) ( setting_type_int_name[index] + 1 ) 1880 unsigned long value,
void *buf,
1907 unsigned long *
value ) {
1913 if ( check_len < 0 )
1930 const char *
value,
void *buf,
size_t len ) {
1932 unsigned long num_value;
1939 return type->denumerate (
type, num_value, buf,
len );
1954 char *buf,
size_t len ) {
1955 unsigned long value;
1978 char *buf,
size_t len ) {
1979 unsigned long value;
1996 #define SETTING_TYPE_INT( index ) { \ 1997 .name = SETTING_TYPE_INT_NAME ( index ), \ 1998 .parse = parse_int_setting, \ 1999 .format = format_int_setting, \ 2000 .denumerate = denumerate_int_setting, \ 2001 .numerate = numerate_int_setting, \ 2010 #define SETTING_TYPE_UINT( index ) { \ 2011 .name = SETTING_TYPE_UINT_NAME ( index ), \ 2012 .parse = parse_int_setting, \ 2013 .format = format_uint_setting, \ 2014 .denumerate = denumerate_int_setting, \ 2015 .numerate = numerate_int_setting, \ 2053 const char *
value,
void *buf,
size_t len ) {
2069 char *buf,
size_t len ) {
2084 const char *
value,
void *buf,
2101 char *buf,
size_t len ) {
2116 const char *
value,
void *buf,
size_t len ) {
2132 char *buf,
size_t len ) {
2168 const char *
value,
void *buf,
size_t len ) {
2185 char *buf,
size_t len ) {
2208 const char *
value,
void *buf,
size_t len ) {
2217 if (
type == &setting_type_guid )
2225 return (
sizeof (
uuid ) );
2251 if (
type == &setting_type_guid )
2294 if ( check_len < 0 )
2345 expstr =
strdup (
string );
2358 if ( (
tmp[0] ==
'$' ) && (
tmp[1] ==
'{' ) )
2360 if (
start && (
tmp[0] ==
'}' ) ) {
2388 new_len =
asprintf ( &expstr,
"%s%s%s",
2409 .description =
"Host name",
2411 .type = &setting_type_string,
2417 .description =
"DNS domain",
2419 .type = &setting_type_string,
2424 .
name =
"next-server",
2425 .description =
"TFTP server",
2427 .type = &setting_type_ipv4,
2433 .description =
"Boot filename",
2435 .type = &setting_type_string,
2440 .
name =
"root-path",
2441 .description =
"SAN root path",
2443 .type = &setting_type_string,
2449 .
name =
"san-filename",
2450 .description =
"SAN filename",
2452 .type = &setting_type_string,
2458 .description =
"User name",
2460 .type = &setting_type_string,
2466 .description =
"Password",
2468 .type = &setting_type_string,
2474 .description =
"Settings priority",
2476 .type = &setting_type_int8,
2482 .
name =
"user-class",
2483 .description =
"DHCP user class",
2485 .type = &setting_type_string,
2491 .
name =
"vendor-class",
2492 .description =
"DHCP vendor class",
2494 .type = &setting_type_string,
2519 if (
len >
sizeof ( content ) )
2520 len =
sizeof ( content );
2522 return sizeof ( content );
2528 .description =
"Last error",
2529 .type = &setting_type_uint32,
2547 static const char buildarch[] =
_S2 ( ARCH );
2550 return (
sizeof ( buildarch ) - 1 );
2555 .
name =
"buildarch",
2556 .description =
"Build architecture",
2557 .type = &setting_type_string,
2563 .
setting = &buildarch_setting,
2575 static const char platform[] =
_S2 ( PLATFORM );
2578 return (
sizeof ( platform ) - 1 );
2584 .description =
"Platform",
2585 .type = &setting_type_string,
2610 .description =
"Version",
2611 .type = &setting_type_string,
2633 if (
len >
sizeof ( content ) )
2634 len =
sizeof ( content );
2636 return sizeof ( content );
2642 .description =
"Seconds since the Epoch",
2643 .type = &setting_type_uint32,
2689 if ( ! uristring ) {
2696 ret =
strlen ( uristring );
2735 .description =
"Current working URI",
2736 .type = &setting_type_string,
2743 .description =
"Current working directory URI",
2744 .type = &setting_type_string,
2813 "builtin" ) ) != 0 ) {
2814 DBG (
"Could not register built-in settings: %s\n",
#define PCI_FUNC(busdevfn)
size_t data_len
Size of setting data.
long fetch_intz_setting(struct settings *settings, const struct setting *setting)
Fetch value of signed integer setting, or zero.
#define EINVAL
Invalid argument.
#define SETTING_IP_EXTRA
IPv4 additional settings.
static int version_fetch(void *data, size_t len)
Fetch version setting.
#define PCI_BUS(busdevfn)
struct arbelprm_rc_send_wqe rc
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.
Dynamic Host Configuration Protocol.
#define DHCP_HOST_NAME
Host name.
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 void uri_put(struct uri *uri)
Decrement URI reference count.
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.
size_t name_len
Size of setting name.
unsigned long strtoul(const char *string, char **endp, int base)
Convert string to numeric value.
const struct settings_scope dhcpv6_scope
IPv6 settings scope.
static struct generic_setting * find_generic_setting(struct generic_settings *generics, const struct setting *setting)
Find generic setting.
static void * generic_setting_name(struct generic_setting *generic)
Get generic setting name.
int setting_denumerate(const struct setting_type *type, unsigned long value, void *buf, size_t len)
Convert number to setting value.
void unregister_settings(struct settings *settings)
Unregister settings block.
struct stp_switch root
Root switch.
#define list_add(new, head)
Add a new entry to the head of a list.
uint32_t next
Next descriptor address.
#define _S2(x)
Stringify expanded argument.
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 fetch_raw_setting_copy(struct settings *settings, const struct setting *setting, void **data)
Fetch value of setting.
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.
#define ref_init(refcnt, free)
Initialise a reference counter.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct settings * parent
Parent settings block.
static void generic_settings_init(struct generic_settings *generics, struct refcnt *refcnt)
Initialise a settings block.
int fetch_ipv4_setting(struct settings *settings, const struct setting *setting, struct in_addr *inp)
Fetch value of IPv4 address setting.
#define DHCP_DOMAIN_NAME
Domain name.
static unsigned short vendor
uint32_t type
Operating system type.
#define SETTING_AUTH
Authentication settings.
int storen_setting(struct settings *settings, const struct setting *setting, unsigned long value)
Store numeric value of setting.
static struct settings_operations builtin_settings_operations
Built-in settings operations.
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 struct settings * parse_settings_name(const char *name, get_child_settings_t get_child)
Parse settings block name.
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.
struct init_fn builtin_init_fn __init_fn(INIT_NORMAL)
Built-in settings initialiser.
static int parse_base64_setting(const struct setting_type *type __unused, const char *value, void *buf, size_t len)
Parse Base64-encoded setting value.
static int delete_setting(struct settings *settings, const struct setting *setting)
Delete setting.
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 int parse_uuid_setting(const struct setting_type *type, const char *value, void *buf, size_t len)
Parse UUID/GUID setting value.
#define ENOENT
No such file or directory.
unsigned long long uint64_t
struct arbelprm_event_queue_entry generic
int(* fetch)(void *data, size_t len)
Fetch setting value.
int store_setting(struct settings *settings, const struct setting *setting, const void *data, size_t len)
Store value of setting.
const char * settings_name(struct settings *settings)
Return settings block name.
int fetch_raw_setting(struct settings *settings, const struct setting *setting, void *data, size_t len)
Fetch value of setting.
#define SETTING_SANBOOT
SAN boot settings.
#define SETTING_HOST_EXTRA
Host identity additional settings.
Autovivified settings block.
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)
#define SETTING_MISC
Miscellaneous settings.
void generic_settings_clear(struct settings *settings)
Clear generic settings block.
struct settings_operations generic_settings_operations
Generic settings operations.
int base64_decode(const char *encoded, void *data, size_t len)
Base64-decode string.
char * expand_settings(const char *string)
Expand variables within string.
int generic_settings_fetch(struct settings *settings, struct setting *setting, void *data, size_t len)
Fetch value of generic setting.
int fetch_int_setting(struct settings *settings, const struct setting *setting, long *value)
Fetch value of signed integer setting.
Uniform Resource Identifiers.
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.
setting_type_int_index
Integer setting type indices.
static int parse_int_setting(const struct setting_type *type, const char *value, void *buf, size_t len)
Parse integer setting value.
static void(*) struct refcnt refcnt)
void(* clear)(struct settings *settings)
Clear settings block.
struct settings_operations * op
Settings block operations.
__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)
struct list_head list
List of generic settings.
static struct settings builtin_settings
Built-in settings.
#define ENOTSUP
Operation not supported.
static int cwuri_fetch(void *data, size_t len)
Fetch current working URI setting.
static int parse_string_setting(const struct setting_type *type __unused, const char *value, void *buf, size_t len)
Parse string setting value.
A doubly-linked list entry (or list head)
static int builtin_applies(struct settings *settings __unused, const struct setting *setting)
Check applicability of built-in setting.
#define SETTINGS
Configuration setting table.
uint32_t start
Starting offset.
#define list_empty(list)
Test whether a list is empty.
static void uuid_mangle(union uuid *uuid)
Change UUID endianness.
#define list_first_entry(list, type, member)
Get the container of the first entry in a list.
uint64_t tag
Setting tag, if applicable.
char * strncpy(char *dest, const char *src, size_t max)
Copy string.
#define list_del(list)
Delete an entry from a list.
static int numeric_setting_value(int is_signed, const void *raw, size_t len, unsigned long *value)
Extract numeric value of setting.
uint16_t busdevfn
PCI bus:dev.fn address.
#define ENOMEM
Not enough space.
int uuid_aton(const char *string, union uuid *uuid)
Parse UUID.
#define INIT_NORMAL
Normal initialisation.
struct list_head list
List of generic settings.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static int setting_type_int_is_signed(const struct setting_type *type)
Get integer setting type signedness.
u32 version
Driver version.
struct settings * settings_target(struct settings *settings)
Redirect to target settings block.
#define __unused
Declare a variable or data structure as unused.
const struct setting * setting
Setting.
An initialisation function.
size_t uri_encode(unsigned int field, const void *raw, size_t raw_len, char *buf, ssize_t len)
Encode URI field.
#define DHCP_ROOT_PATH
Root path.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define container_of(ptr, type, field)
Get containing structure.
struct settings *(* get_child_settings_t)(struct settings *settings, const char *name)
A child settings block locator function.
#define DHCP_EB_SAN_FILENAME
SAN filename.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
pseudo_bit_t value[0x00020]
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
int errno
Global "last error" number.
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 builtin_setting errno_builtin_setting __builtin_setting
Error number built-in setting.
#define DHCP_EB_PASSWORD
Password.
struct generic_settings generic_settings_root
Root generic settings block.
#define SETTINGS_APPLICATORS
Settings applicator table.
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.
uint16_t count
Number of entries.
int hex_decode(char separator, const char *encoded, void *data, size_t len)
Decode hexadecimal string (with optional byte separator character)
static void apply_settings(void)
Apply all settings.
int fetch_string_setting(struct settings *settings, const struct setting *setting, char *data, size_t len)
Fetch value of string setting.
const struct setting_type * type
Setting type.
struct settings * autovivify_child_settings(struct settings *parent, const char *name)
Find or create child settings block.
int fetch_string_setting_copy(struct settings *settings, const struct setting *setting, char **data)
Fetch value of string setting.
char * format_uri_alloc(const struct uri *uri)
Format URI.
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.
static int cwuri_fetch_uri(void *data, size_t len, const char *rel)
Fetch current working URI-related setting.
const struct setting hostname_setting __setting(SETTING_HOST, hostname)
Hostname setting.
int fetch_numeric_setting(struct settings *settings, const struct setting *setting, unsigned long *value, int is_signed)
Fetch value of numeric setting.
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
static uint64_t parse_setting_tag(const char *name)
Parse setting name as tag number.
int fetchn_setting(struct settings *settings, const struct setting *setting, struct settings **origin, struct setting *fetched, unsigned long *value)
Fetch numeric value of setting.
struct settings *(* redirect)(struct settings *settings)
Redirect to underlying settings block (if applicable)
int storef_setting(struct settings *settings, const struct setting *setting, const char *value)
Store formatted 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)
static int cwduri_fetch(void *data, size_t len)
Fetch current working directory URI 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 ERANGE
Result too large.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
static void autovivified_settings_free(struct refcnt *refcnt)
Free autovivified settings block.
const struct setting_type setting_type_string __setting_type
A string setting type.
void * zalloc(size_t size)
Allocate cleared memory.
struct setting setting
Setting.
int setting_applies(struct settings *settings, const struct setting *setting)
Check applicability of setting.
#define PCI_SLOT(busdevfn)
char * strchr(const char *src, int character)
Find character within a string.
#define ref_get(refcnt)
Get additional reference to object.
int asprintf(char **strp, const char *fmt,...)
Write a formatted string to newly allocated memory.
size_t uri_decode(const char *encoded, void *buf, size_t len)
Decode URI field.
char * strdup(const char *src)
Duplicate string.
static void reprioritise_settings(struct settings *settings)
Reprioritise settings.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
static int platform_fetch(void *data, size_t len)
Fetch platform setting.
static int errno_fetch(void *data, size_t len)
Fetch error number setting.
#define ENODEV
No such device.
size_t strlen(const char *src)
Get length of string.
Settings block operations.
#define settings_root
Root settings block.
const char product_version[]
Product version string.
#define SETTING_BOOT
Generic boot settings.
unsigned long fetch_uintz_setting(struct settings *settings, const struct setting *setting)
Fetch value of unsigned integer setting, or zero.
int fetch_uint_setting(struct settings *settings, const struct setting *setting, unsigned long *value)
Fetch value of unsigned integer setting.
int fetch_setting_copy(struct settings *settings, const struct setting *setting, struct settings **origin, struct setting *fetched, void **data)
Fetch copy of setting.
static int buildarch_fetch(void *data, size_t len)
Fetch build architecture setting.
static const struct setting_type * find_setting_type(const char *name)
Find setting type.
void * malloc(size_t size)
Allocate memory.
const char * uuid_ntoa(const union uuid *uuid)
Convert UUID to printable string.
static struct dynamic_item password
struct list_head siblings
Sibling settings blocks.
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)
static const struct setting * applicable_setting(struct settings *settings, const struct setting *setting)
Find setting applicable to settings block, if any.
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)
#define DHCP_VENDOR_CLASS_ID
Vendor class identifier.
static int denumerate_int_setting(const struct setting_type *type, unsigned long value, void *buf, size_t len)
Convert number to setting value.
int order
Sibling ordering.
static void * generic_setting_data(struct generic_setting *generic)
Get generic setting data.
A generic settings block.
const struct settings_scope builtin_scope
Built-in setting scope.
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.
#define DHCP_EB_SIADDR
"Server" IP address
struct settings settings
Settings block.
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)
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)
#define ENOTTY
Inappropriate I/O control operation.
int generic_settings_store(struct settings *settings, const struct setting *setting, const void *data, size_t len)
Store value of generic setting.
int strcmp(const char *first, const char *second)
Compare strings.
#define DHCP_EB_PRIORITY
Priority of this options block.
uint16_t priority
Priotity.
#define SETTING_TYPE_UINT(index)
Define an unsigned integer setting type.
static const char setting_type_int_name[][8]
Integer setting type names.
int(* fetch)(struct settings *settings, struct setting *setting, void *data, size_t len)
Fetch value of setting.
#define SETTING_TYPE_INT(index)
Define a signed integer setting type.
static void * fetch_string_setting_copy_alloc(size_t len)
Allocate memory for copy of string setting.
__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)
__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)
struct settings * find_settings(const char *name)
Find settings block.
uint32_t end
Ending offset.
uint8_t size
Entry size (in 32-bit words)
uint8_t data[48]
Additional event data.
#define DHCP_BOOTFILE_NAME
Bootfile name.
#define __weak
Declare a function as weak (use before the definition)
static struct dynamic_item username
int(* apply)(void)
Apply updated settings.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
int(* applies)(struct settings *settings, const struct setting *setting)
Check applicability of setting.
A Uniform Resource Identifier.
struct list_head children
Child settings blocks.
int register_settings(struct settings *settings, struct settings *parent, const char *name)
Register settings block.
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.
int fetch_uuid_setting(struct settings *settings, const struct setting *setting, union uuid *uuid)
Fetch value of UUID setting.
void clear_settings(struct settings *settings)
Clear settings block.
int setting_numerate(const struct setting_type *type, const void *raw, size_t raw_len, unsigned long *value)
Convert setting value to number.
struct generic_settings generic
Generic settings block.
struct uri * resolve_uri(const struct uri *base_uri, struct uri *relative_uri)
Resolve base+relative URI.
#define DHCP_USER_CLASS_ID
User class identifier.
#define SETTING_TYPES
Configuration setting type table.
struct golan_mkey_seg seg
static int unixtime_fetch(void *data, size_t len)
Fetch current time setting.
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)
#define DHCP_EB_USERNAME
Username.
struct setting * find_setting(const char *name)
Find predefined setting.
#define DBG(...)
Print a debugging message.
struct settings * find_child_settings(struct settings *parent, const char *name)
Find child settings block.
#define LIST_HEAD_INIT(list)
Initialise a static list head.
struct uri * cwuri
Current working URI.
const struct settings_scope * scope
Setting scope (or NULL)
static unsigned int setting_type_int_width(const struct setting_type *type)
Get integer setting type width.
int fetch_ipv6_setting(struct settings *settings, const struct setting *setting, struct in6_addr *inp)
Fetch value of IPv6 address setting.
uint64_t tag
Identity tag.
int setting_parse(const struct setting_type *type, const char *value, void *buf, size_t len)
Parse formatted string to setting value.
static int builtin_fetch(struct settings *settings __unused, struct setting *setting, void *data, size_t len)
Fetch built-in setting.
int(* store)(struct settings *settings, const struct setting *setting, const void *data, size_t len)
Store value of setting.
int setting_name(struct settings *settings, const struct setting *setting, char *buf, size_t len)
Return full setting name.
#define PCI_SEG(busdevfn)
int setting_cmp(const struct setting *a, const struct setting *b)
Compare two settings.
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.
#define NULL
NULL pointer (VOID *)
#define BUILTIN_SETTINGS
Built-in settings table.
static void builtin_init(void)
Initialise built-in settings.
int parse_setting_name(char *name, get_child_settings_t get_child, struct settings **settings, struct setting *setting)
Parse setting name.
size_t base64_encode(const void *raw, size_t raw_len, char *data, size_t len)
Base64-encode data.
struct refcnt * refcnt
Reference counter.
#define ref_put(refcnt)
Drop reference to object.
#define SETTING_HOST
Host identity settings.
struct uri * parse_uri(const char *uri_string)
Parse URI.
void * memset(void *dest, int character, size_t len) __nonnull
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.