+/* 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.
+ *
+ * After the number of tries has expired, the 'fsm' will disable itself
+ * instead of backing off and retrying. */
+void
+reconnect_set_max_tries(struct reconnect *fsm, unsigned int max_tries)
+{
+ fsm->max_tries = max_tries;
+}
+
+/* Returns the current remaining number of connection attempts, UINT_MAX if
+ * the number is unlimited. */
+unsigned int
+reconnect_get_max_tries(struct reconnect *fsm)
+{
+ return fsm->max_tries;
+}
+