util: Move definition of HANDLE here.

A few Open vSwitch source files use a type named HANDLE on Windows systems,
in a way that makes it easier to avoid #ifdefs if we have a dummy
definition on other platforms.  <linux/types.h> was a really weird place
for this dummy definition.  This commit moves it to util.h.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
Move setsockopt TCP_NODELAY to when TCP is connected.

On windows platform, TCP_NODELAY can only be set when TCP
is established.  If the conection is not immediately returning
success, call it when state is changed from TCP_CONNECTING
to SSL_CONNECTING.

Signed-off-by: Linda Sun <lsun@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto: Break out perl code for sorting multiline messages

The flow monitoring tests includes a perl script to sort multiline
messages.  This commit breaks it out of an individual test so that it can
be used elsewhere.

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com changed approach from a separate file to a shell function]
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto: Honour NXFMF_OWN flag of flow monitors

If NXFMF_OWN is set then full updates should be sent.
Prior to this change an abbreviated update is always sent
to the controller to which a monitor belongs, that is,
the NXFMF_OWN flag is ignored.

Also:
* Update existing flow tests for this chagne
* Add a test to exercise NX flow monitor with !own

I noticed this while working on support for OpenFlow1.4 flow monitors.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
odp-util: Make it harder to forget to update ODPUTIL_FLOW_KEY_BYTES.

We've forgotten more than once.  Most updates coincide with adding
new flow members, so a build assertion on FLOW_WC_SEQ seems appropriate.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
stream-ssl: Enable TLSv1.1 and TLSv1.2.

The Open vSwitch SSL code was inadvertently enabling only TLSv1, not
later versions.  This commit should fix it.

See https://www.openssl.org/docs/ssl/SSL_CTX_new.html
and http://www.postgresql.org/message-id/20131203213049.GA8259@gmail.com
for more information.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reported-by: Abhinav Singhal <Abhinav.Singhal@spirent.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
netdev-vport: Use dpif_port as base for tunnel backing port.

In most cases, tunnel ports specify a dpif name to act as the backing
port in the datapath. However, in the case of UDP tunnels the type is
used with the port number appended. This is potentially a problem for
IPsec tunnels because they have different types but should have the
same backing port. The hasn't been a problem in practice though because
no UDP tunnels are currently used with IPsec.

This switches to use the dpif_port in all cases plus a port number if
necessary. It does this by making the names short enough to accomodate
ports, which also makes the naming more consistent.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ovs-thread: Implement OVS specific barrier.

Non-leader revalidator thread uses pthread_barrier_* functions in their
main loop to synchronize with leader thread.  However, since those threads
only call poll_block() intermittently, the poll interval check in
poll_block() can wrongly take the time since last call as poll interval
and issue the following warnings:

"Unreasonably long XXXXms poll interval".

To prevent it, this commit implements the barrier struct and operations
for OVS which allow thread to block on barrier via poll_block().

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>