Commit f469bd1f authored by Andreas Schmidt's avatar Andreas Schmidt

Restructure project to allow proper packaging.

parent b64738a0
Pipeline #773 failed with stages
in 48 seconds
prrt/_version.py export-subst
......@@ -8,10 +8,10 @@ CMakeFiles/
cython_debug/
dist/
prrt.egg-info/
prrt/__pycache__/
tests/__pycache__/
CMakeCache.txt
Makefile
MANIFEST
prrt.cpython*.so
prrt.so
src/cython/prrt.c
\ No newline at end of file
......@@ -15,6 +15,7 @@ build_prrt:
untracked: true
expire_in: "1h"
script:
- rm -vf ~/.pypirc
- which cmake
- which gcc
- which g++
......
......@@ -18,8 +18,8 @@ find_library(M_LIB m)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(src)
add_subdirectory(prrt)
add_subdirectory(tests)
add_custom_target(funtest ./bin/prrtTests)
add_custom_target(perftest python3 eval.py)
\ No newline at end of file
add_custom_target(perftest python3 eval.py)
include requirements.txt
recursive-include src *
\ No newline at end of file
recursive-include src *
recursive-include prrt *
include versioneer.py
include prrt/_version.py
add_subdirectory(prrt)
add_subdirectory(proto)
add_subdirectory(util)
add_executable(sender sender.c)
......@@ -7,4 +7,4 @@ add_executable(receiver receiver.c)
set_property(TARGET receiver PROPERTY C_STANDARD 99)
target_link_libraries(sender LINK_PUBLIC PRRT UTIL ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(receiver LINK_PUBLIC PRRT UTIL ${CMAKE_THREAD_LIBS_INIT})
\ No newline at end of file
target_link_libraries(receiver LINK_PUBLIC PRRT UTIL ${CMAKE_THREAD_LIBS_INIT})
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
This diff is collapsed.
......@@ -11,19 +11,19 @@ cdef extern from "pthread.h" nogil:
ctypedef struct pthread_cond_t:
pass
cdef extern from "prrt/vdmcode/block_code.h":
cdef extern from "proto/vdmcode/block_code.h":
cdef struct prrtCoder:
pass
ctypedef prrtCoder PrrtCoder
cdef extern from "prrt/channelStateInformation.h":
cdef extern from "proto/channelStateInformation.h":
cdef struct prrtChannelStateInformation:
pass
ctypedef prrtChannelStateInformation PrrtChannelStateInformation
cdef extern from "prrt/codingParams.h":
cdef extern from "proto/codingParams.h":
cdef struct prrtCodingParams:
uint8_t k;
uint8_t r;
......@@ -51,7 +51,7 @@ cdef extern from "util/list.h":
void *List_remove(List *list, const ListNode *node)
cdef extern from "prrt/block.h":
cdef extern from "proto/block.h":
cdef struct prrtBlock:
uint32_t data_count
uint32_t redundancy_count
......@@ -64,7 +64,7 @@ cdef extern from "prrt/block.h":
ctypedef prrtBlock PrrtBlock
cdef extern from "prrt/packet.h":
cdef extern from "proto/packet.h":
cdef struct prrtPacket:
uint8_t type_priority;
uint8_t index;
......@@ -74,7 +74,7 @@ cdef extern from "prrt/packet.h":
ctypedef prrtPacket PrrtPacket
cdef extern from "prrt/receiver.h":
cdef extern from "proto/receiver.h":
ctypedef struct PrrtReceiver:
const char* host_name
uint16_t port
......@@ -83,7 +83,7 @@ cdef extern from "prrt/receiver.h":
bint PrrtReceiver_destroy(PrrtReceiver* receiver)
cdef extern from "prrt/socket.h":
cdef extern from "proto/socket.h":
cdef struct prrtSocket:
int dataSocketFd
int feedbackSocketFd
......
from libc.stdint cimport uint32_t, uint16_t, uint8_t, int32_t
cimport cprrt
cdef extern from "prrt/applicationConstraints.c":
cdef extern from "proto/applicationConstraints.c":
pass
cdef extern from "prrt/stores/dataPacketStore.c":
cdef extern from "proto/stores/dataPacketStore.c":
pass
cdef extern from "prrt/stores/forwardPacketTable.c":
cdef extern from "proto/stores/forwardPacketTable.c":
pass
cdef extern from "prrt/stores/lossGatherer.c":
cdef extern from "proto/stores/lossGatherer.c":
pass
cdef extern from "prrt/stores/packetTimeoutTable.c":
cdef extern from "proto/stores/packetTimeoutTable.c":
pass
cdef extern from "prrt/stores/repairBlockStore.c":
cdef extern from "proto/stores/repairBlockStore.c":
pass
cdef extern from "prrt/processes/feedbackReceiver.c":
cdef extern from "proto/processes/feedbackReceiver.c":
pass
cdef extern from "prrt/processes/cleaner.c":
cdef extern from "proto/processes/cleaner.c":
pass
cdef extern from "prrt/processes/dataReceiver.c":
cdef extern from "proto/processes/dataReceiver.c":
pass
cdef extern from "prrt/processes/dataTransmitter.c":
cdef extern from "proto/processes/dataTransmitter.c":
pass
cdef extern from "prrt/block.c":
cdef extern from "proto/block.c":
pass
cdef extern from "prrt/clock.c":
cdef extern from "proto/clock.c":
pass
cdef extern from "prrt/channelStateInformation.c":
cdef extern from "proto/channelStateInformation.c":
pass
cdef extern from "prrt/vdmcode/block_code.c":
cdef extern from "proto/vdmcode/block_code.c":
pass
cdef extern from "prrt/codingParams.c":
cdef extern from "proto/codingParams.c":
pass
cdef extern from "prrt/receiver.c":
cdef extern from "proto/receiver.c":
pass
cdef extern from "prrt/packet.c":
cdef extern from "proto/packet.c":
pass
cdef extern from "prrt/socket.c":
cdef extern from "proto/socket.c":
pass
cdef extern from "util/bptree.c":
......@@ -85,8 +85,7 @@ cdef class PrrtSocket:
cprrt.PrrtSocket_connect(self._c_socket, encodedHost, port)
def send(self, data):
cdef bytes encodedData = data.encode("utf-8")
cprrt.PrrtSocket_send(self._c_socket, encodedData, len(data))
cprrt.PrrtSocket_send(self._c_socket, data, len(data))
def close(self):
cprrt.PrrtSocket_close(self._c_socket)
......@@ -3,7 +3,7 @@
#include <stdlib.h>
#include <signal.h>
#include "util/dbg.h"
#include "prrt/socket.h"
#include "proto/socket.h"
PrrtSocket* sock = NULL;
static volatile int keepRunning = true;
......
......@@ -3,7 +3,7 @@
#include <stdint.h>
#include <unistd.h>
#include "util/dbg.h"
#include "prrt/socket.h"
#include "proto/socket.h"
int main(int argc, char *const argv[]) {
if (argc != 2) {
......
#ifndef PRRT_COMMON_H
#define PRRT_COMMON_H
#include "../prrt/vdmcode/block_code.h"
#include "../proto/vdmcode/block_code.h"
int print_buffer(const char *buf, const int length);
void print_gf(const gf *start, const int len);
......
[bdist_wheel]
# This code is written to work with both Python 2 and Python 3
universal=1
[versioneer]
VCS=git
style=pep440
versionfile_source = prrt/_version.py
versionfile_build = _version.py
tag_prefix = 'prrt-'
parentdir_prefix = ''
......@@ -2,16 +2,17 @@ from setuptools import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import os
import versioneer
os.environ["CC"] = "gcc-5"
os.environ["CXX"] = "g++-5"
ext = Extension(name='prrt', sources=["src/cython/**/*.pyx"])
ext = Extension(name='prrt', sources=["prrt/*.pyx"])
ext_modules = cythonize(ext, gdb_debug=True)
setup(
name='prrt',
version='0.0.12',
version=versioneer.get_version(),
description='Predictably Reliable Real-time Transport',
long_description='Predictably Reliable Real-time Transport Protocol',
url='https://git.nt.uni-saarland.de/LARN/PRRT',
......@@ -30,9 +31,10 @@ setup(
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4'
],
install_requires=["cython==0.25.2"],
install_requires=["cython"],
keywords='prrt protocol',
include_dirs=["./src"],
cmdclass=versioneer.get_cmdclass(),
include_dirs=["./src","./prrt"],
ext_modules=ext_modules
)
cython/prrt.c
\ No newline at end of file
......@@ -2,12 +2,12 @@
extern "C" {
#include "src/prrt/block.h"
#include "src/prrt/packet.h"
#include "src/prrt/codingParams.h"
#include "src/util/dbg.h"
#include "src/prrt/vdmcode/block_code.h"
#include "src/util/common.h"
#include "prrt/proto/block.h"
#include "prrt/proto/packet.h"
#include "prrt/proto/codingParams.h"
#include "prrt/util/dbg.h"
#include "prrt/proto/vdmcode/block_code.h"
#include "prrt/util/common.h"
}
class PrrtBlockTest : public ::testing::Test {
......@@ -150,4 +150,4 @@ TEST_F(PrrtBlockTest, EncodeDecode)
const char *s2 = (const char *) ((char *) ptr->payload + PRRT_PACKET_DATA_HEADER_SIZE);
ASSERT_STREQ(s1, s2);
}
}
\ No newline at end of file
}
#include <gtest/gtest.h>
extern "C" {
#include "src/util/bitmap.h"
#include "prrt/util/bitmap.h"
}
class BitmapTest : public ::testing::Test {
......@@ -62,4 +62,4 @@ TEST_F(BitmapTest, SetRange)
ASSERT_TRUE(Bitmap_get(bitmap, 4));
ASSERT_EQ(3, Bitmap_sum_ones(bitmap, 1, 5));
ASSERT_EQ(2, Bitmap_sum_zeros(bitmap, 1, 5));
}
\ No newline at end of file
}
#include <gtest/gtest.h>
extern "C" {
#include "src/util/bptree.h"
#include "prrt/util/bptree.h"
}
class BPlusTreeTest : public ::testing::Test {
......
#include <gtest/gtest.h>
#include <cmath>
#include <src/prrt/packet.h>
#include <prrt/proto/packet.h>
extern "C" {
#include "src/prrt/stores/forwardPacketTable.h"
#include "prrt/proto/stores/forwardPacketTable.h"
}
class ForwardPacketTableTest : public ::testing::Test {
......@@ -83,4 +83,4 @@ TEST_F(ForwardPacketTableTest, CheckBlock) {
ASSERT_TRUE(PrrtForwardPacketTable_test_set_is_number_relevant(forwardPacketTable, i));
}
ASSERT_FALSE(PrrtForwardPacketTable_test_is_block_relevant(forwardPacketTable, 1, 6));
}
\ No newline at end of file
}
#include <gtest/gtest.h>
extern "C" {
#include "src/prrt/stores/lossGatherer.h"
#include "prrt/proto/stores/lossGatherer.h"
}
class LossGathererTest : public ::testing::Test {
......@@ -105,4 +105,4 @@ TEST_F(LossGathererTest, CalculateStatistics)
ASSERT_EQ(2, stats.burstCount);
printf("PLR: %f, ABL: %f, AGL: %f\n", LossStatistics_get_packet_loss_rate(stats),
LossStatistics_get_avg_burst_length(stats), LossStatistics_get_avg_gap_length(stats));
}
\ No newline at end of file
}
This diff is collapsed.
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