Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
22e1ca8d
Commit
22e1ca8d
authored
Oct 15, 2013
by
Pietro Fezzardi
Committed by
Alessandro Rubini
Oct 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/cmdline.c: reindent (no technical change)
parent
35d5f56a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
123 additions
and
124 deletions
+123
-124
cmdline.c
lib/cmdline.c
+123
-124
No files found.
lib/cmdline.c
View file @
22e1ca8d
...
...
@@ -105,133 +105,132 @@ int pp_parse_cmdline(struct pp_globals *ppg, int argc, char **argv)
cmd_line_print_help
();
return
-
1
;
}
if
(
1
)
{
/* ARub: I don't want to reindent it all */
switch
(
a
[
1
])
{
case
'V'
:
pp_diag_verbosity
++
;
break
;
case
'd'
:
/* Use the general flags, per-instance TBD */
a
=
argv
[
++
i
];
pp_global_flags
=
pp_diag_parse
(
a
);
break
;
case
'f'
:
pp_config_file
(
ppg
,
1
,
argv
[
++
i
]);
break
;
case
'x'
:
GOPTS
(
ppg
)
->
no_rst_clk
=
1
;
break
;
case
'O'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
max_rst
=
atoi
(
a
);
if
(
GOPTS
(
ppg
)
->
max_rst
>
PP_NSEC_PER_SEC
)
{
pp_printf
(
"Use -x to prevent jumps of"
switch
(
a
[
1
])
{
case
'V'
:
pp_diag_verbosity
++
;
break
;
case
'd'
:
/* Use the general flags, per-instance TBD */
a
=
argv
[
++
i
];
pp_global_flags
=
pp_diag_parse
(
a
);
break
;
case
'f'
:
pp_config_file
(
ppg
,
1
,
argv
[
++
i
]);
break
;
case
'x'
:
GOPTS
(
ppg
)
->
no_rst_clk
=
1
;
break
;
case
'O'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
max_rst
=
atoi
(
a
);
if
(
GOPTS
(
ppg
)
->
max_rst
>
PP_NSEC_PER_SEC
)
{
pp_printf
(
"Use -x to prevent jumps of"
" more than one second
\n
"
);
return
-
1
;
}
break
;
case
'M'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
max_dly
=
atoi
(
a
);
if
(
GOPTS
(
ppg
)
->
max_dly
>
PP_NSEC_PER_SEC
)
{
pp_printf
(
"Use -x to prevent jumps of"
" more than one second
\n
"
);
return
-
1
;
}
break
;
case
'M'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
max_dly
=
atoi
(
a
);
if
(
GOPTS
(
ppg
)
->
max_dly
>
PP_NSEC_PER_SEC
)
{
pp_printf
(
"Use -x to prevent jumps of"
" more than one second
\n
"
);
return
-
1
;
}
break
;
case
't'
:
GOPTS
(
ppg
)
->
no_adjust
=
1
;
break
;
case
'a'
:
a
=
argv
[
++
i
];
cmd_line_parse_two
(
a
,
&
n1
,
&
n2
);
/* no negative or zero attenuation */
if
(
n1
<
1
||
n2
<
1
)
return
-
1
;
GOPTS
(
ppg
)
->
ap
=
n1
;
GOPTS
(
ppg
)
->
ai
=
n2
;
break
;
case
'w'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
s
=
atoi
(
a
);
break
;
case
'b'
:
a
=
argv
[
++
i
];
if
(
ppg
->
nlinks
==
1
)
ppg
->
pp_instances
[
0
].
iface_name
=
a
;
else
{
/* If ppsi.conf exists and more than one link is
* configured, it makes no sense trying to set an iface
* name */
pp_printf
(
"Can not use -b option in multi-link conf"
);
return
-
1
;
}
break
;
case
'l'
:
a
=
argv
[
++
i
];
cmd_line_parse_two
(
a
,
&
n1
,
&
n2
);
GOPTS
(
ppg
)
->
inbound_latency
.
nanoseconds
=
n1
;
GOPTS
(
ppg
)
->
outbound_latency
.
nanoseconds
=
n2
;
break
;
case
'i'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
domain_number
=
atoi
(
a
);
break
;
case
'y'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
sync_intvl
=
atoi
(
a
);
break
;
case
'n'
:
a
=
argv
[
++
i
];
/* Page 237 says 0 to 4 (1s .. 16s) */
GOPTS
(
ppg
)
->
announce_intvl
=
atoi
(
a
);
if
(
GOPTS
(
ppg
)
->
announce_intvl
<
0
)
GOPTS
(
ppg
)
->
announce_intvl
=
0
;
if
(
GOPTS
(
ppg
)
->
announce_intvl
>
4
)
GOPTS
(
ppg
)
->
announce_intvl
=
4
;
break
;
case
'g'
:
/* Apply -g option globally, to each configured link */
for
(
j
=
0
;
j
<
ppg
->
nlinks
;
j
++
)
ppg
->
pp_instances
[
j
].
slave_only
=
1
;
break
;
case
'v'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
clock_quality
.
offsetScaledLogVariance
=
atoi
(
a
);
break
;
case
'r'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
clock_quality
.
clockAccuracy
=
atoi
(
a
);
break
;
case
's'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
clock_quality
.
clockClass
=
atoi
(
a
);
break
;
case
'p'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
prio1
=
atoi
(
a
);
break
;
case
'q'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
prio2
=
atoi
(
a
);
break
;
case
'h'
:
/* ignored: was "GOPTS(ppg)->e2e_mode = 1;" */
break
;
case
'e'
:
/* Apply -e option globally, to each configured link */
for
(
j
=
0
;
j
<
ppg
->
nlinks
;
j
++
)
ppg
->
pp_instances
[
j
].
ethernet_mode
=
1
;
break
;
case
'G'
:
/* gptp_mode not supported: fall through */
default:
cmd_line_print_help
();
return
-
1
;
}
break
;
case
't'
:
GOPTS
(
ppg
)
->
no_adjust
=
1
;
break
;
case
'a'
:
a
=
argv
[
++
i
];
cmd_line_parse_two
(
a
,
&
n1
,
&
n2
);
/* no negative or zero attenuation */
if
(
n1
<
1
||
n2
<
1
)
return
-
1
;
GOPTS
(
ppg
)
->
ap
=
n1
;
GOPTS
(
ppg
)
->
ai
=
n2
;
break
;
case
'w'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
s
=
atoi
(
a
);
break
;
case
'b'
:
a
=
argv
[
++
i
];
if
(
ppg
->
nlinks
==
1
)
ppg
->
pp_instances
[
0
].
iface_name
=
a
;
else
{
/* If ppsi.conf exists and more than one link is
* configured, it makes no sense trying to set an iface
* name */
pp_printf
(
"Can not use -b option in multi-link conf"
);
return
-
1
;
}
break
;
case
'l'
:
a
=
argv
[
++
i
];
cmd_line_parse_two
(
a
,
&
n1
,
&
n2
);
GOPTS
(
ppg
)
->
inbound_latency
.
nanoseconds
=
n1
;
GOPTS
(
ppg
)
->
outbound_latency
.
nanoseconds
=
n2
;
break
;
case
'i'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
domain_number
=
atoi
(
a
);
break
;
case
'y'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
sync_intvl
=
atoi
(
a
);
break
;
case
'n'
:
a
=
argv
[
++
i
];
/* Page 237 says 0 to 4 (1s .. 16s) */
GOPTS
(
ppg
)
->
announce_intvl
=
atoi
(
a
);
if
(
GOPTS
(
ppg
)
->
announce_intvl
<
0
)
GOPTS
(
ppg
)
->
announce_intvl
=
0
;
if
(
GOPTS
(
ppg
)
->
announce_intvl
>
4
)
GOPTS
(
ppg
)
->
announce_intvl
=
4
;
break
;
case
'g'
:
/* Apply -g option globally, to each configured link */
for
(
j
=
0
;
j
<
ppg
->
nlinks
;
j
++
)
ppg
->
pp_instances
[
j
].
slave_only
=
1
;
break
;
case
'v'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
clock_quality
.
offsetScaledLogVariance
=
atoi
(
a
);
break
;
case
'r'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
clock_quality
.
clockAccuracy
=
atoi
(
a
);
break
;
case
's'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
clock_quality
.
clockClass
=
atoi
(
a
);
break
;
case
'p'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
prio1
=
atoi
(
a
);
break
;
case
'q'
:
a
=
argv
[
++
i
];
GOPTS
(
ppg
)
->
prio2
=
atoi
(
a
);
break
;
case
'h'
:
/* ignored: was "GOPTS(ppg)->e2e_mode = 1;" */
break
;
case
'e'
:
/* Apply -e option globally, to each configured link */
for
(
j
=
0
;
j
<
ppg
->
nlinks
;
j
++
)
ppg
->
pp_instances
[
j
].
ethernet_mode
=
1
;
break
;
case
'G'
:
/* gptp_mode not supported: fall through */
default:
cmd_line_print_help
();
return
-
1
;
}
}
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment