1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

socket: remove obsolete settings 'endian' and 'header'

This commit is contained in:
Steffen Vogel 2017-08-31 09:28:44 +02:00
parent f6edec4d41
commit 5b4e4a4eb7
2 changed files with 1 additions and 41 deletions

View file

@ -61,12 +61,6 @@ enum socket_layer {
SOCKET_LAYER_UDP
};
enum socket_header {
SOCKET_HEADER_DEFAULT, /**> Default header in the payload, (see msg_format.h) */
SOCKET_HEADER_NONE, /**> No header in the payload, same as HDR_NONE*/
SOCKET_HEADER_FAKE /**> Same as SOCKET_HEADER_NONE but using the first three data values as: sequence, seconds & nano-seconds. */
};
union sockaddr_union {
struct sockaddr sa;
struct sockaddr_storage ss;
@ -83,13 +77,7 @@ struct socket {
int mark; /**< Socket mark for netem, routing and filtering */
int verify_source; /**< Verify the source address of incoming packets against socket::remote. */
enum {
SOCKET_ENDIAN_LITTLE,
SOCKET_ENDIAN_BIG
} endian; /**< Endianness of the data sent/received by the node */
enum socket_layer layer; /**< The OSI / IP layer which should be used for this socket */
enum socket_header header; /**< Payload header type */
union sockaddr_union local; /**< Local address of the socket */
union sockaddr_union remote; /**< Remote address of the socket */

View file

@ -27,7 +27,6 @@
#if defined(__linux__)
#include <netinet/ether.h>
#include <endian.h>
#endif
#include "nodes/socket.h"
@ -382,9 +381,7 @@ int socket_parse(struct node *n, json_t *cfg)
struct socket *s = n->_vd;
const char *local, *remote;
const char *endian = NULL;
const char *layer = NULL;
const char *header = NULL;
const char *format = "msg";
int ret;
@ -394,14 +391,10 @@ int socket_parse(struct node *n, json_t *cfg)
/* Default values */
s->layer = SOCKET_LAYER_UDP;
s->header = SOCKET_HEADER_DEFAULT;
s->endian = SOCKET_ENDIAN_BIG;
s->verify_source = 0;
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s?: s, s?: s, s: s, s: s, s?: b, s?: o, s?: s }",
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s: s, s: s, s?: b, s?: o, s?: s }",
"layer", &layer,
"header", &header,
"endian", &endian,
"remote", &remote,
"local", &local,
"verify_source", &s->verify_source,
@ -430,27 +423,6 @@ int socket_parse(struct node *n, json_t *cfg)
error("Invalid layer '%s' for node %s", layer, node_name(n));
}
/* Application header */
if (header) {
if (!strcmp(header, "gtnet-skt") || (!strcmp(header, "none")))
s->header = SOCKET_HEADER_NONE;
else if (!strcmp(header, "gtnet-skt:fake") || (!strcmp(header, "fake")))
s->header = SOCKET_HEADER_FAKE;
else if (!strcmp(header, "villas") || !strcmp(header, "default"))
s->header = SOCKET_HEADER_DEFAULT;
else
error("Invalid application header type '%s' for node %s", header, node_name(n));
}
if (endian) {
if (!strcmp(endian, "big") || !strcmp(endian, "network"))
s->endian = SOCKET_ENDIAN_BIG;
else if (!strcmp(endian, "little"))
s->endian = SOCKET_ENDIAN_LITTLE;
else
error("Invalid endianness type '%s' for node %s", endian, node_name(n));
}
ret = socket_parse_addr(local, (struct sockaddr *) &s->local, s->layer, AI_PASSIVE);
if (ret) {
error("Failed to resolve local address '%s' of node %s: %s",