summaryrefslogtreecommitdiff
path: root/lib/reconnect.c
diff options
context:
space:
mode:
authorMehak Mahajan <mmahajan@nicira.com>2012-03-10 15:58:10 -0800
committerMehak Mahajan <mmahajan@nicira.com>2012-03-23 18:13:08 -0700
commitf125905cdd3dc0339ad968c0a70128807884b400 (patch)
treeab389d41b625f2d9e5c820bdac80ec2df825ff8a /lib/reconnect.c
parent11460e2316b88f0bd0ea0005d94338d800ea16bd (diff)
downloadopenvswitch-f125905cdd3dc0339ad968c0a70128807884b400.tar.gz
Allow configuring DSCP on controller and manager connections.
The changes allow the user to specify a separate dscp value for the controller connection and the manager connection. The value will take effect on resetting the connections. If no value is specified a default value of 192 is chosen for each of the connections. Feature #10074 Requested-by: Rajiv Ramanathan <rramanathan@nicira.com> Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Diffstat (limited to 'lib/reconnect.c')
-rw-r--r--lib/reconnect.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/reconnect.c b/lib/reconnect.c
index c16901623..7737fcf7e 100644
--- a/lib/reconnect.c
+++ b/lib/reconnect.c
@@ -54,6 +54,8 @@ struct reconnect {
bool passive;
enum vlog_level info; /* Used for informational messages. */
+ uint8_t dscp;
+
/* State. */
enum state state;
long long int state_entered;
@@ -186,6 +188,14 @@ reconnect_get_probe_interval(const struct reconnect *fsm)
return fsm->probe_interval;
}
+/* Returns the dscp value used for establishing the connection between the
+ * manager and the database. */
+uint8_t
+reconnect_get_dscp(const struct reconnect *fsm)
+{
+ return fsm->dscp;
+}
+
/* Limits the maximum number of times that 'fsm' will ask the client to try to
* reconnect to 'max_tries'. UINT_MAX (the default) means an unlimited number
* of tries.
@@ -245,6 +255,14 @@ reconnect_set_probe_interval(struct reconnect *fsm, int probe_interval)
fsm->probe_interval = probe_interval ? MAX(1000, probe_interval) : 0;
}
+/* Sets the dscp value to be used for establishing a connection between the
+ * manager and the database. */
+void
+reconnect_set_dscp(struct reconnect *fsm, uint8_t dscp)
+{
+ fsm->dscp = dscp;
+}
+
/* Returns true if 'fsm' is in passive mode, false if 'fsm' is in active mode
* (the default). */
bool