#include "string-table.h"
#include "string-util.h"
#include "strv.h"
-#include "utf8.h"
#include "util.h"
const char *net_get_name_persistent(sd_device *device) {
}
}
-int config_parse_ifalias(const char *unit,
- const char *filename,
- unsigned line,
- const char *section,
- unsigned section_line,
- const char *lvalue,
- int ltype,
- const char *rvalue,
- void *data,
- void *userdata) {
-
- char **s = data;
-
- assert(filename);
- assert(lvalue);
- assert(rvalue);
- assert(data);
-
- if (!isempty(rvalue)) {
- *s = mfree(*s);
- return 0;
- }
-
- if (!ascii_is_valid(rvalue)) {
- log_syntax(unit, LOG_WARNING, filename, line, 0,
- "Interface alias is not ASCII clean, ignoring assignment: %s", rvalue);
- return 0;
- }
-
- if (strlen(rvalue) >= IFALIASZ) {
- log_syntax(unit, LOG_WARNING, filename, line, 0,
- "Interface alias is too long, ignoring assignment: %s", rvalue);
- return 0;
- }
-
- if (free_and_strdup(s, rvalue) < 0)
- return log_oom();
-
- return 0;
-}
-
int config_parse_hwaddr(const char *unit,
const char *filename,
unsigned line,
CONFIG_PARSER_PROTOTYPE(config_parse_match_strv);
CONFIG_PARSER_PROTOTYPE(config_parse_match_ifnames);
CONFIG_PARSER_PROTOTYPE(config_parse_match_property);
-CONFIG_PARSER_PROTOTYPE(config_parse_ifalias);
int net_get_unique_predictable_data(sd_device *device, bool use_sysname, uint64_t *result);
const char *net_get_name_persistent(sd_device *device);
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
+#include "utf8.h"
struct link_config_ctx {
LIST_HEAD(link_config, links);
return 0;
}
+int config_parse_ifalias(
+ const char *unit,
+ const char *filename,
+ unsigned line,
+ const char *section,
+ unsigned section_line,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
+ char **s = data;
+
+ assert(filename);
+ assert(lvalue);
+ assert(rvalue);
+ assert(data);
+
+ if (!isempty(rvalue)) {
+ *s = mfree(*s);
+ return 0;
+ }
+
+ if (!ascii_is_valid(rvalue)) {
+ log_syntax(unit, LOG_WARNING, filename, line, 0,
+ "Interface alias is not ASCII clean, ignoring assignment: %s", rvalue);
+ return 0;
+ }
+
+ if (strlen(rvalue) >= IFALIASZ) {
+ log_syntax(unit, LOG_WARNING, filename, line, 0,
+ "Interface alias is too long, ignoring assignment: %s", rvalue);
+ return 0;
+ }
+
+ if (free_and_strdup(s, rvalue) < 0)
+ return log_oom();
+
+ return 0;
+}
+
static const char* const mac_address_policy_table[_MAC_ADDRESS_POLICY_MAX] = {
[MAC_ADDRESS_POLICY_PERSISTENT] = "persistent",
[MAC_ADDRESS_POLICY_RANDOM] = "random",
/* gperf lookup function */
const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+CONFIG_PARSER_PROTOTYPE(config_parse_ifalias);
CONFIG_PARSER_PROTOTYPE(config_parse_mac_address_policy);
CONFIG_PARSER_PROTOTYPE(config_parse_name_policy);
CONFIG_PARSER_PROTOTYPE(config_parse_alternative_names_policy);