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
82b6eedd
Commit
82b6eedd
authored
May 26, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up the code
parent
97d2b26f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
packet-exchange/src/send_packet.c
packet-exchange/src/send_packet.c
+11
-8
No files found.
packet-exchange/src/send_packet.c
View file @
82b6eedd
...
...
@@ -43,7 +43,7 @@
static
int
process_socket_error_queue
();
static
void
print_timestamps
(
struct
msghdr
*
msg
);
static
void
process_timestamps
(
int
recvmsg_flags
);
static
void
process_timestamps
();
static
int
so_priority
=
3
;
static
struct
sock_txtime
sk_txtime
;
...
...
@@ -170,15 +170,14 @@ void send_udp_packet(int use_etf, int use_timestamps, uint64_t txtime,
FD_SET
(
fd
,
&
readfs
);
res
=
select
(
fd
+
1
,
&
readfs
,
0
,
NULL
,
NULL
);
printf
(
"select returned: %d, %s
\n
"
,
res
,
res
<
0
?
strerror
(
errno
)
:
"success"
);
if
(
res
>
0
)
{
if
(
FD_ISSET
(
fd
,
&
readfs
))
printf
(
"ready for reading
\n
"
);
process_timestamps
(
MSG_ERRQUEUE
);
}
if
(
res
>
0
)
process_timestamps
();
else
fprintf
(
stderr
,
"select failed
\n
"
);
}
}
static
void
process_timestamps
(
int
recvmsg_flags
)
{
static
void
process_timestamps
()
{
char
data
[
256
];
struct
msghdr
msg
;
struct
iovec
entry
;
...
...
@@ -199,7 +198,7 @@ static void process_timestamps(int recvmsg_flags) {
msg
.
msg_control
=
&
control
;
msg
.
msg_controllen
=
sizeof
(
control
);
if
(
recvmsg
(
fd
,
&
msg
,
recvmsg_flags
|
MSG_DONTWAIT
)
==
-
1
)
{
if
(
recvmsg
(
fd
,
&
msg
,
MSG_ERRQUEUE
|
MSG_DONTWAIT
)
==
-
1
)
{
fprintf
(
stderr
,
"recvmsg failed
\n
"
);
}
else
{
...
...
@@ -222,12 +221,16 @@ static void print_timestamps(struct msghdr *msg) {
break
;
}
default:
#ifdef DEBUG
printf
(
"type %d"
,
cmsg
->
cmsg_type
);
#endif
break
;
}
break
;
default:
#ifdef DEBUG
printf
(
"level %d type %d"
,
cmsg
->
cmsg_level
,
cmsg
->
cmsg_type
);
#endif
break
;
}
printf
(
"
\n
"
);
...
...
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