diff options
-rw-r--r-- | discover/platform.c | 3 | ||||
-rw-r--r-- | lib/pb-config/pb-config.c | 5 | ||||
-rw-r--r-- | lib/pb-protocol/pb-protocol.c | 9 | ||||
-rw-r--r-- | lib/types/types.h | 1 |
4 files changed, 18 insertions, 0 deletions
diff --git a/discover/platform.c b/discover/platform.c index 93f25c3..11e18f8 100644 --- a/discover/platform.c +++ b/discover/platform.c @@ -81,6 +81,8 @@ static void dump_config(struct config *config) pb_log(" %10s: %d\n", device_type_name(prio->type), prio->priority); } + + pb_log(" language: %s\n", config->lang ?: ""); } void config_set_defaults(struct config *config) @@ -93,6 +95,7 @@ void config_set_defaults(struct config *config) config->network.dns_servers = NULL; config->network.n_dns_servers = 0; config->boot_device = NULL; + config->lang = NULL; config->n_boot_priorities = 2; config->boot_priorities = talloc_array(config, struct boot_priority, diff --git a/lib/pb-config/pb-config.c b/lib/pb-config/pb-config.c index d43a5ab..fbaa7cb 100644 --- a/lib/pb-config/pb-config.c +++ b/lib/pb-config/pb-config.c @@ -74,5 +74,10 @@ struct config *config_copy(void *ctx, const struct config *src) else dest->boot_device = NULL; + if (src->lang && strlen(src->lang)) + dest->lang = talloc_strdup(dest, src->lang); + else + dest->lang = NULL; + return dest; } diff --git a/lib/pb-protocol/pb-protocol.c b/lib/pb-protocol/pb-protocol.c index d39c1c4..c184719 100644 --- a/lib/pb-protocol/pb-protocol.c +++ b/lib/pb-protocol/pb-protocol.c @@ -284,6 +284,8 @@ int pb_protocol_config_len(const struct config *config) len += 4 + optional_strlen(config->boot_device); + len += 4 + optional_strlen(config->lang); + return len; } @@ -480,6 +482,8 @@ int pb_protocol_serialise_config(const struct config *config, pos += pb_protocol_serialise_string(pos, config->boot_device); + pos += pb_protocol_serialise_string(pos, config->lang); + assert(pos <= buf + buf_len); (void)buf_len; @@ -915,6 +919,11 @@ int pb_protocol_deserialise_config(struct config *config, config->boot_device = str; + if (read_string(config, &pos, &len, &str)) + goto out; + + config->lang = str; + rc = 0; out: diff --git a/lib/types/types.h b/lib/types/types.h index 0333a02..5536e2a 100644 --- a/lib/types/types.h +++ b/lib/types/types.h @@ -126,6 +126,7 @@ struct config { struct boot_priority *boot_priorities; unsigned int n_boot_priorities; char *boot_device; + char *lang; }; #endif /* _TYPES_H */ |