Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
efa7397b
Commit
efa7397b
authored
Jun 09, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up code
parent
4ca02206
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
14 deletions
+3
-14
packet-exchange/src/send_packet.c
packet-exchange/src/send_packet.c
+1
-13
packet-exchange/src/server.c
packet-exchange/src/server.c
+2
-1
No files found.
packet-exchange/src/send_packet.c
View file @
efa7397b
...
@@ -37,8 +37,6 @@
...
@@ -37,8 +37,6 @@
#include "send_packet.h"
#include "send_packet.h"
#include "utilities.h"
#include "utilities.h"
#define MESSAGE ((uint32_t)0x00FACADE)
static
void
process_timestamps
(
packet_info_t
*
packet_info
,
int64_t
histograms
[
NB_HISTOGRAMS
][
MAX_HIST_VAL
]);
static
void
process_timestamps
(
packet_info_t
*
packet_info
,
int64_t
histograms
[
NB_HISTOGRAMS
][
MAX_HIST_VAL
]);
static
void
init_tx_buffer
(
size_t
_tx_buffer_len
);
static
void
init_tx_buffer
(
size_t
_tx_buffer_len
);
...
@@ -126,17 +124,6 @@ void init_udp_send(int use_etf, int use_timestamps, int packet_priority,
...
@@ -126,17 +124,6 @@ void init_udp_send(int use_etf, int use_timestamps, int packet_priority,
}
}
}
}
uint64_t
get_txtime
()
{
struct
timespec
txtime_ts
;
uint64_t
txtime
;
clock_gettime
(
CLOCK_TAI
,
&
txtime_ts
);
txtime
=
txtime_ts
.
tv_sec
*
NSEC_PER_SEC
+
txtime_ts
.
tv_nsec
;
txtime
+=
NSEC_PER_SEC
;
return
txtime
;
}
/*
/*
* Sends udp packets
* Sends udp packets
*/
*/
...
@@ -145,6 +132,7 @@ packet_info_t send_udp_packet(int use_etf, int use_timestamps,
...
@@ -145,6 +132,7 @@ packet_info_t send_udp_packet(int use_etf, int use_timestamps,
uint64_t
txtime
,
uint64_t
txtime
,
const
char
*
server_ip
,
const
char
*
server_ip
,
int64_t
histograms
[
NB_HISTOGRAMS
][
MAX_HIST_VAL
])
{
int64_t
histograms
[
NB_HISTOGRAMS
][
MAX_HIST_VAL
])
{
struct
msghdr
msg
;
// Message hardware, sent to the socket
struct
msghdr
msg
;
// Message hardware, sent to the socket
struct
cmsghdr
*
cmsg
;
// Control message hardware, for txtime
struct
cmsghdr
*
cmsg
;
// Control message hardware, for txtime
char
control
[
CMSG_SPACE
(
sizeof
(
txtime
))]
=
{};
// Stores txtime
char
control
[
CMSG_SPACE
(
sizeof
(
txtime
))]
=
{};
// Stores txtime
...
...
packet-exchange/src/server.c
View file @
efa7397b
...
@@ -217,9 +217,10 @@ int main(int argc, char *argv[]) {
...
@@ -217,9 +217,10 @@ int main(int argc, char *argv[]) {
if
(
tsn_task
==
RECV_PACKET_TASK
)
{
if
(
tsn_task
==
RECV_PACKET_TASK
)
{
diff
=
((
int64_t
)
stats
->
max_interval
)
-
stats
->
min_interval
;
diff
=
((
int64_t
)
stats
->
max_interval
)
-
stats
->
min_interval
;
printf
(
"(%d) Jitter : %"
PRIi64
" [Packet data: %s]
\n
"
,
printf
(
"(%d) Jitter : %"
PRIi64
" [Packet data: %s
(%x)
]
\n
"
,
stats
->
packets_received
,
stats
->
packets_received
,
diff
,
diff
,
stats
->
packet_info
.
data
,
stats
->
packet_info
.
data
);
stats
->
packet_info
.
data
);
if
(
enable_timestamps
)
{
if
(
enable_timestamps
)
{
...
...
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