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
b6c53e91
Commit
b6c53e91
authored
Feb 27, 2017
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch "adam-makefile"
Another try to fix makefile Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parents
ac9a913c
b9408acd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
20 deletions
+28
-20
conf.c
lib/conf.c
+8
-9
unix-socket.c
time-unix/unix-socket.c
+17
-10
wrs-socket.c
time-wrs/wrs-socket.c
+2
-0
wrs-time.c
time-wrs/wrs-time.c
+1
-1
No files found.
lib/conf.c
View file @
b6c53e91
...
...
@@ -221,7 +221,7 @@ static struct pp_argname arg_mech[] = {
{
"request-response"
,
PP_E2E_MECH
},
{
"delay"
,
PP_E2E_MECH
},
{
"e2e"
,
PP_E2E_MECH
},
#ifdef CONFIG_P2P
#ifdef CONFIG_
HAS_
P2P
{
"peer-delay"
,
PP_P2P_MECH
},
{
"pdelay"
,
PP_P2P_MECH
},
{
"p2p"
,
PP_P2P_MECH
},
...
...
@@ -411,16 +411,15 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
case
ARG_INT
:
if
(
sscanf
(
line
,
"%i"
,
&
(
cfg_arg
.
i
))
!=
1
)
{
pp_diag
(
NULL
,
config
,
1
,
"line %i:
\"
%s
\"
: not int
\n
"
,
lineno
,
word
);
pp_error
(
"line %i:
\"
%s
\"
: not int
\n
"
,
lineno
,
word
);
return
-
1
;
}
break
;
case
ARG_INT2
:
if
(
sscanf
(
line
,
"%i,%i"
,
cfg_arg
.
i2
,
&
cfg_arg
.
i2
[
1
])
<
0
)
{
pp_
diag
(
NULL
,
config
,
1
,
"line %i: wrong arg
\"
%s
\"
"
" for
\"
%s
\"\n
"
,
lineno
,
line
,
word
);
pp_
error
(
"line %i: wrong arg
\"
%s
\"
for
\"
%s
\"\n
"
,
lineno
,
line
,
word
);
return
-
1
;
}
break
;
...
...
@@ -437,8 +436,8 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
if
(
!
strcmp
(
line
,
n
->
name
))
break
;
if
(
!
n
->
name
)
{
pp_
diag
(
NULL
,
config
,
1
,
"line %i: wrong arg
\"
%s
\"
"
" for
\"
%s
\"\n
"
,
lineno
,
line
,
word
);
pp_
error
(
"line %i: wrong arg
\"
%s
\"
for
\"
%s
\"\n
"
,
lineno
,
line
,
word
);
return
-
1
;
}
cfg_arg
.
i
=
n
->
value
;
...
...
@@ -446,8 +445,8 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
case
ARG_TIME
:
if
(
parse_time
(
&
cfg_arg
.
ts
,
line
))
{
pp_
diag
(
NULL
,
config
,
1
,
"line %i: wrong arg
\"
%s
\"
for "
"
\"
%s
\"\n
"
,
lineno
,
line
,
word
);
pp_
error
(
"line %i: wrong arg
\"
%s
\"
for
\"
%s
\"\n
"
,
lineno
,
line
,
word
);
return
-
1
;
}
break
;
...
...
time-unix/unix-socket.c
View file @
b6c53e91
...
...
@@ -120,8 +120,8 @@ static int unix_recv_msg(struct pp_instance *ppi, int fd, void *pkt, int len,
}
/* This is not really hw... */
pp_diag
(
ppi
,
time
,
2
,
"recv stamp: %
i.%09i (%s)
\n
"
,
(
int
)
t
->
secs
,
(
int
)(
t
->
scaled_nsecs
>>
16
),
pp_diag
(
ppi
,
time
,
1
,
"recv stamp: %ll
i.%09i (%s)
\n
"
,
(
long
long
)
t
->
secs
,
(
int
)(
t
->
scaled_nsecs
>>
16
),
tv
?
"kernel"
:
"user"
);
return
ret
;
}
...
...
@@ -198,8 +198,7 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
/* To fake a network frame loss, set the timestamp and do not send */
if
(
ppsi_drop_tx
())
{
if
(
t
)
ppi
->
t_ops
->
get
(
ppi
,
t
);
ppi
->
t_ops
->
get
(
ppi
,
t
);
pp_diag
(
ppi
,
frames
,
1
,
"Drop sent frame
\n
"
);
return
len
;
}
...
...
@@ -213,8 +212,7 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
memcpy
(
hdr
->
h_dest
,
macaddr
[
is_pdelay
],
ETH_ALEN
);
memcpy
(
hdr
->
h_source
,
ch
->
addr
,
ETH_ALEN
);
if
(
t
)
ppi
->
t_ops
->
get
(
ppi
,
t
);
ppi
->
t_ops
->
get
(
ppi
,
t
);
ret
=
send
(
ch
->
fd
,
hdr
,
len
,
0
);
if
(
ret
<
0
)
{
...
...
@@ -222,6 +220,9 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
strerror
(
errno
));
return
ret
;
}
pp_diag
(
ppi
,
time
,
1
,
"send stamp: %lli.%09i (%s)
\n
"
,
(
long
long
)
t
->
secs
,
(
int
)(
t
->
scaled_nsecs
>>
16
),
"user"
);
if
(
pp_diag_allow
(
ppi
,
frames
,
2
))
dump_1588pkt
(
"send: "
,
pkt
,
len
,
t
,
-
1
);
return
ret
;
...
...
@@ -236,8 +237,7 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
memcpy
(
hdr
->
h_dest
,
macaddr
[
is_pdelay
],
ETH_ALEN
);
memcpy
(
vhdr
->
h_source
,
ch
->
addr
,
ETH_ALEN
);
if
(
t
)
ppi
->
t_ops
->
get
(
ppi
,
t
);
ppi
->
t_ops
->
get
(
ppi
,
t
);
ret
=
send
(
ch
->
fd
,
vhdr
,
len
,
0
);
if
(
ret
<
0
)
{
...
...
@@ -245,6 +245,9 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
strerror
(
errno
));
return
ret
;
}
pp_diag
(
ppi
,
time
,
1
,
"send stamp: %lli.%09i (%s)
\n
"
,
(
long
long
)
t
->
secs
,
(
int
)(
t
->
scaled_nsecs
>>
16
),
"user"
);
if
(
pp_diag_allow
(
ppi
,
frames
,
2
))
dump_1588pkt
(
"send: "
,
vhdr
,
len
,
t
,
ppi
->
peer_vid
);
...
...
@@ -253,8 +256,7 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
addr
.
sin_port
=
htons
(
udpport
[
chtype
]);
addr
.
sin_addr
.
s_addr
=
ppi
->
mcast_addr
[
is_pdelay
];
if
(
t
)
ppi
->
t_ops
->
get
(
ppi
,
t
);
ppi
->
t_ops
->
get
(
ppi
,
t
);
ret
=
sendto
(
ppi
->
ch
[
chtype
].
fd
,
pkt
,
len
,
0
,
(
struct
sockaddr
*
)
&
addr
,
...
...
@@ -264,6 +266,11 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
strerror
(
errno
));
return
ret
;
}
pp_diag
(
ppi
,
time
,
1
,
"send stamp: %lli.%09i (%s)
\n
"
,
(
long
long
)
t
->
secs
,
(
int
)(
t
->
scaled_nsecs
>>
16
),
"user"
);
if
(
pp_diag_allow
(
ppi
,
frames
,
2
))
dump_payloadpkt
(
"send: "
,
pkt
,
len
,
t
);
return
ret
;
default:
...
...
time-wrs/wrs-socket.c
View file @
b6c53e91
...
...
@@ -246,6 +246,8 @@ static int wrs_recv_msg(struct pp_instance *ppi, int fd, void *pkt, int len,
}
else
{
mark_incorrect
(
t
);
}
}
else
{
mark_incorrect
(
t
);
}
drop:
...
...
time-wrs/wrs-time.c
View file @
b6c53e91
...
...
@@ -183,7 +183,7 @@ static int wrdate_get(struct pp_time *t)
}
while
((
tmp1
!=
taih
)
||
(
tmp2
!=
tail
));
t
->
secs
=
tail
|
((
uint64_t
)
taih
<<
32
);
t
->
scaled_nsecs
=
nsec
<<
16
;
t
->
scaled_nsecs
=
(
int64_t
)
nsec
<<
16
;
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