Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
Software for White Rabbit PTP Core
Commits
654dbbbf
Commit
654dbbbf
authored
Jan 14, 2016
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syslog: report link-up event, and the failure duration
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
ce414c80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
syslog.c
lib/syslog.c
+18
-1
No files found.
lib/syslog.c
View file @
654dbbbf
...
...
@@ -55,7 +55,7 @@ DEFINE_WRC_COMMAND(mac) = {
};
void
syslog_poll
(
int
l_satus
)
void
syslog_poll
(
int
l_s
t
atus
)
{
struct
wr_sockaddr
addr
;
char
buf
[
256
];
...
...
@@ -63,6 +63,7 @@ void syslog_poll(int l_satus)
unsigned
char
mac
[
6
];
unsigned
char
ip
[
4
];
uint64_t
secs
;
static
uint32_t
down_tics
;
int
len
=
0
;
if
(
needIP
)
...
...
@@ -84,6 +85,22 @@ void syslog_poll(int l_satus)
(
tics
-
tics_zero
)
/
1000
);
goto
send
;
}
if
(
l_status
==
LINK_WENT_DOWN
)
down_tics
=
timer_get_tics
();
if
(
l_status
==
LINK_UP
&&
down_tics
)
{
down_tics
=
timer_get_tics
()
-
down_tics
;
shw_pps_gen_get_time
(
&
secs
,
NULL
);
getIP
(
ip
);
len
=
pp_sprintf
(
buf
+
UDP_END
,
/* 8 == user + 6 == info */
"<14> %s %s Link up after %i.%03i s
\n
"
,
format_time
(
secs
,
TIME_FORMAT_SYSLOG
),
format_ip
(
b1
,
ip
),
down_tics
/
1000
,
down_tics
%
1000
);
down_tics
=
0
;
goto
send
;
}
return
;
send:
...
...
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