Commit 067d59ef authored by Andreas Schmidt's avatar Andreas Schmidt

Python bindings working again.

parent fe116471
Pipeline #107 passed with stage
......@@ -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
......
......@@ -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
......
......@@ -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;
......
......@@ -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)
......
......@@ -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);
......
......@@ -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) {
int min_keys;
BPTreeKey_t min_keys;
BPTreeNode *neighbor;
int neighbor_index;
int k_prime_index, k_prime;
int 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) {
int 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;
int i;
BPTreeKey_t i;
if (n == NULL) {
return count;
......
......@@ -45,7 +45,7 @@
#include <stdint.h>
typedef uint64_t BPTreeKey_t;
typedef int64_t BPTreeKey_t;
#include "../defines.h"
#include "list.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment