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
7b8e5296
Commit
7b8e5296
authored
May 25, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the original udp_send function, not used anymore
parent
895a12fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
53 deletions
+0
-53
packet-exchange/src/send_packet.c
packet-exchange/src/send_packet.c
+0
-52
packet-exchange/src/send_packet.h
packet-exchange/src/send_packet.h
+0
-1
No files found.
packet-exchange/src/send_packet.c
View file @
7b8e5296
...
@@ -41,58 +41,6 @@
...
@@ -41,58 +41,6 @@
#define MESSAGE ((uint32_t)0x00FACADE)
#define MESSAGE ((uint32_t)0x00FACADE)
#define NSEC_PER_SEC 1000000000
#define NSEC_PER_SEC 1000000000
int
send_udp_packet
(
const
char
*
server_ip
)
{
int
status
;
int
sockfd
;
struct
addrinfo
hints
,
*
servinfo
,
*
servinfo_it
;
char
msg
[
1024
]
=
"hello"
;
int
bytes_sent
=
0
;
int
msg_len
=
strlen
(
msg
);
memset
(
&
hints
,
0
,
sizeof
hints
);
hints
.
ai_family
=
AF_UNSPEC
;
hints
.
ai_socktype
=
SOCK_DGRAM
;
status
=
getaddrinfo
(
server_ip
,
SERVER_PORT
,
&
hints
,
&
servinfo
);
if
(
status
!=
0
)
{
fprintf
(
stderr
,
"getaddrinfo: %s
\n
"
,
gai_strerror
(
status
));
return
1
;
}
for
(
servinfo_it
=
servinfo
;
servinfo_it
!=
NULL
;
servinfo_it
=
servinfo_it
->
ai_next
)
{
sockfd
=
socket
(
servinfo
->
ai_family
,
servinfo
->
ai_socktype
,
servinfo
->
ai_protocol
);
if
(
sockfd
==
-
1
)
continue
;
break
;
}
if
(
servinfo_it
==
NULL
)
{
fprintf
(
stderr
,
"Failed to create socket
\n
"
);
return
2
;
}
while
(
bytes_sent
<
msg_len
)
{
bytes_sent
+=
sendto
(
sockfd
,
msg
+
bytes_sent
,
strlen
(
msg
),
0
,
servinfo
->
ai_addr
,
servinfo
->
ai_addrlen
);
}
freeaddrinfo
(
servinfo
);
#ifdef DEBUG_ENABLED
printf
(
"Sent %d bytes to %s
\n
"
,
bytes_sent
,
server_ip
);
#endif
close
(
sockfd
);
return
0
;
}
/*
* ETF qdisc section
*/
static
int
process_socket_error_queue
(
int
fd
);
static
int
process_socket_error_queue
(
int
fd
);
static
int
so_priority
=
3
;
static
int
so_priority
=
3
;
...
...
packet-exchange/src/send_packet.h
View file @
7b8e5296
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#include <stdint.h>
#include <stdint.h>
int
send_udp_packet
(
const
char
*
ip4
);
void
init_udp_etf
(
int
use_etf
,
int
so_priority
,
char
*
network_if
);
void
init_udp_etf
(
int
use_etf
,
int
so_priority
,
char
*
network_if
);
void
send_udp_packet_etf
(
int
use_etf
,
uint64_t
txtime
,
const
char
*
server_ip
);
void
send_udp_packet_etf
(
int
use_etf
,
uint64_t
txtime
,
const
char
*
server_ip
);
...
...
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