struct stream *stream;
struct pstream *pstream;
unsigned int seqno;
+ uint8_t dscp;
};
/* Creates and returns a jsonrpc_session to 'name', which should be a string
s->stream = NULL;
s->pstream = NULL;
s->seqno = 0;
+ s->dscp = 0;
if (!pstream_verify_name(name)) {
reconnect_set_passive(s->reconnect, true, time_msec());
jsonrpc_session_disconnect(s);
if (!reconnect_is_passive(s->reconnect)) {
- error = jsonrpc_stream_open(name, &s->stream,
- reconnect_get_dscp(s->reconnect));
+ error = jsonrpc_stream_open(name, &s->stream, s->dscp);
if (!error) {
reconnect_connecting(s->reconnect, time_msec());
}
} else {
error = s->pstream ? 0 : jsonrpc_pstream_open(name, &s->pstream,
- reconnect_get_dscp(s->reconnect));
+ s->dscp);
if (!error) {
reconnect_listening(s->reconnect, time_msec());
}
jsonrpc_session_set_dscp(struct jsonrpc_session *s,
uint8_t dscp)
{
- reconnect_set_dscp(s->reconnect, dscp);
+ s->dscp = dscp;
}
bool passive;
enum vlog_level info; /* Used for informational messages. */
- uint8_t dscp;
-
/* State. */
enum state state;
long long int state_entered;
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.
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
* revisited later.) */
#include <stdbool.h>
-#include "openvswitch/types.h"
struct reconnect *reconnect_create(long long int now);
void reconnect_destroy(struct reconnect *);
int reconnect_get_min_backoff(const struct reconnect *);
int reconnect_get_max_backoff(const struct reconnect *);
int reconnect_get_probe_interval(const struct reconnect *);
-uint8_t reconnect_get_dscp(const struct reconnect *);
void reconnect_set_max_tries(struct reconnect *, unsigned int max_tries);
unsigned int reconnect_get_max_tries(struct reconnect *);
void reconnect_set_backoff(struct reconnect *,
int min_backoff, int max_backoff);
void reconnect_set_probe_interval(struct reconnect *, int probe_interval);
-void reconnect_set_dscp(struct reconnect *, uint8_t dscp);
bool reconnect_is_passive(const struct reconnect *);
void reconnect_set_passive(struct reconnect *, bool passive,