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

removed broken TCP support

This commit is contained in:
Steffen Vogel 2015-06-02 22:53:19 +02:00
parent 5928e29bba
commit 73fc4da932
6 changed files with 1 additions and 52 deletions

View file

@ -39,9 +39,7 @@ struct node_vtable vtables[] = {
VTABLE(LOG_FILE, "file", file),
VTABLE(IEEE_802_3, "ieee802.3", socket),
VTABLE(IP, "ip", socket),
VTABLE(UDP, "udp", socket),
VTABLE(TCP, "tcp", socket),
VTABLE(TCPD, "tcpd", socket)
VTABLE(UDP, "udp", socket)
};
int node_init(int argc, char *argv[], struct settings *set)
@ -107,25 +105,6 @@ int node_start(struct node *n)
}
}
int node_start_defer(struct node *n)
{
struct socket *s = n->socket;
if (node_type(n) == TCPD) {
info("Wait for incoming TCP connection from node '%s'...", n->name);
s->sd = listen(s->sd2, 1);
if (s->sd < 0)
serror("Failed to listen on socket for node '%s'", n->name);
s->sd = accept(s->sd2, NULL, NULL);
if (s->sd < 0)
serror("Failed to accept on socket for node '%s'", n->name);
}
return 0;
}
int node_stop(struct node *n)
{ INDENT
int ret;
@ -144,7 +123,6 @@ void node_reverse(struct node *n)
case IEEE_802_3:
case IP:
case UDP:
case TCP:
SWAP(n->socket->remote, n->socket->local);
break;
default: { }
@ -162,7 +140,6 @@ void node_destroy(struct node *n)
case IEEE_802_3:
case IP:
case UDP:
case TCP:
free(n->socket->netem);
default: { }
}

View file

@ -74,13 +74,6 @@ static void * path_run(void *arg)
p->pool = alloc(p->poolsize * sizeof(struct msg));
p->previous = p->current = p->pool;
/* Open deferred TCP connection
TODO: fix this
node_start_defer(p->in);
FOREACH(&p->destinations, it)
node_start_defer(it->node); */
/* Main thread loop */
skip: for(;;) {
/* Receive message */

View file

@ -111,7 +111,6 @@ int main(int argc, char *argv[])
node_init(argc-optind, argv+optind, &set);
node_start(node);
node_start_defer(node);
pool = alloc(sizeof(struct msg) * node->combine);

View file

@ -115,7 +115,6 @@ int main(int argc, char *argv[])
info("Start node");
node_start(node);
node_start_defer(node);
pool = alloc(sizeof(struct msg) * node->combine);

View file

@ -99,8 +99,6 @@ int socket_open(struct node *n)
/* Create socket */
switch (node_type(n)) {
case TCPD:
case TCP: s->sd = socket(sin->sin_family, SOCK_STREAM, IPPROTO_TCP); break;
case UDP: s->sd = socket(sin->sin_family, SOCK_DGRAM, IPPROTO_UDP); break;
case IP: s->sd = socket(sin->sin_family, SOCK_RAW, ntohs(sin->sin_port)); break;
case IEEE_802_3:s->sd = socket(sll->sll_family, SOCK_DGRAM, sll->sll_protocol); break;
@ -116,14 +114,6 @@ int socket_open(struct node *n)
if (ret < 0)
serror("Failed to bind socket");
/* Connect socket for sending */
if (node_type(n) == TCP) {
s->sd2 = s->sd;
ret = connect(s->sd, (struct sockaddr *) &s->remote, sizeof(s->remote));
if (ret < 0)
serror("Failed to connect socket");
}
/* Set fwmark for outgoing packets */
if (setsockopt(s->sd, SOL_SOCKET, SO_MARK, &s->mark, sizeof(s->mark)))
serror("Failed to set fwmark for outgoing packets");
@ -133,8 +123,6 @@ int socket_open(struct node *n)
/* Set socket priority, QoS or TOS IP options */
int prio;
switch (node_type(n)) {
case TCPD:
case TCP:
case UDP:
case IP:
prio = IPTOS_LOWDELAY;
@ -381,12 +369,6 @@ int socket_parse_addr(const char *addr, struct sockaddr *sa, enum node_type type
hint.ai_flags |= AI_NUMERICSERV;
break;
case TCPD:
case TCP:
hint.ai_socktype = SOCK_STREAM;
hint.ai_protocol = IPPROTO_TCP;
break;
case UDP:
hint.ai_socktype = SOCK_DGRAM;
hint.ai_protocol = IPPROTO_UDP;

View file

@ -105,7 +105,6 @@ int main(int argc, char *argv[])
node->vt->refcnt++;
node_start(node);
node_start_defer(node);
/* Parse Arguments */
char c, *endptr;