Skip to content

Commit

Permalink
rconn: Remove dead code and data.
Browse files Browse the repository at this point in the history
These functions had no callers, so remove them and the data maintained
just to implement them.

Found by inspection.

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Thomas Graf <[email protected]>
  • Loading branch information
blp committed Jan 19, 2015
1 parent 4c6b0ad commit f33368e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
26 changes: 1 addition & 25 deletions lib/rconn.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -102,7 +102,6 @@ struct rconn {
time_t backoff_deadline;
time_t last_connected;
time_t last_disconnected;
unsigned int packets_sent;
unsigned int seqno;
int last_error;

Expand All @@ -119,7 +118,6 @@ struct rconn {

/* These values are simply for statistics reporting, not used directly by
* anything internal to the rconn (or ofproto for that matter). */
unsigned int packets_received;
unsigned int n_attempted_connections, n_successful_connections;
time_t creation_time;
unsigned long int total_time_connected;
Expand Down Expand Up @@ -262,12 +260,9 @@ rconn_create(int probe_interval, int max_backoff, uint8_t dscp,
rc->last_disconnected = TIME_MIN;
rc->seqno = 0;

rc->packets_sent = 0;

rc->probably_admitted = false;
rc->last_admitted = time_now();

rc->packets_received = 0;
rc->n_attempted_connections = 0;
rc->n_successful_connections = 0;
rc->creation_time = time_now();
Expand Down Expand Up @@ -714,7 +709,6 @@ rconn_recv(struct rconn *rc)
rc->last_admitted = time_now();
}
rc->last_activity = time_now();
rc->packets_received++;
if (rc->state == S_IDLE) {
state_transition(rc, S_ACTIVE);
}
Expand Down Expand Up @@ -831,15 +825,6 @@ rconn_send_with_limit(struct rconn *rc, struct ofpbuf *b,
return error;
}

/* Returns the total number of packets successfully sent on the underlying
* vconn. A packet is not counted as sent while it is still queued in the
* rconn, only when it has been successfuly passed to the vconn. */
unsigned int
rconn_packets_sent(const struct rconn *rc)
{
return rc->packets_sent;
}

/* Adds 'vconn' to 'rc' as a monitoring connection, to which all messages sent
* and received on 'rconn' will be copied. 'rc' takes ownership of 'vconn'. */
void
Expand Down Expand Up @@ -964,14 +949,6 @@ rconn_get_version(const struct rconn *rconn)
return version;
}

/* Returns the total number of packets successfully received by the underlying
* vconn. */
unsigned int
rconn_packets_received(const struct rconn *rc)
{
return rc->packets_received;
}

/* Returns a string representing the internal state of 'rc'. The caller must
* not modify or free the string. */
const char *
Expand Down Expand Up @@ -1157,7 +1134,6 @@ try_send(struct rconn *rc)
return retval;
}
COVERAGE_INC(rconn_sent);
rc->packets_sent++;
if (counter) {
rconn_packet_counter_dec(counter, n_bytes);
}
Expand Down
4 changes: 1 addition & 3 deletions lib/rconn.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -69,8 +69,6 @@ void rconn_recv_wait(struct rconn *);
int rconn_send(struct rconn *, struct ofpbuf *, struct rconn_packet_counter *);
int rconn_send_with_limit(struct rconn *, struct ofpbuf *,
struct rconn_packet_counter *, int queue_limit);
unsigned int rconn_packets_sent(const struct rconn *);
unsigned int rconn_packets_received(const struct rconn *);

void rconn_add_monitor(struct rconn *, struct vconn *);

Expand Down

0 comments on commit f33368e

Please sign in to comment.