Skip to content

Commit

Permalink
ovs-appctl: A port for Windows.
Browse files Browse the repository at this point in the history
Signed-off-by: Gurucharan Shetty <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
shettyg committed Mar 28, 2014
1 parent cb54a8c commit a085dae
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion BUILD.Windows
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ or from a distribution tar ball.
% make lib/vswitch-idl.h lib/vtep-idl.h ofproto/ipfix-entities.def
% make ovsdb/ovsdb-server.exe ovsdb/ovsdb-tool.exe ovsdb/ovsdb-client.exe \
utilities/ovs-vsctl.exe utilities/ovs-ofctl.exe \
utilities/ovs-dpctl.exe vswitchd/ovs-vswitchd.exe
utilities/ovs-dpctl.exe vswitchd/ovs-vswitchd.exe \
utilities/ovs-appctl.exe

OpenSSL, Open vSwitch and Visual C++
------------------------------------
Expand Down
9 changes: 9 additions & 0 deletions utilities/ovs-appctl.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ named \fB@RUNDIR@/\fItarget\fB.\fIpid\fB.ctl\fR, where \fIpid\fR is
replaced by the process ID read from the pidfile, and uses that file
as if it had been specified directly as the target.
.IP
On Windows, \fItarget\fR can be an absolute path to a file that contains
a localhost TCP port on which an Open vSwitch daemon is listening
for control channel connections. By default, each daemon writes the
TCP port on which it is listening for control connection into the file
\fIprogram\fB.ctl\fR located inside the configured \fIOVS_RUNDIR\fR
directory. If \fItarget\fR is not an absolute path, \fBovs\-appctl\fR
looks for a file named \fItarget\fB.ctl\fR in the configured \fIOVS_RUNDIR\fR
directory.
.IP
The default target is \fBovs\-vswitchd\fR.
.
.SH COMMON COMMANDS
Expand Down
7 changes: 7 additions & 0 deletions utilities/ovs-appctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ connect_to_target(const char *target)
char *socket_name;
int error;

#ifndef _WIN32
if (target[0] != '/') {
char *pidfile_name;
pid_t pid;
Expand All @@ -193,6 +194,12 @@ connect_to_target(const char *target)
free(pidfile_name);
socket_name = xasprintf("%s/%s.%ld.ctl",
ovs_rundir(), target, (long int) pid);
#else
/* On windows, if the 'target' contains ':', we make an assumption that
* it is an absolute path. */
if (!strchr(target, ':')) {
socket_name = xasprintf("%s/%s.ctl", ovs_rundir(), target);
#endif
} else {
socket_name = xstrdup(target);
}
Expand Down

0 comments on commit a085dae

Please sign in to comment.