Commit e205d595 authored by Davide Ciminaghi's avatar Davide Ciminaghi Committed by Alessandro Rubini

lib/conf.c: use macros for declaring pp_global_arglines table

Signed-off-by: Davide Ciminaghi's avatarDavide Ciminaghi <ciminaghi@gnudd.com>
parent 430232ac
......@@ -230,90 +230,26 @@ static struct pp_argname arg_ext[] = {
};
static struct pp_argline pp_global_arglines[] = {
{ f_port, "port", ARG_STR},
{ f_port, "link", ARG_STR}, /* old name for "port" */
{ f_if, "iface", ARG_STR},
{
.f = f_simple_int,
.keyword = "proto",
.t = ARG_NAMES,
.args = arg_proto,
.field_offset = offsetof(struct pp_instance, proto),
.needs_port = 1
},
{
.f = f_simple_int,
.keyword = "role",
.t = ARG_NAMES,
.args = arg_role,
.field_offset = offsetof(struct pp_instance, role),
.needs_port = 1,
},
{
.f = f_simple_int,
.keyword = "extension",
.t = ARG_NAMES,
.args = arg_ext,
.field_offset = offsetof(struct pp_instance, cfg.ext),
.needs_port = 1,
},
{ f_vlan, "vlan", ARG_STR},
{ f_diag, "diagnostics", ARG_STR},
{
.f = f_simple_int,
.keyword = "clock-class",
.t = ARG_INT,
.field_offset = offsetof(struct pp_runtime_opts,
clock_quality.clockClass),
.needs_port = 0,
},
{
.f = f_simple_int,
.keyword = "clock-accuracy",
.t = ARG_INT,
.field_offset = offsetof(struct pp_runtime_opts,
clock_quality.clockAccuracy),
.needs_port = 0,
},
{
.f = f_simple_int,
.keyword = "clock-allen-variance",
.t = ARG_INT,
.field_offset = offsetof(struct pp_runtime_opts,
clock_quality.offsetScaledLogVariance),
.needs_port = 0,
},
{ f_servo_pi, "servo-pi", ARG_INT2},
{ f_latency, "latency", ARG_INT2},
{
.f = f_simple_int,
.keyword = "domain-number",
.t = ARG_INT,
.field_offset = offsetof(struct pp_runtime_opts, domain_number),
.needs_port = 0,
},
{ f_announce_intvl, "announce-interval", ARG_INT},
{
.f = f_simple_int,
.keyword = "sync-interval",
.t = ARG_INT,
.field_offset = offsetof(struct pp_runtime_opts, sync_intvl),
.needs_port = 0,
},
{
.f = f_simple_int,
.keyword = "priority1",
.t = ARG_INT,
.field_offset = offsetof(struct pp_runtime_opts, prio1),
.needs_port = 0,
},
{
.f = f_simple_int,
.keyword = "priority2",
.t = ARG_INT,
.field_offset = offsetof(struct pp_runtime_opts, prio2),
.needs_port = 0,
},
LEGACY_OPTION(f_port, "port", ARG_STR),
LEGACY_OPTION(f_port, "link", ARG_STR), /* Old name for port */
LEGACY_OPTION(f_if, "iface", ARG_STR),
INST_OPTION_INT("proto", ARG_NAMES, arg_proto, proto),
INST_OPTION_INT("role", ARG_NAMES, arg_role, role),
INST_OPTION_INT("extension", ARG_NAMES, arg_ext, cfg.ext),
LEGACY_OPTION(f_vlan, "vlan", ARG_STR),
LEGACY_OPTION(f_diag, "diagnostic", ARG_STR),
RT_OPTION_INT("clock-class", ARG_INT, NULL, clock_quality.clockClass),
RT_OPTION_INT("clock-accuracy", ARG_INT, NULL,
clock_quality.clockAccuracy),
RT_OPTION_INT("clock-allen-variance", ARG_INT, NULL,
clock_quality.offsetScaledLogVariance),
LEGACY_OPTION(f_servo_pi, "servo-pi", ARG_INT2),
LEGACY_OPTION(f_latency, "latency", ARG_INT2),
RT_OPTION_INT("domain-number", ARG_INT, NULL, domain_number),
LEGACY_OPTION(f_announce_intvl, "announce-interval", ARG_INT),
RT_OPTION_INT("sync-interval", ARG_INT, NULL, sync_intvl),
RT_OPTION_INT("priority1", ARG_INT, NULL, prio1),
RT_OPTION_INT("priority2", ARG_INT, NULL, prio2),
{}
};
......
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