mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
io: use dots instead of hyphens in format names
This commit is contained in:
parent
3ff2e4d3ec
commit
c59e0948c3
19 changed files with 49 additions and 43 deletions
|
@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.6.2] - Unreleased
|
||||
|
||||
### Changed
|
||||
|
||||
- Format identifiers such as `raw-flt32` now use dots instead of hyphens in their name.
|
||||
Please update your configuration files accordingly.
|
||||
|
||||
## [0.6.1] - 2018-02-17
|
||||
|
||||
### Added
|
||||
|
|
|
@ -62,7 +62,7 @@ nodes = {
|
|||
# - ip Send / receive L3 IP packets
|
||||
# - eth Send / receive L2 Ethernet frames (IEEE802.3)
|
||||
|
||||
format = "gtnet-fake", # For a list of available node-types run: 'villas-node -h'
|
||||
format = "gtnet.fake", # For a list of available node-types run: 'villas-node -h'
|
||||
|
||||
verify_source = true, # Check if source address of incoming packets matches the remote address.
|
||||
|
||||
|
@ -233,7 +233,7 @@ nodes = {
|
|||
prefix = "test_rtt", # An optional prefix in the filename
|
||||
output = "/tmp/results/testA", # The output directory for all results
|
||||
# The results of each test case will be written to a seperate file.
|
||||
format = "villas-human", # The output format of the result files.
|
||||
format = "villas.human", # The output format of the result files.
|
||||
|
||||
cases = ( # The list of test cases
|
||||
# Each test case can specify a single or an array of rates and values
|
||||
|
|
|
@ -41,7 +41,7 @@ static int print_init(struct hook *h)
|
|||
struct print *p = (struct print *) h->_vd;
|
||||
|
||||
p->uri = NULL;
|
||||
p->format = io_format_lookup("villas-human");
|
||||
p->format = io_format_lookup("villas.human");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
21
lib/io/raw.c
21
lib/io/raw.c
|
@ -252,15 +252,14 @@ static struct plugin i = { \
|
|||
REGISTER_PLUGIN(& i);
|
||||
|
||||
/* Feel free to add additional format identifiers here to suit your needs */
|
||||
REGISTER_FORMAT_RAW(p, "raw", "", 0)
|
||||
REGISTER_FORMAT_RAW(p_f32, "raw-flt32", "Raw single precision floating point", RAW_32 | RAW_FLT)
|
||||
REGISTER_FORMAT_RAW(p_f64, "raw-flt64", "Raw double precision floating point", RAW_64 | RAW_FLT)
|
||||
REGISTER_FORMAT_RAW(p_i8, "raw-int8", "Raw 8 bit, signed integer", RAW_8)
|
||||
REGISTER_FORMAT_RAW(p_i16be, "raw-int16-be", "Raw 16 bit, signed integer, big endian byte-order", RAW_16 | RAW_BE)
|
||||
REGISTER_FORMAT_RAW(p_i16le, "raw-int16-le", "Raw 16 bit, signed integer, little endian byte-order", RAW_16)
|
||||
REGISTER_FORMAT_RAW(p_i32be, "raw-int32-be", "Raw 32 bit, signed integer, big endian byte-order", RAW_32 | RAW_BE)
|
||||
REGISTER_FORMAT_RAW(p_i32le, "raw-int32-le", "Raw 32 bit, signed integer, little endian byte-order", RAW_32)
|
||||
REGISTER_FORMAT_RAW(p_i64be, "raw-int64-be", "Raw 64 bit, signed integer, bit endian byte-order", RAW_64 | RAW_BE)
|
||||
REGISTER_FORMAT_RAW(p_i64le, "raw-int64-le", "Raw 64 bit, signed integer, little endian byte-order", RAW_64)
|
||||
REGISTER_FORMAT_RAW(p_f32, "raw.flt32", "Raw single precision floating point", RAW_32 | RAW_FLT)
|
||||
REGISTER_FORMAT_RAW(p_f64, "raw.flt64", "Raw double precision floating point", RAW_64 | RAW_FLT)
|
||||
REGISTER_FORMAT_RAW(p_i8, "raw.int8", "Raw 8 bit, signed integer", RAW_8)
|
||||
REGISTER_FORMAT_RAW(p_i16be, "raw.int16.be", "Raw 16 bit, signed integer, big endian byte-order", RAW_16 | RAW_BE)
|
||||
REGISTER_FORMAT_RAW(p_i16le, "raw.int16.le", "Raw 16 bit, signed integer, little endian byte-order", RAW_16)
|
||||
REGISTER_FORMAT_RAW(p_i32be, "raw.int32.be", "Raw 32 bit, signed integer, big endian byte-order", RAW_32 | RAW_BE)
|
||||
REGISTER_FORMAT_RAW(p_i32le, "raw.int32.le", "Raw 32 bit, signed integer, little endian byte-order", RAW_32)
|
||||
REGISTER_FORMAT_RAW(p_i64be, "raw.int64.be", "Raw 64 bit, signed integer, bit endian byte-order", RAW_64 | RAW_BE)
|
||||
REGISTER_FORMAT_RAW(p_i64le, "raw.int64.le", "Raw 64 bit, signed integer, little endian byte-order", RAW_64)
|
||||
REGISTER_FORMAT_RAW(p_gtnet, "gtnet", "RTDS GTNET", RAW_32 | RAW_FLT | RAW_BE)
|
||||
REGISTER_FORMAT_RAW(p_gtnef, "gtnet-fake", "RTDS GTNET with fake header", RAW_32 | RAW_FLT | RAW_BE | RAW_FAKE)
|
||||
REGISTER_FORMAT_RAW(p_gtnef, "gtnet.fake", "RTDS GTNET with fake header", RAW_32 | RAW_FLT | RAW_BE | RAW_FAKE)
|
||||
|
|
|
@ -113,7 +113,7 @@ int villas_binary_sscan(char *buf, size_t len, size_t *rbytes, struct sample *sm
|
|||
}
|
||||
|
||||
static struct plugin p1 = {
|
||||
.name = "villas-binary",
|
||||
.name = "villas.binary",
|
||||
.description = "VILLAS binary network format",
|
||||
.type = PLUGIN_TYPE_IO,
|
||||
.io = {
|
||||
|
@ -126,7 +126,7 @@ static struct plugin p1 = {
|
|||
|
||||
/** The WebSocket node-type usually uses little endian byte order intead of network byte order */
|
||||
static struct plugin p2 = {
|
||||
.name = "villas-web",
|
||||
.name = "villas.web",
|
||||
.description = "VILLAS binary network format for WebSockets",
|
||||
.type = PLUGIN_TYPE_IO,
|
||||
.io = {
|
||||
|
|
|
@ -290,7 +290,7 @@ void villas_human_rewind(struct io *io)
|
|||
}
|
||||
|
||||
static struct plugin p = {
|
||||
.name = "villas-human",
|
||||
.name = "villas.human",
|
||||
.description = "VILLAS human readable format",
|
||||
.type = PLUGIN_TYPE_IO,
|
||||
.io = {
|
||||
|
|
|
@ -213,7 +213,7 @@ int mqtt_parse(struct node *n, json_t *cfg)
|
|||
struct mqtt *m = (struct mqtt *) n->_vd;
|
||||
|
||||
const char *host;
|
||||
const char *format = "villas-human";
|
||||
const char *format = "villas.human";
|
||||
const char *publish = NULL;
|
||||
const char *subscribe = NULL;
|
||||
const char *username = NULL;
|
||||
|
|
|
@ -449,7 +449,7 @@ int socket_parse(struct node *n, json_t *cfg)
|
|||
|
||||
const char *local, *remote;
|
||||
const char *layer = NULL;
|
||||
const char *format = "villas-binary";
|
||||
const char *format = "villas.binary";
|
||||
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ int test_rtt_parse(struct node *n, json_t *cfg)
|
|||
int ret;
|
||||
struct test_rtt *t = (struct test_rtt *) n->_vd;
|
||||
|
||||
const char *format = "villas-human";
|
||||
const char *format = "villas.human";
|
||||
const char *output = ".";
|
||||
const char *prefix = node_name_short(n);
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ static void usage()
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
int ret, recv, sent;
|
||||
char *format = "villas-human";
|
||||
char *format = "villas.human";
|
||||
|
||||
/* Default values */
|
||||
cnt = 1;
|
||||
|
|
|
@ -110,7 +110,7 @@ int main(int argc, char *argv[])
|
|||
int ret;
|
||||
struct plugin *p;
|
||||
|
||||
char *format = "villas-human"; /** @todo hardcoded for now */
|
||||
char *format = "villas.human"; /** @todo hardcoded for now */
|
||||
|
||||
ret = log_init(&l, l.level, LOG_ALL);
|
||||
if (ret)
|
||||
|
|
|
@ -74,7 +74,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
/* Default values */
|
||||
double epsilon = 1e-9;
|
||||
char *format = "villas-human";
|
||||
char *format = "villas.human";
|
||||
int flags = SAMPLE_HAS_SEQUENCE | SAMPLE_HAS_VALUES | SAMPLE_HAS_ORIGIN;
|
||||
|
||||
struct pool pool = { .state = STATE_DESTROYED };
|
||||
|
|
|
@ -31,7 +31,7 @@ NUM_SAMPLES=${NUM_SAMPLES:-100}
|
|||
# Prepare some test data
|
||||
villas-signal random -v 1 -r 10 -l ${NUM_SAMPLES} -n > ${INPUT_FILE}
|
||||
|
||||
villas-hook print -o format=villas-human -o output=${OUTPUT_FILE1} < ${INPUT_FILE} > ${OUTPUT_FILE2}
|
||||
villas-hook print -o format=villas.human -o output=${OUTPUT_FILE1} < ${INPUT_FILE} > ${OUTPUT_FILE2}
|
||||
|
||||
# Compare only the data values
|
||||
villas-test-cmp ${OUTPUT_FILE1} ${INPUT_FILE} && \
|
||||
|
|
|
@ -38,7 +38,7 @@ NUM_SAMPLES=${NUM_SAMPLES:-100}
|
|||
# Generate test data
|
||||
villas-signal random -l ${NUM_SAMPLES} -n > ${INPUT_FILE}
|
||||
|
||||
for FORMAT in villas-human villas-binary villas-web csv json gtnet-fake raw-flt32; do
|
||||
for FORMAT in villas.human villas.binary villas.web csv json gtnet.fake raw.flt32; do
|
||||
|
||||
VECTORIZES="1"
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ NUM_SAMPLES=${NUM_SAMPLES:-100}
|
|||
# Generate test data
|
||||
villas-signal random -l ${NUM_SAMPLES} -n > ${INPUT_FILE}
|
||||
|
||||
for FORMAT in villas-human villas-binary villas-web csv json gtnet-fake raw-flt32; do
|
||||
for FORMAT in villas.human villas.binary villas.web csv json gtnet.fake raw.flt32; do
|
||||
|
||||
VECTORIZES="1"
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ NUM_VALUES=${NUM_VALUES:-4}
|
|||
# Generate test data
|
||||
villas-signal random -v ${NUM_VALUES} -l ${NUM_SAMPLES} -n > ${INPUT_FILE}
|
||||
|
||||
for FORMAT in villas-human villas-binary villas-web csv json gtnet-fake raw-flt32 protobuf; do
|
||||
for FORMAT in villas.human villas.binary villas.web csv json gtnet.fake raw.flt32 protobuf; do
|
||||
for LAYER in udp ip eth unix; do
|
||||
for VERIFY_SOURCE in true false; do
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ NUM_SAMPLES=${NUM_SAMPLES:-10}
|
|||
# Generate test data
|
||||
villas-signal random -l ${NUM_SAMPLES} -n -v 10 > ${INPUT_FILE}
|
||||
|
||||
for FORMAT in villas-human villas-binary villas-web csv json gtnet-fake raw-flt32; do
|
||||
for FORMAT in villas.human villas.binary villas.web csv json gtnet.fake raw.flt32; do
|
||||
|
||||
VECTORIZES="1"
|
||||
|
||||
|
|
|
@ -45,21 +45,21 @@ static char formats[][32] = {
|
|||
#ifdef WITH_FORMAT_PROTOBUF
|
||||
"protobuf",
|
||||
#endif
|
||||
"raw-int8",
|
||||
"raw-int16-be",
|
||||
"raw-int16-le",
|
||||
"raw-int32-be",
|
||||
"raw-int32-le",
|
||||
"raw-int64-be",
|
||||
"raw-int64-le",
|
||||
"raw-flt32",
|
||||
"raw-flt64",
|
||||
"villas-human",
|
||||
"villas-binary",
|
||||
"raw.int8",
|
||||
"raw.int16.be",
|
||||
"raw.int16.le",
|
||||
"raw.int32.be",
|
||||
"raw.int32.le",
|
||||
"raw.int64.be",
|
||||
"raw.int64.le",
|
||||
"raw.flt32",
|
||||
"raw.flt64",
|
||||
"villas.human",
|
||||
"villas.binary",
|
||||
"csv",
|
||||
"json",
|
||||
"gtnet",
|
||||
"gtnet-fake"
|
||||
"gtnet.fake"
|
||||
};
|
||||
|
||||
void generate_samples(struct pool *p, struct sample *smps[], struct sample *smpt[], unsigned cnt, unsigned values)
|
||||
|
@ -259,7 +259,7 @@ ParameterizedTest(char *fmt, io, highlevel)
|
|||
|
||||
#if 0 /* Show the file contents */
|
||||
char cmd[128];
|
||||
if (!strcmp(fmt, "json") || !strcmp(fmt, "villas-human"))
|
||||
if (!strcmp(fmt, "json") || !strcmp(fmt, "villas.human"))
|
||||
snprintf(cmd, sizeof(cmd), "cat %s", fn);
|
||||
else
|
||||
snprintf(cmd, sizeof(cmd), "hexdump -C %s", fn);
|
||||
|
|
|
@ -26,9 +26,9 @@ function villas_format_supports_vectorize() {
|
|||
local FORMAT=$1
|
||||
|
||||
case $FORMAT in
|
||||
raw-*) ;&
|
||||
raw.*) ;&
|
||||
gtnet) ;&
|
||||
gtnet-fake) return 1 ;;
|
||||
gtnet.fake) return 1 ;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
|
|
Loading…
Add table
Reference in a new issue