Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
PRRT
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
26
Issues
26
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LARN
PRRT
Commits
c1f3364f
Commit
c1f3364f
authored
Jun 29, 2018
by
Andreas Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature/congestionControl
parents
4dbc0b92
6e926c56
Pipeline
#2585
failed with stages
in 1 minute and 15 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
31 deletions
+27
-31
prrt/cprrt.pxd
prrt/cprrt.pxd
+0
-3
prrt/proto/processes/dataReceiver.c
prrt/proto/processes/dataReceiver.c
+23
-15
prrt/proto/socket.c
prrt/proto/socket.c
+1
-9
prrt/proto/socket.h
prrt/proto/socket.h
+0
-3
prrt/prrt.pyx
prrt/prrt.pyx
+3
-1
No files found.
prrt/cprrt.pxd
View file @
c1f3364f
...
...
@@ -163,9 +163,6 @@ cdef extern from "proto/socket.h":
bint
PrrtSocket_get_bbr_is_app_limited
(
PrrtSocket
*
socket
)
bint
PrrtSocket_enable_thread_pinning
(
PrrtSocket
*
socket
)
char
*
PrrtSocket_inet_ntoa
(
in_addr
*
)
uint16_t
PrrtSocket_ntohs
(
uint16_t
v
)
cdef
extern
from
"proto/stores/packetDeliveryStore.h"
:
ctypedef
struct
PrrtPacketDeliveryStore
:
pass
...
...
prrt/proto/processes/dataReceiver.c
View file @
c1f3364f
...
...
@@ -271,7 +271,7 @@ void *receive_data_loop(void *ptr) {
struct
sockaddr_in
remote
;
socklen_t
addrlen
=
sizeof
(
remote
);
unsigned
char
buffer
[
MAX_PAYLOAD_LENGTH
];
PrrtSocket
*
s
ock_ptr
=
ptr
;
PrrtSocket
*
s
=
ptr
;
while
(
1
)
{
debug
(
DEBUG_DATARECEIVER
,
"About to receive."
);
...
...
@@ -284,7 +284,11 @@ void *receive_data_loop(void *ptr) {
struct
timespec
packet_recv_timestamp
;
uint64_t
packet_recv_cyclestamp
=
0
;
receive_from_socket
(
sock_ptr
,
buffer
,
&
n
,
&
remote
,
&
addrlen
,
&
packet_recv_timestamp
,
&
packet_recv_cyclestamp
);
receive_from_socket
(
s
,
buffer
,
&
n
,
&
remote
,
&
addrlen
,
&
packet_recv_timestamp
,
&
packet_recv_cyclestamp
);
if
(
!
atomic_load_explicit
(
&
s
->
closing
,
memory_order_acquire
))
{
break
;
}
debug
(
DEBUG_HARDSTAMPING
,
"Packet TS:
\t
%ld.%09ld; Who? %s"
,
(
long
)
packet_recv_timestamp
.
tv_sec
,
packet_recv_timestamp
.
tv_nsec
,
inet_ntoa
(
remote
.
sin_addr
));
XlapTimeStampClock
(
&
tsph1
,
ts_any_packet
,
0
,
LinkReceive
);
...
...
@@ -315,28 +319,28 @@ void *receive_data_loop(void *ptr) {
kind
=
ts_feedback_packet
;
}
if
(
packetType
==
PACKET_TYPE_DATA
||
packetType
==
PACKET_TYPE_REDUNDANCY
)
{
s
ock_ptr
->
lastReceivedTimestamp
=
prrt_recv_timestamp
;
s
->
lastReceivedTimestamp
=
prrt_recv_timestamp
;
XlapCycleStampValue
(
s
ock_ptr
,
kind
,
seqno
,
ChannelReceive
,
packet_recv_cyclestamp
);
XlapTimeStampValue
(
s
ock_ptr
,
kind
,
seqno
,
ChannelReceive
,
packet_recv_timestamp
);
XlapCycleStampValue
(
s
,
kind
,
seqno
,
ChannelReceive
,
packet_recv_cyclestamp
);
XlapTimeStampValue
(
s
,
kind
,
seqno
,
ChannelReceive
,
packet_recv_timestamp
);
XlapTimestampPlaceholderUse
(
s
ock_ptr
,
kind
,
seqno
,
&
tsph1
);
XlapTimestampPlaceholderUse
(
s
ock_ptr
,
kind
,
seqno
,
&
tsph2
);
XlapTimestampPlaceholderUse
(
s
ock_ptr
,
kind
,
seqno
,
&
tsph3
);
XlapTimestampPlaceholderUse
(
s
,
kind
,
seqno
,
&
tsph1
);
XlapTimestampPlaceholderUse
(
s
,
kind
,
seqno
,
&
tsph2
);
XlapTimestampPlaceholderUse
(
s
,
kind
,
seqno
,
&
tsph3
);
XlapTimeStampCycle
(
s
ock_ptr
,
kind
,
seqno
,
HandlePacketStart
);
XlapTimeStampCycle
(
s
,
kind
,
seqno
,
HandlePacketStart
);
if
(
packetType
==
PACKET_TYPE_DATA
)
{
handle_data_packet
(
s
ock_ptr
,
packet
);
handle_data_packet
(
s
,
packet
);
}
else
if
(
packetType
==
PACKET_TYPE_REDUNDANCY
)
{
handle_redundancy_packet
(
s
ock_ptr
,
packet
);
handle_redundancy_packet
(
s
,
packet
);
}
else
{
goto
error
;
}
send_feedback
(
s
ock_ptr
,
remote
,
seqno
,
prrt_recv_timestamp
,
sentTimestamp
,
packetType
);
XlapTimeStampCycle
(
s
ock_ptr
,
kind
,
seqno
,
HandlePacketEnd
);
send_feedback
(
s
,
remote
,
seqno
,
prrt_recv_timestamp
,
sentTimestamp
,
packetType
);
XlapTimeStampCycle
(
s
,
kind
,
seqno
,
HandlePacketEnd
);
}
else
if
(
packetType
==
PACKET_TYPE_FEEDBACK
)
{
handle_feedback_packet
(
s
ock_ptr
,
packet
,
prrt_recv_timestamp
);
handle_feedback_packet
(
s
,
packet
,
prrt_recv_timestamp
);
PrrtPacket_destroy
(
packet
);
}
else
{
PrrtPacket_print
(
packet
);
...
...
@@ -344,10 +348,14 @@ void *receive_data_loop(void *ptr) {
}
debug
(
DEBUG_DATARECEIVER
,
"Cleanup"
);
PrrtSocket_cleanup
(
s
ock_ptr
);
PrrtSocket_cleanup
(
s
);
debug
(
DEBUG_DATARECEIVER
,
"Cleaned"
);
}
PrrtSocket_cleanup
(
s
);
return
NULL
;
error:
PNOTIMPLEMENTED
(
"SHOULD IMPLEMENT ERROR HANDLER HERE"
);
PrrtSocket_cleanup
(
s
);
return
NULL
;
}
prrt/proto/socket.c
View file @
c1f3364f
...
...
@@ -333,7 +333,7 @@ int PrrtSocket_interrupt(PrrtSocket *s) {
}
if
(
s
->
receiveDataThread
!=
0
)
{
check
(
pthread_cancel
(
s
->
receiveDataThread
)
==
0
,
"Cancel failed."
);
pthread_cancel
(
s
->
receiveDataThread
);
check
(
pthread_join
(
s
->
receiveDataThread
,
res
)
==
0
,
"Join failed."
);
pthread_attr_destroy
(
s
->
receiveDataThreadAttr
);
s
->
receiveDataThread
=
0
;
...
...
@@ -614,11 +614,3 @@ PrrtCoder *PrrtSocket_get_matching_coder(PrrtSocket *s, PrrtCodingConfiguration
}
return
PrrtCoder_copy
(
s
->
coder
);
};
char
*
PrrtSocket_inet_ntoa
(
struct
in_addr
*
in
)
{
return
inet_ntoa
(
*
in
);
}
uint16_t
PrrtSocket_ntohs
(
uint16_t
v
)
{
return
ntohs
(
v
);
}
\ No newline at end of file
prrt/proto/socket.h
View file @
c1f3364f
...
...
@@ -152,7 +152,4 @@ prrtByteCount_t PrrtSocket_get_pipe(PrrtSocket *s);
prrtByteCount_t
PrrtSocket_get_delivered
(
PrrtSocket
*
s
);
bool
PrrtSocket_get_bbr_round_start
(
PrrtSocket
*
s
);
char
*
PrrtSocket_inet_ntoa
(
struct
in_addr
*
in
);
uint16_t
PrrtSocket_ntohs
(
uint16_t
v
);
#endif // PRRT_SOCKET_H
prrt/prrt.pyx
View file @
c1f3364f
...
...
@@ -7,6 +7,8 @@ cimport cython
cimport
cprrt
import
datetime
import
socket
import
ipaddress
include
"sockets.pxd"
...
...
@@ -108,7 +110,7 @@ cdef extern from "util/windowedFilter.c":
pass
cdef
sockaddr_to_addr_and_port
(
sockaddr_in
addr
):
return
(
cprrt
.
PrrtSocket_inet_ntoa
(
&
addr
.
sin_addr
)
.
decode
(
"utf8"
),
cprrt
.
PrrtSocket_
ntohs
(
addr
.
sin_port
))
return
(
ipaddress
.
ip_address
(
socket
.
ntohl
(
addr
.
sin_addr
.
s_addr
)),
socket
.
ntohs
(
addr
.
sin_port
))
class
PrrtCodingConfiguration
:
def
__init__
(
self
,
n
,
k
,
n_cycle
=
None
):
...
...
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