mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
netem: fix network emulation
This commit is contained in:
parent
6cde1591f1
commit
3077722476
1 changed files with 10 additions and 5 deletions
|
@ -66,8 +66,8 @@ int socket_init(struct super_node *sn)
|
|||
struct socket *s = (struct socket *) n->_vd;
|
||||
struct rtnl_link *link;
|
||||
|
||||
if (s->layer != SOCKET_LAYER_ETH ||
|
||||
s->layer != SOCKET_LAYER_IP ||
|
||||
if (s->layer != SOCKET_LAYER_ETH &&
|
||||
s->layer != SOCKET_LAYER_IP &&
|
||||
s->layer != SOCKET_LAYER_UDP)
|
||||
continue;
|
||||
|
||||
|
@ -465,12 +465,13 @@ int socket_parse(struct node *n, json_t *cfg)
|
|||
s->tc_qdisc = NULL;
|
||||
#endif /* WITH_NETEM */
|
||||
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ 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?: o, s?: s }",
|
||||
"layer", &layer,
|
||||
"remote", &remote,
|
||||
"local", &local,
|
||||
"verify_source", &s->verify_source,
|
||||
"multicast", &json_multicast,
|
||||
"netem", &json_netem,
|
||||
"format", &format
|
||||
);
|
||||
if (ret)
|
||||
|
@ -763,7 +764,11 @@ int socket_fd(struct node *n)
|
|||
|
||||
static struct plugin p = {
|
||||
.name = "socket",
|
||||
.description = "BSD network sockets for Ethernet / IP / UDP (libnl3)",
|
||||
#ifdef WITH_NETEM
|
||||
.description = "BSD network sockets for Ethernet / IP / UDP (libnl3, netem support)",
|
||||
#else
|
||||
.description = "BSD network sockets for Ethernet / IP / UDP",
|
||||
#endif
|
||||
.type = PLUGIN_TYPE_NODE,
|
||||
.node = {
|
||||
.vectorize = 0,
|
||||
|
@ -784,4 +789,4 @@ static struct plugin p = {
|
|||
|
||||
REGISTER_PLUGIN(&p)
|
||||
LIST_INIT_STATIC(&p.node.instances)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue