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
6315d6b5
Commit
6315d6b5
authored
May 18, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set enable_etf to 0 as default
parent
ec8f58e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
packet-exchange/src/client.c
packet-exchange/src/client.c
+1
-0
packet-exchange/src/send_packet.c
packet-exchange/src/send_packet.c
+8
-6
No files found.
packet-exchange/src/client.c
View file @
6315d6b5
...
@@ -113,6 +113,7 @@ int main(int argc, char *argv[]) {
...
@@ -113,6 +113,7 @@ int main(int argc, char *argv[]) {
param
.
max_cycles
=
0
;
param
.
max_cycles
=
0
;
param
.
priority
=
99
;
param
.
priority
=
99
;
param
.
enable_affinity
=
0
;
param
.
enable_affinity
=
0
;
param
.
enable_etf
=
0
;
main_param
.
refresh_rate
=
50000
;
main_param
.
refresh_rate
=
50000
;
...
...
packet-exchange/src/send_packet.c
View file @
6315d6b5
...
@@ -94,12 +94,12 @@ int send_udp_packet(const char *server_ip) {
...
@@ -94,12 +94,12 @@ int send_udp_packet(const char *server_ip) {
static
int
so_priority
=
3
;
static
int
so_priority
=
3
;
static
struct
sock_txtime
sk_txtime
;
static
struct
sock_txtime
sk_txtime
;
static
u
int32_t
tx_buffer
=
MESSAGE
;
static
u
nsigned
char
tx_buffer
[
1024
]
=
"Hi"
;
static
uint32_t
tx_buffer_len
=
sizeof
(
MESSAGE
);
static
size_t
tx_buffer_len
=
sizeof
(
tx_buffer
);
static
int
fd
;
static
int
fd
;
// Sets the interface
// Sets the interface
static
int
set_if
(
char
*
network_if
)
{
static
int
set_if
(
char
*
network_if
)
{
struct
ifreq
ifreq
;
struct
ifreq
ifreq
;
memset
(
&
ifreq
,
0
,
sizeof
(
ifreq
));
memset
(
&
ifreq
,
0
,
sizeof
(
ifreq
));
...
@@ -114,7 +114,7 @@ static int set_if(char * network_if) {
...
@@ -114,7 +114,7 @@ static int set_if(char * network_if) {
/*
/*
* Init UDP socket
* Init UDP socket
*/
*/
void
init_udp_etf
(
int
use_etf
,
char
*
network_if
)
{
void
init_udp_etf
(
int
use_etf
,
char
*
network_if
)
{
int
index
;
int
index
;
fd
=
socket
(
PF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
);
fd
=
socket
(
PF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
);
...
@@ -127,7 +127,8 @@ void init_udp_etf(int use_etf, char * network_if) {
...
@@ -127,7 +127,8 @@ void init_udp_etf(int use_etf, char * network_if) {
sizeof
(
so_priority
)))
sizeof
(
so_priority
)))
error
(
EXIT_FAILURE
,
errno
,
"Couldn't set socket priority
\n
"
);
error
(
EXIT_FAILURE
,
errno
,
"Couldn't set socket priority
\n
"
);
if
(
setsockopt
(
fd
,
SOL_SOCKET
,
SO_BINDTODEVICE
,
network_if
,
strlen
(
network_if
)))
if
(
setsockopt
(
fd
,
SOL_SOCKET
,
SO_BINDTODEVICE
,
network_if
,
strlen
(
network_if
)))
error
(
EXIT_FAILURE
,
errno
,
"setsockopt SO_BINDTODEVICE failed
\n
"
);
error
(
EXIT_FAILURE
,
errno
,
"setsockopt SO_BINDTODEVICE failed
\n
"
);
if
(
use_etf
)
{
if
(
use_etf
)
{
...
@@ -178,5 +179,6 @@ void send_udp_packet_etf(int use_etf, uint64_t txtime, const char *server_ip) {
...
@@ -178,5 +179,6 @@ void send_udp_packet_etf(int use_etf, uint64_t txtime, const char *server_ip) {
}
}
sendmsgerr
=
sendmsg
(
fd
,
&
msg
,
0
);
sendmsgerr
=
sendmsg
(
fd
,
&
msg
,
0
);
if
(
sendmsgerr
)
error
(
EXIT_FAILURE
,
errno
,
"sendmsg failed, ret value: %d
\n
"
,
sendmsgerr
);
if
(
sendmsgerr
<
0
)
error
(
EXIT_FAILURE
,
errno
,
"sendmsg failed, ret value: %d
\n
"
,
sendmsgerr
);
}
}
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