aboutsummaryrefslogtreecommitdiff
path: root/lib/vconn.h
AgeCommit message (Collapse)Author
2013-01-24rconn: Fix null pointer dereference in rconn_add_monitor().Ben Pfaff
rconn_add_monitor() tries to check the version of the controller connection being monitored, so that it can decide what OpenFlow version to tell the monitor connection to negotiate. But at any given time an rconn may not have a controller connection (e.g. during backoff), so rc->vconn may be null and thus vconn_get_version(rc->vconn) dereferences a null pointer. Fixing the problem in a local way would require the rconn to remember the previous version negotiated, and that fails if the rconn hasn't yet connected or if the next connection negotiates a new version. This commit instead adds the ability to a vconn to accept any OpenFlow message version and modifies "ovs-ofctl snoop" to use that feature, thus removing the need to negotiate the "correct" version on snoops. Bug #14265. Reported-by: Pratap Reddy <preddy@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-01-04vconn: Fix parameters for vconn_open(), vconn_open_block(), pvconn_open().Ben Pfaff
The customary parameter order in Open vSwitch is to put input parameters before output parameters, but vconn_open() and pvconn_open() had the 'dscp' input parameter at the end, which bugged me a bit. Also, vconn_open_block() didn't take a 'dscp' parameter at all even though it's otherwise a wrapper around vconn_open(). This commit fixes all that up. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2012-11-12vonn: Allow snoops to use the OpenFlow version of the controller connectionSimon Horman
Override the allowed versions of the snoop vconn so that only the version of the controller connection is allowed. This is because the snoop will see the same messages as the controller. Without this change the snoop will try to negotiate a connection using the default allowed versions, or in other words only allow OpenFlow 1.0. This breaks snoops for controller connections using other OpenFlow versions, that is OpenFlow 1.2. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-11-04vconn: Replace minimum version with bitmap of allowed versions.Simon Horman
This is in preparation for allowing the range of allowed OpenFlow versions to be configured. As part of this change pvconn_open() is now paramatised over the allowed versions. this is to avoid avoids needing to provide version information as a parameter to pvconn_accept(). This will in turn avoid the need to pass version information to connmgr_run(). Signed-off-by: Simon Horman <horms@verge.net.au> [blp@nicira.com simplified slightly and generalize log messages] Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-07vconn: Fix vconn_get_version().Ben Pfaff
It's documented to return -1 if the version isn't yet known, but in fact it returned 0. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-31test-vconn: Block in three cases where a race is visible on FreeBSD.Ben Pfaff
On FreeBSD, sometimes plain vconn_connect() or vconn_recv() reports EAGAIN in these cases. Reported-by: Ed Maste <emaste@freebsd.org> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-30openflow: Add enum ofp_versionSimon Horman
Use an enum for ofp_version in ofp-util and ofp-msg. This in conjunction with the use of switch() statements allows the compiler to warn when a new ofp_version isn't handled. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02Global replace of Nicira Networks.Raju Subramanian
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>
2012-03-23Allow configuring DSCP on controller and manager connections.Mehak Mahajan
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>
2012-03-07Introduce ofputil_protocol, to abstract the protocol in use on a connection.Ben Pfaff
Open vSwitch already handles a few different protocol variations, but it does so in a nonuniform manner: - OpenFlow 1.0 and NXM flow formats are distinguished using the NXFF_* constant values from nicira-ext.h. - The "flow_mod_table_id" feature setting is maintained in ofproto as part of an OpenFlow connection's (ofconn's) state. There's no way to easily communicate this state among components. It's not much of a problem yet, but as more protocol support is added it seems better to have an abstract, uniform way to represent protocol versions and variants. This commit implements that by introducing a new type "enum ofputil_protocol". Each ofputil_protocol value represents a variant of a protocol version. Each value is a separate bit, so a single enum can also represent a set of protocols, which is often useful as well. Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-10-04vconn: Remove unnecessary forward declarations and #includes from header.Ben Pfaff
This required fix-ups in a few other files that accidentally depended upon vconn.h including those other headers.
2011-08-04lib: Adapt headers for use in C++.Casey Barker
This commit makes several library headers suitable for inclusion in C++. It adds [extern "C"] guards and makes minor changes to fix casting and keyword issues.
2011-06-14openflow: Merge ofp_stats_request and ofp_stats_reply.Ben Pfaff
These structures for OpenFlow stats requests and replies have identical memebers, but until now they have been separate structures. Since in some cases we actually want to treat both of them the same way, this has led to various kinds of awkwardness. This commit merges them into a new "struct ofp_stats_msg" and fixes up the users.
2011-05-16Convert remaining network-byte-order "uint<N>_t"s into "ovs_be<N>"s.Ben Pfaff
I looked at almost every uint<N>_t in the tree to determine whether it was really in network byte order, and converted the ones that were. The only remaining ones, modulo my mistakes, are in openflow.h. I'm not sure whether we should convert those, because there might be some value in remaining close to upstream for this header.
2010-12-06vconn: New function vconn_transact_multiple_noreply().Ben Pfaff
This will be useful for sending a bunch of flow_mod messages all at once.
2010-12-02vconn: New function vconn_transact_noreply().Ben Pfaff
2010-11-29Convert stream and vconn interfaces to use ovs_be16, ovs_be32.Ben Pfaff
2010-06-17vconn: Move OpenFlow utility functions into new file ofp-util.c.Ben Pfaff
The main purpose of the vconn code is to ship OpenFlow messages across network connections. Over time a large number of utility functions related to OpenFlow messages have also crept into vconn.c, but that's really logically separate. This commit breaks those functions out into a new file.
2010-02-24Merge "master" into "next".Ben Pfaff
2010-02-12vconn: New functions vconn_verify_name(), pvconn_verify_name().Ben Pfaff
These are useful for checking that the syntax of a name is valid, so that completely invalid names can be rejected at program startup time. CC: Jean Tourrilhes <jt@hpl.hp.com>
2010-01-06vconn: Convert vconn code to modern OVS structure.Ben Pfaff
The vconn code is a relative fossil as OVS code goes. It was written before we had really figured how code should fit together. Part of that history is that it used poll_fd_callback() to register callbacks without the assistance of other code. That isn't how the rest of OVS works now; this code is the only remaining user of that function. To make it more like the rest of the system, this code gets rid of the use of poll_fd_callback(). It also adds vconn_run() and vconn_run_wait() functions and calls to them from the places where they are now required.
2009-09-16Factor out code for composing OFPT_PACKET_IN messages.Ben Pfaff
Currently only ofproto.c ever composes OFPT_PACKET_IN messages, but some upcoming code wants to do the same thing, so factor this out into a new function to avoid code duplication.
2009-07-08Have rconn and vconn export information about IPs and portsJustin Pettit
Previously, rconn and vconn only allowed users to find out about the remote IP address. This set of changes allows users to retrieve the remote port, local IP, and local port used for the connection.
2009-06-15Update primary code license to Apache 2.0.Ben Pfaff
2009-07-08Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.v0.90.0Ben Pfaff