summaryrefslogtreecommitdiff
path: root/tests/test-reconnect.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-03-24 13:09:38 -0700
committerBen Pfaff <blp@nicira.com>2010-04-12 11:03:32 -0700
commit19df7f512c50e453c8eaa97675e213b4d6e9735d (patch)
treeeb915fcf266710e759f59595e9c1493b4cd346a6 /tests/test-reconnect.c
parent024b7728cc40be792f9a27c434720258d8e77ef0 (diff)
downloadopenvswitch-19df7f512c50e453c8eaa97675e213b4d6e9735d.tar.gz
reconnect: Implement "passive mode".
This allows the reconnect library to support clients that want to listen for an incoming connection.
Diffstat (limited to 'tests/test-reconnect.c')
-rw-r--r--tests/test-reconnect.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test-reconnect.c b/tests/test-reconnect.c
index 93991ff56..2d0d44148 100644
--- a/tests/test-reconnect.c
+++ b/tests/test-reconnect.c
@@ -235,6 +235,24 @@ diff_stats(const struct reconnect_stats *old,
}
}
+static void
+do_set_passive(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
+{
+ reconnect_set_passive(reconnect, true, now);
+}
+
+static void
+do_listening(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
+{
+ reconnect_listening(reconnect, now);
+}
+
+static void
+do_listen_error(int argc OVS_UNUSED, char *argv[])
+{
+ reconnect_listen_error(reconnect, now, atoi(argv[1]));
+}
+
static const struct command commands[] = {
{ "enable", 0, 0, do_enable },
{ "disable", 0, 0, do_disable },
@@ -248,6 +266,9 @@ static const struct command commands[] = {
{ "advance", 1, 1, do_advance },
{ "timeout", 0, 0, do_timeout },
{ "set-max-tries", 1, 1, do_set_max_tries },
+ { "passive", 0, 0, do_set_passive },
+ { "listening", 0, 0, do_listening },
+ { "listen-error", 1, 1, do_listen_error },
{ NULL, 0, 0, NULL },
};