diff --git a/server/src/node.c b/server/src/node.c index 085443f0b..eb9079a0b 100644 --- a/server/src/node.c +++ b/server/src/node.c @@ -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: { } } diff --git a/server/src/path.c b/server/src/path.c index 043973bc3..e02a145b6 100644 --- a/server/src/path.c +++ b/server/src/path.c @@ -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 */ diff --git a/server/src/receive.c b/server/src/receive.c index 2f9f74e56..8b311b94c 100644 --- a/server/src/receive.c +++ b/server/src/receive.c @@ -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); diff --git a/server/src/send.c b/server/src/send.c index 568fad7ee..564d00b2e 100644 --- a/server/src/send.c +++ b/server/src/send.c @@ -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); diff --git a/server/src/socket.c b/server/src/socket.c index bb238123d..d493b7d27 100644 --- a/server/src/socket.c +++ b/server/src/socket.c @@ -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; diff --git a/server/src/test.c b/server/src/test.c index 8f9731793..ce92145fd 100644 --- a/server/src/test.c +++ b/server/src/test.c @@ -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;