diff options
author | Mehak Mahajan <mmahajan@nicira.com> | 2012-03-10 15:58:10 -0800 |
---|---|---|
committer | Mehak Mahajan <mmahajan@nicira.com> | 2012-03-23 18:13:08 -0700 |
commit | f125905cdd3dc0339ad968c0a70128807884b400 (patch) | |
tree | ab389d41b625f2d9e5c820bdac80ec2df825ff8a /lib/jsonrpc.c | |
parent | 11460e2316b88f0bd0ea0005d94338d800ea16bd (diff) |
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/jsonrpc.c')
-rw-r--r-- | lib/jsonrpc.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c index 09b10711..fa3362d1 100644 --- a/lib/jsonrpc.c +++ b/lib/jsonrpc.c @@ -60,19 +60,20 @@ static void jsonrpc_error(struct jsonrpc *, int error); /* This is just the same as stream_open() except that it uses the default * JSONRPC ports if none is specified. */ int -jsonrpc_stream_open(const char *name, struct stream **streamp) +jsonrpc_stream_open(const char *name, struct stream **streamp, uint8_t dscp) { return stream_open_with_default_ports(name, JSONRPC_TCP_PORT, - JSONRPC_SSL_PORT, streamp); + JSONRPC_SSL_PORT, streamp, + dscp); } /* This is just the same as pstream_open() except that it uses the default * JSONRPC ports if none is specified. */ int -jsonrpc_pstream_open(const char *name, struct pstream **pstreamp) +jsonrpc_pstream_open(const char *name, struct pstream **pstreamp, uint8_t dscp) { return pstream_open_with_default_ports(name, JSONRPC_TCP_PORT, - JSONRPC_SSL_PORT, pstreamp); + JSONRPC_SSL_PORT, pstreamp, dscp); } /* Returns a new JSON-RPC stream that uses 'stream' for input and output. The @@ -825,12 +826,14 @@ jsonrpc_session_connect(struct jsonrpc_session *s) jsonrpc_session_disconnect(s); if (!reconnect_is_passive(s->reconnect)) { - error = jsonrpc_stream_open(name, &s->stream); + error = jsonrpc_stream_open(name, &s->stream, + reconnect_get_dscp(s->reconnect)); if (!error) { reconnect_connecting(s->reconnect, time_msec()); } } else { - error = s->pstream ? 0 : jsonrpc_pstream_open(name, &s->pstream); + error = s->pstream ? 0 : jsonrpc_pstream_open(name, &s->pstream, + reconnect_get_dscp(s->reconnect)); if (!error) { reconnect_listening(s->reconnect, time_msec()); } @@ -1041,3 +1044,10 @@ jsonrpc_session_set_probe_interval(struct jsonrpc_session *s, { reconnect_set_probe_interval(s->reconnect, probe_interval); } + +void +jsonrpc_session_set_dscp(struct jsonrpc_session *s, + uint8_t dscp) +{ + reconnect_set_dscp(s->reconnect, dscp); +} |