From: Guus Sliepen Date: Sat, 19 Jun 2021 21:04:05 +0000 (+0200) Subject: Remove some unused variables. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=22b4cde7698b0d6c45bad752b1ab9acb5a68329b;p=meshlink-tiny Remove some unused variables. --- diff --git a/src/connection.h b/src/connection.h index 0bdea9e..d414e83 100644 --- a/src/connection.h +++ b/src/connection.h @@ -62,7 +62,6 @@ typedef struct connection_t { struct buffer_t inbuf; struct buffer_t outbuf; io_t io; /* input/output event on this metadata connection */ - int tcplen; /* length of incoming TCPpacket */ int allow_request; /* defined if there's only one request possible */ time_t last_ping_time; /* last time we saw some activity from the other end or pinged them */ time_t last_key_renewal; /* last time we renewed the SPTPS key */ diff --git a/src/devtools.c b/src/devtools.c index 54fe84a..2c135ea 100644 --- a/src/devtools.c +++ b/src/devtools.c @@ -66,7 +66,6 @@ void devtool_get_node_status(meshlink_handle_t *mesh, meshlink_node_t *node, dev } memcpy(&status->status, &internal->status, sizeof status->status); - memcpy(&status->address, &internal->address, sizeof status->address); status->mtu = internal->mtu; status->minmtu = internal->minmtu; status->maxmtu = internal->maxmtu; diff --git a/src/devtools.h b/src/devtools.h index 60b51d1..16b8959 100644 --- a/src/devtools.h +++ b/src/devtools.h @@ -32,7 +32,6 @@ typedef struct devtool_node_status devtool_node_status_t; /// The status of a node. struct devtool_node_status { uint32_t status; - struct sockaddr_storage address; uint16_t mtu; uint16_t minmtu; uint16_t maxmtu; diff --git a/src/meshlink_internal.h b/src/meshlink_internal.h index 3113bea..3074863 100644 --- a/src/meshlink_internal.h +++ b/src/meshlink_internal.h @@ -97,12 +97,9 @@ struct meshlink_handle { struct connection_t *connection; struct outgoing_t *outgoing; - int connection_burst; int contradicting_add_edge; int contradicting_del_edge; int sleeptime; - time_t connection_burst_time; - time_t last_hard_try; time_t last_unreachable; timeout_t pingtimer; timeout_t periodictimer; @@ -111,9 +108,6 @@ struct meshlink_handle { uint64_t prng_state[4]; uint32_t session_id; - int next_pit; - int pits[10]; - // Infrequently used callbacks meshlink_node_status_cb_t node_status_cb; meshlink_node_status_cb_t meta_status_cb; diff --git a/src/meta.c b/src/meta.c index 32e3de2..09edf79 100644 --- a/src/meta.c +++ b/src/meta.c @@ -95,12 +95,6 @@ bool receive_meta_sptps(void *handle, uint8_t type, const void *data, uint16_t l return true; } - /* Are we receiving a TCPpacket? */ - - if(c->tcplen) { - abort(); // TODO: get rid of tcplen altogether - } - /* Change newline to null byte, just like non-SPTPS requests */ if(request[length - 1] == '\n') { diff --git a/src/node.c b/src/node.c index 1c1c864..ce5a5a2 100644 --- a/src/node.c +++ b/src/node.c @@ -55,8 +55,6 @@ void free_node(node_t *n) { utcp_exit(n->utcp); - sockaddrfree(&n->address); - ecdsa_free(n->ecdsa); sptps_stop(&n->sptps); diff --git a/src/node.h b/src/node.h index dd19884..29d3725 100644 --- a/src/node.h +++ b/src/node.h @@ -53,10 +53,8 @@ typedef struct node_t { dev_class_t devclass; // Used for packet I/O - int sock; /* Socket to use for outgoing UDP packets */ uint32_t session_id; /* Unique ID for this node's currently running process */ sptps_t sptps; - sockaddr_t address; /* his real (internet) ip to send UDP packets to */ struct utcp *utcp; @@ -85,7 +83,6 @@ typedef struct node_t { char *canonical_address; /* The canonical address of this node, if known */ sockaddr_t recent[MAX_RECENT]; /* Recently seen addresses */ - sockaddr_t catta_address; /* Latest address seen by Catta */ struct node_t *nexthop; /* nearest node from us to him */ } node_t;