X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Frconn.c;h=06f36264ed51a4954437c677d1c7cf6bce2f6a34;hb=cd0cd65fe3721aa575e5eec081783f8047eda545;hp=36828f3abda1703fcf64cd006c1a8c71181abfb2;hpb=07c8c80deed155a4edf5ecf262d4d2642f0c1354;p=sliver-openvswitch.git diff --git a/lib/rconn.c b/lib/rconn.c index 36828f3ab..06f36264e 100644 --- a/lib/rconn.c +++ b/lib/rconn.c @@ -30,10 +30,10 @@ #include "timeval.h" #include "util.h" #include "vconn.h" - -#define THIS_MODULE VLM_rconn #include "vlog.h" +VLOG_DEFINE_THIS_MODULE(rconn) + #define STATES \ STATE(VOID, 1 << 0) \ STATE(BACKOFF, 1 << 1) \ @@ -710,7 +710,7 @@ rconn_failure_duration(const struct rconn *rconn) /* Returns the IP address of the peer, or 0 if the peer's IP address is not * known. */ uint32_t -rconn_get_remote_ip(const struct rconn *rconn) +rconn_get_remote_ip(const struct rconn *rconn) { return rconn->remote_ip; } @@ -718,16 +718,16 @@ rconn_get_remote_ip(const struct rconn *rconn) /* Returns the transport port of the peer, or 0 if the peer's port is not * known. */ uint16_t -rconn_get_remote_port(const struct rconn *rconn) +rconn_get_remote_port(const struct rconn *rconn) { return rconn->remote_port; } /* Returns the IP address used to connect to the peer, or 0 if the - * connection is not an IP-based protocol or if its IP address is not + * connection is not an IP-based protocol or if its IP address is not * known. */ uint32_t -rconn_get_local_ip(const struct rconn *rconn) +rconn_get_local_ip(const struct rconn *rconn) { return rconn->local_ip; } @@ -735,7 +735,7 @@ rconn_get_local_ip(const struct rconn *rconn) /* Returns the transport port used to connect to the peer, or 0 if the * connection does not contain a port or if the port is not known. */ uint16_t -rconn_get_local_port(const struct rconn *rconn) +rconn_get_local_port(const struct rconn *rconn) { return rconn->vconn ? vconn_get_local_port(rconn->vconn) : 0; } @@ -1059,7 +1059,7 @@ state_transition(struct rconn *rc, enum state state) } static void -question_connectivity(struct rconn *rc) +question_connectivity(struct rconn *rc) { time_t now = time_now(); if (now - rc->last_questioned > 60) { @@ -1097,7 +1097,7 @@ copy_to_monitor(struct rconn *rc, const struct ofpbuf *b) } static bool -is_connected_state(enum state state) +is_connected_state(enum state state) { return (state & (S_ACTIVE | S_IDLE)) != 0; }