Commit d1f43bb1 authored by Alessandro Rubini's avatar Alessandro Rubini

config: new config parser, to simplify further additions

This is a rewrite of the configuration parser, more based on data
structures se we'll soon be able to read more than one configuration
file (to add special cases while developing) and protocol extensions
will be able to extend the table of allowed options.

Both the configuration file format and the layout of the code calling
lib/conf.c::pp_config_file() is unchanged in this commit. This means
that even if you enable config diagnostics on the command line it
won't have effect, because the config file is parsed before the
command line. This is fixed by a later commit.

The only visible change in this commit is that "port" is allowed as a
synonim for "link", to be deprecated soon (but it will not be removed
from the parsing of the config file). Thus, pp_instance->link_name is
renamed to port_name.

The compiled size of this commit is the same as the previous one.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent f44d4a0a
......@@ -14,6 +14,7 @@ static char *thing_name[] = {
[pp_dt_servo] = "diag-servo",
[pp_dt_bmc] = "diag-bmc",
[pp_dt_ext] = "diag-extension",
[pp_dt_config] = "diag-config",
};
......
......@@ -113,7 +113,7 @@ struct pp_net_path {
* (see lib/conf.c)
*/
struct pp_instance_cfg {
char link_name[16];
char port_name[16];
char iface_name[16];
int proto; /* 0: raw, 1: udp */
int role; /* 0: auto, 1: master, 2: slave */
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment