aboutsummaryrefslogtreecommitdiff
path: root/lib/stream.c
AgeCommit message (Collapse)Author
2013-10-01stream: Log a warning when the default OpenFlow or OVSDB port is used.Justin Pettit
Both OpenFlow and OVSDB have new IANA-assigned port numbers. We still default to the original values (6633 and 6632, respectively), but this commit logs a warning. In the future, we will switch to the official values (6653 and 6640, respectively). Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-10-01Don't differentiate between TCP and SSL ports for OpenFlow and OVSDB.Justin Pettit
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>
2013-09-27Remove unused variables and functions.Jarno Rajahalme
Found by Clang. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-04-18ovsdb-server: Announce bound listening ports as status:bound_port.Ben Pfaff
The administrator can request that OVSDB bind any available TCP port, but in that case there is no easy way to find out what port it has bound. This commit adds that information as the "bound_port" key in the "status" column. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-01-16Replace most uses of assert by ovs_assert.Ben Pfaff
This is a straight search-and-replace, except that I also removed #include <assert.h> from each file where there were no assert calls left. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2012-09-26pstream: Add set_dscp method.Isaku Yamahata
Introduce set_dscp method to pstream. This will be used by dynamic dscp change of listening socket. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-30ofp-msgs: New approach to encoding and decoding OpenFlow headers.Ben Pfaff
OpenFlow headers are not as uniform as they could be, with size, alignment, and numbering changes from one version to another and across varieties (e.g. ordinary messages vs. "stats" messages). Until now the Open vSwitch internal APIs haven't done a good job of abstracting those differences in header formats. This commit changes that; from this commit forward very little code actually needs to understand the header format or numbering. Instead, it can just encode or decode, or pull or put, the header using a more abstract API using the ofpraw_, ofptype_, and other APIs in the new ofp-msgs module. Signed-off-by: Ben Pfaff <blp@nicira.com> Tested-by: Simon Horman <horms@verge.net.au> Reviewed-by: Simon Horman <horms@verge.net.au>
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-04-12stream: By default disable probing on unix sockets.Ethan Jackson
There isn't a lot of value in sending inactivity probes on unix sockets. This patch changes the default to disable them. Signed-off-by: Ethan Jackson <ethan@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-07Begin breaking openflow-1.0.h into common and version-specific definitions.Ben Pfaff
The intention is that, as each OpenFlow 1.1 and 1.2 feature is added to Open vSwitch, the corresponding protocol definitions will be broken up this way: - Definitions that are the same in OF1.0 and OF1.1 will retain the "OFP" or "ofp" prefix and move to openflow-common.h. - Definitions that are specific to OF1.0 will be renamed with an "OFP10" or "ofp10" prefix and stay in openflow-1.0.h. - Definitions that are specific to OF1.1 or to OF1.1 and OF1.2 will be renamed with an "OFP11" or "ofp11" prefix and move to openflow-1.1.h. - Definitions that are specific to OF1.2 will be renamed with an "OFP12" or "ofp12" prefix and move to openflow-1.2.h. This commit starts this process with some basic OpenFlow definitions. Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-12-19vswitchd: In-band rules for Controller are missing after executing ↵Ansis Atteka
force-reload-kmod command In current implementation vswitchd adds Controller in-band rules only if there is a route in kernel routing table that might route traffic to the Controller. But, when executing force-reload-kmod command, network configuration (e.g. assigned IP addresses, routes) are flushed away, hence Controller in-band rules are not added. This commit fixes this limitation and allows vswitchd to add Controller in-band rules even if there are no routes in the kernel routing table. Issue: #8625 Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2011-11-23stream: Make classes constSimon Horman
The classes are never modified and may be declared constant.
2011-11-02stream: Fix uninitialized values in stream_init().Ben Pfaff
stream_init() didn't initialize the remote_ip, remote_port, local_ip, or local_port members of the stream, so "unix" streams that don't have any of those would get random values instead. Reported-by: "Voravit T." <voravit@kth.se> Reported-by: Jari Sundell <sundell.software@gmail.com>
2011-02-23stream: Make stream_report_content() tolerate negative size.Ben Pfaff
A negative size probably means that a system call failed. The caller could set that to 0 but we might as well just tolerate it in stream_report_content() by making the parameter type signed. Coverity #10718.
2011-01-27stream: Fix error message.Ben Pfaff
This message is supposed to be helpful but with the arguments in the wrong order it was just confusing.
2010-11-30coverage: Make the coverage counters catalog program-specific.Ben Pfaff
Until now, the collection of coverage counters supported by a given OVS program was not specific to that program. That means that, for example, even though ovs-dpctl does not have anything to do with mac_learning, it still has a coverage counter for it. This is confusing, at best. This commit fixes the problem on some systems, in particular on ones that use GCC and the GNU linker. It uses the feature of the GNU linker described in its manual as: If an orphaned section's name is representable as a C identifier then the linker will automatically see PROVIDE two symbols: __start_SECNAME and __end_SECNAME, where SECNAME is the name of the section. These indicate the start address and end address of the orphaned section respectively. Systems that don't support these features retain the earlier behavior. This commit also fixes the annoyance that files that include coverage counters must be listed on COVERAGE_FILES in lib/automake.mk. This commit also fixes the annoyance that modifying any source file that includes a coverage counter caused all programs that link against libopenvswitch.a to relink, even programs that the source file was not linked into. For example, modifying ofproto/ofproto.c (which includes coverage counters) caused tests/test-aes128 to relink, even though test-aes128 does not link again ofproto.o.
2010-11-29Convert stream and vconn interfaces to use ovs_be16, ovs_be32.Ben Pfaff
2010-10-29vlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.Ben Pfaff
It's kind of odd for VLOG_DEFINE_THIS_MODULE to supply its own semicolon, so this commit switches to the more common form.
2010-08-25stream, vconn: Fix comments.Ben Pfaff
All streams and all vconns are "active", so there's no point in noting that requirement in comments. (A long time ago, active and passive vconns were conflated instead of having passive vconns broken out as pvconns. But active and passive streams have always been distinct.)
2010-07-21vlog: Make the vlog module catalog program-specific.Ben Pfaff
Until now, the collection of vlog modules supported by a given OVS program was not specific to that program. That means that, for example, even though ovs-dpctl does not have anything to do with jsonrpc, it still has a vlog module for it. This is confusing, at best. This commit fixes the problem on some systems, in particular on ones that use GCC and the GNU linker. It uses the feature of the GNU linker described in its manual as: If an orphaned section's name is representable as a C identifier then the linker will automatically see PROVIDE two symbols: __start_SECNAME and __end_SECNAME, where SECNAME is the name of the section. These indicate the start address and end address of the orphaned section respectively. Systems that don't support these features retain the earlier behavior. This commit also fixes the annoyance that modifying lib/vlog-modules.def causes all sources files that #include "vlog.h" to recompile.
2010-07-21vlog: Introduce VLOG_DEFINE_THIS_MODULE for declaring vlog module in use.Ben Pfaff
Adding a macro to define the vlog module in use adds a level of indirection, which makes it easier to change how the vlog module must be defined. A followup commit needs to do that, so getting these widespread changes out of the way first should make that commit easier to review.
2010-06-24vconn: Fix tracking of "connected" state.Ben Pfaff
While I was looking at the rconn code for connection backoff and retry, I noticed that ovs-vswitchd was logging the following on each connection attempt: Jun 11 15:17:41|00020|vconn_stream|ERR|send: Connection refused The "send:" part didn't make much sense. The configured controller was not actually running, so the vconn code should not have been able to connect at all, so the message should have been about a connection failing, not about sending on a completed connection failing. Investigation showed that different parts of the library have different ideas about return value semantics. vconn_open() and stream_open() both return 0 if a connection succeeded or if one is in progress, but some of its callers thought that it returned 0 if the connection succeeded and EAGAIN if the connection was in progress. This commit fixes up the callers that had the wrong idea, by making them instead all vconn_connect() or stream_connect() to determine whether the connection is complete.
2010-05-11Diagnose attempts to connect the wrong protocol to a network port.Ben Pfaff
Sometimes, when a user asks me to help debug a problem, it turns out that an SSL connection was being made on a TCP port, or vice versa, or that an OpenFlow connection was being made on a JSON-RPC port, or vice versa, and so on. This commit adds log messages that diagnose this kind of problem, e.g. "tcp:127.0.0.1:6633: received JSON-RPC data on OpenFlow channel".
2010-04-13Make fatal signals cause an exit more promptly in special cases.Ben Pfaff
The fatal-signal library notices and records fatal signals (e.g. SIGTERM) and terminates the process on the next trip through poll_block(). But some special utilities do not always invoke poll_block() promptly, e.g. "ovs-ofctl monitor" does not call poll_block() as long as OpenFlow messages are available. But these special cases seem like they are all likely to call into functions that themselves block (those with "_block" in their names). So make a new rule that such functions should always call fatal_signal_run(), either directly or through poll_block(). This commit implements and documents that rule. Bug #2625.
2010-04-12vconn-stream: Factor out port defaults into public helper functions.Ben Pfaff
These functions will be used elsewhere in an upcoming commit.
2010-04-12stream: Generalize stream_open_block().Ben Pfaff
This change makes it possible to separate opening a stream from blocking on connection completion. This avoids some code redundancy in an upcoming commit.
2010-04-12stream: New functions stream_verify_name() and pstream_verify_name().Ben Pfaff
These functions can be useful for checking whether a given name is an active or passive connection method. The implementation is cut-and-paste from vconn_verify_name() and pvconn_verify_name().
2010-02-11Merge "master" into "next".Ben Pfaff
The main change here is the need to update all of the uses of UNUSED in the next branch to OVS_UNUSED as it is now spelled on "master".
2010-01-07stream: Really enable SSL streams.Ben Pfaff
SSL streams were supposed to work, but they didn't. Oops.
2010-01-06Add SSL support to "stream" library and OVSDB.Ben Pfaff
2010-01-06stream: Add stream_run(), stream_run_wait() functions.Ben Pfaff
SSL, which will be added in an upcoming commit, requires some background processing, which is best done in a "run" function in our architecture. This commit adds stream_run() and stream_run_wait() and calls to them from the places where they will be required.
2010-01-06Check invariants earlier in vconn and stream code.Ben Pfaff
These invariants are checked by vconn_open() and stream_open(), but there is no reason not to check them earlier also. vconn and stream creation don't have to go through vconn_open() and stream_open(), so this ensures that the invariants get checked either way.
2009-11-12stream: New function pstream_accept_block().Ben Pfaff
2009-11-04stream: New library for bidirectional streams (e.g. TCP, SSL, Unix sockets).Ben Pfaff
This code is heavily based on the vconn code. Eventually we should make the stream-based vconns (currently that's all of them) a wrapper around streams, but I haven't done that yet. SSL is not implemented yet.