2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-17 14:28:02 +00:00
Commit Graph

24 Commits

Author SHA1 Message Date
Saurabh Shah
f6861bef4f Fix build break in ofproto/tunnel.c for windows platform.
The breakage was introduced by commit: a36de779
("openvswitch: Userspace tunneling.").

Reported-by: Edwin Chiu <echiu@nicira.com>
Signed-off-by: Saurabh Shah <ssaurabh@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2014-11-20 06:58:28 -08:00
Gurucharan Shetty
6ce798bd70 netinet/in.h: Add definition for IPPROTO_GRE.
Commit b7ea2d480338(Extend OVS IPFIX exporter to export tunnel headers)
added a usage for IPROTO_GRE. But that does not look available in any
Visual Studio headers. So add it.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-08-18 10:23:40 -07:00
Alin Serdean
e655917a7c Prepare include headers
Preparing the include headers needed to compile dpif-linux.c with MSVC.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-08-13 09:00:19 -07:00
Alin Serdean
22861b8ce6 No newline at end of file
Adding newline at end of the following files: packet.h, uio.h.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-08-13 08:58:46 -07:00
Alin Serdean
cafc0664aa Add defines, enums and headers for MSVC
Add defines needed to compile netlink-socket.c and netlink.c.

Add a wrapper and the functionality behind it for syconf.

Add the newly created files to the noinst_HEADERS in windows/automake.mk

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-07-29 09:28:31 -07:00
Gurucharan Shetty
6c04f67c6a 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>
2014-03-17 14:20:49 -07:00
Gurucharan Shetty
bbaf134dcf 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>
2014-03-17 14:20:49 -07:00
Gurucharan Shetty
f062911fe3 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>
2014-03-17 14:20:49 -07:00
Gurucharan Shetty
31b97ffddd 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>
2014-03-17 14:20:49 -07:00
Gurucharan Shetty
f6cea7c9e7 windows/unistd: Add definitions for STD*_FILENO.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2014-03-17 14:20:48 -07:00
Gurucharan Shetty
48aa31aa4e 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>
2014-03-17 14:20:48 -07:00
Gurucharan Shetty
1d7c9c6573 windows/sys: Define sa_family_t for easy compilation.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2014-03-13 14:26:19 -07:00
Gurucharan Shetty
c2f9ec40ec windefs: Add definition for pid_t.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2014-03-13 14:25:36 -07:00
Gurucharan Shetty
d9d404aecc windows/net: Definition for IFNAMSIZ.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-03-13 14:23:30 -07:00
Gurucharan Shetty
03f234dcb8 windows/netinet: Copy ip6.h and icmp6.h from netbsd.
There are a few structure definitions that is used from
these headers. So copy them from the netbsd repo.

The following changes have been made on top of it:
* The keyword "__packed" has been removed
from the headers as the corresponding Linux headers don't
do packing.
* #if BYTE_ORDER == 'X' macros have been replaced by CONSTANT_HTONx().
* code inside #ifdef _KERNEL has been deleted.
* code inside #ifdef ICMP6_STRINGS has been deleted.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-03-13 14:22:52 -07:00
Gurucharan Shetty
a19152efb0 windows/netinet: Add some #defines needed for Windows.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-03-13 09:15:30 -07:00
Gurucharan Shetty
a081392bad ovsdb: fsync() for Windows.
There is no fsync() in Windows. But there is a _commit()
which does the same thing.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-03-13 09:14:59 -07:00
Gurucharan Shetty
daa04db864 ovsdb-server: Truncate file for Windows.
There is no ftruncate() in visual studio. There is a _chsize_s()
which has a similar functionality.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-03-12 09:14:54 -07:00
Gurucharan Shetty
5e3411b1a1 windows: Add stub headers for windows.
Windows does not have a bunch of headers that
are available in Linux. Instead of littering the code
with #ifndef _WIN32, add stub headers.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-03-11 20:35:57 -07:00
Gurucharan Shetty
1680d3d7e3 getrusage-windows: getrusage() for Windows.
We use getrusage mainly to get user CPU time and system CPU time.
Windows has a GetProcessTimes and GetThreadTimes that does the
same job. So use them.

We also use getrusage to get page faults. Use GetProcessMemoryInfo()
for that.

We also get number of context switches, block i/o times and use it for
debug information when we wake up from poll_block late. I haven't found
functions for that in Windows. We only use it for debug information, so
it should be okay not implementing it.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Co-authored-by: Linda Sun <lsun@vmware.com>
Signed-off-by: Linda Sun <lsun@vmware.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-03-06 16:35:04 -08:00
Gurucharan Shetty
9d0581fdf2 getopt_long: Copy over the implementation from netbsd.
Windows does not have a getopt_long function. This commit
copies over the getopt_long implementation from netbsd with
some minor modifications and is used only on Windows platform.

Modifications on top of the version in NetBSD repo.
* Remove header files not available in Visual Studio.
* Remove some unwanted #defines.
* Add Open vSwitch specific header files like config.h, vlog.h, util.h
* Add the following #define's
define __UNCONST(a)    ((void *)(unsigned long)(const void *)(a))
define _DIAGASSERT(q) ovs_assert(q)
define warnx VLOG_WARN
* Add extern declaration in getopt.h for optarg, optind.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-01-27 10:33:45 -08:00
Gurucharan Shetty
5a6af13f96 syslog: Provide stub functions for openlog and syslog.
One option to implement openlog and syslog functionality in Windows
is to use windows event logger. But it looks like it involves changing
registry settings and in general looks complicated.

For the time being, do nothing for syslog. All the information needed for
debugging will be present through the 'file' option anyways.

We can start OVS daemons on Windows with "-vfile:info -vsyslog:off".

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-01-24 07:59:02 -08:00
Gurucharan Shetty
fa5b8c6724 syslog: Add LOG_LOCALX definitions.
LOG_LOCAL0 is used in lib/vlog.c.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-01-24 07:48:18 -08:00
Alin Serdean
e42dfc7225 Add common definitions for Windows builds.
Signed-off-by: Alin Serdean <aserdean at cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-12-27 08:03:52 -08:00