ui: add URL for static configurations to load a specified file
[petitboot] / lib / pb-protocol / pb-protocol.c
index ab5ea8a376e1500895ba047b3e656e8ac114fd59..9d07a588f92a5a6c3792b67a27ee507fdf2e4d4d 100644 (file)
@@ -260,6 +260,7 @@ static int pb_protocol_interface_config_len(struct interface_config *conf)
        if (conf->method == CONFIG_METHOD_STATIC) {
                len += 4 + optional_strlen(conf->static_config.address);
                len += 4 + optional_strlen(conf->static_config.gateway);
+               len += 4 + optional_strlen(conf->static_config.url);
        }
 
        return len;
@@ -454,6 +455,8 @@ static int pb_protocol_serialise_config_interface(char *buf,
                                conf->static_config.address);
                pos += pb_protocol_serialise_string(pos,
                                conf->static_config.gateway);
+               pos += pb_protocol_serialise_string(pos,
+                               conf->static_config.url);
        }
 
        return pos - buf;
@@ -900,6 +903,9 @@ static int pb_protocol_deserialise_config_interface(const char **buf,
 
                if (read_string(iface, buf, len, &iface->static_config.gateway))
                        return -1;
+
+               if (read_string(iface, buf, len, &iface->static_config.url))
+                       return -1;
        }
 
        return 0;