Commit 2f92a669 authored by Aurelio Colosimo's avatar Aurelio Colosimo

pp_open_globals: removed rt_opts parameter

rt_opts parameter was always passed as NULL. With this patch, users who do not
want default rt_opts provided by proto-standard need to set their rt_opts
explicitly.
Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent 01eff47c
...@@ -115,7 +115,7 @@ int main(int argc, char **argv) ...@@ -115,7 +115,7 @@ int main(int argc, char **argv)
exit(__LINE__); exit(__LINE__);
} }
pp_open_globals(ppg, NULL); pp_open_globals(ppg);
if (pp_parse_cmdline(ppg, argc, argv) != 0) if (pp_parse_cmdline(ppg, argc, argv) != 0)
return -1; return -1;
......
...@@ -146,7 +146,7 @@ int wrc_ptp_start() ...@@ -146,7 +146,7 @@ int wrc_ptp_start()
{ {
struct pp_instance *ppi = &ppi_static; struct pp_instance *ppi = &ppi_static;
pp_open_globals(&ppg_static, 0 /* no opts */); pp_open_globals(&ppg_static);
/* Call the state machine. Being it in "Initializing" state, make /* Call the state machine. Being it in "Initializing" state, make
* ppsi initialize what is necessary */ * ppsi initialize what is necessary */
......
...@@ -228,8 +228,7 @@ static inline void pp_timeout_restart_annrec(struct pp_instance *ppi) ...@@ -228,8 +228,7 @@ static inline void pp_timeout_restart_annrec(struct pp_instance *ppi)
/* The channel for an instance must be created and possibly destroyed. */ /* The channel for an instance must be created and possibly destroyed. */
extern int pp_open_globals(struct pp_globals *ppg, extern int pp_open_globals(struct pp_globals *ppg);
struct pp_runtime_opts *rt_opts);
extern int pp_close_globals(struct pp_globals *ppg); extern int pp_close_globals(struct pp_globals *ppg);
......
...@@ -53,7 +53,7 @@ int ppsi_main(int argc, char **argv) ...@@ -53,7 +53,7 @@ int ppsi_main(int argc, char **argv)
ppi->iface_name = "eth0"; ppi->iface_name = "eth0";
/* This just llocates the stuff */ /* This just llocates the stuff */
pp_open_globals(ppg, NULL); pp_open_globals(ppg);
if (pp_parse_cmdline(ppg, argc, argv) != 0) if (pp_parse_cmdline(ppg, argc, argv) != 0)
return -1; return -1;
......
...@@ -34,7 +34,7 @@ struct pp_runtime_opts default_rt_opts = { ...@@ -34,7 +34,7 @@ struct pp_runtime_opts default_rt_opts = {
.ttl = PP_DEFAULT_TTL, .ttl = PP_DEFAULT_TTL,
}; };
int pp_open_globals(struct pp_globals *ppg, struct pp_runtime_opts *_rt_opts) int pp_open_globals(struct pp_globals *ppg)
{ {
/* /*
* Initialize default data set * Initialize default data set
...@@ -45,12 +45,10 @@ int pp_open_globals(struct pp_globals *ppg, struct pp_runtime_opts *_rt_opts) ...@@ -45,12 +45,10 @@ int pp_open_globals(struct pp_globals *ppg, struct pp_runtime_opts *_rt_opts)
def->numberPorts = ppg->nlinks; def->numberPorts = ppg->nlinks;
struct pp_runtime_opts *rt_opts; struct pp_runtime_opts *rt_opts;
if (_rt_opts) if (!ppg->rt_opts)
rt_opts = _rt_opts; ppg->rt_opts = &default_rt_opts;
else
rt_opts = &default_rt_opts;
ppg->rt_opts = rt_opts; rt_opts = ppg->rt_opts;
memcpy(&def->clockQuality, &rt_opts->clock_quality, memcpy(&def->clockQuality, &rt_opts->clock_quality,
sizeof(ClockQuality)); sizeof(ClockQuality));
......
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