summaryrefslogtreecommitdiff
path: root/lib/jsonrpc.h
Commit message (Collapse)AuthorAgeFilesLines
* Use the IANA-assigned ports for OpenFlow and OVSDB.Justin Pettit2015-03-121-3/+1
| | | | | | | | We've been warning about the change since 2.1, which was released a year ago. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-vsctl: reconnect to the database if connection was droppedAnsis Atteka2014-02-191-0/+1
| | | | | | | | | | | | | | If ovs-vsctl has to wait for ovs-vswitchd to reconfigure itself according to the new database, then sometimes ovs-vsctl could end up stuck in the event loop if OVSDB connection was dropped while ovs-vsctl was still running. This patch fixes this problem by letting ovs-vsctl to reconnect to the OVSDB, if it has to wait cur_cfg field to be updated. Issue: 1191997 Reported-by: Spiro Kourtessis <spiro@nicira.com> Signed-Off-By: Ansis Atteka <aatteka@nicira.com>
* ovsdb: Define official port number.Justin Pettit2013-10-011-4/+7
| | | | | Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Don't differentiate between TCP and SSL ports for OpenFlow and OVSDB.Justin Pettit2013-10-011-3/+2
| | | | | | | | | | | | The OVS code has always made a distinction between the unencrypted (TCP) and SSL port numbers for the OpenFlow and OVSDB protocols. The default port numbers for both protocols has changed, and there continues to be no distinction between the unencrypted and SSL versions. This commit removes the distinction in port numbers. A future patch will recognize the change in default port number. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-vsctl: Try connecting only once for active connections by default.Ben Pfaff2013-03-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | | Until now, ovs-vsctl has kept trying to the database server until it succeeded or the timeout expired (if one was specified with --timeout). This meant that if ovsdb-server wasn't running, then ovs-vsctl would hang. The result was that almost every ovs-vsctl invocation in scripts specified a timeout on the off-chance that the database server might not be running. But it's difficult to choose a good timeout. A timeout that is too short can cause spurious failures. A timeout that is too long causes long delays if the server really isn't running. This commit should alleviate this problem. It changes ovs-vsctl's behavior so that, if it fails to connect to the server, it exits unsuccessfully. This makes --timeout obsolete for the purpose of avoiding a hang if the database server isn't running. (--timeout is still useful to avoid a hang if ovsdb-server is running but ovs-vswitchd is not, for ovs-vsctl commands that modify the database. --no-wait also avoids that issue.) Bug #2393. Bug #15594. Reported-by: Jeff Merrick <jmerrick@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovsdb/jsonrpc-server: ovsdb-server closes accepted connections immediately.Mehak Mahajan2012-10-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2012-09-14T05:38:26Z|00001|jsonrpc|WARN|tcp:127.0.0.1:6634: receive error: Con ovsdb-client: transaction failed (Connection reset by peer) NOTE: This occurs intermittently depending on how ovsdb-server runs. Running ovsdb-client on a remote machine increases the possibility. This is because ovsdb-server closes newly accepted tcp connection. The following changesets caused it. struct jsonrpc_session::dscp isn't set based on listening socket's dscp value. - ovsdb-server creates passive connection and listens on it. - ovsdb-server accepts connection by ovsdb_jsonrpc_server_run(). The accepted socket inherits from the listening sockets. ovsdb_jsonrpc_server_run() creates json session, but leaves dscp of struct jsonrpc_session zero. - On calling reconfigure_from_db(), it resets dscp value to all jsonrpc sessions. Eventually jsonrpc_session_set_dscp() is called. Then jsonrpc_session_force_reconnect() closes the connection. With this patch, - struct jsonrpc_session::dscp is correctly set based on listening sockets dscp value. - dscp of listening socket is changed dynamically by setsockopt. This leaves a window where accepted socket may have old dscp. But it is ignored for now because it would complicates codes too much. The related change sets: - 0442efd9b1a88d923b56eab6b72b6be8231a49f7 Reapplying the dscp changes: No need to restart DB/OVS on changing dscp value. - 59efa47adf3234ec51541405726d033173851285 Revert DSCP update changes. - b2e18db292cd4962af3248f11e9f17e6eaf9c033 No need to restart DB / OVS on changing dscp value. - f125905cdd3dc0339ad968c0a70128807884b400 Allow configuring DSCP on controller and manager connections. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
* jsonrpc: Treat receiving part of a message as activity.Ben Pfaff2012-09-071-0/+1
| | | | | | | | | | | | | | | Until now, the jsonrpc code has only counted receiving a full JSON-RPC messages as activity. This could theoretically time out, then, while a very long message is in transit or if a slow link is involved. This commit changes this code to count receiving any part of a message as activity. This isn't a problem for OpenFlow connections because OpenFlow messages are at most 64 kB in size. This problem hasn't actually been observed in practice. Bug #12789. Signed-off-by: Ben Pfaff <blp@nicira.com>
* Global replace of Nicira Networks.Raju Subramanian2012-05-021-1/+1
| | | | | | | | Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Allow configuring DSCP on controller and manager connections.Mehak Mahajan2012-03-231-2/+5
| | | | | | | | | | | 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>
* jsonrpc: Make jsonrpc_error() internal.Ben Pfaff2012-02-271-2/+1
| | | | | | | | This function is an implementation detail. The JSONRPC unit test used it, but not for any good reason, so this commit changes the test to avoid using it. Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovsdb-server: Write manager status information to Manager table.Andrew Evans2011-02-011-0/+5
| | | | | | | | | | | | This commit makes the status of manager connections visible via the Manager table in the database. Two new columns have been created for this purpose: 'is_connected' and 'status'. The former is a boolean flag, and the latter is a string-string map which may contain the keys "last_error", "state", and "time_in_state". Requested-by: Keith Amidon <keith@nicira.com> Reviewed by: Ben Pfaff. Feature #3692.
* Add "Manager" and "manager_options" to allow options for OVSDB connections.Ben Pfaff2010-11-051-0/+5
| | | | | | | | | I'm retaining the "managers" column in the Open_vSwitch table for now, but I hope that applications transition to using "manager_options" eventually so that we could drop it. CC: Andrew Lambeth <wal@nicira.com> CC: Jeremy Stribling <strib@nicira.com>
* ovsdb: Use port 6632 as a default port for database connections.Ben Pfaff2010-04-121-1/+12
| | | | | Until now we have required a port number to be specified explicitly for database connections. This commit adopts port 6632 as a default.
* ovsdb-server: Factor out complication by using jsonrpc_session.Ben Pfaff2010-01-041-0/+2
|
* jsonrpc: Make it easy to get a new JSON-RPC request's id.Ben Pfaff2009-12-021-1/+2
|
* jsonrpc: New type "jsonrpc_session", which automatically reconnects.Ben Pfaff2009-12-021-0/+19
|
* ovsdb: Add new ovsdb-client program.Ben Pfaff2009-11-061-0/+2
|
* Implement JSON-RPC protocol.Ben Pfaff2009-11-041-0/+83