Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LARN
PRRT
Commits
067d59ef
Commit
067d59ef
authored
Mar 18, 2016
by
Andreas Schmidt
Browse files
Python bindings working again.
parent
fe116471
Pipeline
#107
passed with stage
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/cython/cprrt.pxd
View file @
067d59ef
...
...
@@ -11,12 +11,6 @@ cdef extern from "pthread.h" nogil:
ctypedef
struct
pthread_cond_t
:
pass
cdef
extern
from
"prrt/stores/forwardPacketTable.h"
:
cdef
struct
prrtForwardPacketTable
:
pass
ctypedef
prrtForwardPacketTable
PrrtForwardPacketTable
cdef
extern
from
"prrt/vdmcode/block_code.h"
:
cdef
struct
prrtCoder
:
pass
...
...
@@ -107,10 +101,6 @@ cdef extern from "prrt/socket.h":
BPTreeNode
*
dataStore
PrrtRepairBlockStore
*
repairBlockStore
PrrtForwardPacketTable
*
forwardPacketTable
List
*
receivers
uint16_t
packetsCount
...
...
src/cython/prrt.pyx
View file @
067d59ef
...
...
@@ -4,12 +4,27 @@ cimport cprrt
cdef
extern
from
"prrt/applicationConstraints.c"
:
pass
cdef
extern
from
"prrt/stores/dataPacketStore.c"
:
pass
cdef
extern
from
"prrt/stores/forwardPacketTable.c"
:
pass
cdef
extern
from
"prrt/stores/lossGatherer.c"
:
pass
cdef
extern
from
"prrt/stores/packetTimeoutTable.c"
:
pass
cdef
extern
from
"prrt/stores/repairBlockStore.c"
:
pass
cdef
extern
from
"prrt/processes/feedbackReceiver.c"
:
pass
cdef
extern
from
"prrt/processes/cleaner.c"
:
pass
cdef
extern
from
"prrt/processes/dataReceiver.c"
:
pass
...
...
src/prrt/socket.c
View file @
067d59ef
...
...
@@ -312,10 +312,10 @@ PrrtPacket *PrrtSocket_recv_feedback(PrrtSocket *prrtSocket, const size_t length
check_mem
(
prrtPacket
);
PrrtPacket_decode
(
bufin
,
(
uint16_t
)
n
,
prrtPacket
);
PrrtPacketFeedbackPayload
*
payload
=
prrtPacket
->
payload
;
struct
in_addr
a
;
a
.
s_addr
=
payload
->
receiverAddress
;
debug
(
"Receiver Address: %s"
,
inet_ntoa
(
a
));
//
PrrtPacketFeedbackPayload* payload = prrtPacket->payload;
//
struct in_addr a;
//
a.s_addr = payload->receiverAddress;
//
debug("Receiver Address: %s", inet_ntoa(a));
prrtTimestamp_t
forwardTripTimestamp
=
((
PrrtPacketFeedbackPayload
*
)
prrtPacket
->
payload
)
->
forwardTripTimestamp_us
;
...
...
src/prrt/stores/lossGatherer.c
View file @
067d59ef
...
...
@@ -34,8 +34,6 @@ LossStatistics LossGatherer_calculate_statistics(LossGatherer *lossGatherer, uin
.
packetCount
=
length
,
.
gapCount
=
(
uint16_t
)
x0
,
.
burstCount
=
(
uint16_t
)
(
1
-
((
uint16_t
)
x0
)),
};
statistics
.
gapLength
=
statistics
.
gapCount
;
statistics
.
burstLength
=
statistics
.
burstCount
;
...
...
@@ -64,6 +62,8 @@ LossStatistics LossGatherer_calculate_statistics(LossGatherer *lossGatherer, uin
error:
PERROR
(
"Stats error.%s"
,
""
);
LossStatistics
ls
;
return
ls
;
}
bool
LossGatherer_check_loss
(
LossGatherer
*
lossGatherer
,
uint32_t
sequenceNumber
)
...
...
src/prrt/stores/lossGatherer.h
View file @
067d59ef
...
...
@@ -17,7 +17,7 @@ typedef struct lossStatistics {
uint16_t
burstCount
;
}
LossStatistics
;
LossGatherer
*
LossGatherer_create
();
LossGatherer
*
LossGatherer_create
(
void
);
LossStatistics
LossGatherer_calculate_statistics
(
LossGatherer
*
lossGatherer
,
uint32_t
start
,
uint16_t
length
);
bool
LossGatherer_mark_loss
(
LossGatherer
*
lossGatherer
,
uint32_t
sequenceNumber
);
bool
LossGatherer_check_loss
(
LossGatherer
*
lossGatherer
,
uint32_t
sequenceNumber
);
...
...
src/util/bptree.c
View file @
067d59ef
...
...
@@ -956,11 +956,11 @@ BPTreeNode *redistribute_nodes(BPTreeNode *root, BPTreeNode *n, BPTreeNode *neig
*/
BPTreeNode
*
delete_entry
(
BPTreeNode
*
root
,
BPTreeNode
*
n
,
BPTreeKey_t
key
,
void
*
pointer
)
{
in
t
min_keys
;
BPTreeKey_
t
min_keys
;
BPTreeNode
*
neighbor
;
in
t
neighbor_index
;
in
t
k_prime_index
,
k_prime
;
in
t
capacity
;
BPTreeKey_
t
neighbor_index
;
BPTreeKey_
t
k_prime_index
,
k_prime
;
BPTreeKey_
t
capacity
;
// Remove key and pointer from node.
...
...
@@ -1040,7 +1040,7 @@ BPTreeNode *BPTree_delete(BPTreeNode *root, BPTreeKey_t key) {
void
destroy_tree_nodes
(
BPTreeNode
*
root
)
{
in
t
i
;
BPTreeKey_
t
i
;
if
(
root
->
is_leaf
)
for
(
i
=
0
;
i
<
root
->
num_keys
;
i
++
)
free
(
root
->
pointers
[
i
]);
...
...
@@ -1085,7 +1085,7 @@ void BPTree_get_range(BPTreeNode *root, List *list, BPTreeKey_t key_start, BPTre
uint32_t
BPTree_size
(
BPTreeNode
*
root
)
{
BPTreeNode
*
n
=
root
;
uint32_t
count
=
0
;
in
t
i
;
BPTreeKey_
t
i
;
if
(
n
==
NULL
)
{
return
count
;
...
...
src/util/bptree.h
View file @
067d59ef
...
...
@@ -45,7 +45,7 @@
#include
<stdint.h>
typedef
u
int64_t
BPTreeKey_t
;
typedef
int64_t
BPTreeKey_t
;
#include
"../defines.h"
#include
"list.h"
...
...
Write
Preview
Supports
Markdown
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