socket-util: Fix definition of LINUX.

Reported-by: Mukesh Hira <mhira@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Pritesh Kothari <pritesh.kothari@cisco.com>
FAQ: Add question about meter support.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Pritesh Kothari <pritesh.kothari@cisco.com>
ofproto-dpif: Revalidate flows when the group table changes.

Otherwise group table modifications won't be immediately reflected in the
treatment of flows already passing through the switch.

Reported-by: Hyojoon Kim <joonk@gatech.edu>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Tested-by: Hyojoon Kim <joonk@gatech.edu>
backtrace: Add log_backtrace()

log_backtrace() and log_backtrace_msg() logs the back trace into
the log file. It may be most useful when debugging unit tests.
"backtrace.h" documents the usage. It is not being called directly
in the code, but rather as a handy tool available when needed.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
windefs: Include the library advapi32.

advapi32 is needed by multiple functions
So include it in a common place.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
windows/unistd: Add definitions for STD*_FILENO.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
ovs-ofctl: Use fcntl instead of sys/fcntl.

Windows does not have a sys/fcntl.h

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto: Don't use DELETE inside enumerator list.

Visual studio does not like it. It is mostly a keyword.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
sflow: Include the windefs.h header for windows.

sflow.h uses u_int32_t that needs windefs.h for compilation
in visual studio.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
strsep: Copy from netbsd.

Windows does not have a strsep.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
windefs: srandom() and random() for windows.

Windows does not have a srandom() and random(). But it does
have a srand() and rand(). We use these functions in sflow code.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
system-stats: Port for Windows.

This does not provide us all the functionality that
is available in Linux. But should be a start.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
BUILD.Windows: Update compilable utilities.

We can now compile a few OVS userspace components on Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Fix typos in documentation.

Reported-by: Anshuman Manral <anshuman.manral@outlook.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
dpif-netdev: init atomic flag dp->destroyed

It is better to explicitly initialize the dp->destroy than to rely
on xzalloc().

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath: compat: Downstream the reciprocal_div.{c,h}.

The reciprocal division code used in datapath is flawed.  The bug
has been fixed in the linux kernel repo in commit 809fa972fd(
reciprocal_divide: update/correction of the algorithm).

This commit downstreams the reciprocal_div.{c,h} from the linux
kernel repo.

Signed-off-by: Alex Wang <alexw@nicira.com>
Reviewed-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Man ovs-ofctl: Typo in arp_spa & arp_tpa

It seems there is a typo in definition of arp_spa & arp_tpa

Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
socket-util: Fix dscp error check for Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
stream: Call WSAStartup() before calling any winsock functions.

The WSAStartup function initiates use of the Winsock DLL by a process.
The function should be called before any winsock related functions
are called.

Since, we use stream-fd-windows through pstream_open or stream_open
add the WSAStartup() call there.

The current version of the Windows Sockets specification is version 2.2

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
tests: Fix small typo in "OpenFlow" in ofproto tests.

Signed-off-by: Justin Pettit <jpettit@nicira.com>