Skip to contentSkip to conversation

build revolution

PATCH In review Alon Bar-Lev 7 participants 187 messages Feb 29, 2012 – Apr 26, 2012 1 message not in the archive Kbuild Page 4 of 4

lore
Share & tools
lore
#101 lore raw

Re: [Openvpn-devel] [PATCH 49/52] build: move wrappers into platform module

In reply to Samuli Seppänen

Well, at first I wanted to split it into its own libplatform distinct from libcompat.

libcompat - emulation of missing library functions, drop-in replacement. libplatform - extensions to library functions, such as unicode or security additions.

But then I've seen that there is too much openvpn specific logic, especially in log messages. So I left what I would have placed in libplatform in platform.c for now.

After this round we should consider if we want to progress in this.

One missing part is the exec wrappers which needs some work before moving to platform.

Alon.

2012/3/8 Samuli Seppänen <[email protected]...>:

Quoted 1,682 lines

This probably makes sense, lots of good refactorings. That said, I'd like to know how you selected what goes to platform.c?

--
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock

Quoted 1,669 lines

+ Some fixups within the platform.c functions.
- need to check environment set on Windows.

---
 src/openvpn/Makefile.am    |    1 +
 src/openvpn/buffer.c       |    2 +-
 src/openvpn/crypto.c       |    6 +-
 src/openvpn/error.c        |    2 +-
 src/openvpn/init.c         |   18 +-
 src/openvpn/manage.c       |   16 +-
 src/openvpn/misc.c         |  295 ++---------------------------------- src/openvpn/misc.h         |  106 +------------- src/openvpn/mstats.c       |    2 +-
 src/openvpn/multi.c        |    2 +-
 src/openvpn/openvpn.h      |    4 +-
 src/openvpn/openvpn.vcproj |    8 +
 src/openvpn/options.c      |   14 +-
 src/openvpn/packet_id.c    |    2 +-
 src/openvpn/pf.c           |    6 +-
 src/openvpn/platform.c     |  369 ++++++++++++++++++++++++++++++++++++++++++++ src/openvpn/platform.h     |  142 +++++++++++++++++ src/openvpn/ps.c           |    2 +-
 src/openvpn/ssl_openssl.c  |    2 +-
 src/openvpn/ssl_verify.c   |    8 +-
 src/openvpn/status.c       |    6 +-
 src/openvpn/tun.c          |   12 +-
 src/openvpn/win32.c        |   27 ----

 23 files changed, 584 insertions(+), 468 deletions(-)

 create mode 100644 src/openvpn/platform.c
 create mode 100644 src/openvpn/platform.h

src/openvpn/Makefile.am +1 -0
index 333eebc..6ba12b8 100644
@@ -58,6 +58,7 @@ openvpn_SOURCES = \
         mbuf.c mbuf.h \
         memdbg.h \
         misc.c misc.h \
+       platform.c platform.h \
         console.c console.h \
         mroute.c mroute.h \
         mss.c mss.h \
src/openvpn/buffer.c +0 -0
index ad30223..5eee3ee 100644
@@ -1080,7 +1080,7 @@ buffer_list_advance (struct buffer_list *ol, int n)

 struct buffer_list *
 buffer_list_file (const char *fn, int max_line_len) {
-  FILE *fp = openvpn_fopen (fn, "r");
+  FILE *fp = platform_fopen (fn, "r"); struct buffer_list *bl = NULL;

   if (fp)

src/openvpn/crypto.c +3 -3
index 2e2e5d7..f811966 100644
@@ -868,7 +868,7 @@ read_key_file (struct key2 *key2, const char *file, const unsigned int flags)
  #endif
      {
        in = alloc_buf_gc (2048, &gc);
-      fd = openvpn_open (file, O_RDONLY, 0);
+      fd = platform_open (file, O_RDONLY, 0);
        if (fd == -1)
         msg (M_ERR, "Cannot open file key file '%s'", file);
        size = read (fd, in.data, in.capacity);
@@ -1029,7 +1029,7 @@ read_passphrase_hash (const char *passphrase_file,
      const int min_passphrase_size = 8;
      uint8_t buf[64];
      int total_size = 0;
-    int fd = openvpn_open (passphrase_file, O_RDONLY, 0);
+    int fd = platform_open (passphrase_file, O_RDONLY, 0);
 
      if (fd == -1)
        msg (M_ERR, "Cannot open passphrase file: '%s'", passphrase_file);
@@ -1079,7 +1079,7 @@ write_key_file (const int nkeys, const char *filename)
    const int bytes_per_line = 16;
 
    /* open key file */
-  fd = openvpn_open (filename, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR);
+  fd = platform_open (filename, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR);
 
    if (fd == -1)
      msg (M_ERR, "Cannot open shared secret file '%s' for write", filename);
src/openvpn/error.c +1 -1
index 1f2dd86..d6ad639 100644
@@ -640,7 +640,7 @@ x_check_status (int status,
                  my_errno);
 
           if (x_cs_err_delay_ms)
-           sleep_milliseconds (x_cs_err_delay_ms);
+           platform_sleep_milliseconds (x_cs_err_delay_ms);
         }
        gc_free (&gc);
      }
src/openvpn/init.c +0 -0
index bba3cf8..bc7718e 100644
@@ -935,7 +935,7 @@ do_genkey (const struct options * options)
                "shared secret output file (--secret)");
 

       if (options->mlock)      /* should we disable paging? */
-       do_mlockall (true);
+       platform_mlockall (true);

       nbits_written = write_key_file (2, options->shared_secret_file);

src/openvpn/init.c +1 -1
@@ -1022,7 +1022,7 @@ do_uid_gid_chroot (struct context *c, bool no_delay)
        if (c->options.chroot_dir)
         {
           if (no_delay)
-           do_chroot (c->options.chroot_dir);
+           platform_chroot (c->options.chroot_dir);

          else
            msg (M_INFO, "NOTE: chroot %s", why_not); }

src/openvpn/init.c +2 -2
@@ -1030,8 +1030,8 @@ do_uid_gid_chroot (struct context *c, bool no_delay)
        /* set user and/or group that we want to setuid/setgid to */
        if (no_delay)
         {
-         set_group (&c0->group_state);
-         set_user (&c0->user_state);
+         platform_group_set (&c0->platform_state_group);
+         platform_user_set (&c0->platform_state_user);
           c0->uid_gid_set = true;
         }
        else if (c0->uid_gid_specified)
@@ -2780,8 +2780,8 @@ do_init_first_time (struct context *c)
 
        /* get user and/or group that we want to setuid/setgid to */

       c0->uid_gid_specified =
-       get_group (c->options.groupname, &c0->group_state) |
-       get_user (c->options.username, &c0->user_state);
+       platform_group_get (c->options.groupname, &c0->platform_state_group) |
+       platform_user_get (c->options.username, &c0->platform_state_user);

       /* get --writepid file descriptor */ get_pid_file (c->options.writepid, &c0->pid_state);

src/openvpn/init.c +3 -3
@@ -2791,13 +2791,13 @@ do_init_first_time (struct context *c)
 
        /* should we disable paging? */
        if (c->options.mlock && c->did_we_daemonize)
-       do_mlockall (true);     /* call again in case we daemonized */
+       platform_mlockall (true);       /* call again in case we daemonized */
 
        /* save process ID in a file */
        write_pid (&c0->pid_state);
 
        /* should we change scheduling priority? */
-      set_nice (c->options.nice);
+      platform_nice (c->options.nice);
      }
  }
 
@@ -3342,7 +3342,7 @@ init_instance (struct context *c, const struct env_set *env, const unsigned int
 
    /* should we disable paging? */
    if (c->first_time && options->mlock)
-    do_mlockall (true);
+    platform_mlockall (true);
 
  #if P2MP
    /* get passwords if undefined */
src/openvpn/manage.c +8 -8
index 85c9aca..1dddd41 100644
@@ -1146,7 +1146,7 @@ man_dispatch_command (struct management *man, struct status_output *so, const ch
      }
    else if (streq (p[0], "pid"))
      {
-      msg (M_CLIENT, "SUCCESS: pid=%d", openvpn_getpid ());
+      msg (M_CLIENT, "SUCCESS: pid=%d", platform_getpid ());
      }
  #ifdef MANAGEMENT_DEF_AUTH
    else if (streq (p[0], "nclients"))
@@ -1429,7 +1429,7 @@ man_record_peer_info (struct management *man)
             {
               const in_addr_t a = ntohl (addr.sin_addr.s_addr);
               const int p = ntohs (addr.sin_port);
-             FILE *fp = openvpn_fopen (man->settings.write_peer_info_file, "w");
+             FILE *fp = platform_fopen (man->settings.write_peer_info_file, "w");
               if (fp)
                 {
                   fprintf (fp, "%s\n%d\n", print_in_addr_t (a, 0, &gc), p);
@@ -2013,17 +2013,17 @@ man_settings_init (struct man_settings *ms,
         */
        if (client_user)
         {
-         struct user_state s;
-         get_user (client_user, &s);
-         ms->client_uid = user_state_uid (&s);
+         struct platform_state_user s;
+         platform_user_get (client_user, &s);
+         ms->client_uid = platform_state_user_uid (&s);
           msg (D_MANAGEMENT, "MANAGEMENT: client_uid=%d", ms->client_uid);
           ASSERT (ms->client_uid >= 0);
         }
        if (client_group)
         {
-         struct group_state s;
-         get_group (client_group, &s);
-         ms->client_gid = group_state_gid (&s);
+         struct platform_state_group s;
+         platform_group_get (client_group, &s);
+         ms->client_gid = platform_state_group_gid (&s);
           msg (D_MANAGEMENT, "MANAGEMENT: client_gid=%d", ms->client_gid);
           ASSERT (ms->client_gid >= 0);
         }
src/openvpn/misc.c +0 -0
index 2571194..2ded9bf 100644
@@ -56,122 +56,6 @@ int script_security = SSEC_BUILT_IN; /* GLOBAL */
  /* contains SM_x value defined in misc.h */

 int script_method = SM_EXECVE; /* GLOBAL */

src/openvpn/misc.c +0 -116
-/* Redefine the top level directory of the filesystem
-   to restrict access to files for security */
-void
-do_chroot (const char *path)
-{
-  if (path)
-    {
-#ifdef HAVE_CHROOT
-      const char *top = "/";
-      if (chroot (path))
-       msg (M_ERR, "chroot to '%s' failed", path);
-      if (openvpn_chdir (top))
-       msg (M_ERR, "cd to '%s' failed", top);
-      msg (M_INFO, "chroot to '%s' and cd to '%s' succeeded", path, top);
-#else
-      msg (M_FATAL, "Sorry but I can't chroot to '%s' because this operating system doesn't appear to support the chroot() system call", path);
-#endif
-    }
-}
-
-/* Get/Set UID of process */
-
-bool
-get_user (const char *username, struct user_state *state)
-{
-  bool ret = false;
-  CLEAR (*state);
-  if (username)
-    {
-#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
-      state->pw = getpwnam (username);
-      if (!state->pw)
-       msg (M_ERR, "failed to find UID for user %s", username);
-      state->username = username;
-      ret = true;
-#else
-      msg (M_FATAL, "cannot get UID for user %s -- platform lacks getpwname() or setuid() system calls", username);
-#endif
-    }
-  return ret;
-}
-
-void
-set_user (const struct user_state *state)
-{
-#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
-  if (state->username && state->pw)
-    {
-      if (setuid (state->pw->pw_uid))
-       msg (M_ERR, "setuid('%s') failed", state->username);
-      msg (M_INFO, "UID set to %s", state->username);
-    }
-#endif
-}
-
-/* Get/Set GID of process */
-
-bool
-get_group (const char *groupname, struct group_state *state)
-{
-  bool ret = false;
-  CLEAR (*state);
-  if (groupname)
-    {
-#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
-      state->gr = getgrnam (groupname);
-      if (!state->gr)
-       msg (M_ERR, "failed to find GID for group %s", groupname);
-      state->groupname = groupname;
-      ret = true;
-#else
-      msg (M_FATAL, "cannot get GID for group %s -- platform lacks getgrnam() or setgid() system calls", groupname);
-#endif
-    }
-  return ret;
-}
-
-void
-set_group (const struct group_state *state)
-{
-#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
-  if (state->groupname && state->gr)
-    {
-      if (setgid (state->gr->gr_gid))
-       msg (M_ERR, "setgid('%s') failed", state->groupname);
-      msg (M_INFO, "GID set to %s", state->groupname);
-#ifdef HAVE_SETGROUPS
-      {
-        gid_t gr_list[1];
-       gr_list[0] = state->gr->gr_gid;
-       if (setgroups (1, gr_list))
-         msg (M_ERR, "setgroups('%s') failed", state->groupname);
-      }
-#endif
-    }
-#endif
-}
-
-/* Change process priority */
-void
-set_nice (int niceval)
-{
-  if (niceval)
-    {
-#ifdef HAVE_NICE
-      errno = 0;
-      if (nice (niceval) < 0 && errno != 0)
-       msg (M_WARN | M_ERRNO, "WARNING: nice %d failed: %s", niceval, strerror(errno));
-      else
-       msg (M_INFO, "nice %d succeeded", niceval);
-#else
-      msg (M_WARN, "WARNING: nice %d failed (function not implemented)", niceval);
-#endif
-    }
-}
-

 /*
  * Pass tunnel endpoint and MTU parms to a user-supplied script.
  * Used to execute the up/down script/plugins.

src/openvpn/misc.c +2 -78
@@ -253,7 +137,7 @@ get_pid_file (const char* filename, struct pid_state *state)
    CLEAR (*state);
    if (filename)
      {
-      state->fp = openvpn_fopen (filename, "w");
+      state->fp = platform_fopen (filename, "w");
        if (!state->fp)
         msg (M_ERR, "Open error on pid file %s", filename);
        state->filename = filename;
@@ -266,42 +150,13 @@ write_pid (const struct pid_state *state)
  {
    if (state->filename && state->fp)
      {
-      unsigned int pid = openvpn_getpid ();
+      unsigned int pid = platform_getpid ();
        fprintf(state->fp, "%u\n", pid);
        if (fclose (state->fp))
         msg (M_ERR, "Close error on pid file %s", state->filename);
      }
  }
 
-/* Get current PID */
-unsigned int
-openvpn_getpid ()
-{
-#ifdef WIN32
-  return (unsigned int) GetCurrentProcessId ();
-#else
-#ifdef HAVE_GETPID
-  return (unsigned int) getpid ();
-#else
-  return 0;
-#endif
-#endif
-}
-
-/* Disable paging */
-void
-do_mlockall(bool print_msg)
-{
-#ifdef HAVE_MLOCKALL
-  if (mlockall (MCL_CURRENT | MCL_FUTURE))
-    msg (M_WARN | M_ERRNO, "WARNING: mlockall call failed");
-  else if (print_msg)
-    msg (M_INFO, "mlockall call succeeded");
-#else
-  msg (M_WARN, "WARNING: mlockall call failed (function not implemented)");
-#endif
-}
-
  /*
   * Set standard file descriptors to /dev/null
   */
@@ -325,27 +180,6 @@ set_std_files_to_null (bool stdin_only)
  }
 
  /*
- * Wrapper for chdir library function
- */
-int
-openvpn_chdir (const char* dir)
-{
-#ifdef HAVE_CHDIR
-#ifdef WIN32
-  int res;
-  struct gc_arena gc = gc_new ();
-  res = _wchdir (wide_string (dir, &gc));
-  gc_free (&gc);
-  return res;
-#else
-  return chdir (dir);
-#endif
-#else
-  return -1;
-#endif
-}
-
-/*
   *  dup inetd/xinetd socket descriptor and save
   */
 
@@ -391,32 +225,6 @@ warn_if_group_others_accessible (const char* filename)
  }
 
  /*
- * convert system() return into a success/failure value
- */
-bool
-system_ok (int stat)
-{
-#ifdef WIN32
-  return stat == 0;
-#else
-  return stat != -1 && WIFEXITED (stat) && WEXITSTATUS (stat) == 0;
-#endif
-}
-
-/*
- * did system() call execute the given command?
- */
-bool
-system_executed (int stat)
-{
-#ifdef WIN32
-  return stat != -1;
-#else
-  return stat != -1 && WEXITSTATUS (stat) != 127;
-#endif
-}
-
-/*
   * Print an error message based on the status code returned by system().
   */

 const char *

src/openvpn/misc.c +1 -1
@@ -456,7 +264,7 @@ openvpn_execve_check (const struct argv *a, const struct env_set *es, const unsi
    const int stat = openvpn_execve (a, es, flags);
    int ret = false;
 
-  if (system_ok (stat))
+  if (platform_system_ok (stat))
      ret = true;

   else
     {

src/openvpn/misc.c +1 -21
@@ -554,7 +362,6 @@ openvpn_system (const char *command, const struct env_set *es, unsigned int flag
  {
  #ifdef HAVE_SYSTEM
    int ret;
-  struct gc_arena gc;
 
    perf_push (PERF_SCRIPT);
 
@@ -573,13 +380,7 @@ openvpn_system (const char *command, const struct env_set *es, unsigned int flag
    /*
     * execute the command
     */
-#ifdef WIN32
-  gc = gc_new ();
-  ret = _wsystem (wide_string (command, &gc));
-  gc_free (&gc);
-#else
-  ret = system (command);
-#endif
+  ret = platform_system(command);
 
    /* debugging */
    dmsg (D_SCRIPT, "SYSTEM return=%u", ret);
@@ -599,19 +400,6 @@ openvpn_system (const char *command, const struct env_set *es, unsigned int flag
  #endif
  }
 
-int
-openvpn_access (const char *path, int mode)
-{
-#ifdef WIN32
-  struct gc_arena gc = gc_new ();
-  int ret = _waccess (wide_string (path, &gc), mode);
-  gc_free (&gc);
-  return ret;
-#else
-  return access (path, mode);
-#endif
-}
-
  /*
   * Run execve() inside a fork(), duping stdout.  Designed to replicate the semantics of popen() but
   * in a safer way that doesn't require the invocation of a shell or the risks
@@ -981,7 +769,7 @@ env_set_remove_from_environment (const struct env_set *es)
 

 static struct env_item *global_env = NULL; /* GLOBAL */

src/openvpn/misc.c +1 -1
-static void
+void

 manage_env (char *str)
 {
   remove_env_item (str, true, &global_env);

src/openvpn/misc.c +0 -0
@@ -1078,27 +866,11 @@ setenv_str_ex (struct env_set *es,
      }

   else
     {
-#if defined(WIN32)
+      char *str = construct_name_value (name_tmp, val_tmp, NULL);
+      if (platform_putenv(str))
       {
-        if (!SetEnvironmentVariableW (wide_string (name_tmp, &gc),
-                                      wide_string (val_tmp, &gc)))
-         msg (M_WARN | M_ERRNO, "SetEnvironmentVariable failed, name='%s', value='%s'",
-              name_tmp,
-              val_tmp ? val_tmp : "NULL");
+        msg (M_WARN | M_ERRNO, "putenv('%s') failed", str);
       }

src/openvpn/misc.c +0 -13
-#elif defined(HAVE_PUTENV)
-      {
-       char *str = construct_name_value (name_tmp, val_tmp, NULL);
-       int status;
-
-       status = putenv (str);
-       /*msg (M_INFO, "PUTENV '%s'", str);*/
-       if (!status)
-         manage_env (str);
-       if (status)
-         msg (M_WARN | M_ERRNO, "putenv('%s') failed", str);
-      }
-#endif

     }

   gc_free (&gc);

src/openvpn/misc.c +0 -29
@@ -1162,35 +934,6 @@ count_netmask_bits(const char *dotted_quad)
    return ((int)result);
  }
 
-/*
- * Go to sleep for n milliseconds.
- */
-void
-sleep_milliseconds (unsigned int n)
-{
-#ifdef WIN32
-  Sleep (n);
-#else
-  struct timeval tv;
-  tv.tv_sec = n / 1000;
-  tv.tv_usec = (n % 1000) * 1000;
-  select (0, NULL, NULL, NULL, &tv);
-#endif
-}
-
-/*
- * Go to sleep indefinitely.
- */
-void
-sleep_until_signal (void)
-{
-#ifdef WIN32
-  ASSERT (0);
-#else
-  select (0, NULL, NULL, NULL, NULL);
-#endif
-}
-
  /* return true if filename can be opened for read */

 bool
 test_file (const char *filename)

src/openvpn/misc.c +1 -1
@@ -1198,7 +941,7 @@ test_file (const char *filename)
    bool ret = false;
    if (filename)
      {
-      FILE *fp = openvpn_fopen (filename, "r");
+      FILE *fp = platform_fopen (filename, "r");
        if (fp)
         {
           fclose (fp);
@@ -1246,7 +989,7 @@ create_temp_file (const char *directory, const char *prefix, struct gc_arena *gc
 
        /* Atomically create the file.  Errors out if the file already

          exists.  */
-      fd = openvpn_open (retfname, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IWUSR);
+      fd = platform_open (retfname, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IWUSR); if (fd != -1)
         {
           close (fd);

src/openvpn/misc.c +0 -16
@@ -1342,22 +1085,6 @@ gen_path (const char *directory, const char *filename, struct gc_arena *gc)
      return NULL;
  }
 
-/* delete a file, return true if succeeded */
-bool
-delete_file (const char *filename)
-{
-#if defined(WIN32)
-  struct gc_arena gc = gc_new ();
-  BOOL ret = DeleteFileW (wide_string (filename, &gc));
-  gc_free (&gc);
-  return (ret != 0);
-#elif defined(HAVE_UNLINK)
-  return (unlink (filename) == 0);
-#else
-  return false;
-#endif
-}
-

 bool
 absolute_pathname (const char *pathname)
 {

src/openvpn/misc.c +1 -1
@@ -1524,7 +1251,7 @@ get_user_pass_cr (struct user_pass *up,
 
           warn_if_group_others_accessible (auth_file);
 
-         fp = openvpn_fopen (auth_file, "r");
+         fp = platform_fopen (auth_file, "r");
           if (!fp)
             msg (M_ERR, "Error opening '%s' auth file: %s", prefix, auth_file);
 
src/openvpn/misc.h +1 -38
index 12a8f71..d4c8e33 100644
@@ -29,6 +29,7 @@
  #include "common.h"
  #include "integer.h"
  #include "buffer.h"
+#include "platform.h"
 
  /* socket descriptor passed by inetd/xinetd server to us */
  #define INETD_SOCKET_DESCRIPTOR 0
@@ -58,37 +59,6 @@ struct env_set {
    struct env_item *list;
  };
 
-/* Get/Set UID of process */
-
-struct user_state {
-#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
-  const char *username;
-  struct passwd *pw;
-#else
-  int dummy;
-#endif
-};
-
-bool get_user (const char *username, struct user_state *state);
-void set_user (const struct user_state *state);
-
-/* Get/Set GID of process */
-
-struct group_state {
-#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
-  const char *groupname;
-  struct group *gr;
-#else
-  int dummy;
-#endif
-};
-
-bool get_group (const char *groupname, struct group_state *state);
-void set_group (const struct group_state *state);
-
-void set_nice (int niceval);
-void do_chroot (const char *path);
-
  void run_up_down (const char *command,
                   const struct plugin_list *plugins,
                   int plugin_type,
@@ -111,9 +81,6 @@ struct pid_state {
 
  void get_pid_file (const char* filename, struct pid_state *state);
  void write_pid (const struct pid_state *state);
-unsigned int openvpn_getpid (void);
-
-void do_mlockall (bool print_msg); /* Disable paging */
 
  /* check file protections */
  void warn_if_group_others_accessible(const char* filename);
@@ -122,9 +89,6 @@ void warn_if_group_others_accessible(const char* filename);
  #define S_SCRIPT (1<<0)
  #define S_FATAL  (1<<1)
 
-/* interpret the status code returned by system()/execve() */
-bool system_ok(int);
-bool system_executed (int stat);
  const char *system_error_message (int, struct gc_arena *gc);
 
  /* wrapper around the execve() call */
@@ -133,7 +97,6 @@ int openvpn_execve (const struct argv *a, const struct env_set *es, const unsign
  bool openvpn_execve_check (const struct argv *a, const struct env_set *es, const unsigned int flags, const char *error_message);
  bool openvpn_execve_allowed (const unsigned int flags);
  int openvpn_system (const char *command, const struct env_set *es, unsigned int flags);
-int openvpn_access (const char *path, int mode);
 

 static inline bool
 openvpn_run_script (const struct argv *a, const struct env_set *es, const unsigned int flags, const char *hook)

src/openvpn/misc.h +0 -67
@@ -144,37 +107,6 @@ openvpn_run_script (const struct argv *a, const struct env_set *es, const unsign
    return openvpn_execve_check(a, es, flags | S_SCRIPT, msg);
  }
 
-#ifdef WIN32
-FILE * openvpn_fopen (const char *path, const char *mode);
-#else
-static inline FILE *
-openvpn_fopen (const char *path, const char *mode)
-{
-  return fopen (path, mode);
-}
-#endif
-
-#ifdef WIN32
-int openvpn_open (const char *path, int flags, int mode);
-#else
-static inline int
-openvpn_open (const char *path, int flags, mode_t mode)
-{
-  return open (path, flags, mode);
-}
-#endif
-
-#ifdef WIN32
-typedef struct _stat openvpn_stat_t;
-int openvpn_stat (const char *path, openvpn_stat_t *buf);
-#else
-typedef struct stat openvpn_stat_t;
-static inline int
-openvpn_stat (const char *path, openvpn_stat_t *buf)
-{
-  return stat (path, buf);
-}
-#endif
 
  #ifdef HAVE_STRERROR
  /* a thread-safe version of strerror */
@@ -184,9 +116,6 @@ const char* strerror_ts (int errnum, struct gc_arena *gc);
  /* Set standard file descriptors to /dev/null */
  void set_std_files_to_null (bool stdin_only);
 
-/* Wrapper for chdir library function */
-int openvpn_chdir (const char* dir);
-
  /* dup inetd/xinetd socket descriptor and save */
  extern int inetd_socket_descriptor;
  void save_inetd_socket_descriptor (void);
@@ -242,12 +171,6 @@ const char **make_extended_arg_array (char **p, struct gc_arena *gc);
  int count_netmask_bits(const char *);
  unsigned int count_bits(unsigned int );
 
-/* go to sleep for n milliseconds */
-void sleep_milliseconds (unsigned int n);
-
-/* go to sleep indefinitely */
-void sleep_until_signal (void);
-
  /* an analogue to the random() function, but use OpenSSL functions if available */
  #ifdef ENABLE_CRYPTO
  long int get_random(void);
@@ -264,9 +187,6 @@ const char *create_temp_file (const char *directory, const char *prefix, struct
  /* put a directory and filename together */
  const char *gen_path (const char *directory, const char *filename, struct gc_arena *gc);
 
-/* delete a file, return true if succeeded */
-bool delete_file (const char *filename);
-
  /* return true if pathname is absolute */
  bool absolute_pathname (const char *pathname);
 
@@ -448,28 +368,4 @@ void argv_printf_cat (struct argv *a, const char *format, ...)
  #endif
    ;
 
-/*
- * Extract UID or GID
- */
-
-static inline int
-user_state_uid (const struct user_state *s)
-{
-#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
-  if (s->pw)
-    return s->pw->pw_uid;
-#endif
-  return -1;
-}
-
-static inline int
-group_state_gid (const struct group_state *s)
-{
-#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
-  if (s->gr)
-    return s->gr->gr_gid;
-#endif
-  return -1;
-}
-
  #endif
src/openvpn/mstats.c +1 -1
index b4b864b..3be493c 100644
@@ -114,7 +114,7 @@ mstats_close(void)
        mmap_stats->state = MSTATS_EXPIRED;
        if (munmap((void *)mmap_stats, sizeof(struct mmap_stats)))
         msg (M_WARN | M_ERRNO, "mstats_close: munmap error");
-      delete_file(mmap_fn);
+      platform_unlink(mmap_fn);
        mmap_stats = NULL;
      }
  }
src/openvpn/multi.c +1 -1
index e79c6f1..9876b80 100644
@@ -1452,7 +1452,7 @@ multi_client_connect_post (struct multi_context *m,
                              option_types_found,
                              mi->context.c2.es);
 
-      if (!delete_file (dc_file))
+      if (!platform_unlink (dc_file))
         msg (D_MULTI_ERRORS, "MULTI: problem deleting temporary file: %s",
              dc_file);
 
src/openvpn/openvpn.h +2 -2
index b314885..0732d0f 100644
@@ -143,8 +143,8 @@ struct context_0
    /* workspace for --user/--group */
    bool uid_gid_specified;
    bool uid_gid_set;
-  struct user_state user_state;
-  struct group_state group_state;
+  struct platform_state_user platform_state_user;
+  struct platform_state_group platform_state_group;
  };
 
 
src/openvpn/openvpn.vcproj +0 -0
index 6c19621..4680e52 100644
@@ -347,6 +347,10 @@

                                >
                        </File>
                        <File
+                               RelativePath=".\platform.c"
+                               >
+                       </File>
+                       <File RelativePath=".\plugin.c" >
                        </File>

src/openvpn/openvpn.vcproj +0 -0
@@ -649,6 +653,10 @@

                                >
                        </File>
                        <File
+                               RelativePath=".\platform.h"
+                               >
+                       </File>
+                       <File RelativePath=".\plugin.h" >
                        </File>

src/openvpn/options.c +1 -1
index 258b060..bd83843 100644
@@ -920,7 +920,7 @@ setenv_settings (struct env_set *es, const struct options *o)
    setenv_int (es, "daemon", o->daemon);
    setenv_int (es, "daemon_log_redirect", o->log);
    setenv_unsigned (es, "daemon_start_time", time(NULL));
-  setenv_int (es, "daemon_pid", openvpn_getpid());
+  setenv_int (es, "daemon_pid", platform_getpid());
 
  #ifdef ENABLE_CONNECTION
    if (o->connection_list)
@@ -2640,18 +2640,18 @@ check_file_access(const int type, const char *file, const int mode, const char *

       char *fullpath = strdup(file);  /* POSIX dirname() implementaion may modify its arguments */ char *dirpath = dirname(fullpath);

-      if (openvpn_access (dirpath, mode|X_OK) != 0)
+      if (platform_access (dirpath, mode|X_OK) != 0) errcode = errno;
       free(fullpath);
     }

   /* Is the file itself accessible? */
-  if (!errcode && (type & CHKACC_FILE) && (openvpn_access (file, mode) != 0) )
+  if (!errcode && (type & CHKACC_FILE) && (platform_access (file, mode) != 0) ) errcode = errno;

   /* If the file exists and is accessible, is it writable? */
-  if (!errcode && (type & CHKACC_FILEXSTWR) && (openvpn_access (file, F_OK) == 0) )
-    if (openvpn_access (file, W_OK) != 0)
+  if (!errcode && (type & CHKACC_FILEXSTWR) && (platform_access (file, F_OK) == 0) )
+    if (platform_access (file, W_OK) != 0)
       errcode = errno;

   /* Scream if an error is found */

src/openvpn/options.c +0 -0
@@ -3755,7 +3755,7 @@ read_config_file (struct options *options,
        if (streq (file, "stdin"))
         fp = stdin;

       else
-       fp = openvpn_fopen (file, "r");
+       fp = platform_fopen (file, "r");
       if (fp)
        {
          line_num = 0;

src/openvpn/options.c +1 -1
@@ -4528,7 +4528,7 @@ add_option (struct options *options,
    else if (streq (p[0], "cd") && p[1])
      {
        VERIFY_PERMISSION (OPT_P_GENERAL);
-      if (openvpn_chdir (p[1]))
+      if (platform_chdir (p[1]))
         {
           msg (M_ERR, "cd to '%s' failed", p[1]);
           goto err;
src/openvpn/packet_id.c +1 -1
index 186f074..0102129 100644
@@ -368,7 +368,7 @@ packet_id_persist_load (struct packet_id_persist *p, const char *filename)
    if (!packet_id_persist_enabled (p))
      {
        /* open packet-id persist file for both read and write */
-      p->fd = openvpn_open (filename,
+      p->fd = platform_open (filename,
                              O_CREAT | O_RDWR | O_BINARY,
                              S_IRUSR | S_IWUSR);
        if (p->fd == -1)
src/openvpn/pf.c +0 -0
index 729792e..7ed1e70 100644
@@ -504,8 +504,8 @@ pf_check_reload (struct context *c)

       && c->c2.pf.filename
       && event_timeout_trigger (&c->c2.pf.reload, &c->c2.timeval, ETT_DEFAULT)) {
-      openvpn_stat_t s;
-      if (!openvpn_stat (c->c2.pf.filename, &s))
+      platform_stat_t s;
+      if (!platform_stat (c->c2.pf.filename, &s))
        {
          if (s.st_mtime > c->c2.pf.file_last_mod)
            {

src/openvpn/pf.c +1 -1
@@ -605,7 +605,7 @@ pf_destroy_context (struct pf_context *pfc)
  #ifdef PLUGIN_PF
    if (pfc->filename)
      {
-      delete_file (pfc->filename);
+      platform_unlink (pfc->filename);
        free (pfc->filename);
      }
  #endif
src/openvpn/platform.c new file +369 -0
new file mode 100644
index 0000000..c79f680
@@ -0,0 +1,369 @@
+/*
+ *  OpenVPN -- An application to securely tunnel IP networks
+ *             over a single TCP/UDP port, with support for SSL/TLS-based
+ *             session authentication and key exchange,
+ *             packet encryption, packet authentication, and
+ *             packet compression.
+ *
+ *  Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <[email protected]...>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program (see the file COPYING included with this
+ *  distribution); if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "buffer.h"
+#include "error.h"
+#include "win32.h"
+
+#include "memdbg.h"
+
+#include "platform.h"
+
+/* Redefine the top level directory of the filesystem
+   to restrict access to files for security */
+void
+platform_chroot (const char *path)
+{
+  if (path)
+    {
+#ifdef HAVE_CHROOT
+      const char *top = "/";
+      if (chroot (path))
+       msg (M_ERR, "chroot to '%s' failed", path);
+      if (platform_chdir (top))
+       msg (M_ERR, "cd to '%s' failed", top);
+      msg (M_INFO, "chroot to '%s' and cd to '%s' succeeded", path, top);
+#else
+      msg (M_FATAL, "Sorry but I can't chroot to '%s' because this operating system doesn't appear to support the chroot() system call", path);
+#endif
+    }
+}
+
+/* Get/Set UID of process */
+
+bool
+platform_user_get (const char *username, struct platform_state_user *state)
+{
+  bool ret = false;
+  CLEAR (*state);
+  if (username)
+    {
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+      state->pw = getpwnam (username);
+      if (!state->pw)
+       msg (M_ERR, "failed to find UID for user %s", username);
+      state->username = username;
+      ret = true;
+#else
+      msg (M_FATAL, "cannot get UID for user %s -- platform lacks getpwname() or setuid() system calls", username);
+#endif
+    }
+  return ret;
+}
+
+void
+platform_user_set (const struct platform_state_user *state)
+{
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+  if (state->username && state->pw)
+    {
+      if (setuid (state->pw->pw_uid))
+       msg (M_ERR, "setuid('%s') failed", state->username);
+      msg (M_INFO, "UID set to %s", state->username);
+    }
+#endif
+}
+
+/* Get/Set GID of process */
+
+bool
+platform_group_get (const char *groupname, struct platform_state_group *state)
+{
+  bool ret = false;
+  CLEAR (*state);
+  if (groupname)
+    {
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+      state->gr = getgrnam (groupname);
+      if (!state->gr)
+       msg (M_ERR, "failed to find GID for group %s", groupname);
+      state->groupname = groupname;
+      ret = true;
+#else
+      msg (M_FATAL, "cannot get GID for group %s -- platform lacks getgrnam() or setgid() system calls", groupname);
+#endif
+    }
+  return ret;
+}
+
+void
+platform_group_set (const struct platform_state_group *state)
+{
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+  if (state->groupname && state->gr)
+    {
+      if (setgid (state->gr->gr_gid))
+       msg (M_ERR, "setgid('%s') failed", state->groupname);
+      msg (M_INFO, "GID set to %s", state->groupname);
+#ifdef HAVE_SETGROUPS
+      {
+        gid_t gr_list[1];
+       gr_list[0] = state->gr->gr_gid;
+       if (setgroups (1, gr_list))
+         msg (M_ERR, "setgroups('%s') failed", state->groupname);
+      }
+#endif
+    }
+#endif
+}
+
+/* Change process priority */
+void
+platform_nice (int niceval)
+{
+  if (niceval)
+    {
+#ifdef HAVE_NICE
+      errno = 0;
+      if (nice (niceval) < 0 && errno != 0)
+       msg (M_WARN | M_ERRNO, "WARNING: nice %d failed: %s", niceval, strerror(errno));
+      else
+       msg (M_INFO, "nice %d succeeded", niceval);
+#else
+      msg (M_WARN, "WARNING: nice %d failed (function not implemented)", niceval);
+#endif
+    }
+}
+
+/* Get current PID */
+unsigned int
+platform_getpid ()
+{
+#ifdef WIN32
+  return (unsigned int) GetCurrentProcessId ();
+#else
+#ifdef HAVE_GETPID
+  return (unsigned int) getpid ();
+#else
+  return 0;
+#endif
+#endif
+}
+
+/* Disable paging */
+void
+platform_mlockall(bool print_msg)
+{
+#ifdef HAVE_MLOCKALL
+  if (mlockall (MCL_CURRENT | MCL_FUTURE))
+    msg (M_WARN | M_ERRNO, "WARNING: mlockall call failed");
+  else if (print_msg)
+    msg (M_INFO, "mlockall call succeeded");
+#else
+  msg (M_WARN, "WARNING: mlockall call failed (function not implemented)");
+#endif
+}
+
+/*
+ * Wrapper for chdir library function
+ */
+int
+platform_chdir (const char* dir)
+{
+#ifdef HAVE_CHDIR
+#ifdef WIN32
+  int res;
+  struct gc_arena gc = gc_new ();
+  res = _wchdir (wide_string (dir, &gc));
+  gc_free (&gc);
+  return res;
+#else
+  return chdir (dir);
+#endif
+#else
+  return -1;
+#endif
+}
+
+/*
+ * convert system() return into a success/failure value
+ */
+bool
+platform_system_ok (int stat)
+{
+#ifdef WIN32
+  return stat == 0;
+#else
+  return stat != -1 && WIFEXITED (stat) && WEXITSTATUS (stat) == 0;
+#endif
+}
+
+/*
+ * did system() call execute the given command?
+ */
+bool
+platform_system_executed (int stat)
+{
+#ifdef WIN32
+  return stat != -1;
+#else
+  return stat != -1 && WEXITSTATUS (stat) != 127;
+#endif
+}
+
+int
+platform_access (const char *path, int mode)
+{
+#ifdef WIN32
+  struct gc_arena gc = gc_new ();
+  int ret = _waccess (wide_string (path, &gc), mode & ~X_OK);
+  gc_free (&gc);
+  return ret;
+#else
+  return access (path, mode);
+#endif
+}
+
+/*
+ * Go to sleep for n milliseconds.
+ */
+void
+platform_sleep_milliseconds (unsigned int n)
+{
+#ifdef WIN32
+  Sleep (n);
+#else
+  struct timeval tv;
+  tv.tv_sec = n / 1000;
+  tv.tv_usec = (n % 1000) * 1000;
+  select (0, NULL, NULL, NULL, &tv);
+#endif
+}
+
+/*
+ * Go to sleep indefinitely.
+ */
+void
+platform_sleep_until_signal (void)
+{
+#ifdef WIN32
+  ASSERT (0);
+#else
+  select (0, NULL, NULL, NULL, NULL);
+#endif
+}
+
+/* delete a file, return true if succeeded */
+bool
+platform_unlink (const char *filename)
+{
+#if defined(WIN32)
+  struct gc_arena gc = gc_new ();
+  BOOL ret = DeleteFileW (wide_string (filename, &gc));
+  gc_free (&gc);
+  return (ret != 0);
+#elif defined(HAVE_UNLINK)
+  return (unlink (filename) == 0);
+#else
+  return false;
+#endif
+}
+
+int platform_system(const char *command) {
+  int ret;
+#ifdef WIN32
+  struct gc_arena gc = gc_new ();
+  ret = _wsystem (wide_string (command, &gc));
+  gc_free (&gc);
+#else
+  ret = system (command);
+#endif
+  return ret;
+}
+
+int platform_putenv(char *string)
+{
+  int status;
+#if defined(WIN32)
+  struct gc_arena gc = gc_new ();
+  char *s = string_alloc(string, &gc);
+  char *value = strchr(s, '=');
+  if (value!=NULL)
+    {
+      *value = '\0';
+      value++;
+      if (*value == '\0')
+        value = NULL;
+    }
+
+  status = SetEnvironmentVariableW (wide_string (s, &gc),
+      wide_string (value, &gc)) ? 1: 0;
+  gc_free (&gc);
+#elif defined(HAVE_PUTENV)
+  void manage_env (char *str); /* TODO: Resolve properly */
+  status = putenv (string);
+  if (!status)
+    manage_env (string);
+#endif
+
+  return status;
+}
+
+FILE *
+platform_fopen (const char *path, const char *mode)
+{
+#ifdef WIN32
+  struct gc_arena gc = gc_new ();
+  FILE *f = _wfopen (wide_string (path, &gc), wide_string (mode, &gc));
+  gc_free (&gc);
+  return f;
+#else
+  return fopen(path, mode);
+#endif
+}
+
+int
+platform_open (const char *path, int flags, int mode)
+{
+#ifdef WIN32
+  struct gc_arena gc = gc_new ();
+  int fd = _wopen (wide_string (path, &gc), flags, mode);
+  gc_free (&gc);
+  return fd;
+#else
+  return open(path, flags, mode);
+#endif
+}
+
+int
+platform_stat (const char *path, platform_stat_t *buf)
+{
+#ifdef WIN32
+  struct gc_arena gc = gc_new ();
+  int res = _wstat (wide_string (path, &gc), buf);
+  gc_free (&gc);
+  return res;
+#else
+  return stat(path, buf);
+#endif
+}
+
src/openvpn/platform.h new file +142 -0
new file mode 100644
index 0000000..7bd2067
@@ -0,0 +1,142 @@
+/*
+ *  OpenVPN -- An application to securely tunnel IP networks
+ *             over a single TCP/UDP port, with support for SSL/TLS-based
+ *             session authentication and key exchange,
+ *             packet encryption, packet authentication, and
+ *             packet compression.
+ *
+ *  Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <[email protected]...>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program (see the file COPYING included with this
+ *  distribution); if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef PLATFORM_H
+#define PLATFORM_H
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+
+#ifdef HAVE_STDIO_H
+#include <stdio.h>
+#endif
+
+#include "basic.h"
+
+/* Get/Set UID of process */
+
+struct platform_state_user {
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+  const char *username;
+  struct passwd *pw;
+#else
+  int dummy;
+#endif
+};
+
+/* Get/Set GID of process */
+
+struct platform_state_group {
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+  const char *groupname;
+  struct group *gr;
+#else
+  int dummy;
+#endif
+};
+
+bool platform_user_get (const char *username, struct platform_state_user *state);
+void platform_user_set (const struct platform_state_user *state);
+
+bool platform_group_get (const char *groupname, struct platform_state_group *state);
+void platform_group_set (const struct platform_state_group *state);
+
+/*
+ * Extract UID or GID
+ */
+
+static inline int
+platform_state_user_uid (const struct platform_state_user *s)
+{
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+  if (s->pw)
+    return s->pw->pw_uid;
+#endif
+  return -1;
+}
+
+static inline int
+platform_state_group_gid (const struct platform_state_group *s)
+{
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+  if (s->gr)
+    return s->gr->gr_gid;
+#endif
+  return -1;
+}
+
+void platform_chroot (const char *path);
+
+void platform_nice (int niceval);
+
+unsigned int platform_getpid (void);
+
+void platform_mlockall (bool print_msg); /* Disable paging */
+
+int platform_chdir (const char* dir);
+
+/* interpret the status code returned by system()/execve() */
+bool platform_system_ok (int stat);
+bool platform_system_executed (int stat);
+int platform_system(const char *command);
+
+int platform_access (const char *path, int mode);
+
+void platform_sleep_milliseconds (unsigned int n);
+
+void platform_sleep_until_signal (void);
+
+/* delete a file, return true if succeeded */
+bool platform_unlink (const char *filename);
+
+int platform_putenv (char *string);
+
+FILE *platform_fopen (const char *path, const char *mode);
+int platform_open (const char *path, int flags, int mode);
+
+#ifdef WIN32
+typedef struct _stat platform_stat_t;
+#else
+typedef struct stat platform_stat_t;
+#endif
+int platform_stat (const char *path, platform_stat_t *buf);
+
+#endif
src/openvpn/ps.c +1 -1
index a4e50e8..5d056ee 100644
@@ -337,7 +337,7 @@ journal_add (const char *journal_dir, struct proxy_connection *pc, struct proxy_
        check_malloc_return (jfn);
        openvpn_snprintf (jfn, fnlen, "%s/%s", journal_dir, t);
        dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: client origin %s -> %s", jfn, f);
-      fd = openvpn_open (jfn, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP);
+      fd = platform_open (jfn, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP);
        if (fd != -1)
         {
           write(fd, f, strlen(f));
src/openvpn/ssl_openssl.c +1 -1
index 6a60cb5..d712c66 100644
@@ -280,7 +280,7 @@ tls_ctx_load_pkcs12(struct tls_root_ctx *ctx, const char *pkcs12_file,
  #endif
      {
        /* Load the PKCS #12 file */
-      if (!(fp = openvpn_fopen(pkcs12_file, "rb")))
+      if (!(fp = platform_fopen(pkcs12_file, "rb")))
         msg(M_SSLERR, "Error opening file %s", pkcs12_file);
        p12 = d2i_PKCS12_fp(fp, NULL);
        fclose(fp);
src/openvpn/ssl_verify.c +3 -3
index 51457f8..e837e39 100644
@@ -517,7 +517,7 @@ verify_cert_call_command(const char *verify_command, struct env_set *es,
    if (verify_export_cert)
      {
         if (tmp_file)
-          delete_file(tmp_file);
+          platform_unlink(tmp_file);
      }
 
    gc_free(&gc);
@@ -551,7 +551,7 @@ verify_check_crl_dir(const char *crl_dir, openvpn_x509_cert_t *cert)
        x509_free_serial(serial);
        return FAILURE;
      }
-  fd = openvpn_open (fn, O_RDONLY, 0);
+  fd = platform_open (fn, O_RDONLY, 0);
    if (fd >= 0)
      {
        msg (D_HANDSHAKE, "VERIFY CRL: certificate serial number %s is revoked", serial);
@@ -735,7 +735,7 @@ key_state_rm_auth_control_file (struct key_state *ks)
  {
    if (ks && ks->auth_control_file)
      {
-      delete_file (ks->auth_control_file);
+      platform_unlink (ks->auth_control_file);
        free (ks->auth_control_file);
        ks->auth_control_file = NULL;
      }
@@ -987,7 +987,7 @@ verify_user_pass_script (struct tls_session *session, const struct user_pass *up
 

  done:
   if (tmp_file && strlen (tmp_file) > 0)
-    delete_file (tmp_file);
+    platform_unlink (tmp_file);

   argv_reset (&argv);
   gc_free (&gc);

src/openvpn/status.c +0 -0
index 0be5e4c..5f9ab9e 100644
@@ -78,17 +78,17 @@ status_open (const char *filename,
            switch (so->flags)
              {

             case STATUS_OUTPUT_WRITE:
-              so->fd = openvpn_open (filename,
+              so->fd = platform_open (filename,
                                      O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); break;
             case STATUS_OUTPUT_READ:
-              so->fd = openvpn_open (filename,
+              so->fd = platform_open (filename, O_RDONLY,
                                      S_IRUSR | S_IWUSR); break;
             case STATUS_OUTPUT_READ|STATUS_OUTPUT_WRITE:
-              so->fd = openvpn_open (filename,
+              so->fd = platform_open (filename,
                                      O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); break;

src/openvpn/tun.c +2 -2
index abc6a99..e6a7bc8 100644
@@ -1545,22 +1545,22 @@ tuncfg (const char *dev, const char *dev_type, const char *dev_node, int persist
      msg (M_ERR, "Cannot ioctl TUNSETPERSIST(%d) %s", persist_mode, dev);
    if (username != NULL)
      {
-      struct user_state user_state;
+      struct platform_state_user platform_state_user;
 
-      if (!get_user (username, &user_state))
+      if (!platform_user_get (username, &platform_state_user))
          msg (M_ERR, "Cannot get user entry for %s", username);

       else
-        if (ioctl (tt->fd, TUNSETOWNER, user_state.pw->pw_uid) < 0)
+        if (ioctl (tt->fd, TUNSETOWNER, platform_state_user.pw->pw_uid) < 0) msg (M_ERR, "Cannot ioctl TUNSETOWNER(%s) %s", username, dev); }
   if (groupname != NULL)
     {
-      struct group_state group_state;
+      struct platform_state_group platform_state_group;

-      if (!get_group (groupname, &group_state))
+      if (!platform_group_get (groupname, &platform_state_group)) msg (M_ERR, "Cannot get group entry for %s", groupname); else
-        if (ioctl (tt->fd, TUNSETGROUP, group_state.gr->gr_gid) < 0)
+        if (ioctl (tt->fd, TUNSETGROUP, platform_state_group.gr->gr_gid) < 0) msg (M_ERR, "Cannot ioctl TUNSETOWNER(%s) %s", groupname, dev); }
   close_tun (tt);

src/openvpn/win32.c +0 -28
index e94343b..e8e69dc 100644
@@ -976,33 +976,6 @@ wide_string (const char* utf8, struct gc_arena *gc)
    return ucs16;
  }
 
-FILE *
-openvpn_fopen (const char *path, const char *mode)
-{
-  struct gc_arena gc = gc_new ();
-  FILE *f = _wfopen (wide_string (path, &gc), wide_string (mode, &gc));
-  gc_free (&gc);
-  return f;
-}
-
-int
-openvpn_open (const char *path, int flags, int mode)
-{
-  struct gc_arena gc = gc_new ();
-  int fd = _wopen (wide_string (path, &gc), flags, mode);
-  gc_free (&gc);
-  return fd;
-}
-
-int
-openvpn_stat (const char *path, openvpn_stat_t *buf)
-{
-  struct gc_arena gc = gc_new ();
-  int res = _wstat (wide_string (path, &gc), buf);
-  gc_free (&gc);
-  return res;
-}
-
  /*
   * call ourself in another process
   */
--

1.7.3.4

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#102 lore raw

Re: [Openvpn-devel] [PATCH 49/52] build: move wrappers into platform module

Thanks for the clarifications! I like the idea of moving some functionality into more general-purpose libraries whenever possible. Those libraries could then be - at least theoretically - used by other projects, so that the code gets more exposure and testing, as well as taking some of the maintenance load of our shoulders.

I give this one a feature-ACK, but could somebody else take a better look at the actual code changes?

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc
 
irc freenode net: mattock
Quoted 1,700 lines

Well, at first I wanted to split it into its own libplatform distinct from libcompat.

libcompat - emulation of missing library functions, drop-in replacement. libplatform - extensions to library functions, such as unicode or security additions.

But then I've seen that there is too much openvpn specific logic, especially in log messages. So I left what I would have placed in libplatform in platform.c for now.

After this round we should consider if we want to progress in this.

One missing part is the exec wrappers which needs some work before moving to platform.

Alon.

2012/3/8 Samuli Seppänen <[email protected]...>:

Quoted 1,681 lines

This probably makes sense, lots of good refactorings. That said, I'd like to know how you selected what goes to platform.c?

--
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock

Quoted 1,669 lines

+ Some fixups within the platform.c functions.
- need to check environment set on Windows.

---
 src/openvpn/Makefile.am    |    1 +
 src/openvpn/buffer.c       |    2 +-
 src/openvpn/crypto.c       |    6 +-
 src/openvpn/error.c        |    2 +-
 src/openvpn/init.c         |   18 +-
 src/openvpn/manage.c       |   16 +-
 src/openvpn/misc.c         |  295 ++----------------------------------
 src/openvpn/misc.h         |  106 +-------------
 src/openvpn/mstats.c       |    2 +-
 src/openvpn/multi.c        |    2 +-
 src/openvpn/openvpn.h      |    4 +-
 src/openvpn/openvpn.vcproj |    8 +
 src/openvpn/options.c      |   14 +-
 src/openvpn/packet_id.c    |    2 +-
 src/openvpn/pf.c           |    6 +-
 src/openvpn/platform.c     |  369 ++++++++++++++++++++++++++++++++++++++++++++
 src/openvpn/platform.h     |  142 +++++++++++++++++
 src/openvpn/ps.c           |    2 +-
 src/openvpn/ssl_openssl.c  |    2 +-
 src/openvpn/ssl_verify.c   |    8 +-
 src/openvpn/status.c       |    6 +-
 src/openvpn/tun.c          |   12 +-
 src/openvpn/win32.c        |   27 ----
 23 files changed, 584 insertions(+), 468 deletions(-)
 create mode 100644 src/openvpn/platform.c
 create mode 100644 src/openvpn/platform.h
src/openvpn/Makefile.am +1 -0
index 333eebc..6ba12b8 100644
@@ -58,6 +58,7 @@ openvpn_SOURCES = \
        mbuf.c mbuf.h \
        memdbg.h \
        misc.c misc.h \
+       platform.c platform.h \
        console.c console.h \
        mroute.c mroute.h \
        mss.c mss.h \
src/openvpn/buffer.c +1 -1
index ad30223..5eee3ee 100644
@@ -1080,7 +1080,7 @@ buffer_list_advance (struct buffer_list *ol, int n)
 struct buffer_list *
 buffer_list_file (const char *fn, int max_line_len)
 {
-  FILE *fp = openvpn_fopen (fn, "r");
+  FILE *fp = platform_fopen (fn, "r");
   struct buffer_list *bl = NULL;
 
   if (fp)
src/openvpn/crypto.c +3 -3
index 2e2e5d7..f811966 100644
@@ -868,7 +868,7 @@ read_key_file (struct key2 *key2, const char *file, const unsigned int flags)
 #endif
     {
       in = alloc_buf_gc (2048, &gc);
-      fd = openvpn_open (file, O_RDONLY, 0);
+      fd = platform_open (file, O_RDONLY, 0);
       if (fd == -1)
        msg (M_ERR, "Cannot open file key file '%s'", file);
       size = read (fd, in.data, in.capacity);
@@ -1029,7 +1029,7 @@ read_passphrase_hash (const char *passphrase_file,
     const int min_passphrase_size = 8;
     uint8_t buf[64];
     int total_size = 0;
-    int fd = openvpn_open (passphrase_file, O_RDONLY, 0);
+    int fd = platform_open (passphrase_file, O_RDONLY, 0);
 
     if (fd == -1)
       msg (M_ERR, "Cannot open passphrase file: '%s'", passphrase_file);
@@ -1079,7 +1079,7 @@ write_key_file (const int nkeys, const char *filename)
   const int bytes_per_line = 16;
 
   /* open key file */
-  fd = openvpn_open (filename, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR);
+  fd = platform_open (filename, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR);
 
   if (fd == -1)
     msg (M_ERR, "Cannot open shared secret file '%s' for write", filename);
src/openvpn/error.c +1 -1
index 1f2dd86..d6ad639 100644
@@ -640,7 +640,7 @@ x_check_status (int status,
                 my_errno);
 
          if (x_cs_err_delay_ms)
-           sleep_milliseconds (x_cs_err_delay_ms);
+           platform_sleep_milliseconds (x_cs_err_delay_ms);
        }
       gc_free (&gc);
     }
src/openvpn/init.c +9 -9
index bba3cf8..bc7718e 100644
@@ -935,7 +935,7 @@ do_genkey (const struct options * options)
               "shared secret output file (--secret)");
 
       if (options->mlock)      /* should we disable paging? */
-       do_mlockall (true);
+       platform_mlockall (true);
 
       nbits_written = write_key_file (2, options->shared_secret_file);
 
@@ -1022,7 +1022,7 @@ do_uid_gid_chroot (struct context *c, bool no_delay)
       if (c->options.chroot_dir)
        {
          if (no_delay)
-           do_chroot (c->options.chroot_dir);
+           platform_chroot (c->options.chroot_dir);
          else
            msg (M_INFO, "NOTE: chroot %s", why_not);
        }
@@ -1030,8 +1030,8 @@ do_uid_gid_chroot (struct context *c, bool no_delay)
       /* set user and/or group that we want to setuid/setgid to */
       if (no_delay)
        {
-         set_group (&c0->group_state);
-         set_user (&c0->user_state);
+         platform_group_set (&c0->platform_state_group);
+         platform_user_set (&c0->platform_state_user);
          c0->uid_gid_set = true;
        }
       else if (c0->uid_gid_specified)
@@ -2780,8 +2780,8 @@ do_init_first_time (struct context *c)
 
       /* get user and/or group that we want to setuid/setgid to */
       c0->uid_gid_specified =
-       get_group (c->options.groupname, &c0->group_state) |
-       get_user (c->options.username, &c0->user_state);
+       platform_group_get (c->options.groupname, &c0->platform_state_group) |
+       platform_user_get (c->options.username, &c0->platform_state_user);
 
       /* get --writepid file descriptor */
       get_pid_file (c->options.writepid, &c0->pid_state);
@@ -2791,13 +2791,13 @@ do_init_first_time (struct context *c)
 
       /* should we disable paging? */
       if (c->options.mlock && c->did_we_daemonize)
-       do_mlockall (true);     /* call again in case we daemonized */
+       platform_mlockall (true);       /* call again in case we daemonized */
 
       /* save process ID in a file */
       write_pid (&c0->pid_state);
 
       /* should we change scheduling priority? */
-      set_nice (c->options.nice);
+      platform_nice (c->options.nice);
     }
 }
 
@@ -3342,7 +3342,7 @@ init_instance (struct context *c, const struct env_set *env, const unsigned int
 
   /* should we disable paging? */
   if (c->first_time && options->mlock)
-    do_mlockall (true);
+    platform_mlockall (true);
 
 #if P2MP
   /* get passwords if undefined */
src/openvpn/manage.c +8 -8
index 85c9aca..1dddd41 100644
@@ -1146,7 +1146,7 @@ man_dispatch_command (struct management *man, struct status_output *so, const ch
     }
   else if (streq (p[0], "pid"))
     {
-      msg (M_CLIENT, "SUCCESS: pid=%d", openvpn_getpid ());
+      msg (M_CLIENT, "SUCCESS: pid=%d", platform_getpid ());
     }
 #ifdef MANAGEMENT_DEF_AUTH
   else if (streq (p[0], "nclients"))
@@ -1429,7 +1429,7 @@ man_record_peer_info (struct management *man)
            {
              const in_addr_t a = ntohl (addr.sin_addr.s_addr);
              const int p = ntohs (addr.sin_port);
-             FILE *fp = openvpn_fopen (man->settings.write_peer_info_file, "w");
+             FILE *fp = platform_fopen (man->settings.write_peer_info_file, "w");
              if (fp)
                {
                  fprintf (fp, "%s\n%d\n", print_in_addr_t (a, 0, &gc), p);
@@ -2013,17 +2013,17 @@ man_settings_init (struct man_settings *ms,
        */
       if (client_user)
        {
-         struct user_state s;
-         get_user (client_user, &s);
-         ms->client_uid = user_state_uid (&s);
+         struct platform_state_user s;
+         platform_user_get (client_user, &s);
+         ms->client_uid = platform_state_user_uid (&s);
          msg (D_MANAGEMENT, "MANAGEMENT: client_uid=%d", ms->client_uid);
          ASSERT (ms->client_uid >= 0);
        }
       if (client_group)
        {
-         struct group_state s;
-         get_group (client_group, &s);
-         ms->client_gid = group_state_gid (&s);
+         struct platform_state_group s;
+         platform_group_get (client_group, &s);
+         ms->client_gid = platform_state_group_gid (&s);
          msg (D_MANAGEMENT, "MANAGEMENT: client_gid=%d", ms->client_gid);
          ASSERT (ms->client_gid >= 0);
        }
src/openvpn/misc.c +11 -284
index 2571194..2ded9bf 100644
@@ -56,122 +56,6 @@ int script_security = SSEC_BUILT_IN; /* GLOBAL */
 /* contains SM_x value defined in misc.h */
 int script_method = SM_EXECVE; /* GLOBAL */
 
-/* Redefine the top level directory of the filesystem
-   to restrict access to files for security */
-void
-do_chroot (const char *path)
-{
-  if (path)
-    {
-#ifdef HAVE_CHROOT
-      const char *top = "/";
-      if (chroot (path))
-       msg (M_ERR, "chroot to '%s' failed", path);
-      if (openvpn_chdir (top))
-       msg (M_ERR, "cd to '%s' failed", top);
-      msg (M_INFO, "chroot to '%s' and cd to '%s' succeeded", path, top);
-#else
-      msg (M_FATAL, "Sorry but I can't chroot to '%s' because this operating system doesn't appear to support the chroot() system call", path);
-#endif
-    }
-}
-
-/* Get/Set UID of process */
-
-bool
-get_user (const char *username, struct user_state *state)
-{
-  bool ret = false;
-  CLEAR (*state);
-  if (username)
-    {
-#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
-      state->pw = getpwnam (username);
-      if (!state->pw)
-       msg (M_ERR, "failed to find UID for user %s", username);
-      state->username = username;
-      ret = true;
-#else
-      msg (M_FATAL, "cannot get UID for user %s -- platform lacks getpwname() or setuid() system calls", username);
-#endif
-    }
-  return ret;
-}
-
-void
-set_user (const struct user_state *state)
-{
-#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
-  if (state->username && state->pw)
-    {
-      if (setuid (state->pw->pw_uid))
-       msg (M_ERR, "setuid('%s') failed", state->username);
-      msg (M_INFO, "UID set to %s", state->username);
-    }
-#endif
-}
-
-/* Get/Set GID of process */
-
-bool
-get_group (const char *groupname, struct group_state *state)
-{
-  bool ret = false;
-  CLEAR (*state);
-  if (groupname)
-    {
-#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
-      state->gr = getgrnam (groupname);
-      if (!state->gr)
-       msg (M_ERR, "failed to find GID for group %s", groupname);
-      state->groupname = groupname;
-      ret = true;
-#else
-      msg (M_FATAL, "cannot get GID for group %s -- platform lacks getgrnam() or setgid() system calls", groupname);
-#endif
-    }
-  return ret;
-}
-
-void
-set_group (const struct group_state *state)
-{
-#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
-  if (state->groupname && state->gr)
-    {
-      if (setgid (state->gr->gr_gid))
-       msg (M_ERR, "setgid('%s') failed", state->groupname);
-      msg (M_INFO, "GID set to %s", state->groupname);
-#ifdef HAVE_SETGROUPS
-      {
-        gid_t gr_list[1];
-       gr_list[0] = state->gr->gr_gid;
-       if (setgroups (1, gr_list))
-         msg (M_ERR, "setgroups('%s') failed", state->groupname);
-      }
-#endif
-    }
-#endif
-}
-
-/* Change process priority */
-void
-set_nice (int niceval)
-{
-  if (niceval)
-    {
-#ifdef HAVE_NICE
-      errno = 0;
-      if (nice (niceval) < 0 && errno != 0)
-       msg (M_WARN | M_ERRNO, "WARNING: nice %d failed: %s", niceval, strerror(errno));
-      else
-       msg (M_INFO, "nice %d succeeded", niceval);
-#else
-      msg (M_WARN, "WARNING: nice %d failed (function not implemented)", niceval);
-#endif
-    }
-}
-
 /*
  * Pass tunnel endpoint and MTU parms to a user-supplied script.
  * Used to execute the up/down script/plugins.
@@ -253,7 +137,7 @@ get_pid_file (const char* filename, struct pid_state *state)
   CLEAR (*state);
   if (filename)
     {
-      state->fp = openvpn_fopen (filename, "w");
+      state->fp = platform_fopen (filename, "w");
       if (!state->fp)
        msg (M_ERR, "Open error on pid file %s", filename);
       state->filename = filename;
@@ -266,42 +150,13 @@ write_pid (const struct pid_state *state)
 {
   if (state->filename && state->fp)
     {
-      unsigned int pid = openvpn_getpid ();
+      unsigned int pid = platform_getpid ();
       fprintf(state->fp, "%u\n", pid);
       if (fclose (state->fp))
        msg (M_ERR, "Close error on pid file %s", state->filename);
     }
 }
 
-/* Get current PID */
-unsigned int
-openvpn_getpid ()
-{
-#ifdef WIN32
-  return (unsigned int) GetCurrentProcessId ();
-#else
-#ifdef HAVE_GETPID
-  return (unsigned int) getpid ();
-#else
-  return 0;
-#endif
-#endif
-}
-
-/* Disable paging */
-void
-do_mlockall(bool print_msg)
-{
-#ifdef HAVE_MLOCKALL
-  if (mlockall (MCL_CURRENT | MCL_FUTURE))
-    msg (M_WARN | M_ERRNO, "WARNING: mlockall call failed");
-  else if (print_msg)
-    msg (M_INFO, "mlockall call succeeded");
-#else
-  msg (M_WARN, "WARNING: mlockall call failed (function not implemented)");
-#endif
-}
-
 /*
  * Set standard file descriptors to /dev/null
  */
@@ -325,27 +180,6 @@ set_std_files_to_null (bool stdin_only)
 }
 
 /*
- * Wrapper for chdir library function
- */
-int
-openvpn_chdir (const char* dir)
-{
-#ifdef HAVE_CHDIR
-#ifdef WIN32
-  int res;
-  struct gc_arena gc = gc_new ();
-  res = _wchdir (wide_string (dir, &gc));
-  gc_free (&gc);
-  return res;
-#else
-  return chdir (dir);
-#endif
-#else
-  return -1;
-#endif
-}
-
-/*
  *  dup inetd/xinetd socket descriptor and save
  */
 
@@ -391,32 +225,6 @@ warn_if_group_others_accessible (const char* filename)
 }
 
 /*
- * convert system() return into a success/failure value
- */
-bool
-system_ok (int stat)
-{
-#ifdef WIN32
-  return stat == 0;
-#else
-  return stat != -1 && WIFEXITED (stat) && WEXITSTATUS (stat) == 0;
-#endif
-}
-
-/*
- * did system() call execute the given command?
- */
-bool
-system_executed (int stat)
-{
-#ifdef WIN32
-  return stat != -1;
-#else
-  return stat != -1 && WEXITSTATUS (stat) != 127;
-#endif
-}
-
-/*
  * Print an error message based on the status code returned by system().
  */
 const char *
@@ -456,7 +264,7 @@ openvpn_execve_check (const struct argv *a, const struct env_set *es, const unsi
   const int stat = openvpn_execve (a, es, flags);
   int ret = false;
 
-  if (system_ok (stat))
+  if (platform_system_ok (stat))
     ret = true;
   else
     {
@@ -554,7 +362,6 @@ openvpn_system (const char *command, const struct env_set *es, unsigned int flag
 {
 #ifdef HAVE_SYSTEM
   int ret;
-  struct gc_arena gc;
 
   perf_push (PERF_SCRIPT);
 
@@ -573,13 +380,7 @@ openvpn_system (const char *command, const struct env_set *es, unsigned int flag
   /*
    * execute the command
    */
-#ifdef WIN32
-  gc = gc_new ();
-  ret = _wsystem (wide_string (command, &gc));
-  gc_free (&gc);
-#else
-  ret = system (command);
-#endif
+  ret = platform_system(command);
 
   /* debugging */
   dmsg (D_SCRIPT, "SYSTEM return=%u", ret);
@@ -599,19 +400,6 @@ openvpn_system (const char *command, const struct env_set *es, unsigned int flag
 #endif
 }
 
-int
-openvpn_access (const char *path, int mode)
-{
-#ifdef WIN32
-  struct gc_arena gc = gc_new ();
-  int ret = _waccess (wide_string (path, &gc), mode);
-  gc_free (&gc);
-  return ret;
-#else
-  return access (path, mode);
-#endif
-}
-
 /*
  * Run execve() inside a fork(), duping stdout.  Designed to replicate the semantics of popen() but
  * in a safer way that doesn't require the invocation of a shell or the risks
@@ -981,7 +769,7 @@ env_set_remove_from_environment (const struct env_set *es)
 
 static struct env_item *global_env = NULL; /* GLOBAL */
 
-static void
+void
 manage_env (char *str)
 {
   remove_env_item (str, true, &global_env);
@@ -1078,27 +866,11 @@ setenv_str_ex (struct env_set *es,
     }
   else
     {
-#if defined(WIN32)
+      char *str = construct_name_value (name_tmp, val_tmp, NULL);
+      if (platform_putenv(str))
       {
-        if (!SetEnvironmentVariableW (wide_string (name_tmp, &gc),
-                                      wide_string (val_tmp, &gc)))
-         msg (M_WARN | M_ERRNO, "SetEnvironmentVariable failed, name='%s', value='%s'",
-              name_tmp,
-              val_tmp ? val_tmp : "NULL");
+        msg (M_WARN | M_ERRNO, "putenv('%s') failed", str);
       }
-#elif defined(HAVE_PUTENV)
-      {
-       char *str = construct_name_value (name_tmp, val_tmp, NULL);
-       int status;
-
-       status = putenv (str);
-       /*msg (M_INFO, "PUTENV '%s'", str);*/
-       if (!status)
-         manage_env (str);
-       if (status)
-         msg (M_WARN | M_ERRNO, "putenv('%s') failed", str);
-      }
-#endif
     }
 
   gc_free (&gc);
@@ -1162,35 +934,6 @@ count_netmask_bits(const char *dotted_quad)
   return ((int)result);
 }
 
-/*
- * Go to sleep for n milliseconds.
- */
-void
-sleep_milliseconds (unsigned int n)
-{
-#ifdef WIN32
-  Sleep (n);
-#else
-  struct timeval tv;
-  tv.tv_sec = n / 1000;
-  tv.tv_usec = (n % 1000) * 1000;
-  select (0, NULL, NULL, NULL, &tv);
-#endif
-}
-
-/*
- * Go to sleep indefinitely.
- */
-void
-sleep_until_signal (void)
-{
-#ifdef WIN32
-  ASSERT (0);
-#else
-  select (0, NULL, NULL, NULL, NULL);
-#endif
-}
-
 /* return true if filename can be opened for read */
 bool
 test_file (const char *filename)
@@ -1198,7 +941,7 @@ test_file (const char *filename)
   bool ret = false;
   if (filename)
     {
-      FILE *fp = openvpn_fopen (filename, "r");
+      FILE *fp = platform_fopen (filename, "r");
       if (fp)
        {
          fclose (fp);
@@ -1246,7 +989,7 @@ create_temp_file (const char *directory, const char *prefix, struct gc_arena *gc
 
       /* Atomically create the file.  Errors out if the file already
          exists.  */
-      fd = openvpn_open (retfname, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IWUSR);
+      fd = platform_open (retfname, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IWUSR);
       if (fd != -1)
         {
           close (fd);
@@ -1342,22 +1085,6 @@ gen_path (const char *directory, const char *filename, struct gc_arena *gc)
     return NULL;
 }
 
-/* delete a file, return true if succeeded */
-bool
-delete_file (const char *filename)
-{
-#if defined(WIN32)
-  struct gc_arena gc = gc_new ();
-  BOOL ret = DeleteFileW (wide_string (filename, &gc));
-  gc_free (&gc);
-  return (ret != 0);
-#elif defined(HAVE_UNLINK)
-  return (unlink (filename) == 0);
-#else
-  return false;
-#endif
-}
-
 bool
 absolute_pathname (const char *pathname)
 {
@@ -1524,7 +1251,7 @@ get_user_pass_cr (struct user_pass *up,
 
          warn_if_group_others_accessible (auth_file);
 
-         fp = openvpn_fopen (auth_file, "r");
+         fp = platform_fopen (auth_file, "r");
          if (!fp)
            msg (M_ERR, "Error opening '%s' auth file: %s", prefix, auth_file);
 
src/openvpn/misc.h +1 -105
index 12a8f71..d4c8e33 100644
@@ -29,6 +29,7 @@
 #include "common.h"
 #include "integer.h"
 #include "buffer.h"
+#include "platform.h"
 
 /* socket descriptor passed by inetd/xinetd server to us */
 #define INETD_SOCKET_DESCRIPTOR 0
@@ -58,37 +59,6 @@ struct env_set {
   struct env_item *list;
 };
 
-/* Get/Set UID of process */
-
-struct user_state {
-#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
-  const char *username;
-  struct passwd *pw;
-#else
-  int dummy;
-#endif
-};
-
-bool get_user (const char *username, struct user_state *state);
-void set_user (const struct user_state *state);
-
-/* Get/Set GID of process */
-
-struct group_state {
-#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
-  const char *groupname;
-  struct group *gr;
-#else
-  int dummy;
-#endif
-};
-
-bool get_group (const char *groupname, struct group_state *state);
-void set_group (const struct group_state *state);
-
-void set_nice (int niceval);
-void do_chroot (const char *path);
-
 void run_up_down (const char *command,
                  const struct plugin_list *plugins,
                  int plugin_type,
@@ -111,9 +81,6 @@ struct pid_state {
 
 void get_pid_file (const char* filename, struct pid_state *state);
 void write_pid (const struct pid_state *state);
-unsigned int openvpn_getpid (void);
-
-void do_mlockall (bool print_msg); /* Disable paging */
 
 /* check file protections */
 void warn_if_group_others_accessible(const char* filename);
@@ -122,9 +89,6 @@ void warn_if_group_others_accessible(const char* filename);
 #define S_SCRIPT (1<<0)
 #define S_FATAL  (1<<1)
 
-/* interpret the status code returned by system()/execve() */
-bool system_ok(int);
-bool system_executed (int stat);
 const char *system_error_message (int, struct gc_arena *gc);
 
 /* wrapper around the execve() call */
@@ -133,7 +97,6 @@ int openvpn_execve (const struct argv *a, const struct env_set *es, const unsign
 bool openvpn_execve_check (const struct argv *a, const struct env_set *es, const unsigned int flags, const char *error_message);
 bool openvpn_execve_allowed (const unsigned int flags);
 int openvpn_system (const char *command, const struct env_set *es, unsigned int flags);
-int openvpn_access (const char *path, int mode);
 
 static inline bool
 openvpn_run_script (const struct argv *a, const struct env_set *es, const unsigned int flags, const char *hook)
@@ -144,37 +107,6 @@ openvpn_run_script (const struct argv *a, const struct env_set *es, const unsign
   return openvpn_execve_check(a, es, flags | S_SCRIPT, msg);
 }
 
-#ifdef WIN32
-FILE * openvpn_fopen (const char *path, const char *mode);
-#else
-static inline FILE *
-openvpn_fopen (const char *path, const char *mode)
-{
-  return fopen (path, mode);
-}
-#endif
-
-#ifdef WIN32
-int openvpn_open (const char *path, int flags, int mode);
-#else
-static inline int
-openvpn_open (const char *path, int flags, mode_t mode)
-{
-  return open (path, flags, mode);
-}
-#endif
-
-#ifdef WIN32
-typedef struct _stat openvpn_stat_t;
-int openvpn_stat (const char *path, openvpn_stat_t *buf);
-#else
-typedef struct stat openvpn_stat_t;
-static inline int
-openvpn_stat (const char *path, openvpn_stat_t *buf)
-{
-  return stat (path, buf);
-}
-#endif
 
 #ifdef HAVE_STRERROR
 /* a thread-safe version of strerror */
@@ -184,9 +116,6 @@ const char* strerror_ts (int errnum, struct gc_arena *gc);
 /* Set standard file descriptors to /dev/null */
 void set_std_files_to_null (bool stdin_only);
 
-/* Wrapper for chdir library function */
-int openvpn_chdir (const char* dir);
-
 /* dup inetd/xinetd socket descriptor and save */
 extern int inetd_socket_descriptor;
 void save_inetd_socket_descriptor (void);
@@ -242,12 +171,6 @@ const char **make_extended_arg_array (char **p, struct gc_arena *gc);
 int count_netmask_bits(const char *);
 unsigned int count_bits(unsigned int );
 
-/* go to sleep for n milliseconds */
-void sleep_milliseconds (unsigned int n);
-
-/* go to sleep indefinitely */
-void sleep_until_signal (void);
-
 /* an analogue to the random() function, but use OpenSSL functions if available */
 #ifdef ENABLE_CRYPTO
 long int get_random(void);
@@ -264,9 +187,6 @@ const char *create_temp_file (const char *directory, const char *prefix, struct
 /* put a directory and filename together */
 const char *gen_path (const char *directory, const char *filename, struct gc_arena *gc);
 
-/* delete a file, return true if succeeded */
-bool delete_file (const char *filename);
-
 /* return true if pathname is absolute */
 bool absolute_pathname (const char *pathname);
 
@@ -448,28 +368,4 @@ void argv_printf_cat (struct argv *a, const char *format, ...)
 #endif
   ;
 
-/*
- * Extract UID or GID
- */
-
-static inline int
-user_state_uid (const struct user_state *s)
-{
-#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
-  if (s->pw)
-    return s->pw->pw_uid;
-#endif
-  return -1;
-}
-
-static inline int
-group_state_gid (const struct group_state *s)
-{
-#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
-  if (s->gr)
-    return s->gr->gr_gid;
-#endif
-  return -1;
-}
-
 #endif
src/openvpn/mstats.c +1 -1
index b4b864b..3be493c 100644
@@ -114,7 +114,7 @@ mstats_close(void)
       mmap_stats->state = MSTATS_EXPIRED;
       if (munmap((void *)mmap_stats, sizeof(struct mmap_stats)))
        msg (M_WARN | M_ERRNO, "mstats_close: munmap error");
-      delete_file(mmap_fn);
+      platform_unlink(mmap_fn);
       mmap_stats = NULL;
     }
 }
src/openvpn/multi.c +1 -1
index e79c6f1..9876b80 100644
@@ -1452,7 +1452,7 @@ multi_client_connect_post (struct multi_context *m,
                             option_types_found,
                             mi->context.c2.es);
 
-      if (!delete_file (dc_file))
+      if (!platform_unlink (dc_file))
        msg (D_MULTI_ERRORS, "MULTI: problem deleting temporary file: %s",
             dc_file);
 
src/openvpn/openvpn.h +2 -2
index b314885..0732d0f 100644
@@ -143,8 +143,8 @@ struct context_0
   /* workspace for --user/--group */
   bool uid_gid_specified;
   bool uid_gid_set;
-  struct user_state user_state;
-  struct group_state group_state;
+  struct platform_state_user platform_state_user;
+  struct platform_state_group platform_state_group;
 };
 
 
src/openvpn/openvpn.vcproj +8 -0
index 6c19621..4680e52 100644
@@ -347,6 +347,10 @@
                                >
                        </File>
                        <File
+                               RelativePath=".\platform.c"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\plugin.c"
                                >
                        </File>
@@ -649,6 +653,10 @@
                                >
                        </File>
                        <File
+                               RelativePath=".\platform.h"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\plugin.h"
                                >
                        </File>
src/openvpn/options.c +7 -7
index 258b060..bd83843 100644
@@ -920,7 +920,7 @@ setenv_settings (struct env_set *es, const struct options *o)
   setenv_int (es, "daemon", o->daemon);
   setenv_int (es, "daemon_log_redirect", o->log);
   setenv_unsigned (es, "daemon_start_time", time(NULL));
-  setenv_int (es, "daemon_pid", openvpn_getpid());
+  setenv_int (es, "daemon_pid", platform_getpid());
 
 #ifdef ENABLE_CONNECTION
   if (o->connection_list)
@@ -2640,18 +2640,18 @@ check_file_access(const int type, const char *file, const int mode, const char *
       char *fullpath = strdup(file);  /* POSIX dirname() implementaion may modify its arguments */
       char *dirpath = dirname(fullpath);
 
-      if (openvpn_access (dirpath, mode|X_OK) != 0)
+      if (platform_access (dirpath, mode|X_OK) != 0)
           errcode = errno;
       free(fullpath);
     }
 
   /* Is the file itself accessible? */
-  if (!errcode && (type & CHKACC_FILE) && (openvpn_access (file, mode) != 0) )
+  if (!errcode && (type & CHKACC_FILE) && (platform_access (file, mode) != 0) )
       errcode = errno;
 
   /* If the file exists and is accessible, is it writable? */
-  if (!errcode && (type & CHKACC_FILEXSTWR) && (openvpn_access (file, F_OK) == 0) )
-    if (openvpn_access (file, W_OK) != 0)
+  if (!errcode && (type & CHKACC_FILEXSTWR) && (platform_access (file, F_OK) == 0) )
+    if (platform_access (file, W_OK) != 0)
       errcode = errno;
 
   /* Scream if an error is found */
@@ -3755,7 +3755,7 @@ read_config_file (struct options *options,
       if (streq (file, "stdin"))
        fp = stdin;
       else
-       fp = openvpn_fopen (file, "r");
+       fp = platform_fopen (file, "r");
       if (fp)
        {
          line_num = 0;
@@ -4528,7 +4528,7 @@ add_option (struct options *options,
   else if (streq (p[0], "cd") && p[1])
     {
       VERIFY_PERMISSION (OPT_P_GENERAL);
-      if (openvpn_chdir (p[1]))
+      if (platform_chdir (p[1]))
        {
          msg (M_ERR, "cd to '%s' failed", p[1]);
          goto err;
src/openvpn/packet_id.c +1 -1
index 186f074..0102129 100644
@@ -368,7 +368,7 @@ packet_id_persist_load (struct packet_id_persist *p, const char *filename)
   if (!packet_id_persist_enabled (p))
     {
       /* open packet-id persist file for both read and write */
-      p->fd = openvpn_open (filename,
+      p->fd = platform_open (filename,
                             O_CREAT | O_RDWR | O_BINARY,
                             S_IRUSR | S_IWUSR);
       if (p->fd == -1)
src/openvpn/pf.c +3 -3
index 729792e..7ed1e70 100644
@@ -504,8 +504,8 @@ pf_check_reload (struct context *c)
       && c->c2.pf.filename
       && event_timeout_trigger (&c->c2.pf.reload, &c->c2.timeval, ETT_DEFAULT))
     {
-      openvpn_stat_t s;
-      if (!openvpn_stat (c->c2.pf.filename, &s))
+      platform_stat_t s;
+      if (!platform_stat (c->c2.pf.filename, &s))
        {
          if (s.st_mtime > c->c2.pf.file_last_mod)
            {
@@ -605,7 +605,7 @@ pf_destroy_context (struct pf_context *pfc)
 #ifdef PLUGIN_PF
   if (pfc->filename)
     {
-      delete_file (pfc->filename);
+      platform_unlink (pfc->filename);
       free (pfc->filename);
     }
 #endif
src/openvpn/platform.c new file +369 -0
new file mode 100644
index 0000000..c79f680
@@ -0,0 +1,369 @@
+/*
+ *  OpenVPN -- An application to securely tunnel IP networks
+ *             over a single TCP/UDP port, with support for SSL/TLS-based
+ *             session authentication and key exchange,
+ *             packet encryption, packet authentication, and
+ *             packet compression.
+ *
+ *  Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <[email protected]....>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program (see the file COPYING included with this
+ *  distribution); if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "buffer.h"
+#include "error.h"
+#include "win32.h"
+
+#include "memdbg.h"
+
+#include "platform.h"
+
+/* Redefine the top level directory of the filesystem
+   to restrict access to files for security */
+void
+platform_chroot (const char *path)
+{
+  if (path)
+    {
+#ifdef HAVE_CHROOT
+      const char *top = "/";
+      if (chroot (path))
+       msg (M_ERR, "chroot to '%s' failed", path);
+      if (platform_chdir (top))
+       msg (M_ERR, "cd to '%s' failed", top);
+      msg (M_INFO, "chroot to '%s' and cd to '%s' succeeded", path, top);
+#else
+      msg (M_FATAL, "Sorry but I can't chroot to '%s' because this operating system doesn't appear to support the chroot() system call", path);
+#endif
+    }
+}
+
+/* Get/Set UID of process */
+
+bool
+platform_user_get (const char *username, struct platform_state_user *state)
+{
+  bool ret = false;
+  CLEAR (*state);
+  if (username)
+    {
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+      state->pw = getpwnam (username);
+      if (!state->pw)
+       msg (M_ERR, "failed to find UID for user %s", username);
+      state->username = username;
+      ret = true;
+#else
+      msg (M_FATAL, "cannot get UID for user %s -- platform lacks getpwname() or setuid() system calls", username);
+#endif
+    }
+  return ret;
+}
+
+void
+platform_user_set (const struct platform_state_user *state)
+{
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+  if (state->username && state->pw)
+    {
+      if (setuid (state->pw->pw_uid))
+       msg (M_ERR, "setuid('%s') failed", state->username);
+      msg (M_INFO, "UID set to %s", state->username);
+    }
+#endif
+}
+
+/* Get/Set GID of process */
+
+bool
+platform_group_get (const char *groupname, struct platform_state_group *state)
+{
+  bool ret = false;
+  CLEAR (*state);
+  if (groupname)
+    {
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+      state->gr = getgrnam (groupname);
+      if (!state->gr)
+       msg (M_ERR, "failed to find GID for group %s", groupname);
+      state->groupname = groupname;
+      ret = true;
+#else
+      msg (M_FATAL, "cannot get GID for group %s -- platform lacks getgrnam() or setgid() system calls", groupname);
+#endif
+    }
+  return ret;
+}
+
+void
+platform_group_set (const struct platform_state_group *state)
+{
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+  if (state->groupname && state->gr)
+    {
+      if (setgid (state->gr->gr_gid))
+       msg (M_ERR, "setgid('%s') failed", state->groupname);
+      msg (M_INFO, "GID set to %s", state->groupname);
+#ifdef HAVE_SETGROUPS
+      {
+        gid_t gr_list[1];
+       gr_list[0] = state->gr->gr_gid;
+       if (setgroups (1, gr_list))
+         msg (M_ERR, "setgroups('%s') failed", state->groupname);
+      }
+#endif
+    }
+#endif
+}
+
+/* Change process priority */
+void
+platform_nice (int niceval)
+{
+  if (niceval)
+    {
+#ifdef HAVE_NICE
+      errno = 0;
+      if (nice (niceval) < 0 && errno != 0)
+       msg (M_WARN | M_ERRNO, "WARNING: nice %d failed: %s", niceval, strerror(errno));
+      else
+       msg (M_INFO, "nice %d succeeded", niceval);
+#else
+      msg (M_WARN, "WARNING: nice %d failed (function not implemented)", niceval);
+#endif
+    }
+}
+
+/* Get current PID */
+unsigned int
+platform_getpid ()
+{
+#ifdef WIN32
+  return (unsigned int) GetCurrentProcessId ();
+#else
+#ifdef HAVE_GETPID
+  return (unsigned int) getpid ();
+#else
+  return 0;
+#endif
+#endif
+}
+
+/* Disable paging */
+void
+platform_mlockall(bool print_msg)
+{
+#ifdef HAVE_MLOCKALL
+  if (mlockall (MCL_CURRENT | MCL_FUTURE))
+    msg (M_WARN | M_ERRNO, "WARNING: mlockall call failed");
+  else if (print_msg)
+    msg (M_INFO, "mlockall call succeeded");
+#else
+  msg (M_WARN, "WARNING: mlockall call failed (function not implemented)");
+#endif
+}
+
+/*
+ * Wrapper for chdir library function
+ */
+int
+platform_chdir (const char* dir)
+{
+#ifdef HAVE_CHDIR
+#ifdef WIN32
+  int res;
+  struct gc_arena gc = gc_new ();
+  res = _wchdir (wide_string (dir, &gc));
+  gc_free (&gc);
+  return res;
+#else
+  return chdir (dir);
+#endif
+#else
+  return -1;
+#endif
+}
+
+/*
+ * convert system() return into a success/failure value
+ */
+bool
+platform_system_ok (int stat)
+{
+#ifdef WIN32
+  return stat == 0;
+#else
+  return stat != -1 && WIFEXITED (stat) && WEXITSTATUS (stat) == 0;
+#endif
+}
+
+/*
+ * did system() call execute the given command?
+ */
+bool
+platform_system_executed (int stat)
+{
+#ifdef WIN32
+  return stat != -1;
+#else
+  return stat != -1 && WEXITSTATUS (stat) != 127;
+#endif
+}
+
+int
+platform_access (const char *path, int mode)
+{
+#ifdef WIN32
+  struct gc_arena gc = gc_new ();
+  int ret = _waccess (wide_string (path, &gc), mode & ~X_OK);
+  gc_free (&gc);
+  return ret;
+#else
+  return access (path, mode);
+#endif
+}
+
+/*
+ * Go to sleep for n milliseconds.
+ */
+void
+platform_sleep_milliseconds (unsigned int n)
+{
+#ifdef WIN32
+  Sleep (n);
+#else
+  struct timeval tv;
+  tv.tv_sec = n / 1000;
+  tv.tv_usec = (n % 1000) * 1000;
+  select (0, NULL, NULL, NULL, &tv);
+#endif
+}
+
+/*
+ * Go to sleep indefinitely.
+ */
+void
+platform_sleep_until_signal (void)
+{
+#ifdef WIN32
+  ASSERT (0);
+#else
+  select (0, NULL, NULL, NULL, NULL);
+#endif
+}
+
+/* delete a file, return true if succeeded */
+bool
+platform_unlink (const char *filename)
+{
+#if defined(WIN32)
+  struct gc_arena gc = gc_new ();
+  BOOL ret = DeleteFileW (wide_string (filename, &gc));
+  gc_free (&gc);
+  return (ret != 0);
+#elif defined(HAVE_UNLINK)
+  return (unlink (filename) == 0);
+#else
+  return false;
+#endif
+}
+
+int platform_system(const char *command) {
+  int ret;
+#ifdef WIN32
+  struct gc_arena gc = gc_new ();
+  ret = _wsystem (wide_string (command, &gc));
+  gc_free (&gc);
+#else
+  ret = system (command);
+#endif
+  return ret;
+}
+
+int platform_putenv(char *string)
+{
+  int status;
+#if defined(WIN32)
+  struct gc_arena gc = gc_new ();
+  char *s = string_alloc(string, &gc);
+  char *value = strchr(s, '=');
+  if (value!=NULL)
+    {
+      *value = '\0';
+      value++;
+      if (*value == '\0')
+        value = NULL;
+    }
+
+  status = SetEnvironmentVariableW (wide_string (s, &gc),
+      wide_string (value, &gc)) ? 1: 0;
+  gc_free (&gc);
+#elif defined(HAVE_PUTENV)
+  void manage_env (char *str); /* TODO: Resolve properly */
+  status = putenv (string);
+  if (!status)
+    manage_env (string);
+#endif
+
+  return status;
+}
+
+FILE *
+platform_fopen (const char *path, const char *mode)
+{
+#ifdef WIN32
+  struct gc_arena gc = gc_new ();
+  FILE *f = _wfopen (wide_string (path, &gc), wide_string (mode, &gc));
+  gc_free (&gc);
+  return f;
+#else
+  return fopen(path, mode);
+#endif
+}
+
+int
+platform_open (const char *path, int flags, int mode)
+{
+#ifdef WIN32
+  struct gc_arena gc = gc_new ();
+  int fd = _wopen (wide_string (path, &gc), flags, mode);
+  gc_free (&gc);
+  return fd;
+#else
+  return open(path, flags, mode);
+#endif
+}
+
+int
+platform_stat (const char *path, platform_stat_t *buf)
+{
+#ifdef WIN32
+  struct gc_arena gc = gc_new ();
+  int res = _wstat (wide_string (path, &gc), buf);
+  gc_free (&gc);
+  return res;
+#else
+  return stat(path, buf);
+#endif
+}
+
src/openvpn/platform.h new file +142 -0
new file mode 100644
index 0000000..7bd2067
@@ -0,0 +1,142 @@
+/*
+ *  OpenVPN -- An application to securely tunnel IP networks
+ *             over a single TCP/UDP port, with support for SSL/TLS-based
+ *             session authentication and key exchange,
+ *             packet encryption, packet authentication, and
+ *             packet compression.
+ *
+ *  Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <[email protected]....>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program (see the file COPYING included with this
+ *  distribution); if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef PLATFORM_H
+#define PLATFORM_H
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+
+#ifdef HAVE_STDIO_H
+#include <stdio.h>
+#endif
+
+#include "basic.h"
+
+/* Get/Set UID of process */
+
+struct platform_state_user {
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+  const char *username;
+  struct passwd *pw;
+#else
+  int dummy;
+#endif
+};
+
+/* Get/Set GID of process */
+
+struct platform_state_group {
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+  const char *groupname;
+  struct group *gr;
+#else
+  int dummy;
+#endif
+};
+
+bool platform_user_get (const char *username, struct platform_state_user *state);
+void platform_user_set (const struct platform_state_user *state);
+
+bool platform_group_get (const char *groupname, struct platform_state_group *state);
+void platform_group_set (const struct platform_state_group *state);
+
+/*
+ * Extract UID or GID
+ */
+
+static inline int
+platform_state_user_uid (const struct platform_state_user *s)
+{
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+  if (s->pw)
+    return s->pw->pw_uid;
+#endif
+  return -1;
+}
+
+static inline int
+platform_state_group_gid (const struct platform_state_group *s)
+{
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+  if (s->gr)
+    return s->gr->gr_gid;
+#endif
+  return -1;
+}
+
+void platform_chroot (const char *path);
+
+void platform_nice (int niceval);
+
+unsigned int platform_getpid (void);
+
+void platform_mlockall (bool print_msg); /* Disable paging */
+
+int platform_chdir (const char* dir);
+
+/* interpret the status code returned by system()/execve() */
+bool platform_system_ok (int stat);
+bool platform_system_executed (int stat);
+int platform_system(const char *command);
+
+int platform_access (const char *path, int mode);
+
+void platform_sleep_milliseconds (unsigned int n);
+
+void platform_sleep_until_signal (void);
+
+/* delete a file, return true if succeeded */
+bool platform_unlink (const char *filename);
+
+int platform_putenv (char *string);
+
+FILE *platform_fopen (const char *path, const char *mode);
+int platform_open (const char *path, int flags, int mode);
+
+#ifdef WIN32
+typedef struct _stat platform_stat_t;
+#else
+typedef struct stat platform_stat_t;
+#endif
+int platform_stat (const char *path, platform_stat_t *buf);
+
+#endif
src/openvpn/ps.c +1 -1
index a4e50e8..5d056ee 100644
@@ -337,7 +337,7 @@ journal_add (const char *journal_dir, struct proxy_connection *pc, struct proxy_
       check_malloc_return (jfn);
       openvpn_snprintf (jfn, fnlen, "%s/%s", journal_dir, t);
       dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: client origin %s -> %s", jfn, f);
-      fd = openvpn_open (jfn, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP);
+      fd = platform_open (jfn, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP);
       if (fd != -1)
        {
          write(fd, f, strlen(f));
src/openvpn/ssl_openssl.c +1 -1
index 6a60cb5..d712c66 100644
@@ -280,7 +280,7 @@ tls_ctx_load_pkcs12(struct tls_root_ctx *ctx, const char *pkcs12_file,
 #endif
     {
       /* Load the PKCS #12 file */
-      if (!(fp = openvpn_fopen(pkcs12_file, "rb")))
+      if (!(fp = platform_fopen(pkcs12_file, "rb")))
        msg(M_SSLERR, "Error opening file %s", pkcs12_file);
       p12 = d2i_PKCS12_fp(fp, NULL);
       fclose(fp);
src/openvpn/ssl_verify.c +4 -4
index 51457f8..e837e39 100644
@@ -517,7 +517,7 @@ verify_cert_call_command(const char *verify_command, struct env_set *es,
   if (verify_export_cert)
     {
        if (tmp_file)
-          delete_file(tmp_file);
+          platform_unlink(tmp_file);
     }
 
   gc_free(&gc);
@@ -551,7 +551,7 @@ verify_check_crl_dir(const char *crl_dir, openvpn_x509_cert_t *cert)
       x509_free_serial(serial);
       return FAILURE;
     }
-  fd = openvpn_open (fn, O_RDONLY, 0);
+  fd = platform_open (fn, O_RDONLY, 0);
   if (fd >= 0)
     {
       msg (D_HANDSHAKE, "VERIFY CRL: certificate serial number %s is revoked", serial);
@@ -735,7 +735,7 @@ key_state_rm_auth_control_file (struct key_state *ks)
 {
   if (ks && ks->auth_control_file)
     {
-      delete_file (ks->auth_control_file);
+      platform_unlink (ks->auth_control_file);
       free (ks->auth_control_file);
       ks->auth_control_file = NULL;
     }
@@ -987,7 +987,7 @@ verify_user_pass_script (struct tls_session *session, const struct user_pass *up
 
  done:
   if (tmp_file && strlen (tmp_file) > 0)
-    delete_file (tmp_file);
+    platform_unlink (tmp_file);
 
   argv_reset (&argv);
   gc_free (&gc);
src/openvpn/status.c +3 -3
index 0be5e4c..5f9ab9e 100644
@@ -78,17 +78,17 @@ status_open (const char *filename,
           switch (so->flags)
             {
             case STATUS_OUTPUT_WRITE:
-              so->fd = openvpn_open (filename,
+              so->fd = platform_open (filename,
                                      O_CREAT | O_TRUNC | O_WRONLY,
                                      S_IRUSR | S_IWUSR);
               break;
             case STATUS_OUTPUT_READ:
-              so->fd = openvpn_open (filename,
+              so->fd = platform_open (filename,
                                      O_RDONLY,
                                      S_IRUSR | S_IWUSR);
               break;
             case STATUS_OUTPUT_READ|STATUS_OUTPUT_WRITE:
-              so->fd = openvpn_open (filename,
+              so->fd = platform_open (filename,
                                      O_CREAT | O_RDWR,
                                      S_IRUSR | S_IWUSR);
               break;
src/openvpn/tun.c +6 -6
index abc6a99..e6a7bc8 100644
@@ -1545,22 +1545,22 @@ tuncfg (const char *dev, const char *dev_type, const char *dev_node, int persist
     msg (M_ERR, "Cannot ioctl TUNSETPERSIST(%d) %s", persist_mode, dev);
   if (username != NULL)
     {
-      struct user_state user_state;
+      struct platform_state_user platform_state_user;
 
-      if (!get_user (username, &user_state))
+      if (!platform_user_get (username, &platform_state_user))
         msg (M_ERR, "Cannot get user entry for %s", username);
       else
-        if (ioctl (tt->fd, TUNSETOWNER, user_state.pw->pw_uid) < 0)
+        if (ioctl (tt->fd, TUNSETOWNER, platform_state_user.pw->pw_uid) < 0)
           msg (M_ERR, "Cannot ioctl TUNSETOWNER(%s) %s", username, dev);
     }
   if (groupname != NULL)
     {
-      struct group_state group_state;
+      struct platform_state_group platform_state_group;
 
-      if (!get_group (groupname, &group_state))
+      if (!platform_group_get (groupname, &platform_state_group))
         msg (M_ERR, "Cannot get group entry for %s", groupname);
       else
-        if (ioctl (tt->fd, TUNSETGROUP, group_state.gr->gr_gid) < 0)
+        if (ioctl (tt->fd, TUNSETGROUP, platform_state_group.gr->gr_gid) < 0)
           msg (M_ERR, "Cannot ioctl TUNSETOWNER(%s) %s", groupname, dev);
     }
   close_tun (tt);
src/openvpn/win32.c +0 -28
index e94343b..e8e69dc 100644
@@ -976,33 +976,6 @@ wide_string (const char* utf8, struct gc_arena *gc)
   return ucs16;
 }
 
-FILE *
-openvpn_fopen (const char *path, const char *mode)
-{
-  struct gc_arena gc = gc_new ();
-  FILE *f = _wfopen (wide_string (path, &gc), wide_string (mode, &gc));
-  gc_free (&gc);
-  return f;
-}
-
-int
-openvpn_open (const char *path, int flags, int mode)
-{
-  struct gc_arena gc = gc_new ();
-  int fd = _wopen (wide_string (path, &gc), flags, mode);
-  gc_free (&gc);
-  return fd;
-}
-
-int
-openvpn_stat (const char *path, openvpn_stat_t *buf)
-{
-  struct gc_arena gc = gc_new ();
-  int res = _wstat (wide_string (path, &gc), buf);
-  gc_free (&gc);
-  return res;
-}
-
 /*
  * call ourself in another process
  */
--

1.7.3.4

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#103 lore raw

Re: [Openvpn-devel] [PATCH 49/52] build: move wrappers into platform module

Hi,

Quoted 2 lines · Samuli Seppänen

I give this one a feature-ACK, but could somebody else take a better look at the actual code changes?

code ACK.

Verified that code is just moved + function names renamed, and in a few places, parts of functions moved to a new platform_... function that has the same code.

That was a long one... :-o

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#104 lore raw

PATCH 50/52 build: windows: install version.sh to allow installer read version

In reply to Alon Bar-Lev
---
 .gitignore    |    1 +
 Makefile.am   |    5 +++++
 configure.ac  |    1 +
 version.sh.in |    4 ++++
 4 files changed, 11 insertions(+), 0 deletions(-)
 create mode 100644 version.sh.in
.gitignore +1 -0
index e7232cf..2f72ed8 100644
@@ -39,6 +39,7 @@ m4/ltsugar.m4
 m4/ltversion.m4
 m4/lt~obsolete.m4
 
+version.sh
 msvc-env-local.bat
 config-msvc-local.h
 config-msvc-version.h
Makefile.am +5 -0
index 5293518..68aa0a8 100644
@@ -69,3 +69,8 @@ endif
 dist_noinst_HEADERS = \
 	config-msvc.h \
 	config-msvc-version.h.in
+
+if WIN32
+rootdir=$(prefix)
+root_DATA = version.sh
+endif
configure.ac +1 -0
index d53a74a..0f2a62e 100644
@@ -904,6 +904,7 @@ AC_SUBST([OPTIONAL_PKCS11_HELPER_LIBS])
 AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
 
 AC_CONFIG_FILES([
+	version.sh
 	Makefile
 	build/Makefile
 	build/msvc/Makefile
version.sh.in new file +4 -0
new file mode 100644
index 0000000..2af5a36
@@ -0,0 +1,4 @@
+OPENVPN_PACKAGE_NAME="@PACKAGE_NAME@"
+OPENVPN_PACKAGE_TARNAME="@PACKAGE_TARNAME@"
+OPENVPN_PACKAGE_VERSION="@PACKAGE_VERSION@"
+OPENVPN_PACKAGE_HOST="@host@"
Signature · 1 line
1.7.3.4
#105 lore raw

Re: [Openvpn-devel] [PATCH 50/52] build: windows: install version.sh to allow installer read version

Is this meant to allow using these variables[1] in the NSIS script(s)?

Signature · 12 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock

[1]

OPENVPN_PACKAGE_NAME="@PACKAGE_NAME@"
OPENVPN_PACKAGE_TARNAME="@PACKAGE_TARNAME@"
OPENVPN_PACKAGE_VERSION="@PACKAGE_VERSION@"
OPENVPN_PACKAGE_HOST="@host@"
Quoted 56 lines
---
 .gitignore    |    1 +
 Makefile.am   |    5 +++++
 configure.ac  |    1 +
 version.sh.in |    4 ++++
 4 files changed, 11 insertions(+), 0 deletions(-)
 create mode 100644 version.sh.in
.gitignore +1 -0
index e7232cf..2f72ed8 100644
@@ -39,6 +39,7 @@ m4/ltsugar.m4
 m4/ltversion.m4
 m4/lt~obsolete.m4
 
+version.sh
 msvc-env-local.bat
 config-msvc-local.h
 config-msvc-version.h
Makefile.am +5 -0
index 5293518..68aa0a8 100644
@@ -69,3 +69,8 @@ endif
 dist_noinst_HEADERS = \
 	config-msvc.h \
 	config-msvc-version.h.in
+
+if WIN32
+rootdir=$(prefix)
+root_DATA = version.sh
+endif
configure.ac +1 -0
index d53a74a..0f2a62e 100644
@@ -904,6 +904,7 @@ AC_SUBST([OPTIONAL_PKCS11_HELPER_LIBS])
 AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
 
 AC_CONFIG_FILES([
+	version.sh
 	Makefile
 	build/Makefile
 	build/msvc/Makefile
version.sh.in new file +4 -0
new file mode 100644
index 0000000..2af5a36
@@ -0,0 +1,4 @@
+OPENVPN_PACKAGE_NAME="@PACKAGE_NAME@"
+OPENVPN_PACKAGE_TARNAME="@PACKAGE_TARNAME@"
+OPENVPN_PACKAGE_VERSION="@PACKAGE_VERSION@"
+OPENVPN_PACKAGE_HOST="@host@"
#106 lore raw

Re: [Openvpn-devel] [PATCH 50/52] build: windows: install version.sh to allow installer read version

Not exactly.
It is used[1] by the packaging script... just sourced to get some environment variables.

[1] https://github.com/alonbl/openvpn-build/blob/master/windows-nsis/build#L55

2012/3/8 Samuli Seppänen <[email protected]...>:

Quoted 75 lines

Is this meant to allow using these variables[1] in the NSIS script(s)?

--
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock

[1]

OPENVPN_PACKAGE_NAME="@PACKAGE_NAME@"
OPENVPN_PACKAGE_TARNAME="@PACKAGE_TARNAME@"
OPENVPN_PACKAGE_VERSION="@PACKAGE_VERSION@"
OPENVPN_PACKAGE_HOST="@host@"

Quoted 56 lines

---
 .gitignore    |    1 +
 Makefile.am   |    5 +++++
 configure.ac  |    1 +
 version.sh.in |    4 ++++

 4 files changed, 11 insertions(+), 0 deletions(-)

 create mode 100644 version.sh.in

.gitignore +0 -0
index e7232cf..2f72ed8 100644
@@ -39,6 +39,7 @@ m4/ltsugar.m4

 m4/ltversion.m4
 m4/lt~obsolete.m4

+version.sh
 msvc-env-local.bat
 config-msvc-local.h
 config-msvc-version.h

Makefile.am +0 -0
index 5293518..68aa0a8 100644
@@ -69,3 +69,8 @@ endif
  dist_noinst_HEADERS = \
       config-msvc.h \

      config-msvc-version.h.in

Makefile.am +5 -0
+
+if WIN32
+rootdir=$(prefix)
+root_DATA = version.sh
+endif
configure.ac +0 -0
index d53a74a..0f2a62e 100644
@@ -904,6 +904,7 @@ AC_SUBST([OPTIONAL_PKCS11_HELPER_LIBS])
  AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
 

 AC_CONFIG_FILES([
+     version.sh
      Makefile
      build/Makefile
      build/msvc/Makefile

version.sh.in new file +4 -0
new file mode 100644
index 0000000..2af5a36
@@ -0,0 +1,4 @@
+OPENVPN_PACKAGE_NAME="@PACKAGE_NAME@"
+OPENVPN_PACKAGE_TARNAME="@PACKAGE_TARNAME@"
+OPENVPN_PACKAGE_VERSION="@PACKAGE_VERSION@"
+OPENVPN_PACKAGE_HOST="@host@"
#107 lore raw

Re: [Openvpn-devel] [PATCH 50/52] build: windows: install version.sh to allow installer read version

Ok. ACK.

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock
Quoted 81 lines

Not exactly.
It is used[1] by the packaging script... just sourced to get some environment variables.

[1] https://github.com/alonbl/openvpn-build/blob/master/windows-nsis/build#L55

2012/3/8 Samuli Seppänen <[email protected]...>:

Quoted 74 lines

Is this meant to allow using these variables[1] in the NSIS script(s)?

--
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock

[1]

OPENVPN_PACKAGE_NAME="@PACKAGE_NAME@"
OPENVPN_PACKAGE_TARNAME="@PACKAGE_TARNAME@"
OPENVPN_PACKAGE_VERSION="@PACKAGE_VERSION@"
OPENVPN_PACKAGE_HOST="@host@"

Quoted 56 lines
---
 .gitignore    |    1 +
 Makefile.am   |    5 +++++
 configure.ac  |    1 +
 version.sh.in |    4 ++++
 4 files changed, 11 insertions(+), 0 deletions(-)
 create mode 100644 version.sh.in
.gitignore +1 -0
index e7232cf..2f72ed8 100644
@@ -39,6 +39,7 @@ m4/ltsugar.m4
 m4/ltversion.m4
 m4/lt~obsolete.m4
 
+version.sh
 msvc-env-local.bat
 config-msvc-local.h
 config-msvc-version.h
Makefile.am +5 -0
index 5293518..68aa0a8 100644
@@ -69,3 +69,8 @@ endif
 dist_noinst_HEADERS = \
      config-msvc.h \
      config-msvc-version.h.in
+
+if WIN32
+rootdir=$(prefix)
+root_DATA = version.sh
+endif
configure.ac +1 -0
index d53a74a..0f2a62e 100644
@@ -904,6 +904,7 @@ AC_SUBST([OPTIONAL_PKCS11_HELPER_LIBS])
 AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
 
 AC_CONFIG_FILES([
+     version.sh
      Makefile
      build/Makefile
      build/msvc/Makefile
version.sh.in new file +4 -0
new file mode 100644
index 0000000..2af5a36
@@ -0,0 +1,4 @@
+OPENVPN_PACKAGE_NAME="@PACKAGE_NAME@"
+OPENVPN_PACKAGE_TARNAME="@PACKAGE_TARNAME@"
+OPENVPN_PACKAGE_VERSION="@PACKAGE_VERSION@"
+OPENVPN_PACKAGE_HOST="@host@"
#108 lore raw

PATCH 51/52 build: distribute samples in windows

In reply to Alon Bar-Lev
---
 configure.ac       |    3 +++
 sample/Makefile.am |   14 ++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
configure.ac +3 -0
index 0f2a62e..2b095a3 100644
@@ -903,6 +903,9 @@ AC_SUBST([OPTIONAL_PKCS11_HELPER_LIBS])
 
 AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
 
+sampledir="\$(docdir)/sample"
+AC_SUBST([sampledir])
+
 AC_CONFIG_FILES([
 	version.sh
 	Makefile
sample/Makefile.am +14 -0
index 5df8d9c..8e35bfc 100644
@@ -17,3 +17,17 @@ EXTRA_DIST = \
 	sample-windows \
 	sample-keys \
 	sample-scripts
+
+if WIN32
+sample_DATA = \
+	client.ovpn \
+	server.ovpn \
+	sample-windows/sample.ovpn
+
+client.ovpn: sample-config-files/client.conf
+	-rm -f client.ovpn
+	cp "$(srcdir)/sample-config-files/client.conf" client.ovpn
+server.ovpn: sample-config-files/server.conf
+	-rm -f server.ovpn
+	cp "$(srcdir)/sample-config-files/server.conf" server.ovpn
+endif
Signature · 1 line
1.7.3.4
#109 lore raw

Re: [Openvpn-devel] [PATCH 51/52] build: distribute samples in windows

So, this essentially makes sure client.conf and server.conf are included in Windows (installers) as client.ovpn and server.ovpn?

If so, ACK.

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock
Quoted 42 lines
---
 configure.ac       |    3 +++
 sample/Makefile.am |   14 ++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
configure.ac +3 -0
index 0f2a62e..2b095a3 100644
@@ -903,6 +903,9 @@ AC_SUBST([OPTIONAL_PKCS11_HELPER_LIBS])
 
 AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
 
+sampledir="\$(docdir)/sample"
+AC_SUBST([sampledir])
+
 AC_CONFIG_FILES([
 	version.sh
 	Makefile
sample/Makefile.am +14 -0
index 5df8d9c..8e35bfc 100644
@@ -17,3 +17,17 @@ EXTRA_DIST = \
 	sample-windows \
 	sample-keys \
 	sample-scripts
+
+if WIN32
+sample_DATA = \
+	client.ovpn \
+	server.ovpn \
+	sample-windows/sample.ovpn
+
+client.ovpn: sample-config-files/client.conf
+	-rm -f client.ovpn
+	cp "$(srcdir)/sample-config-files/client.conf" client.ovpn
+server.ovpn: sample-config-files/server.conf
+	-rm -f server.ovpn
+	cp "$(srcdir)/sample-config-files/server.conf" server.ovpn
+endif
#110 lore raw

PATCH 52/52 build: use tap-windows.h as external dependency

In reply to Alon Bar-Lev

tap-windows.h is provided by the tap project

---
 configure.ac               |   12 ++++++++
 include/Makefile.am        |    2 -
 include/tap-windows.h      |   68 --------------------------------------------
 msvc-env.bat               |    2 +
 src/openvpn/Makefile.am    |    1 +
 src/openvpn/openvpn.vcproj |    4 +-
 6 files changed, 17 insertions(+), 72 deletions(-)
 delete mode 100644 include/tap-windows.h
configure.ac +12 -0
index 2b095a3..c6cabee 100644
@@ -666,6 +666,18 @@ PKG_CHECK_MODULES(
 	)]
 )
 
+AC_ARG_VAR([TAP_WINDOWS_CFLAGS], [C compiler flags for TAP-Windows])
+if test "${WIN32}" = "yes"; then
+	old_CFLAGS="${CFLAGS}"
+	CFLAGS="${CFLAGS} ${TAP_WINDOWS_CFLAGS}"
+	AC_CHECK_HEADERS(
+		[tap-windows.h],
+		,
+		[AC_MSG_ERROR([tap-windows.h is required but missing])]
+	)
+	CFLAGS="${old_CFLAGS}"
+fi
+
 if test "${have_openssl_crypto}" = "yes"; then
 	saved_CFLAGS="${CFLAGS}"
 	saved_LIBS="${LIBS}"
include/Makefile.am +0 -2
index 36eeb6c..13dee61 100644
@@ -12,6 +12,4 @@
 MAINTAINERCLEANFILES = \
 	$(srcdir)/Makefile.in
 
-dist_noinst_HEADERS = tap-windows.h
-
 include_HEADERS = openvpn-plugin.h
include/tap-windows.h deleted +0 -68

68 lines not on this page · raw message

msvc-env.bat +2 -0
index ef9c7bb..e37757b 100644
@@ -23,7 +23,9 @@ if "%OPENVPN_DEPROOT%" == "" set OPENVPN_DEPROOT=c:\Temp\openvpn-deps
 if "%OPENSSL_HOME%" == "" set OPENSSL_HOME=%OPENVPN_DEPROOT%
 if "%LZO_HOME%" == "" set LZO_HOME=%OPENVPN_DEPROOT%
 if "%PKCS11H_HOME%" == "" set PKCS11H_HOME=%OPENVPN_DEPROOT%
+if "%TAP_WINDOWS_HOME%" == "" set TAP_WINDOWS_HOME=%OPENVPN_DEPROOT%
 
 if not exist "%OPENSSL_HOME%" echo WARNING: openssl '%OPENSSL_HOME%' does not exist
 if not exist "%LZO_HOME%" echo WARNING: lzo '%LZO_HOME%' does not exist
 if not exist "%PKCS11H_HOME%" echo WARNING: pkcs11-helper '%PKCS11H_HOME%' does not exist
+if not exist "%TAP_WINDOWS_HOME%" echo WARNING: tap-windows '%TAP_WINDOWS_HOME%' does not exist
src/openvpn/Makefile.am +1 -0
index 6ba12b8..1410021 100644
@@ -22,6 +22,7 @@ INCLUDES = \
 	-I$(top_srcdir)/src/compat
 
 AM_CFLAGS = \
+	$(TAP_WINDOWS_CFLAGS) \
 	$(OPTIONAL_CRYPTO_CFLAGS) \
 	$(OPTIONAL_LZO_CFLAGS) \
 	$(OPTIONAL_PKCS11_HELPER_CFLAGS)
src/openvpn/openvpn.vcproj +2 -2
index 4680e52..c1aa8a0 100644
@@ -41,7 +41,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
+				AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS)"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -118,7 +118,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
-				AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
+				AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS)"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
Signature · 1 line
1.7.3.4
#111 lore raw

Re: [Openvpn-devel] [PATCH 52/52] build: use tap-windows.h as external dependency

If I understood this correctly, include/tap-windows.h gets removed, and will then be included using the same mechanism that's used to include LZO headers, OpenSSL headers, etc. I think this makes sense now that the TAP-driver is a separate subproject.

ACK.

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock
Quoted 182 lines

tap-windows.h is provided by the tap project

---
 configure.ac               |   12 ++++++++
 include/Makefile.am        |    2 -
 include/tap-windows.h      |   68 --------------------------------------------
 msvc-env.bat               |    2 +
 src/openvpn/Makefile.am    |    1 +
 src/openvpn/openvpn.vcproj |    4 +-
 6 files changed, 17 insertions(+), 72 deletions(-)
 delete mode 100644 include/tap-windows.h
configure.ac +12 -0
index 2b095a3..c6cabee 100644
@@ -666,6 +666,18 @@ PKG_CHECK_MODULES(
        )]
 )
 
+AC_ARG_VAR([TAP_WINDOWS_CFLAGS], [C compiler flags for TAP-Windows])
+if test "${WIN32}" = "yes"; then
+       old_CFLAGS="${CFLAGS}"
+       CFLAGS="${CFLAGS} ${TAP_WINDOWS_CFLAGS}"
+       AC_CHECK_HEADERS(
+               [tap-windows.h],
+               ,
+               [AC_MSG_ERROR([tap-windows.h is required but missing])]
+       )
+       CFLAGS="${old_CFLAGS}"
+fi
+
 if test "${have_openssl_crypto}" = "yes"; then
        saved_CFLAGS="${CFLAGS}"
        saved_LIBS="${LIBS}"
include/Makefile.am +0 -2
index 36eeb6c..13dee61 100644
@@ -12,6 +12,4 @@
 MAINTAINERCLEANFILES = \
        $(srcdir)/Makefile.in
 
-dist_noinst_HEADERS = tap-windows.h
-
 include_HEADERS = openvpn-plugin.h
include/tap-windows.h deleted +0 -68
deleted file mode 100644
index 243a4a2..0000000
@@ -1,68 +0,0 @@
-/*
- *  TAP-Windows -- A kernel driver to provide virtual tap
- *                 device functionality on Windows.
- *
- *  This code was inspired by the CIPE-Win32 driver by Damion K. Wilson.
- *
- *  This source code is Copyright (C) 2002-2010 OpenVPN Technologies, Inc.,
- *  and is released under the GPL version 2 (see below).
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2
- *  as published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program (see the file COPYING included with this
- *  distribution); if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __TAP_WIN_H
-#define __TAP_WIN_H
-
-//=============
-// TAP IOCTLs
-//=============
-
-#define TAP_WIN_CONTROL_CODE(request,method) \
-  CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS)
-
-// Present in 8.1
-
-#define TAP_WIN_IOCTL_GET_MAC               TAP_WIN_CONTROL_CODE (1, METHOD_BUFFERED)
-#define TAP_WIN_IOCTL_GET_VERSION           TAP_WIN_CONTROL_CODE (2, METHOD_BUFFERED)
-#define TAP_WIN_IOCTL_GET_MTU               TAP_WIN_CONTROL_CODE (3, METHOD_BUFFERED)
-#define TAP_WIN_IOCTL_GET_INFO              TAP_WIN_CONTROL_CODE (4, METHOD_BUFFERED)
-#define TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT TAP_WIN_CONTROL_CODE (5, METHOD_BUFFERED)
-#define TAP_WIN_IOCTL_SET_MEDIA_STATUS      TAP_WIN_CONTROL_CODE (6, METHOD_BUFFERED)
-#define TAP_WIN_IOCTL_CONFIG_DHCP_MASQ      TAP_WIN_CONTROL_CODE (7, METHOD_BUFFERED)
-#define TAP_WIN_IOCTL_GET_LOG_LINE          TAP_WIN_CONTROL_CODE (8, METHOD_BUFFERED)
-#define TAP_WIN_IOCTL_CONFIG_DHCP_SET_OPT   TAP_WIN_CONTROL_CODE (9, METHOD_BUFFERED)
-
-// Added in 8.2
-
-/* obsoletes TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT */
-#define TAP_WIN_IOCTL_CONFIG_TUN            TAP_WIN_CONTROL_CODE (10, METHOD_BUFFERED)
-
-//=================
-// Registry keys
-//=================
-
-#define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
-
-#define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
-
-//======================
-// Filesystem prefixes
-//======================
-
-#define USERMODEDEVICEDIR "\\\\.\\Global\\"
-#define SYSDEVICEDIR      "\\Device\\"
-#define USERDEVICEDIR     "\\DosDevices\\Global\\"
-#define TAP_WIN_SUFFIX    ".tap"
-
-#endif
msvc-env.bat +2 -0
index ef9c7bb..e37757b 100644
@@ -23,7 +23,9 @@ if "%OPENVPN_DEPROOT%" == "" set OPENVPN_DEPROOT=c:\Temp\openvpn-deps
 if "%OPENSSL_HOME%" == "" set OPENSSL_HOME=%OPENVPN_DEPROOT%
 if "%LZO_HOME%" == "" set LZO_HOME=%OPENVPN_DEPROOT%
 if "%PKCS11H_HOME%" == "" set PKCS11H_HOME=%OPENVPN_DEPROOT%
+if "%TAP_WINDOWS_HOME%" == "" set TAP_WINDOWS_HOME=%OPENVPN_DEPROOT%
 
 if not exist "%OPENSSL_HOME%" echo WARNING: openssl '%OPENSSL_HOME%' does not exist
 if not exist "%LZO_HOME%" echo WARNING: lzo '%LZO_HOME%' does not exist
 if not exist "%PKCS11H_HOME%" echo WARNING: pkcs11-helper '%PKCS11H_HOME%' does not exist
+if not exist "%TAP_WINDOWS_HOME%" echo WARNING: tap-windows '%TAP_WINDOWS_HOME%' does not exist
src/openvpn/Makefile.am +1 -0
index 6ba12b8..1410021 100644
@@ -22,6 +22,7 @@ INCLUDES = \
        -I$(top_srcdir)/src/compat
 
 AM_CFLAGS = \
+       $(TAP_WINDOWS_CFLAGS) \
        $(OPTIONAL_CRYPTO_CFLAGS) \
        $(OPTIONAL_LZO_CFLAGS) \
        $(OPTIONAL_PKCS11_HELPER_CFLAGS)
src/openvpn/openvpn.vcproj +2 -3
index 4680e52..c1aa8a0 100644
@@ -41,7 +41,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
+                               AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
@@ -118,7 +118,7 @@
                                Name="VCCLCompilerTool"
                                Optimization="2"
                                EnableIntrinsicFunctions="true"
-                               AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
+                               AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS)"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
--

1.7.3.4

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Acked-by Gert Doering Acked-by Acked-by Acked-by Acked-by Adriaan de Jong Acked-by Acked-by Adriaan de Jong Acked-by Samuli Seppänen on the v1 series
#112 lore raw
In reply to Alon Bar-Lev
Quoted 6 lines · Alon Bar-Lev

1. Many cleanups.
2. New directory layout.
3. Remove easy-rsa, install-win32, windows build, tap-win32.
4. Standard autotools build system.
5. msbuild build system.
6. Split out most of platform specific code.

All patches in this patch set has been ACKed, and I've pushed out a new master branch with these changes. Below is a completely git history with all commits references and ACK credits.

Thanks a lot to Alon for his hard work on this patch set. But we must beware that more changes and improvements will come in the near future too. Many improvements are to come on top of this.

kind regards,

David Sommerseth

commit 0e4b6c455e0236a4eb45eb1df869b5ce0b97518a

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:22 2012 +0200
    build: use tap-windows.h as external dependency

    tap-windows.h is provided by the tap project

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 880a2ae97c44d75a3529adda8a11e266fb61092e

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:21 2012 +0200
    build: distribute samples in windows

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 6187644b660ce284d0a706811eae2dce7cb411b2

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:20 2012 +0200
    build: windows: install version.sh to allow installer read version

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 14a131ac1cfc95e5ba2518ff887d04c034aecc53

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:19 2012 +0200

build: move wrappers into platform module

+ Some fixups within the platform.c functions.
- need to check environment set on Windows.

commit 72c7b12cb65cee69ea129cc520b26dcc64977a17

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:18 2012 +0200
    cleanup: move console related function into its own module

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Gert Doering <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit f106f64b1cc228b3b937ed15a1a45bc28edefed9

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:17 2012 +0200
    build: move inet_ntop(), inet_pton() emulation into compat

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 7b49c16761b4a11f1f0846cd46bd7194392efbfa

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:16 2012 +0200
    build: move daemon() emulation into compat

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 3d163bc544ab9dfc62d9a2c865f8abb865bf6eb3

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:15 2012 +0200

build: move gettimeofday() emulation to compat

Remove all references to gettimeofday() from main project.

SIDE EFFECT: mingw will use its own internal gettimeofday().

commit dc81e743989640cc681a40e69455cc9fc736ab9c

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:14 2012 +0200

build: split out compat

compat should not use any of the main project headers or conventions, it should be a standalone library that provides missing library functions.

commit c110b289eced4a792fd7c7c29e651b22f602fd24

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:13 2012 +0200

build: move out config.h include from syshead

Yet another step in reducing the syshead.h content.

Conditional compilation of sources needs to be based on a minimum program prefix (config.h only).

commit 4b1a82db0975088dbfe69c2a97f0a96ef972b2a4

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:12 2012 +0200
    build: win-msvc: msbuild format

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 709f7a1f73baade82f07146273d31d53007f394d

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:11 2012 +0200
    build: autoconf: update defaults for options

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 9b33b5a4b1aa170080d18b0f32f6599b519589f0

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:10 2012 +0200
    build: proper crypto detection and usage

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Adriaan de Jong <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 74bbc71b75bac49f5c9df81827fa184b8a365d36

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:09 2012 +0200
    build: proper lzo detection and usage

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Adriaan de Jong <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 0708426170fd578f598fb0f0d3df78bd1fca7117

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:08 2012 +0200
    build: properly process lzo-stub

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 18b5fbdfb3aba63a62de197b4931cac77af2323c

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:07 2012 +0200
    build: proper pkcs11-helper detection and usage

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit e06832a7edcf93e0feda8802beea55a3cc7ddf9f

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:06 2012 +0200

build: distribute pkg.m4

RHEL and others do not install this globally, so we provide our own
copy.

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit cd5990e0e0da1621b9c2d9ca927ff8d1af3c241a

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:05 2012 +0200
    build: proper selinux detection and usage

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit cab53332e11b9a447883da0c95552c453f760f0b

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:04 2012 +0200
    build: autoconf: minor cleanups

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Adriaan de Jong <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 7647a48c2d2c446ee387316389085fe83c6ef894

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:03 2012 +0200
    build: properly detect and use socket libs

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit bdae41107ddde61cae5ae2037c1420b539c52ff8

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:02 2012 +0200

build: libdl usage

1. properly detect.
2. Link only required components.
3. No way we don't have LoadLibrary on Windows.
4. ENABLE_PLUGIN should be controlled in autoconf.

commit c3fc703d31f47ceef66bc8006e2870e3c4d05ee6

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:01 2012 +0200
    build: autoconf: commands as environment

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Adriaan de Jong <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 98bc1a3e06a11be62bb1f5ab3d7c1b98dfbabbaa

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:12:00 2012 +0200
    build: add libtool + windows resources for executables

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 34cb9132ef2dae08f91a66015ea5437539a4b557

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:59 2012 +0200

build: standard directory layout

Suitable for mature project.

root - administrative stuff
doc - documents
src - sources
tests - tests
distro - distro specific files
sample - samples

SIDE EFFECT: many changes to rpm spec.

commit fcff80aac1f71ebf881fbc269fb3c4df0789de6b

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:58 2012 +0200
    build: remove awk and non-standard autoconf output processing

    Replace with simpler environment solution.

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit e02570fd7d1f7fcc0928b42c0f7a7bb597e80208

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:57 2012 +0200
    build: autoconf: remove OPENVPN_ADD_LIBS useless macro

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 51bd56f46f55177cf0f8b7811b35a009e150d55e

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:56 2012 +0200
    build: autotools: first pass of trivial autotools changes

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Adriaan de Jong <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 0dbd45db7d76fdff9fbaa64d147c2d2278492efc

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:55 2012 +0200
    build: m4/ax_socklen_t.m4: cleanup

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit bdd80be1fed0f4b3956246a44082a4226362074d

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:54 2012 +0200
    build: m4/ax_emptyarray.m4: cleanup

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit c5c3cef6d374108ca230d701c86fe0b812e2cd3f

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:53 2012 +0200
    build: m4/ax_varargs.m4: cleanup

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 0fc5b8b3390797b67bc48036649109a78f36a186

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:52 2012 +0200
    build: split acinclude.m4 into m4/*

    ax_emptyarray.m4  ax_openvpn_lib.m4  ax_socklen_t.m4  ax_varargs.m4

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Adriaan de Jong <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit d313dc950308d960f550279a69f445e712244beb

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:51 2012 +0200
    build: remove windows specific build system

    It will be completely re-written in future

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit ac2447cd533763a7240f12603eab463ebb5c4bac

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:50 2012 +0200
    cleanup: rename tap-windows function from win32 to win

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 8e3ca1f6c1400f4a9275760d1680a65bb4a99eae

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:49 2012 +0200

Remove tap-win32

Introduce tap-windows.h which is modified tap-win32/common.h. Except of function rename, it is the same without the tap_id. This file should be provided as part of tap-win32 MSI. For now we hold a copy.

commit 26abb83cb1cf0c331db875186250b0c8d55d6013

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:48 2012 +0200
    Remove easy-rsa

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 30029449d475c1e45f080d7481e4c7bf762b2480

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:47 2012 +0200
    Remove install-win32

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 31d19917af05d7730e3c397ade5bb9c21c047bef

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:46 2012 +0200
    build: we need the sample.ovpn in future

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit fbae7d2b7e94a7849e086f08cbb424aee32391a7

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:45 2012 +0200
    build: plugins: properly use CC, CFLAGS and LDFLAGS

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Adriaan de Jong <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 5c2922c4593b7eedc3f9c93958285d67afeb0d37

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:44 2012 +0200
    build: rename plugin directory to plugins

    This to avoid conflit with plugin.c rules

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit ce3862789e5443758441c905569703577e67525a

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:43 2012 +0200
    build: handle printf style format in mingw

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 195b17e9f2d197b591221153c853f8d458b1c259

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:42 2012 +0200
    Update .gitignore

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit bae6143d3fa1bf47d36d6f3a55afcd26aa8403e4

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:41 2012 +0200
    build: correct place to alter WINVER is at build system

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 16d909e2c88f49231475c4163541394e16969d45

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:40 2012 +0200
    fixup: init.c: add missing conditional for ENABLE_CLIENT_CR

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Adriaan de Jong <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 553d95da5a5663e371c0cf35356a8fdfdc22975b

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:39 2012 +0200
    cleanup: memcmp.c: remove unused source

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 8a4eaf5aa6debaca434b1bd2099394724edb31d9

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:38 2012 +0200
    cleanup: tun.c: fix incorrect option in message (ip-win32)

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 435b02dceee397a630c8fe7f08cbdcac11820e1a

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:37 2012 +0200
    cleanup: crypto_openssl.c: remove support for pre-openssl-0.9.6

    autoconf rejecting this anyway:
    ----
    AC_MSG_CHECKING([that OpenSSL Library is at least version 0.9.6])
    <snip>
    AC_MSG_ERROR([OpenSSL crypto Library is too old.])
    ----

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 68c7df22639c60b243dce4459e04e572fd32a3ed

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:36 2012 +0200
    cleanup: remove redundant ';'

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit b2c1643eabfc27c662510401c1841ca5fe721593

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:35 2012 +0200
    cleanup: win32.c: wrong printf format

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Adriaan de Jong <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit cc8dd14442ed10a2a7079d1707a045a33e451c13

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:34 2012 +0200
    cleanup: remove C++ warnings

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit 74b6d864453d757a59e7b33d0415a5af6da22d76

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:33 2012 +0200
    cleanup: options.c: remove redundant include

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Adriaan de Jong <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit b3c099d5dd249f7e2b8b5fcef5e795d88aaf35d4

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:32 2012 +0200
    package: rpm: strip should be handled by package management

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

commit e87f4b611d4f75fda908838160a39a0aea992fdc

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Feb 29 22:11:31 2012 +0200
    build: version should not contain '-'

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>
#113 lore raw

cover build revolution

The last commit was partial, and done even if I NAK some of the patches. As it seems my opinion of a patch of fellows nor mine is not taken into consideration properly. I curious how process had been performed if someone else had found a problem.

This also had been done while Samuli is in progress of creating a different flow, and all parties involved are aware of this process.

I am sending the leftovers from my branch.

And stopping until bureaucracy is resolved.

Alon.

Alon Bar-Lev (6):
build: ax_varargs.m4: fixups
build: autoconf: misc sockets fixups
tree: ChangeLog: add ident attribute
build: msvc: upgrade to Visual Studio 2010 + fixups
build: enable lzo by default
build: windows: set vendor to openvpn project + cleanups

 .gitattributes                                 |    1 +
 .gitignore                                     |    2 +
 ChangeLog                                      |    2 +
 build/msvc/msvc-generate/Makefile.am           |    2 +-
 build/msvc/msvc-generate/msvc-generate.vcproj  |   74 ---
 build/msvc/msvc-generate/msvc-generate.vcxproj |   69 +++
 configure.ac                                   |   57 +-
 m4/ax_varargs.m4                               |   10 +-
 msvc-build.bat                                 |   27 +-
 msvc-dev.bat                                   |   19 +-
 msvc-env.bat                                   |    7 +-
 openvpn.sln                                    |   90 ++--
 src/compat/Makefile.am                         |    3 +-
 src/compat/compat.vcproj                       |  197 ------
 src/compat/compat.vcxproj                      |   87 +++
 src/compat/compat.vcxproj.filters              |   42 ++
 src/openvpn/Makefile.am                        |    3 +-
 src/openvpn/openvpn.vcproj                     |  777 ------------------------
 src/openvpn/openvpn.vcxproj                    |  261 ++++++++
 src/openvpn/openvpn.vcxproj.filters            |  458 ++++++++++++++
 src/openvpn/openvpn_win32_resources.rc         |    6 +-
 src/openvpnserv/Makefile.am                    |    3 +-
 src/openvpnserv/openvpnserv.vcproj             |  209 -------
 src/openvpnserv/openvpnserv.vcxproj            |  112 ++++
 src/openvpnserv/openvpnserv.vcxproj.filters    |   35 ++
 src/openvpnserv/openvpnserv_resources.rc       |    4 +-
 26 files changed, 1197 insertions(+), 1360 deletions(-)
 create mode 100644 .gitattributes
 delete mode 100644 build/msvc/msvc-generate/msvc-generate.vcproj
 create mode 100644 build/msvc/msvc-generate/msvc-generate.vcxproj
 delete mode 100644 src/compat/compat.vcproj
 create mode 100644 src/compat/compat.vcxproj
 create mode 100644 src/compat/compat.vcxproj.filters
 delete mode 100644 src/openvpn/openvpn.vcproj
 create mode 100644 src/openvpn/openvpn.vcxproj
 create mode 100644 src/openvpn/openvpn.vcxproj.filters
 delete mode 100644 src/openvpnserv/openvpnserv.vcproj
 create mode 100644 src/openvpnserv/openvpnserv.vcxproj
 create mode 100644 src/openvpnserv/openvpnserv.vcxproj.filters
Signature · 1 line
1.7.3.4
#114 lore raw

Branch for buid fixups is here[1].

[1] https://github.com/alonbl/openvpn/tree/build2

Quoted 67 lines · Alon Bar-Lev

The last commit was partial, and done even if I NAK some of the patches. As it seems my opinion of a patch of fellows nor mine is not taken into consideration properly. I curious how process had been performed if someone else had found a problem.

This also had been done while Samuli is in progress of creating a different flow, and all parties involved are aware of this process.

I am sending the leftovers from my branch.

And stopping until bureaucracy is resolved.

Alon.

Alon Bar-Lev (6):
 build: ax_varargs.m4: fixups
 build: autoconf: misc sockets fixups
 tree: ChangeLog: add ident attribute
 build: msvc: upgrade to Visual Studio 2010 + fixups
 build: enable lzo by default
 build: windows: set vendor to openvpn project + cleanups

 .gitattributes                                 |    1 + .gitignore                                     |    2 + ChangeLog                                      |    2 + build/msvc/msvc-generate/Makefile.am           |    2 +- build/msvc/msvc-generate/msvc-generate.vcproj  |   74 --- build/msvc/msvc-generate/msvc-generate.vcxproj |   69 +++ configure.ac                                   |   57 +- m4/ax_varargs.m4                               |   10 +- msvc-build.bat                                 |   27 +- msvc-dev.bat                                   |   19 +- msvc-env.bat                                   |    7 +- openvpn.sln                                    |   90 ++-- src/compat/Makefile.am                         |    3 +- src/compat/compat.vcproj                       |  197 ------ src/compat/compat.vcxproj                      |   87 +++ src/compat/compat.vcxproj.filters              |   42 ++ src/openvpn/Makefile.am                        |    3 +- src/openvpn/openvpn.vcproj                     |  777
------------------------
 src/openvpn/openvpn.vcxproj                    |  261 ++++++++ src/openvpn/openvpn.vcxproj.filters            |  458 ++++++++++++++ src/openvpn/openvpn_win32_resources.rc         |    6 +- src/openvpnserv/Makefile.am                    |    3 +- src/openvpnserv/openvpnserv.vcproj             |  209 ------- src/openvpnserv/openvpnserv.vcxproj            |  112 ++++ src/openvpnserv/openvpnserv.vcxproj.filters    |   35 ++ src/openvpnserv/openvpnserv_resources.rc       |    4 +-

 26 files changed, 1197 insertions(+), 1360 deletions(-)

 create mode 100644 .gitattributes
 delete mode 100644 build/msvc/msvc-generate/msvc-generate.vcproj create mode 100644 build/msvc/msvc-generate/msvc-generate.vcxproj delete mode 100644 src/compat/compat.vcproj
 create mode 100644 src/compat/compat.vcxproj
 create mode 100644 src/compat/compat.vcxproj.filters delete mode 100644 src/openvpn/openvpn.vcproj
 create mode 100644 src/openvpn/openvpn.vcxproj
 create mode 100644 src/openvpn/openvpn.vcxproj.filters delete mode 100644 src/openvpnserv/openvpnserv.vcproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj.filters

--
1.7.3.4

#115 lore raw

cover build patches

More from my queue.

https://github.com/alonbl/openvpn/commits/build2

Alon Bar-Lev (6):
build: openbsd: detect netinet/ip.h correctly
build: tap: search for tap header
cleanup: warnings at src/openvpn/httpdigest.c
cleanup: warnings at src/openvpn/ntlm.c
cleanup: warnings at src/openvpn/ssl_verify_openssl.c
cleanup: ~0 is too large for 32bit ipv4 address

 configure.ac                     |   35 ++++++++++++++++-------------
 src/openvpn/Makefile.am          |    2 +-
 src/openvpn/httpdigest.c         |   44 +++++++++++++++++++-------------------
 src/openvpn/ntlm.c               |   12 +++++-----
 src/openvpn/route.c              |    2 +-
 src/openvpn/ssl_verify_openssl.c |    2 +-
 6 files changed, 50 insertions(+), 47 deletions(-)
Signature · 1 line
1.7.3.4
#116 lore raw

PATCH 1/6 build: openbsd: detect netinet/ip.h correctly

In reply to Alon Bar-Lev
---
 configure.ac |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
configure.ac +3 -0
index a30e873..b0dcdb7 100644
@@ -395,6 +395,9 @@ SOCKET_INCLUDES="
 #ifdef HAVE_WS2TCPIP_H
 #include <ws2tcpip.h>
 #endif
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 "
 
 AC_CHECK_HEADERS(
Signature · 1 line
1.7.3.4
#117 lore raw

Re: [Openvpn-devel] [PATCH 1/6] build: openbsd: detect netinet/ip.h correctly

Hi,

Quoted 10 lines · Alon Bar-Lev
---
 configure.ac |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
configure.ac +0 -0
index a30e873..b0dcdb7 100644

configure.ac SOCKET_INCLUDES=" · line 401

Quoted 7 lines
configure.ac +3 -0
@@ -395,6 +395,9 @@ SOCKET_INCLUDES="
 #ifdef HAVE_WS2TCPIP_H
 #include <ws2tcpip.h>
 #endif
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 "

ACK.

(It gets the job done, and is consistent with what we have right now. Wether or not I think we could do with "less stuff done in configure" is a separate discussion and needs not affect *this* patch).

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#118 lore raw

Re: [Openvpn-devel] [PATCH 1/6] build: openbsd: detect netinet/ip.h correctly

In reply to Alon Bar-Lev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Alon Bar-Lev

3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)

Applied to master branches on -testing and -stable trees.

commit 2a7448912efbba7a246f481566117d6b8f6341c1

Author: Alon Bar-Lev <[email protected]...>
Date:   Mon Mar 26 23:26:35 2012 +0200
    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Gert Doering <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9y0VUACgkQDC186MBRfrppLwCgn8MB7/81KoZlWorHYVpYOcRC QQQAnjdizuTL3++ZyRwMgKJ1NpSrRgui
=tiUq
-----END PGP SIGNATURE-----

#119 lore raw

PATCH 2/6 build: tap: search for tap header

In reply to Alon Bar-Lev

Windows and solaris has something in common, in both the tap header is external. So make the Windows tap-windows.h search common to all platform.

Display an error if we cannot find tap header.

---
 configure.ac            |   32 ++++++++++++++++----------------
 src/openvpn/Makefile.am |    2 +-
 2 files changed, 17 insertions(+), 17 deletions(-)
configure.ac +16 -16
index b0dcdb7..d217343 100644
@@ -365,11 +365,9 @@ AC_CHECK_HEADERS([ \
 AC_CHECK_HEADERS([ \
 	sys/time.h sys/un.h sys/ioctl.h sys/stat.h \
 	sys/mman.h sys/file.h \
-	unistd.h signal.h libgen.h \
+	unistd.h signal.h libgen.h stropts.h \
 	syslog.h pwd.h grp.h \
-	net/if_tun.h net/tun/if_tun.h stropts.h \
-	sys/sockio.h \
-	sys/uio.h linux/if_tun.h linux/sockios.h \
+	sys/sockio.h sys/uio.h linux/sockios.h \
 	linux/types.h sys/poll.h sys/epoll.h err.h \
 ])
 
@@ -586,6 +584,20 @@ else
 fi
 LIBS="${old_LIBS}"
 
+AC_ARG_VAR([TAP_CFLAGS], [C compiler flags for tap])
+old_CFLAGS="${CFLAGS}"
+CFLAGS="${CFLAGS} ${TAP_CFLAGS}"
+AC_CHECK_HEADERS(
+	[ \
+		net/if_tun.h net/tun/if_tun.h \
+		linux/if_tun.h \
+		tap-windows.h \
+	],
+	[have_tap_header="yes"]
+)
+CFLAGS="${old_CFLAGS}"
+test "${have_tap_header}" = "yes" || AC_MSG_ERROR([no tap header could be found])
+
 AC_CHECK_LIB(
 	[selinux],
 	[setcon],
@@ -672,18 +684,6 @@ PKG_CHECK_MODULES(
 	)]
 )
 
-AC_ARG_VAR([TAP_WINDOWS_CFLAGS], [C compiler flags for TAP-Windows])
-if test "${WIN32}" = "yes"; then
-	old_CFLAGS="${CFLAGS}"
-	CFLAGS="${CFLAGS} ${TAP_WINDOWS_CFLAGS}"
-	AC_CHECK_HEADERS(
-		[tap-windows.h],
-		,
-		[AC_MSG_ERROR([tap-windows.h is required but missing])]
-	)
-	CFLAGS="${old_CFLAGS}"
-fi
-
 if test "${have_openssl_crypto}" = "yes"; then
 	saved_CFLAGS="${CFLAGS}"
 	saved_LIBS="${LIBS}"
src/openvpn/Makefile.am +1 -1
index 1410021..01ff732 100644
@@ -22,7 +22,7 @@ INCLUDES = \
 	-I$(top_srcdir)/src/compat
 
 AM_CFLAGS = \
-	$(TAP_WINDOWS_CFLAGS) \
+	$(TAP_CFLAGS) \
 	$(OPTIONAL_CRYPTO_CFLAGS) \
 	$(OPTIONAL_LZO_CFLAGS) \
 	$(OPTIONAL_PKCS11_HELPER_CFLAGS)
Signature · 1 line
1.7.3.4
#120 lore raw

Re: [Openvpn-devel] [PATCH 2/6] build: tap: search for tap header

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · Alon Bar-Lev

Windows and solaris has something in common, in both the tap header is external. So make the Windows tap-windows.h search common to all platform.

Display an error if we cannot find tap header.

|   32 ++++++++++++++++---------------- src/openvpn/Makefile.am |    2
+- 2 files changed, 17 insertions(+), 17 deletions(-)

ACK. Applied to master branches on -testing and -stable trees.

commit 7cacdfd4b7f221139e0d2a0334f1f1cd8f2a1b75

Author: Alon Bar-Lev <[email protected]...>
Date:   Mon Mar 26 23:26:36 2012 +0200
    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9y0ZQACgkQDC186MBRfrpgngCeN885LwzL/On2WpNoaWTS7+c+ /2gAnjKcN4hFKbRWWo77Skt9tJHUyvYZ
=7RkS
-----END PGP SIGNATURE-----

#121 lore raw

PATCH 3/6 cleanup: warnings at src/openvpn/httpdigest.c

In reply to Alon Bar-Lev
---
 src/openvpn/httpdigest.c |   44 ++++++++++++++++++++++----------------------
 1 files changed, 22 insertions(+), 22 deletions(-)
src/openvpn/httpdigest.c +22 -22
index 78b8344..a011e56 100644
@@ -76,20 +76,20 @@ DigestCalcHA1(
   const md_kt_t *md5_kt = md_kt_get("MD5");
 
   md_ctx_init(&md5_ctx, md5_kt);
-  md_ctx_update(&md5_ctx, pszUserName, strlen(pszUserName));
-  md_ctx_update(&md5_ctx, ":", 1);
-  md_ctx_update(&md5_ctx, pszRealm, strlen(pszRealm));
-  md_ctx_update(&md5_ctx, ":", 1);
-  md_ctx_update(&md5_ctx, pszPassword, strlen(pszPassword));
+  md_ctx_update(&md5_ctx, (uint8_t *)pszUserName, strlen(pszUserName));
+  md_ctx_update(&md5_ctx, (uint8_t *)":", 1);
+  md_ctx_update(&md5_ctx, (uint8_t *)pszRealm, strlen(pszRealm));
+  md_ctx_update(&md5_ctx, (uint8_t *)":", 1);
+  md_ctx_update(&md5_ctx, (uint8_t *)pszPassword, strlen(pszPassword));
   md_ctx_final(&md5_ctx, HA1);
   if (pszAlg && strcasecmp(pszAlg, "md5-sess") == 0)
     {
       md_ctx_init(&md5_ctx, md5_kt);
       md_ctx_update(&md5_ctx, HA1, HASHLEN);
-      md_ctx_update(&md5_ctx, ":", 1);
-      md_ctx_update(&md5_ctx, pszNonce, strlen(pszNonce));
-      md_ctx_update(&md5_ctx, ":", 1);
-      md_ctx_update(&md5_ctx, pszCNonce, strlen(pszCNonce));
+      md_ctx_update(&md5_ctx, (uint8_t *)":", 1);
+      md_ctx_update(&md5_ctx, (uint8_t *)pszNonce, strlen(pszNonce));
+      md_ctx_update(&md5_ctx, (uint8_t *)":", 1);
+      md_ctx_update(&md5_ctx, (uint8_t *)pszCNonce, strlen(pszCNonce));
       md_ctx_final(&md5_ctx, HA1);
     };
   md_ctx_cleanup(&md5_ctx);
@@ -119,12 +119,12 @@ DigestCalcResponse(
 
   /* calculate H(A2) */
   md_ctx_init(&md5_ctx, md5_kt);
-  md_ctx_update(&md5_ctx, pszMethod, strlen(pszMethod));
-  md_ctx_update(&md5_ctx, ":", 1);
-  md_ctx_update(&md5_ctx, pszDigestUri, strlen(pszDigestUri));
+  md_ctx_update(&md5_ctx, (uint8_t *)pszMethod, strlen(pszMethod));
+  md_ctx_update(&md5_ctx, (uint8_t *)":", 1);
+  md_ctx_update(&md5_ctx, (uint8_t *)pszDigestUri, strlen(pszDigestUri));
   if (strcasecmp(pszQop, "auth-int") == 0)
     {
-      md_ctx_update(&md5_ctx, ":", 1);
+      md_ctx_update(&md5_ctx, (uint8_t *)":", 1);
       md_ctx_update(&md5_ctx, HEntity, HASHHEXLEN);
     };
   md_ctx_final(&md5_ctx, HA2);
@@ -133,17 +133,17 @@ DigestCalcResponse(
   /* calculate response */
   md_ctx_init(&md5_ctx, md5_kt);
   md_ctx_update(&md5_ctx, HA1, HASHHEXLEN);
-  md_ctx_update(&md5_ctx, ":", 1);
-  md_ctx_update(&md5_ctx, pszNonce, strlen(pszNonce));
-  md_ctx_update(&md5_ctx, ":", 1);
+  md_ctx_update(&md5_ctx, (uint8_t *)":", 1);
+  md_ctx_update(&md5_ctx, (uint8_t *)pszNonce, strlen(pszNonce));
+  md_ctx_update(&md5_ctx, (uint8_t *)":", 1);
   if (*pszQop)
     {
-      md_ctx_update(&md5_ctx, pszNonceCount, strlen(pszNonceCount));
-      md_ctx_update(&md5_ctx, ":", 1);
-      md_ctx_update(&md5_ctx, pszCNonce, strlen(pszCNonce));
-      md_ctx_update(&md5_ctx, ":", 1);
-      md_ctx_update(&md5_ctx, pszQop, strlen(pszQop));
-      md_ctx_update(&md5_ctx, ":", 1);
+      md_ctx_update(&md5_ctx, (uint8_t *)pszNonceCount, strlen(pszNonceCount));
+      md_ctx_update(&md5_ctx, (uint8_t *)":", 1);
+      md_ctx_update(&md5_ctx, (uint8_t *)pszCNonce, strlen(pszCNonce));
+      md_ctx_update(&md5_ctx, (uint8_t *)":", 1);
+      md_ctx_update(&md5_ctx, (uint8_t *)pszQop, strlen(pszQop));
+      md_ctx_update(&md5_ctx, (uint8_t *)":", 1);
     };
   md_ctx_update(&md5_ctx, HA2Hex, HASHHEXLEN);
   md_ctx_final(&md5_ctx, RespHash);
Signature · 1 line
1.7.3.4
#122 lore raw

Re: [Openvpn-devel] [PATCH 3/6] cleanup: warnings at src/openvpn/httpdigest.c

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · Alon Bar-Lev

src/openvpn/httpdigest.c | 44
++++++++++++++++++++++---------------------- 1 files changed, 22 insertions(+), 22 deletions(-)

src/openvpn/httpdigest.c index renamed from src/openvpn/httpdigest.c +0 -0

78b8344..a011e56 100644 --- a/src/openvpn/httpdigest.c +++ b/src/openvpn/httpdigest.c @@ -76,20 +76,20 @@ DigestCalcHA1( const md_kt_t *md5_kt = md_kt_get("MD5");

Quoted 9 lines

md_ctx_init(&md5_ctx, md5_kt); - md_ctx_update(&md5_ctx, pszUserName, strlen(pszUserName)); - md_ctx_update(&md5_ctx, ":", 1); - md_ctx_update(&md5_ctx, pszRealm, strlen(pszRealm)); - md_ctx_update(&md5_ctx, ":", 1); - md_ctx_update(&md5_ctx, pszPassword, strlen(pszPassword)); + md_ctx_update(&md5_ctx, (uint8_t *)pszUserName, strlen(pszUserName)); + md_ctx_update(&md5_ctx, (uint8_t *)":", 1); + md_ctx_update(&md5_ctx, (uint8_t *)pszRealm, strlen(pszRealm)); + md_ctx_update(&md5_ctx, (uint8_t *)":", 1); + md_ctx_update(&md5_ctx, (uint8_t *)pszPassword, strlen(pszPassword));

My remark here goes to all these type-cast patches [1,2,3].

Wouldn't it be way cleaner to rather fix the function declarations and do the proper type-casting in the {crypto,ssl}_{open,polar}ssl.[ch] and {crypto,ssl}_backend.h files? Instead of type-casting the whole source code where such warnings might pop up?

kind regards,

David Sommerseth

[1] <http://thread.gmane.org/gmane.network.openvpn.devel/5772/focus=6118>
[2] <http://thread.gmane.org/gmane.network.openvpn.devel/5772/focus=6119>
[3] <http://thread.gmane.org/gmane.network.openvpn.devel/5772/focus=6122>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9yz8cACgkQDC186MBRfrqHNgCggHTdTK2T0SacEtrhbVfpCYGw 37cAoJWTFnIFF5wSOG45s9ZO5wXtZm4E
=vKjb
-----END PGP SIGNATURE-----

#123 lore raw

Re: [Openvpn-devel] [PATCH 3/6] cleanup: warnings at src/openvpn/httpdigest.c

Quoted 26 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · Alon Bar-Lev

src/openvpn/httpdigest.c |   44 ++++++++++++++++++++++---------------------- 1 files changed, 22 insertions(+), 22 deletions(-)

src/openvpn/httpdigest.c index renamed from src/openvpn/httpdigest.c +0 -0

78b8344..a011e56 100644 --- a/src/openvpn/httpdigest.c +++ b/src/openvpn/httpdigest.c @@ -76,20 +76,20 @@ DigestCalcHA1( const md_kt_t *md5_kt = md_kt_get("MD5");

Quoted 9 lines

md_ctx_init(&md5_ctx, md5_kt); -  md_ctx_update(&md5_ctx, pszUserName, strlen(pszUserName)); -  md_ctx_update(&md5_ctx, ":", 1); - md_ctx_update(&md5_ctx, pszRealm, strlen(pszRealm)); - md_ctx_update(&md5_ctx, ":", 1); -  md_ctx_update(&md5_ctx, pszPassword, strlen(pszPassword)); +  md_ctx_update(&md5_ctx, (uint8_t *)pszUserName, strlen(pszUserName)); +  md_ctx_update(&md5_ctx, (uint8_t *)":", 1); +  md_ctx_update(&md5_ctx, (uint8_t *)pszRealm, strlen(pszRealm)); +  md_ctx_update(&md5_ctx, (uint8_t *)":", 1); + md_ctx_update(&md5_ctx, (uint8_t *)pszPassword, strlen(pszPassword));

My remark here goes to all these type-cast patches [1,2,3].

Quoted 4 lines

Wouldn't it be way cleaner to rather fix the function declarations and do the proper type-casting in the {crypto,ssl}_{open,polar}ssl.[ch] and {crypto,ssl}_backend.h files?  Instead of type-casting the whole source code where such warnings might pop up?

I fixed the smallest chunk I found using sun compiler...

Anyway, I think the use of uint8_t is misleading in this case, buffers should be declared as (unsigned char *). If you agree to this statement we need a larger change, I can do this as well.

Most of the code fixed is using standard C string (char *), so casting will be necessary in either case.

Alon.

#124 lore raw

PATCH 4/6 cleanup: warnings at src/openvpn/ntlm.c

In reply to Alon Bar-Lev
---
 src/openvpn/ntlm.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
src/openvpn/ntlm.c +6 -6
index 3390bdd..bd09d88 100644
@@ -77,9 +77,9 @@ gen_md4_hash (const char* data, int data_len, char *result)
 {
   /* result is 16 byte md4 hash */
   const md_kt_t *md4_kt = md_kt_get("MD4");
-  char md[MD4_DIGEST_LENGTH];
+  unsigned char md[MD4_DIGEST_LENGTH];
 
-  md_full(md4_kt, data, data_len, md);
+  md_full(md4_kt, (uint8_t *)data, data_len, md);
   memcpy (result, md, MD4_DIGEST_LENGTH);
 }
 
@@ -90,7 +90,7 @@ gen_hmac_md5 (const char* data, int data_len, const char* key, int key_len,char
 	hmac_ctx_t hmac_ctx;
 	CLEAR(hmac_ctx);
 
-	hmac_ctx_init(&hmac_ctx, key, key_len, md5_kt);
+	hmac_ctx_init(&hmac_ctx, (uint8_t *)key, key_len, md5_kt);
 	hmac_ctx_update(&hmac_ctx, (const unsigned char *)data, data_len);
 	hmac_ctx_final(&hmac_ctx, (unsigned char *)result);
 	hmac_ctx_cleanup(&hmac_ctx);
@@ -307,13 +307,13 @@ ntlm_phase_3 (const struct http_proxy_info *p, const char *phase_2, struct gc_ar
 		unsigned char key1[DES_KEY_LENGTH], key2[DES_KEY_LENGTH], key3[DES_KEY_LENGTH];
 
 		create_des_keys ((unsigned char *)md4_hash, key1);
-		cipher_des_encrypt_ecb (key1, challenge, ntlm_response);
+		cipher_des_encrypt_ecb (key1, (uint8_t *)challenge, (uint8_t *)ntlm_response);
 
 		create_des_keys ((unsigned char *)&(md4_hash[DES_KEY_LENGTH-1]), key2);
-		cipher_des_encrypt_ecb (key2, challenge, &ntlm_response[DES_KEY_LENGTH]);
+		cipher_des_encrypt_ecb (key2, (uint8_t *)challenge, (uint8_t *)&ntlm_response[DES_KEY_LENGTH]);
 
 		create_des_keys ((unsigned char *)&(md4_hash[2*(DES_KEY_LENGTH-1)]), key3);
-		cipher_des_encrypt_ecb (key3, challenge, &ntlm_response[DES_KEY_LENGTH*2]);
+		cipher_des_encrypt_ecb (key3, (uint8_t *)challenge, (uint8_t *)&ntlm_response[DES_KEY_LENGTH*2]);
 	}
 
 
Signature · 1 line
1.7.3.4
#125 lore raw

PATCH 5/6 cleanup: warnings at src/openvpn/ssl_verify_openssl.c

In reply to Alon Bar-Lev
---
 src/openvpn/ssl_verify_openssl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/openvpn/ssl_verify_openssl.c +1 -1
index 1ccfc60..5a73f6a 100644
@@ -240,7 +240,7 @@ x509_free_serial (char *serial)
 unsigned char *
 x509_get_sha1_hash (X509 *cert)
 {
-  char *hash = malloc(SHA_DIGEST_LENGTH);
+  unsigned char *hash = malloc(SHA_DIGEST_LENGTH);
   memcpy(hash, cert->sha1_hash, SHA_DIGEST_LENGTH);
   return hash;
 }
Signature · 1 line
1.7.3.4
#126 lore raw

PATCH 6/6 cleanup: ~0 is too large for 32bit ipv4 address

In reply to Alon Bar-Lev
---
 src/openvpn/route.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/openvpn/route.c +1 -1
index bf7af63..608403b 100644
@@ -268,7 +268,7 @@ init_route (struct route *r,
 	    const struct route_option *ro,
 	    const struct route_list *rl)
 {
-  const in_addr_t default_netmask = ~0;
+  const in_addr_t default_netmask = 0xffffffff;
   bool status;
 
   CLEAR (*r);
Signature · 1 line
1.7.3.4
#127 lore raw

Re: [Openvpn-devel] [PATCH 6/6] cleanup: ~0 is too large for 32bit ipv4 address

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · Alon Bar-Lev

src/openvpn/route.c | 2 +- 1 files changed, 1 insertions(+), 1
deletions(-)

src/openvpn/route.c index renamed from src/openvpn/route.c +0 -0

bf7af63..608403b 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -268,7 +268,7 @@ init_route (struct route *r, const struct route_option *ro, const struct route_list *rl) { - const in_addr_t default_netmask = ~0; + const in_addr_t default_netmask = 0xffffffff;

Please can you explain more in detail why this change is needed? In my perspective, using ~0 is safer as it will always set all bits - no matter the size of default_netmask.

And there are many more places in in source code where ~0 is used to provide that netmask. I would like to see some consistency, rather to just fix warnings which appears on some platform(s).

In general, if you can provide a more verbose description why the patch is written in the commit messages, it will also help the review process.
Most of us are not that skilled in reading others mind ;-)

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9yznwACgkQDC186MBRfrrt9ACfbubdsMWzvKQnav6pQxyOXYwM 8XoAn1jCoLOQO6PS4TfBE+1YiNGeCm+U
=ABwa
-----END PGP SIGNATURE-----

#128 lore raw

Re: [Openvpn-devel] [PATCH 6/6] cleanup: ~0 is too large for 32bit ipv4 address

now to the list...

Quoted 19 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · Alon Bar-Lev

src/openvpn/route.c |    2 +- 1 files changed, 1 insertions(+), 1 deletions(-)

src/openvpn/route.c index renamed from src/openvpn/route.c +0 -0

bf7af63..608403b 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -268,7 +268,7 @@ init_route (struct route *r, const struct route_option *ro, const struct route_list *rl) { - const in_addr_t default_netmask = ~0; +  const in_addr_t default_netmask = 0xffffffff;

Please can you explain more in detail why this change is needed?  In my perspective, using ~0 is safer as it will always set all bits - no matter the size of default_netmask.

Quoted 7 lines

And there are many more places in in source code where ~0 is used to provide that netmask.  I would like to see some consistency, rather to just fix warnings which appears on some platform(s).

In general, if you can provide a more verbose description why the patch is written in the commit messages, it will also help the review process. Most of us are not that skilled in reading others mind ;-)

Hmmm....
First there is a warning... :)
And I don't like warnings...

The explanation is that ipv4 is always 32bit, while ~0 can be either 32bit or 64bit depends on toolchain.
~0 should be used only if indeed the variable is 32bit/64bit by architecture, this is not the case with ipv4.

0xffffffff as-is is valid ipv4 address/netmask...

I found only this warning, if there are more places, I guess these needs to be fixed as well. So if you agree to the above, I will find the other places.

Alon.

#129 lore raw

Re: [Openvpn-devel] [PATCH 6/6] cleanup: ~0 is too large for 32bit ipv4 address

Hi,

Quoted 5 lines · Alon Bar-Lev

0xffffffff as-is is valid ipv4 address/netmask...

I found only this warning, if there are more places, I guess these needs to be fixed as well. So if you agree to the above, I will find the other places.

I'd opt for having a well-understandable define, like

#define IPV4_NETMASK_HOSTONLY 0xffffffffU

(note the "U", that will make sure all compilers know "hey, unsigned!") and use that constant in places that use ~0 today in this very specific meaning.

A quick grep turned up places in pf.c, route.c (where some places actually seem to mean "-1", like in windows-route_find_if_index()?!?), tun.c

I'd rather not tackle "those other places" in this go, just the "this is a host-only netmask!" bits.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#130 lore raw

PATCH 1/1 Avoid using ~0

To avoid casting use two constants:
1. IPV4_NETMASK_HOST
2. dwMINUS_ONE

---
 src/openvpn/basic.h  |    6 ++++++
 src/openvpn/mroute.c |    2 +-
 src/openvpn/pf.c     |    2 +-
 src/openvpn/route.c  |   44 ++++++++++++++++++++++----------------------
 src/openvpn/route.h  |    2 +-
 src/openvpn/tun.c    |   42 +++++++++++++++++++++---------------------
 6 files changed, 52 insertions(+), 46 deletions(-)
src/openvpn/basic.h +6 -0
index 88539e2..561c513 100644
@@ -46,4 +46,10 @@
 /* clear an object */
 #define CLEAR(x) memset(&(x), 0, sizeof(x))
 
+#define IPV4_NETMASK_HOST 0xffffffffU
+
+#ifdef WIN32
+#define dwMINUS_ONE ((DWORD)-1)
+#endif
+
 #endif
src/openvpn/mroute.c +1 -1
index 5b53571..aecb702 100644
@@ -342,7 +342,7 @@ mroute_addr_mask_host_bits (struct mroute_addr *ma)
 	  if ( bits_to_clear >= 8 )
 	    { ma->addr[byte--] = 0; bits_to_clear -= 8; }
 	  else
-	    { ma->addr[byte--] &= (~0 << bits_to_clear); bits_to_clear = 0; }
+	    { ma->addr[byte--] &= (IPV4_NETMASK_HOST << bits_to_clear); bits_to_clear = 0; }
         }
       ASSERT( bits_to_clear == 0 );
     }
src/openvpn/pf.c +1 -1
index 7ed1e70..3c46801 100644
@@ -125,7 +125,7 @@ add_subnet (const char *line, const char *prefix, const int line_num, struct pf_
     {
       /* match special "unknown" tag for addresses unrecognized by mroute */
       network.s_addr = htonl(0);
-      netmask = ~0;
+      netmask = IPV4_NETMASK_HOST;
     }
 
   {
src/openvpn/route.c +22 -22

153 lines not on this page · raw message

src/openvpn/route.h +1 -1
index 25ecaee..c0f5f57 100644
@@ -317,7 +317,7 @@ netbits_to_netmask (const int netbits)
   const int addrlen = sizeof (in_addr_t) * 8;
   in_addr_t mask = 0;
   if (netbits > 0 && netbits <= addrlen)
-    mask = ~0 << (addrlen-netbits);
+    mask = IPV4_NETMASK_HOST << (addrlen-netbits);
   return mask;
 }
 
src/openvpn/tun.c +21 -21

147 lines not on this page · raw message

Signature · 1 line
1.7.3.4
#131 lore raw

Re: [Openvpn-devel] [PATCH] Avoid using ~0

Hi Alon,

I stumbled over a minor mistake:

2012/3/28 Alon Bar-Lev <[email protected]...>:

src/openvpn/route.c add_route (struct route *r, · line 1373

Quoted 13 lines
src/openvpn/route.c +1 -1
index bf7af63..05ea57f 100644
@@ -1367,7 +1367,7 @@ add_route (struct route *r,
     else if ((flags & ROUTE_METHOD_MASK) == ROUTE_METHOD_EXE)
       {
        netcmd_semaphore_lock ();
-       status = openvpn_execve_check (&argv, es, 0, "ERROR: Windows route add command failed");
+       status = openvpn_execve_check (&argv, es, 0, "ERROR: Windows route add command f(DWORD)ailed");
        netcmd_semaphore_release ();
       }
     else if ((flags & ROUTE_METHOD_MASK) == ROUTE_METHOD_ADAPTIVE)

Cheers
Fabian

#132 lore raw

Re: [Openvpn-devel] [PATCH] Avoid using ~0

Quoted 5 lines · Fabian Knittel

Hi Alon,

I stumbled over a minor mistake:

2012/3/28 Alon Bar-Lev <[email protected]...>:

Quoted 16 lines

src/openvpn/route.c add_route (struct route *r, · line 1373

Quoted 13 lines
src/openvpn/route.c +1 -1
index bf7af63..05ea57f 100644
@@ -1367,7 +1367,7 @@ add_route (struct route *r,
     else if ((flags & ROUTE_METHOD_MASK) == ROUTE_METHOD_EXE)
       {
        netcmd_semaphore_lock ();
-       status = openvpn_execve_check (&argv, es, 0, "ERROR: Windows route add command failed");
+       status = openvpn_execve_check (&argv, es, 0, "ERROR: Windows route add command f(DWORD)ailed");
        netcmd_semaphore_release ();
       }
     else if ((flags & ROUTE_METHOD_MASK) == ROUTE_METHOD_ADAPTIVE)

Cheers
Fabian

Great catch!
Don't know where this came from :)

Alon.

#133 lore raw

PATCH 1/1 Avoid using ~0

To avoid casting use two constants:
1. IPV4_NETMASK_HOST
2. dwMINUS_ONE

---
 src/openvpn/basic.h  |    6 ++++++
 src/openvpn/mroute.c |    2 +-
 src/openvpn/pf.c     |    2 +-
 src/openvpn/route.c  |   42 +++++++++++++++++++++---------------------
 src/openvpn/route.h  |    2 +-
 src/openvpn/tun.c    |   42 +++++++++++++++++++++---------------------
 6 files changed, 51 insertions(+), 45 deletions(-)
src/openvpn/basic.h +6 -0
index 88539e2..561c513 100644
@@ -46,4 +46,10 @@
 /* clear an object */
 #define CLEAR(x) memset(&(x), 0, sizeof(x))
 
+#define IPV4_NETMASK_HOST 0xffffffffU
+
+#ifdef WIN32
+#define dwMINUS_ONE ((DWORD)-1)
+#endif
+
 #endif
src/openvpn/mroute.c +1 -1
index 5b53571..aecb702 100644
@@ -342,7 +342,7 @@ mroute_addr_mask_host_bits (struct mroute_addr *ma)
 	  if ( bits_to_clear >= 8 )
 	    { ma->addr[byte--] = 0; bits_to_clear -= 8; }
 	  else
-	    { ma->addr[byte--] &= (~0 << bits_to_clear); bits_to_clear = 0; }
+	    { ma->addr[byte--] &= (IPV4_NETMASK_HOST << bits_to_clear); bits_to_clear = 0; }
         }
       ASSERT( bits_to_clear == 0 );
     }
src/openvpn/pf.c +1 -1
index 7ed1e70..3c46801 100644
@@ -125,7 +125,7 @@ add_subnet (const char *line, const char *prefix, const int line_num, struct pf_
     {
       /* match special "unknown" tag for addresses unrecognized by mroute */
       network.s_addr = htonl(0);
-      netmask = ~0;
+      netmask = IPV4_NETMASK_HOST;
     }
 
   {
src/openvpn/route.c +21 -21

145 lines not on this page · raw message

src/openvpn/route.h +1 -1
index 25ecaee..c0f5f57 100644
@@ -317,7 +317,7 @@ netbits_to_netmask (const int netbits)
   const int addrlen = sizeof (in_addr_t) * 8;
   in_addr_t mask = 0;
   if (netbits > 0 && netbits <= addrlen)
-    mask = ~0 << (addrlen-netbits);
+    mask = IPV4_NETMASK_HOST << (addrlen-netbits);
   return mask;
 }
 
src/openvpn/tun.c +21 -21

147 lines not on this page · raw message

Signature · 1 line
1.7.3.4
#134 lore raw

Re: [Openvpn-devel] [PATCH] Avoid using ~0

In reply to Alon Bar-Lev

Hi,

Quoted 2 lines · Alon Bar-Lev

To avoid casting use two constants:
1. IPV4_NETMASK_HOST

Fine with that one.

Quoted 1 line

2. dwMINUS_ONE

I think this is way over board. It should be possible to spell "-1" as such - and it doesn't increase readability to introduce a MINUS_ONE define here. If at all, introduce a "NO_IF_INDEX_FOUND" #define for the "find tap ifindex" logic - but please make it a separate patch.

These are unrelated issues and must be reviewed independently (especially "different people understand the respective bits of the code and can give their ACK").

src/openvpn/route.c print_in6_addr_netbits_only( struct in6_addr network_copy, int netbits, · line 1534

Quoted 7 lines
src/openvpn/route.c +1 -1
@@ -1530,7 +1530,7 @@ print_in6_addr_netbits_only( struct in6_addr network_copy, int netbits,
       if ( bits_to_clear >= 8 )
 	{ network_copy.s6_addr[byte--] = 0; bits_to_clear -= 8; }
       else
-	{ network_copy.s6_addr[byte--] &= (~0 << bits_to_clear); bits_to_clear = 0; }
+	{ network_copy.s6_addr[byte--] &= (IPV4_NETMASK_HOST << bits_to_clear); bits_to_clear = 0; }
     }

This particular one should NOT get "IPV4_NETMASK_HOST", as it isn't IPv4.

"0xff" would be fine, or just leave it at "~0".

src/openvpn/route.c get_default_gateway (struct route_gateway_info *rgi) · line 2389

Quoted 2 lines
src/openvpn/route.c +1 -1
-	unsigned int lowest_metric = ~0;
+	unsigned int lowest_metric = (unsigned int)-1;

This bit is not looking good. If "-1" is a valid value for "lowest_metric" (to signal "not set" etc) we shouldn't cast "-1" to (unsigned int) but use a signed int here.

This should NOT be "just patched because we're it" but better understood and properly fixed.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#135 lore raw

Re: [Openvpn-devel] [PATCH] Avoid using ~0

Quoted 34 lines · Gert Doering

Hi,

Quoted 2 lines · Alon Bar-Lev

To avoid casting use two constants:
1. IPV4_NETMASK_HOST

Fine with that one.

Quoted 1 line

2. dwMINUS_ONE

I think this is way over board.  It should be possible to spell "-1" as such - and it doesn't increase readability to introduce a MINUS_ONE define here.  If at all, introduce a "NO_IF_INDEX_FOUND" #define for the "find tap ifindex" logic - but please make it a separate patch.

These are unrelated issues and must be reviewed independently (especially "different people understand the respective bits of the code and can give their ACK").

Quoted 7 lines
src/openvpn/route.c +0 -0
@@ -1530,7 +1530,7 @@ print_in6_addr_netbits_only( struct in6_addr network_copy, int netbits,
        if ( bits_to_clear >= 8 )
       { network_copy.s6_addr[byte--] = 0; bits_to_clear -= 8; }

       else
-     { network_copy.s6_addr[byte--] &= (~0 << bits_to_clear); bits_to_clear = 0; }
+     { network_copy.s6_addr[byte--] &= (IPV4_NETMASK_HOST << bits_to_clear); bits_to_clear = 0; } }

This particular one should NOT get "IPV4_NETMASK_HOST", as it isn't IPv4.

"0xff" would be fine, or just leave it at "~0".

Quoted 2 lines

-     unsigned int lowest_metric = ~0;
+     unsigned int lowest_metric = (unsigned int)-1;

Quoted 6 lines

This bit is not looking good.  If "-1" is a valid value for "lowest_metric" (to signal "not set" etc) we shouldn't cast "-1" to (unsigned int) but use a signed int here.

This should NOT be "just patched because we're it" but better understood and properly fixed.

OK.
Fair enough, although I want to focus on the major cleanups right now. If we focus on the minor ones we get progress but much slower.

Alon.

#136 lore raw

cover cleanup: avoid using ~0

Remove the arithmetic magic in favor of constants or alternatives.

Alon Bar-Lev (4):
cleanup: avoid using ~0 - generic
cleanup: avoid using ~0 - ipv6
cleanup: avoid using ~0 - netmask
cleanup: avoid using ~0 - windows

 config-msvc.h         |    1 +
 configure.ac          |    2 +-
 src/openvpn/basic.h   |    2 ++
 src/openvpn/mroute.c  |    2 +-
 src/openvpn/pf.c      |    2 +-
 src/openvpn/route.c   |   46 +++++++++++++++++++++++++---------------------
 src/openvpn/route.h   |    2 +-
 src/openvpn/syshead.h |    4 ++++
 src/openvpn/tun.c     |   48 ++++++++++++++++++++++++------------------------
 src/openvpn/tun.h     |    2 ++
 10 files changed, 62 insertions(+), 49 deletions(-)
Signature · 1 line
1.7.3.4
#137 lore raw

PATCH 1/4 cleanup: avoid using ~0 - generic

In reply to Alon Bar-Lev

Use limits.h for maximum value.

---
 config-msvc.h         |    1 +
 configure.ac          |    2 +-
 src/openvpn/route.c   |    2 +-
 src/openvpn/syshead.h |    4 ++++
 4 files changed, 7 insertions(+), 2 deletions(-)
config-msvc.h +1 -0
index 0e42505..99c00f9 100644
@@ -30,6 +30,7 @@
 #define HAVE_STRERROR 1
 #define HAVE_STRINGS_H 1
 #define HAVE_STRING_H 1
+#define HAVE_LIMITS_H 1
 #define HAVE_SYSTEM 1
 #define HAVE_TIME 1
 #define HAVE_TIME_H 1
configure.ac +1 -1
index ef34697..e962323 100644
@@ -354,7 +354,7 @@ AX_EMPTY_ARRAY
 AC_CHECK_SIZEOF([unsigned int])
 AC_CHECK_SIZEOF([unsigned long])
 AC_CHECK_HEADERS([ \
-	stdio.h stdarg.h \
+	stdio.h stdarg.h limits.h \
 	time.h errno.h fcntl.h io.h direct.h \
 	ctype.h sys/types.h sys/socket.h \
 	signal.h unistd.h dlfcn.h \
src/openvpn/route.c +1 -1
index bf7af63..a628e77 100644
@@ -2386,7 +2386,7 @@ get_default_gateway (struct route_gateway_info *rgi)
       {
 	char line[256];
 	int count = 0;
-	unsigned int lowest_metric = ~0;
+	unsigned int lowest_metric = UINT_MAX;
 	in_addr_t best_gw = 0;
 	bool found = false;
 	while (fgets (line, sizeof (line), fp) != NULL)
src/openvpn/syshead.h +4 -0
index e60dc44..0595b67 100644
@@ -129,6 +129,10 @@
 #include <signal.h>
 #endif
 
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
 #endif
Signature · 1 line
1.7.3.4
#138 lore raw

Re: [Openvpn-devel] [PATCH 1/4] cleanup: avoid using ~0 - generic

Hi,

Quoted 3 lines · Alon Bar-Lev

Use limits.h for maximum value.

I like this approach - it is a maximum value, so UINT_MAX is making this obvious.

ACK.

There is a similar bit of code in the win32 section, in get_default_gateway_row():

get_default_gateway_row (const MIB_IPFORWARDTABLE *routes) {
struct gc_arena gc = gc_new ();
DWORD lowest_metric = ~0;

... which might also be a candidate for this change. As I'm not sure whether UINT_MAX is appropriate for a DWORD, I'm not proposing anything particular for this occurance.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#139 lore raw

Re: [Openvpn-devel] [PATCH 1/4] cleanup: avoid using ~0 - generic

Quoted 11 lines · Gert Doering

There is a similar bit of code in the win32 section, in get_default_gateway_row():

get_default_gateway_row (const MIB_IPFORWARDTABLE *routes) {
 struct gc_arena gc = gc_new ();
 DWORD lowest_metric = ~0;

... which might also be a candidate for this change.  As I'm not sure whether UINT_MAX is appropriate for a DWORD, I'm not proposing anything particular for this occurance.

Right... I need to modify the patch.
But I am not sure UINT_MAX is appropriate...

Alon.

#140 lore raw

Re: [Openvpn-devel] [PATCH 1/4] cleanup: avoid using ~0 - generic

Hi,

Quoted 9 lines · Alon Bar-Lev
Quoted 8 lines · Gert Doering

There is a similar bit of code in the win32 section, in get_default_gateway_row():

get_default_gateway_row (const MIB_IPFORWARDTABLE *routes) {
 struct gc_arena gc = gc_new ();
 DWORD lowest_metric = ~0;

Quoted 5 lines
Quoted 3 lines

... which might also be a candidate for this change.  As I'm not sure whether UINT_MAX is appropriate for a DWORD, I'm not proposing anything particular for this occurance.

Right... I need to modify the patch.

Let's get this one in first, as it is (to follow the current workflow), and let one of the Windows guys look into the other part.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#141 lore raw

Re: [Openvpn-devel] [PATCH 1/4] cleanup: avoid using ~0 - generic

In reply to Alon Bar-Lev
Quoted 10 lines · Alon Bar-Lev

Use limits.h for maximum value.

---
 config-msvc.h         |    1 +
 configure.ac          |    2 +-
 src/openvpn/route.c   |    2 +-
 src/openvpn/syshead.h |    4 ++++
 4 files changed, 7 insertions(+), 2 deletions(-)

Applied to master branches on -testing and -stable trees

commit 112731fcc39535ba425ac717cb0d5bd1a2a11c61

Author: Alon Bar-Lev <[email protected]...>
Date:   Thu Mar 29 11:16:39 2012 +0200
    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Gert Doering <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth

#142 lore raw

PATCH 2/4 cleanup: avoid using ~0 - ipv6

In reply to Alon Bar-Lev
---
 src/openvpn/route.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/openvpn/route.c +1 -1
index a628e77..dda71c9 100644
@@ -1530,7 +1530,7 @@ print_in6_addr_netbits_only( struct in6_addr network_copy, int netbits,
       if ( bits_to_clear >= 8 )
 	{ network_copy.s6_addr[byte--] = 0; bits_to_clear -= 8; }
       else
-	{ network_copy.s6_addr[byte--] &= (~0 << bits_to_clear); bits_to_clear = 0; }
+	{ network_copy.s6_addr[byte--] &= (0xff << bits_to_clear); bits_to_clear = 0; }
     }
 
   return print_in6_addr( network_copy, 0, gc);
Signature · 1 line
1.7.3.4
#143 lore raw

Re: [Openvpn-devel] [PATCH 2/4] cleanup: avoid using ~0 - ipv6

Hi,

Quoted 4 lines · Alon Bar-Lev
---
 src/openvpn/route.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

ACK. 0xff is all that is needed, and makes it more obvious what is done - "up to 8 bits are masked away".

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#144 lore raw

Re: [Openvpn-devel] [PATCH 2/4] cleanup: avoid using ~0 - ipv6

In reply to Alon Bar-Lev
Quoted 5 lines · Alon Bar-Lev
---
 src/openvpn/route.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to master branches on -testing and -stable trees

commit ffa1184d7fde8262f5c19438a59657e318d5126f

Author: Alon Bar-Lev <[email protected]...>
Date:   Thu Mar 29 11:16:40 2012 +0200
    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Gert Doering <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth

#145 lore raw

PATCH 3/4 cleanup: avoid using ~0 - netmask

In reply to Alon Bar-Lev

Use IPV4_NETMASK_HOST constant.

---
 src/openvpn/basic.h  |    2 ++
 src/openvpn/mroute.c |    2 +-
 src/openvpn/pf.c     |    2 +-
 src/openvpn/route.c  |   12 ++++++------
 src/openvpn/route.h  |    2 +-
 src/openvpn/tun.c    |    2 +-
 6 files changed, 12 insertions(+), 10 deletions(-)
src/openvpn/basic.h +2 -0
index 88539e2..7c13e22 100644
@@ -46,4 +46,6 @@
 /* clear an object */
 #define CLEAR(x) memset(&(x), 0, sizeof(x))
 
+#define IPV4_NETMASK_HOST 0xffffffffU
+
 #endif
src/openvpn/mroute.c +1 -1
index 5b53571..aecb702 100644
@@ -342,7 +342,7 @@ mroute_addr_mask_host_bits (struct mroute_addr *ma)
 	  if ( bits_to_clear >= 8 )
 	    { ma->addr[byte--] = 0; bits_to_clear -= 8; }
 	  else
-	    { ma->addr[byte--] &= (~0 << bits_to_clear); bits_to_clear = 0; }
+	    { ma->addr[byte--] &= (IPV4_NETMASK_HOST << bits_to_clear); bits_to_clear = 0; }
         }
       ASSERT( bits_to_clear == 0 );
     }
src/openvpn/pf.c +1 -1
index 7ed1e70..3c46801 100644
@@ -125,7 +125,7 @@ add_subnet (const char *line, const char *prefix, const int line_num, struct pf_
     {
       /* match special "unknown" tag for addresses unrecognized by mroute */
       network.s_addr = htonl(0);
-      netmask = ~0;
+      netmask = IPV4_NETMASK_HOST;
     }
 
   {
src/openvpn/route.c +6 -6
index dda71c9..f681a58 100644
@@ -268,7 +268,7 @@ init_route (struct route *r,
 	    const struct route_option *ro,
 	    const struct route_list *rl)
 {
-  const in_addr_t default_netmask = ~0;
+  const in_addr_t default_netmask = IPV4_NETMASK_HOST;
   bool status;
 
   CLEAR (*r);
@@ -797,7 +797,7 @@ add_bypass_routes (struct route_bypass *rb,
     {
       if (rb->bypass[i])
 	add_route3 (rb->bypass[i],
-		    ~0,
+		    IPV4_NETMASK_HOST,
 		    gateway,
 		    tt,
 		    flags | ROUTE_REF_GW,
@@ -819,7 +819,7 @@ del_bypass_routes (struct route_bypass *rb,
     {
       if (rb->bypass[i])
 	del_route3 (rb->bypass[i],
-		    ~0,
+		    IPV4_NETMASK_HOST,
 		    gateway,
 		    tt,
 		    flags | ROUTE_REF_GW,
@@ -870,7 +870,7 @@ redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, u
 	       * adding this special /32 route */
 	      if (rl->spec.remote_host != IPV4_INVALID_ADDR) {
 		add_route3 (rl->spec.remote_host,
-			    ~0,
+			    IPV4_NETMASK_HOST,
 			    rl->rgi.gateway.addr,
 			    tt,
 			    flags | ROUTE_REF_GW,
@@ -944,7 +944,7 @@ undo_redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *
       if (rl->iflags & RL_DID_LOCAL)
 	{
 	  del_route3 (rl->spec.remote_host,
-		      ~0,
+		      IPV4_NETMASK_HOST,
 		      rl->rgi.gateway.addr,
 		      tt,
 		      flags | ROUTE_REF_GW,
@@ -3125,7 +3125,7 @@ netmask_to_netbits (const in_addr_t network, const in_addr_t netmask, int *netbi
 static void
 add_host_route_if_nonlocal (struct route_bypass *rb, const in_addr_t addr)
 {
-  if (test_local_addr(addr, NULL) == TLA_NONLOCAL && addr != 0 && addr != ~0)
+  if (test_local_addr(addr, NULL) == TLA_NONLOCAL && addr != 0 && addr != IPV4_NETMASK_HOST)
     add_bypass_address (rb, addr);
 }
 
src/openvpn/route.h +1 -1
index 25ecaee..c0f5f57 100644
@@ -317,7 +317,7 @@ netbits_to_netmask (const int netbits)
   const int addrlen = sizeof (in_addr_t) * 8;
   in_addr_t mask = 0;
   if (netbits > 0 && netbits <= addrlen)
-    mask = ~0 << (addrlen-netbits);
+    mask = IPV4_NETMASK_HOST << (addrlen-netbits);
   return mask;
 }
 
src/openvpn/tun.c +1 -1
index e6a7bc8..21778a2 100644
@@ -489,7 +489,7 @@ init_tun (const char *dev,       /* --dev option */
 	  if (tt->type == DEV_TYPE_TAP || (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET))
 	    check_subnet_conflict (tt->local, tt->remote_netmask, "TUN/TAP adapter");
 	  else if (tt->type == DEV_TYPE_TUN)
-	    check_subnet_conflict (tt->local, ~0, "TUN/TAP adapter");
+	    check_subnet_conflict (tt->local, IPV4_NETMASK_HOST, "TUN/TAP adapter");
 	}
 
       /*
Signature · 1 line
1.7.3.4
#146 lore raw

Re: [Openvpn-devel] [PATCH 3/4] cleanup: avoid using ~0 - netmask

Hi,

Quoted 3 lines · Alon Bar-Lev

Use IPV4_NETMASK_HOST constant.

ACK on this one, to start with. Thanks.

The others I'm just looking into, but need to read a bit more code around to see whether I fully understand what that code is doing (it "looks harmless enough", but signed/unsigned issues tend to do that)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#147 lore raw

Re: [Openvpn-devel] [PATCH 3/4] cleanup: avoid using ~0 - netmask

In reply to Alon Bar-Lev
Quoted 12 lines · Alon Bar-Lev

Use IPV4_NETMASK_HOST constant.

---
 src/openvpn/basic.h  |    2 ++
 src/openvpn/mroute.c |    2 +-
 src/openvpn/pf.c     |    2 +-
 src/openvpn/route.c  |   12 ++++++------
 src/openvpn/route.h  |    2 +-
 src/openvpn/tun.c    |    2 +-
 6 files changed, 12 insertions(+), 10 deletions(-)

Applied to master branches on -testing and -stable trees

commit 32e576d270834636e8e8667fcb7e91cdac03b4a4

Author: Alon Bar-Lev <[email protected]...>
Date:   Thu Mar 29 11:16:41 2012 +0200
    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Gert Doering <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth

#148 lore raw

PATCH 4/4 cleanup: avoid using ~0 - windows

In reply to Alon Bar-Lev

Use the following constants:
- METRIC_NOT_USED
- TUN_ADAPTER_INDEX_INVALID

---
 src/openvpn/route.c |   30 +++++++++++++++++-------------
 src/openvpn/tun.c   |   46 +++++++++++++++++++++++-----------------------
 src/openvpn/tun.h   |    2 ++
 3 files changed, 42 insertions(+), 36 deletions(-)
src/openvpn/route.c +17 -13
index f681a58..e97cbed 100644
@@ -45,6 +45,10 @@
 
 #include "memdbg.h"
 
+#ifdef WIN32
+#define METRIC_NOT_USED ((DWORD)-1)
+#endif
+
 static void delete_route (struct route *r, const struct tuntap *tt, unsigned int flags, const struct route_gateway_info *rgi, const struct env_set *es);
 
 static void get_bypass_addresses (struct route_bypass *rb, const unsigned int flags);
@@ -1342,7 +1346,7 @@ add_route (struct route *r,
 
 #elif defined (WIN32)
   {
-    DWORD ai = ~0;
+    DWORD ai = TUN_ADAPTER_INDEX_INVALID;
     argv_printf (&argv, "%s%sc ADD %s MASK %s %s",
 		 get_win_sys_path(),
 		 WIN_ROUTE_PATH_SUFFIX,
@@ -2098,7 +2102,7 @@ static const MIB_IPFORWARDROW *
 get_default_gateway_row (const MIB_IPFORWARDTABLE *routes)
 {
   struct gc_arena gc = gc_new ();
-  DWORD lowest_metric = ~0;
+  DWORD lowest_metric = METRIC_NOT_USED;
   const MIB_IPFORWARDROW *ret = NULL;
   int i;
   int best = -1;
@@ -2155,7 +2159,7 @@ get_default_gateway (struct route_gateway_info *rgi)
 	{
 	  rgi->flags |= RGI_ADDR_DEFINED;
 	  a_index = adapter_index_of_ip (adapters, rgi->gateway.addr, NULL, &rgi->gateway.netmask);
-	  if (a_index != ~0)
+	  if (a_index != TUN_ADAPTER_INDEX_INVALID)
 	    {
 	      rgi->adapter_index = a_index;
 	      rgi->flags |= (RGI_IFACE_DEFINED|RGI_NETMASK_DEFINED);
@@ -2176,7 +2180,7 @@ static DWORD
 windows_route_find_if_index (const struct route *r, const struct tuntap *tt)
 {
   struct gc_arena gc = gc_new ();
-  DWORD ret = ~0;
+  DWORD ret = TUN_ADAPTER_INDEX_INVALID;
   int count = 0;
   const IP_ADAPTER_INFO *adapters = get_adapter_info_list (&gc);
   const IP_ADAPTER_INFO *tun_adapter = get_tun_adapter (tt, adapters);
@@ -2198,14 +2202,14 @@ windows_route_find_if_index (const struct route *r, const struct tuntap *tt)
     {
       msg (M_WARN, "Warning: route gateway is not reachable on any active network adapters: %s",
 	   print_in_addr_t (r->gateway, 0, &gc));
-      ret = ~0;
+      ret = TUN_ADAPTER_INDEX_INVALID;
     }
   else if (count > 1)
     {
       msg (M_WARN, "Warning: route gateway is ambiguous: %s (%d matches)",
 	   print_in_addr_t (r->gateway, 0, &gc),
 	   count);
-      ret = ~0;
+      ret = TUN_ADAPTER_INDEX_INVALID;
     }
 
   dmsg (D_ROUTE_DEBUG, "DEBUG: route find if: on_tun=%d count=%d index=%d",
@@ -2223,9 +2227,9 @@ add_route_ipapi (const struct route *r, const struct tuntap *tt, DWORD adapter_i
   struct gc_arena gc = gc_new ();
   bool ret = false;
   DWORD status;
-  const DWORD if_index = (adapter_index == ~0) ? windows_route_find_if_index (r, tt) : adapter_index;
+  const DWORD if_index = (adapter_index == TUN_ADAPTER_INDEX_INVALID) ? windows_route_find_if_index (r, tt) : adapter_index;
 
-  if (if_index != ~0)
+  if (if_index != TUN_ADAPTER_INDEX_INVALID)
     {
       MIB_IPFORWARDROW fr;
       CLEAR (fr);
@@ -2239,10 +2243,10 @@ add_route_ipapi (const struct route *r, const struct tuntap *tt, DWORD adapter_i
       fr.dwForwardAge = 0;
       fr.dwForwardNextHopAS = 0;
       fr.dwForwardMetric1 = (r->flags & RT_METRIC_DEFINED) ? r->metric : 1;
-      fr.dwForwardMetric2 = ~0;
-      fr.dwForwardMetric3 = ~0;
-      fr.dwForwardMetric4 = ~0;
-      fr.dwForwardMetric5 = ~0;
+      fr.dwForwardMetric2 = METRIC_NOT_USED;
+      fr.dwForwardMetric3 = METRIC_NOT_USED;
+      fr.dwForwardMetric4 = METRIC_NOT_USED;
+      fr.dwForwardMetric5 = METRIC_NOT_USED;
 
       if ((r->network & r->netmask) != r->network)
 	msg (M_WARN, "Warning: address %s is not a network address in relation to netmask %s",
@@ -2299,7 +2303,7 @@ del_route_ipapi (const struct route *r, const struct tuntap *tt)
   DWORD status;
   const DWORD if_index = windows_route_find_if_index (r, tt);
 
-  if (if_index != ~0)
+  if (if_index != TUN_ADAPTER_INDEX_INVALID)
     {
       MIB_IPFORWARDROW fr;
       CLEAR (fr);
src/openvpn/tun.c +23 -23

142 lines not on this page · raw message

src/openvpn/tun.h +2 -0
index 749bee5..9bd990f 100644
@@ -40,6 +40,8 @@
 
 #ifdef WIN32
 
+#define TUN_ADAPTER_INDEX_INVALID ((DWORD)-1)
+
 /* time constants for --ip-win32 adaptive */
 #define IPW32_SET_ADAPTIVE_DELAY_WINDOW 300
 #define IPW32_SET_ADAPTIVE_TRY_NETSH    20
Signature · 1 line
1.7.3.4
#149 lore raw

Re: [Openvpn-devel] [PATCH 4/4] cleanup: avoid using ~0 - windows

Hi,

Quoted 3 lines · Alon Bar-Lev

Use the following constants:
- METRIC_NOT_USED
- TUN_ADAPTER_INDEX_INVALID

3/4-ACK.

ACK on the TUN_ADAPTER_INDEX_INVALID change.

ACK on the METRIC_NOT_USED change for route_add_ipapi() - checked vs. CreateIpForwardEntry() documentation on

http://msdn.microsoft.com/en-us/library/windows/desktop/aa365860(v=vs.85).aspx

"A number of members of the MIB_IPFORWARDROW structure pointed to
by the route parameter are not currently used by CreateIpForwardEntry. These members include dwForwardPolicy, dwForwardType, dwForwardAge, dwForwardNextHopAS, dwForwardMetric2, dwForwardMetric3, dwForwardMetric4, and dwForwardMetric5."

(doesn't particularily tell whether they should be set to zero or to
-1, for forward-compatibility, but having a constant "METRIC_NOT_USED" makes the code easier to understand, IMHO, without functional changes).

I'm a bit unsure about that one:

Hi,

Quoted 3 lines · Alon Bar-Lev

Use the following constants:
- METRIC_NOT_USED
- TUN_ADAPTER_INDEX_INVALID

3/4-ACK.

ACK on the TUN_ADAPTER_INDEX_INVALID change.

ACK on the METRIC_NOT_USED change for route_add_ipapi() - checked vs. CreateIpForwardEntry() documentation on

http://msdn.microsoft.com/en-us/library/windows/desktop/aa365860(v=vs.85).aspx

"A number of members of the MIB_IPFORWARDROW structure pointed to
by the route parameter are not currently used by CreateIpForwardEntry. These members include dwForwardPolicy, dwForwardType, dwForwardAge, dwForwardNextHopAS, dwForwardMetric2, dwForwardMetric3, dwForwardMetric4, and dwForwardMetric5."

(doesn't particularily tell whether they should be set to zero or to
-1, for forward-compatibility, but having a constant "METRIC_NOT_USED" makes the code easier to understand, IMHO, without functional changes).

I'm a bit unsure about that one:

src/openvpn/route.c static const MIB_IPFORWARDROW * · line 2108

Quoted 9 lines
src/openvpn/route.c +1 -1
@@ -2098,7 +2102,7 @@ static const MIB_IPFORWARDROW *
 get_default_gateway_row (const MIB_IPFORWARDTABLE *routes)
 {
   struct gc_arena gc = gc_new ();
-  DWORD lowest_metric = ~0;
+  DWORD lowest_metric = METRIC_NOT_USED;
   const MIB_IPFORWARDROW *ret = NULL;
   int i;
   int best = -1;

because it's not actually "METRIC_NOT_USED", but the WIN32 analog to the UINT_MAX patch in 1/4. So this change should not go in, but it should be initialized to "DWORD_MAX", whatever that is.

So I'd propose to split this into two separate patches, with this particular chunked separated out.

thanks,

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#150 lore raw

PATCH 1/1 Enable pedantic in windows compilation

In reply to Alon Bar-Lev

Apparently -ansi undef WIN32 macro.

---
 configure.ac |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
configure.ac +2 -1
index d217343..ef34697 100644
@@ -886,7 +886,8 @@ fi
 
 if test "${enable_pedantic}" = "yes"; then
 	enable_strict="yes"
-	CFLAGS="${CFLAGS} -ansi -pedantic"
+	CFLAGS="${CFLAGS} -pedantic"
+	test "${WIN32}" != "yes" && CFLAGS="${CFLAGS} -ansi"
 fi
 if test "${enable_strict}" = "yes"; then
 	CFLAGS="${CFLAGS} -Wall -Wno-unused-parameter -Wno-unused-function"
Signature · 1 line
1.7.3.4
#151 lore raw

Re: [Openvpn-devel] [PATCH] Enable pedantic in windows compilation

Quoted 7 lines · Alon Bar-Lev

Apparently -ansi undef WIN32 macro.

---
 configure.ac |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

ACK! Applied to master branches on -testing and -stable trees.

commit 31444111839f0720d6173a71f66fa3a988bcf9fb

Author: Alon Bar-Lev <[email protected]...>
Date:   Wed Mar 28 20:43:15 2012 +0200
    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth

#152 lore raw
In reply to Alon Bar-Lev
Quoted 10 lines

The last commit was partial, and done even if I NAK some of the patches. As it seems my opinion of a patch of fellows nor mine is not taken into consideration properly. I curious how process had been performed if someone else had found a problem.

This also had been done while Samuli is in progress of creating a different flow, and all parties involved are aware of this process.

I'll be doing a review of our ACK system this week. The goal is to see what kind of issues we've catched with it, and where it makes most sense. In some cases the ACK requirement may just slow down the development a without significant benefits.

That said, please don't comment quite yet, please wait a while until I come up with some concrete examples to be used as a basis for the discussion.

Quoted 3 lines

I am sending the leftovers from my branch.

And stopping until bureaucracy is resolved.

Thanks!

Quoted 51 lines

Alon.

Alon Bar-Lev (6):
build: ax_varargs.m4: fixups
build: autoconf: misc sockets fixups
tree: ChangeLog: add ident attribute
build: msvc: upgrade to Visual Studio 2010 + fixups
build: enable lzo by default
build: windows: set vendor to openvpn project + cleanups

 .gitattributes                                 |    1 +
 .gitignore                                     |    2 +
 ChangeLog                                      |    2 +
 build/msvc/msvc-generate/Makefile.am           |    2 +-
 build/msvc/msvc-generate/msvc-generate.vcproj  |   74 ---
 build/msvc/msvc-generate/msvc-generate.vcxproj |   69 +++
 configure.ac                                   |   57 +-
 m4/ax_varargs.m4                               |   10 +-
 msvc-build.bat                                 |   27 +-
 msvc-dev.bat                                   |   19 +-
 msvc-env.bat                                   |    7 +-
 openvpn.sln                                    |   90 ++--
 src/compat/Makefile.am                         |    3 +-
 src/compat/compat.vcproj                       |  197 ------
 src/compat/compat.vcxproj                      |   87 +++
 src/compat/compat.vcxproj.filters              |   42 ++
 src/openvpn/Makefile.am                        |    3 +-
 src/openvpn/openvpn.vcproj                     |  777 ------------------------
 src/openvpn/openvpn.vcxproj                    |  261 ++++++++
 src/openvpn/openvpn.vcxproj.filters            |  458 ++++++++++++++
 src/openvpn/openvpn_win32_resources.rc         |    6 +-
 src/openvpnserv/Makefile.am                    |    3 +-
 src/openvpnserv/openvpnserv.vcproj             |  209 -------
 src/openvpnserv/openvpnserv.vcxproj            |  112 ++++
 src/openvpnserv/openvpnserv.vcxproj.filters    |   35 ++
 src/openvpnserv/openvpnserv_resources.rc       |    4 +-
 26 files changed, 1197 insertions(+), 1360 deletions(-)
 create mode 100644 .gitattributes
 delete mode 100644 build/msvc/msvc-generate/msvc-generate.vcproj
 create mode 100644 build/msvc/msvc-generate/msvc-generate.vcxproj
 delete mode 100644 src/compat/compat.vcproj
 create mode 100644 src/compat/compat.vcxproj
 create mode 100644 src/compat/compat.vcxproj.filters
 delete mode 100644 src/openvpn/openvpn.vcproj
 create mode 100644 src/openvpn/openvpn.vcxproj
 create mode 100644 src/openvpn/openvpn.vcxproj.filters
 delete mode 100644 src/openvpnserv/openvpnserv.vcproj
 create mode 100644 src/openvpnserv/openvpnserv.vcxproj
 create mode 100644 src/openvpnserv/openvpnserv.vcxproj.filters
Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock
#153 lore raw

PATCH 1/6 build: ax_varargs.m4: fixups

In reply to David Sommerseth
---
 m4/ax_varargs.m4 |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
m4/ax_varargs.m4 +6 -4
index 37cdebe..c295d21 100644
@@ -12,11 +12,12 @@ AC_DEFUN([AX_CPP_VARARG_MACRO_GCC], [dnl
 		[VAR],
 		[AC_COMPILE_IFELSE(
 			[AC_LANG_PROGRAM(
-				,
 				[[
 #define macro(a, b...) func(a, b)
 int func(int a, int b, int c);
-int test() { return macro(1, 2, 3); }
+				]],
+				[[
+int i = macro(1, 2, 3);
 				]]
 			)],
 			[VAR=yes],
@@ -50,11 +51,12 @@ AC_DEFUN([AX_CPP_VARARG_MACRO_ISO], [dnl
 		[VAR],
 		[AC_COMPILE_IFELSE(
 			[AC_LANG_PROGRAM(
-				,
 				[[
 #define macro(a, ...) func(a, __VA_ARGS__)
 int func(int a, int b, int c);
-int test() { return macro(1, 2, 3); }
+				]],
+				[[
+int i = macro(1, 2, 3);
 				]]
 			)],
 			[VAR=yes],
Signature · 1 line
1.7.3.4
#154 lore raw

Re: [Openvpn-devel] [PATCH 1/6] build: ax_varargs.m4: fixups

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 4 lines · Alon Bar-Lev

m4/ax_varargs.m4 | 10 ++++++---- 1 files changed, 6 insertions(+), 4
deletions(-)

ACK! Applied to master branches on -testing and -stable trees.

commit 4df219c764bf107d9d7fb49b417269b94cc536c4

Author: Alon Bar-Lev <[email protected]...>
Date:   Sat Mar 24 09:58:33 2012 +0200
    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9wYr4ACgkQDC186MBRfrq79QCfejMJt+cMgLuvIKymPdW/gePJ ToEAniHwfwiqNaxVuaQflv4r2lRYGgz2
=B846
-----END PGP SIGNATURE-----

#155 lore raw

PATCH 2/6 build: autoconf: misc sockets fixups

In reply to David Sommerseth
---
 configure.ac |   53 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 28 insertions(+), 25 deletions(-)
configure.ac +28 -25
index c6cabee..9a6ff29 100644
@@ -522,6 +522,33 @@ AC_CHECK_FUNCS([ \
 	chsize ftruncate execve getpeereid umask basename dirname access \
 	epoll_create \
 ])
+
+AC_CHECK_LIB(
+	[dl],
+	[dlopen],
+	[DL_LIBS="-ldl"]
+)
+AC_SUBST([DL_LIBS])
+
+AC_CHECK_LIB(
+	[nsl],
+	[inet_ntoa],
+	[SOCKETS_LIBS="${SOCKETS_LIBS} -lnsl"]
+)
+AC_CHECK_LIB(
+	[socket],
+	[socket],
+	[SOCKETS_LIBS="${SOCKETS_LIBS} -lsocket"]
+)
+AC_CHECK_LIB(
+	[resolv],
+	[gethostbyname],
+	[SOCKETS_LIBS="${SOCKETS_LIBS} -lresolv"]
+)
+AC_SUBST([SOCKETS_LIBS])
+
+old_LIBS="${LIBS}"
+LIBS="${LIBS} ${SOCKETS_LIBS}"
 AC_CHECK_FUNCS([sendmsg recvmsg inet_ntop inet_pton])
 AC_CHECK_FUNCS(
 	[res_init],
@@ -529,7 +556,6 @@ AC_CHECK_FUNCS(
 	,
 	[[#include <resolv.h>]]
 )
-
 # Windows use stdcall for winsock so we cannot auto detect these
 m4_define(
 	[SOCKET_FUNCS],
@@ -555,30 +581,7 @@ else
 	)
 	AC_CHECK_FUNCS(SOCKET_OPT_FUNCS)
 fi
-
-AC_CHECK_LIB(
-	[dl],
-	[dlopen],
-	[DL_LIBS="-ldl"]
-)
-AC_SUBST([DL_LIBS])
-
-AC_CHECK_LIB(
-	[nsl],
-	[inet_ntoa],
-	[SOCKETS_LIBS="${SOCKETS_LIBS} -lnsl"]
-)
-AC_CHECK_LIB(
-	[socket],
-	[socket],
-	[SOCKETS_LIBS="${SOCKETS_LIBS} -lsocket"]
-)
-AC_CHECK_LIB(
-	[resolv],
-	[gethostbyname],
-	[SOCKETS_LIBS="${SOCKETS_LIBS} -lresolv"]
-)
-AC_SUBST([SOCKETS_LIBS])
+LIBS="${old_LIBS}"
 
 AC_CHECK_LIB(
 	[selinux],
Signature · 1 line
1.7.3.4
#156 lore raw

Re: [Openvpn-devel] [PATCH 2/6] build: autoconf: misc sockets fixups

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Alon Bar-Lev

53 ++++++++++++++++++++++++++++------------------------- 1 files changed, 28 insertions(+), 25 deletions(-)

ACK! Applied to master branches on -testing and -stable trees.

commit aee7428c53483ada74ecbea70316bbaf0c461f11

Author: Alon Bar-Lev <[email protected]...>
Date:   Sat Mar 24 09:58:34 2012 +0200
    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9wYvcACgkQDC186MBRfrp6/ACfaN9jemvJvFa6CU+0v9KiqgJm 04wAn33hLB0akTmeu58jKShZjIFthrq/
=Btpy
-----END PGP SIGNATURE-----

#157 lore raw

PATCH 3/6 tree: ChangeLog: add ident attribute

In reply to David Sommerseth
---
 .gitattributes |    1 +
 ChangeLog      |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)
 create mode 100644 .gitattributes
.gitattributes new file +1 -0
new file mode 100644
index 0000000..9cf9e1f
@@ -0,0 +1 @@
+ChangeLog ident
ChangeLog +2 -0
index d498344..d7cc77c 100644
@@ -1,6 +1,8 @@
 OpenVPN Change Log
 Copyright (C) 2002-2011 OpenVPN Technologies, Inc. <[email protected]...>
 
+$Id$
+
 2012.02.21 -- Version 2.3-alpha1
 Adriaan de Jong (127):
       Added Doxygen doxyfile
Signature · 1 line
1.7.3.4
#158 lore raw

Re: [Openvpn-devel] [PATCH 3/6] tree: ChangeLog: add ident attribute

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 11 lines · Alon Bar-Lev

--- .gitattributes | 1 + ChangeLog | 2 ++ 2 files changed,
3 insertions(+), 0 deletions(-) create mode 100644 .gitattributes

.gitattributes new file mode 100644 renamed from .gitattributes +0 -0
index 0000000..9cf9e1f --- /dev/null +++ b/.gitattributes @@ -0,0 +1

@@ +ChangeLog ident diff --git a/ChangeLog b/ChangeLog index d498344..d7cc77c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ OpenVPN Change Log Copyright (C) 2002-2011 OpenVPN Technologies, Inc. <[email protected]...>

+$Id$ +

What is the purpose of this change?

kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9wNWEACgkQDC186MBRfrqE8wCeJXzMntgvqVJG52zqP0u4YJA/ mCMAnRXr5Uu7f04U300O/7ycFOCFB5rt
=htU2
-----END PGP SIGNATURE-----

#159 lore raw

Re: [Openvpn-devel] [PATCH 3/6] tree: ChangeLog: add ident attribute

Quoted 15 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · Alon Bar-Lev

--- .gitattributes |    1 + ChangeLog      |    2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) create mode 100644 .gitattributes

.gitattributes new file mode 100644 renamed from .gitattributes +0 -0
index 0000000..9cf9e1f --- /dev/null +++ b/.gitattributes @@ -0,0 +1

@@ +ChangeLog ident diff --git a/ChangeLog b/ChangeLog index d498344..d7cc77c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ OpenVPN Change Log Copyright (C) 2002-2011 OpenVPN Technologies, Inc. <[email protected]...>

Quoted 3 lines
Quoted 1 line

+$Id$ +

What is the purpose of this change?

Oh...
I remembered that this was in tree long ago[1], thought that it was dropped out when moving to git not intentionally.

If otherwise, ignore this patch.

It is nice to see the revision of the changelog as most probably it is the last revision before release. So if one forget to tag or something the data is available.

Alon.

[1] http://svn.openvpn.net/projects/openvpn/branches/2.0/openvpn/ChangeLog

#160 lore raw

Re: [Openvpn-devel] [PATCH 3/6] tree: ChangeLog: add ident attribute

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 21 lines · Alon Bar-Lev
Quoted 15 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 11 lines · Alon Bar-Lev

--- .gitattributes | 1 + ChangeLog | 2 ++ 2 files
changed, 3 insertions(+), 0 deletions(-) create mode 100644 .gitattributes

.gitattributes new file mode 100644 renamed from .gitattributes +1 -0
index 0000000..9cf9e1f --- /dev/null +++ b/.gitattributes @@ -0,0
+1 @@ +ChangeLog ident diff --git a/ChangeLog b/ChangeLog index 

d498344..d7cc77c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ OpenVPN Change Log Copyright (C) 2002-2011 OpenVPN Technologies, Inc. <[email protected]...>

Quoted 3 lines
Quoted 1 line

+$Id$ +

What is the purpose of this change?

Quoted 8 lines

Oh... I remembered that this was in tree long ago[1], thought that it was dropped out when moving to git not intentionally.

If otherwise, ignore this patch.

It is nice to see the revision of the changelog as most probably it is the last revision before release. So if one forget to tag or something the data is available.

Yeah, I agree that such markers may make sense in some cases. But with git, the closest you can get to make this useful is to use .gitattributes which can be told to update this with the blob sha reference of the ChangeLog file. But that's not much helpful in the end. So I rather suggest we drop this one.

There's a rather sane discussion here on this topic:
<http://stackoverflow.com/questions/384108/moving-from-cvs-to-git-id-equivalent>

Currently, I update ChangeLog when tagging the tree when we're about to do a new release. I use the output of git shortlog as a summary. This information is also available in the message blob of signed tags as well.
This way, the ChangeLog is always updated with all committed changes,
and for a more verbose changelog, you have 'git log' (or the git web UI).

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9wSQcACgkQDC186MBRfrr3VwCfa+4ndOkOa62QTT5TGSOQTfN1 MkoAn3ZaD4DTvFtvRzCoNS+60l2riN6J
=2JQG
-----END PGP SIGNATURE-----

A message that is not in the archive (sent off-list or not yet received): [email protected]...

#162 lore raw

Re: [Openvpn-devel] [PATCH 3/6] tree: ChangeLog: add ident attribute

Quoted 55 lines · Alon Bar-Lev
Quoted 40 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 21 lines · Alon Bar-Lev
Quoted 15 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 11 lines · Alon Bar-Lev

--- .gitattributes |    1 + ChangeLog      |    2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) create mode 100644 .gitattributes

.gitattributes new file mode 100644 renamed from .gitattributes +1 -0
index 0000000..9cf9e1f --- /dev/null +++ b/.gitattributes @@ -0,0
+1 @@ +ChangeLog ident diff --git a/ChangeLog b/ChangeLog index

d498344..d7cc77c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ OpenVPN Change Log Copyright (C) 2002-2011 OpenVPN Technologies, Inc. <[email protected]...>

Quoted 3 lines
Quoted 1 line

+$Id$ +

What is the purpose of this change?

Quoted 8 lines

Oh... I remembered that this was in tree long ago[1], thought that it was dropped out when moving to git not intentionally.

If otherwise, ignore this patch.

It is nice to see the revision of the changelog as most probably it is the last revision before release. So if one forget to tag or something the data is available.

Yeah, I agree that such markers may make sense in some cases.  But with git, the closest you can get to make this useful is to use .gitattributes which can be told to update this with the blob sha reference of the ChangeLog file.  But that's not much helpful in the end.  So I rather suggest we drop this one.

Quoted 8 lines

There's a rather sane discussion here on this topic:
<http://stackoverflow.com/questions/384108/moving-from-cvs-to-git-id-equivalent>

Currently, I update ChangeLog when tagging the tree when we're about to do a new release.  I use the output of git shortlog as a summary.  This information is also available in the message blob of signed tags as well. This way, the ChangeLog is always updated with all committed changes, and for a more verbose changelog, you have 'git log' (or the git web UI).

OK.
Drop it.

Alon.

#163 lore raw

PATCH 4/6 build: msvc: upgrade to Visual Studio 2010 + fixups

In reply to David Sommerseth
---
 .gitignore                                     |    2 +
 build/msvc/msvc-generate/Makefile.am           |    2 +-
 build/msvc/msvc-generate/msvc-generate.vcproj  |   74 ---
 build/msvc/msvc-generate/msvc-generate.vcxproj |   69 +++
 msvc-build.bat                                 |   27 +-
 msvc-dev.bat                                   |   19 +-
 msvc-env.bat                                   |    7 +-
 openvpn.sln                                    |   90 ++--
 src/compat/Makefile.am                         |    3 +-
 src/compat/compat.vcproj                       |  197 ------
 src/compat/compat.vcxproj                      |   87 +++
 src/compat/compat.vcxproj.filters              |   42 ++
 src/openvpn/Makefile.am                        |    3 +-
 src/openvpn/openvpn.vcproj                     |  777 ------------------------
 src/openvpn/openvpn.vcxproj                    |  261 ++++++++
 src/openvpn/openvpn.vcxproj.filters            |  458 ++++++++++++++
 src/openvpnserv/Makefile.am                    |    3 +-
 src/openvpnserv/openvpnserv.vcproj             |  209 -------
 src/openvpnserv/openvpnserv.vcxproj            |  112 ++++
 src/openvpnserv/openvpnserv.vcxproj.filters    |   35 ++
 20 files changed, 1153 insertions(+), 1324 deletions(-)
 delete mode 100644 build/msvc/msvc-generate/msvc-generate.vcproj
 create mode 100644 build/msvc/msvc-generate/msvc-generate.vcxproj
 delete mode 100644 src/compat/compat.vcproj
 create mode 100644 src/compat/compat.vcxproj
 create mode 100644 src/compat/compat.vcxproj.filters
 delete mode 100644 src/openvpn/openvpn.vcproj
 create mode 100644 src/openvpn/openvpn.vcxproj
 create mode 100644 src/openvpn/openvpn.vcxproj.filters
 delete mode 100644 src/openvpnserv/openvpnserv.vcproj
 create mode 100644 src/openvpnserv/openvpnserv.vcxproj
 create mode 100644 src/openvpnserv/openvpnserv.vcxproj.filters
.gitignore +2 -0
index 2f72ed8..60b9433 100644
@@ -10,6 +10,8 @@
 *.suo
 *.ncb
 *.vcproj.*
+*.vcxproj.user
+*.sln.cache
 *.log
 Release
 Debug
build/msvc/msvc-generate/Makefile.am +1 -1
index 035ae22..539fb6c 100644
@@ -13,6 +13,6 @@ MAINTAINERCLEANFILES = \
 	$(srcdir)/Makefile.in
 
 dist_noinst_DATA = \
-	msvc-generate.vcproj \
+	msvc-generate.vcxproj \
 	Makefile.mak \
 	msvc-generate.js
build/msvc/msvc-generate/msvc-generate.vcproj deleted +0 -74

74 lines not on this page · raw message

build/msvc/msvc-generate/msvc-generate.vcxproj new file +69 -0

70 lines not on this page · raw message

msvc-build.bat +20 -7
index 02a396c..01417d1 100644
@@ -1,23 +1,37 @@
 @echo off
-
 rem Copyright (C) 2008-2012 Alon Bar-Lev <[email protected]...>
 
-call msvc-env.bat
-
 @rem this stupid command needed for SetEnv.cmd to operate
 setlocal ENABLEDELAYEDEXPANSION
 
+call msvc-env.bat
+
 set PLATFORMS=Win32
 set CONFIGURATIONS=Release
 
-call "%VCHOME%\bin\vcvars32.bat"
+if exist "%VCHOME%\vcvarsall.bat" (
+	call "%VCHOME%\vcvarsall.bat"
+) else if exist "%VCHOME%\bin\vcvars32.bat" (
+	call "%VCHOME%\bin\vcvars32.bat"
+) else (
+	echo Cannot detect visual studio
+	goto error
+)
+
+msbuild /help > nul 2>&1
+if errorlevel 1 set DO_VCBUILD=1
 
 for %%p in (%PLATFORMS%) do (
 	for %%c in (%CONFIGURATIONS%) do (
 		rmdir /q /s %SOURCEBASE%\%%p\%%c > nul 2>&1
 
-		vcbuild /errfile:error.log /showenv %SOLUTION% /rebuild /platform:%%p "%%c|%%p"
-		for %%f in (error.log) do if %%~zf GTR 0 goto error
+		if "%DO_VCBUILD%" NEQ "" (
+			vcbuild /errfile:error.log /showenv "%SOLUTION%" /rebuild /platform:%%p "%%c|%%p"
+			for %%f in (error.log) do if %%~zf GTR 0 goto error
+		) else  (
+			msbuild "%SOLUTION%" /p:Configuration="%%c" /p:Platform="%%p"
+			if errorlevel 1 goto error
+		)
 	)
 )
 
@@ -25,7 +39,6 @@ exit /b 0
 goto end
 
 :error
-if "%1" NEQ "batch" pause
 exit /b 1
 goto end
 
msvc-dev.bat +18 -1
index 671a56d..4dac172 100644
@@ -4,6 +4,23 @@ setlocal
 cd %0\..
 call msvc-env.bat
 
-start "" "%VSHOME%\Common7\IDE\devenv.exe" %SOLUTION%
+if exist "%VSHOME%\Common7\IDE\VCExpress.exe" (
+	set IDE=%VSHOME%\Common7\IDE\VCExpress.exe
+) else if exist "%VSHOME%\Common7\IDE\devenv.exe" (
+	set IDE=%VSHOME%\Common7\IDE\devenv.exe
+) else (
+	echo "Cannot detect visual studio environment"
+	goto error
+)
+start "" "%IDE%" "%SOLUTION%"
+
+exit /b 0
+goto end
+
+:error
+exit /b 1
+goto end
+
+:end
 
 endlocal
msvc-env.bat +4 -3
index e37757b..3c9eb5b 100644
@@ -6,9 +6,10 @@ rem Put your own settings at msvc-env-local.bat
 if exist msvc-env-local.bat call msvc-env-local.bat
 
 if "%ProgramFiles(x86)%"=="" set ProgramFiles(x86)=%ProgramFiles%
-if "%VS90COMNTOOLS%"=="" set VS90COMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\Common7\Tools\
-if "%VSHOME%"=="" set VSHOME=%VS90COMNTOOLS%..\..
-if "%VCHOME%"=="" set VCHOME=%VSHOME%\VC
+if "%VSCOMNTOOLS%"=="" SET VSCOMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\Tools
+if "%VSCOMNTOOLS%"=="" SET VSCOMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\Common7\Tools
+if "%VSHOME%"=="" SET VSHOME=%VSCOMNTOOLS%\..\..
+if "%VCHOME%"=="" SET VCHOME=%VSHOME%\VC
 
 set SOURCEBASE=%cd%
 set SOLUTION=openvpn.sln
openvpn.sln +38 -52

90 lines not on this page · raw message

src/compat/Makefile.am +2 -1
index 91b7f40..5ee35f7 100644
@@ -13,7 +13,8 @@ MAINTAINERCLEANFILES = \
 	$(srcdir)/Makefile.in
 
 EXTRA_DIST = \
-	compat.vcproj
+	compat.vcxproj \
+	compat.vcxproj.filters
 
 noinst_LTLIBRARIES = libcompat.la
 
src/compat/compat.vcproj deleted +0 -197

197 lines not on this page · raw message

src/compat/compat.vcxproj new file +87 -0

88 lines not on this page · raw message

src/compat/compat.vcxproj.filters new file +42 -0

43 lines not on this page · raw message

src/openvpn/Makefile.am +2 -1
index 1410021..4e485e7 100644
@@ -15,7 +15,8 @@ MAINTAINERCLEANFILES = \
 	$(srcdir)/Makefile.in
 
 EXTRA_DIST = \
-	openvpn.vcproj
+	openvpn.vcxproj \
+	openvpn.vcxproj.filters
 
 INCLUDES = \
 	-I$(top_srcdir)/include \
src/openvpn/openvpn.vcproj deleted +0 -777

777 lines not on this page · raw message

src/openvpn/openvpn.vcxproj new file +261 -0

262 lines not on this page · raw message

src/openvpn/openvpn.vcxproj.filters new file +458 -0

459 lines not on this page · raw message

src/openvpnserv/Makefile.am +2 -1
index 8584b06..a989c25 100644
@@ -14,7 +14,8 @@ include $(top_srcdir)/build/ltrc.inc
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
 
 EXTRA_DIST = \
-	openvpnserv.vcproj
+	openvpnserv.vcxproj \
+	openvpnserv.vcxproj.filters
 
 if WIN32
 sbin_PROGRAMS = openvpnserv
src/openvpnserv/openvpnserv.vcproj deleted +0 -209

209 lines not on this page · raw message

src/openvpnserv/openvpnserv.vcxproj new file +112 -0

113 lines not on this page · raw message

src/openvpnserv/openvpnserv.vcxproj.filters new file +35 -0
new file mode 100644
index 0000000..a6f8ecc
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="openvpnserv.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="service.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="service.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="openvpnserv_resources.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
Signature · 1 line
1.7.3.4
#164 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

Quoted 25 lines · Alon Bar-Lev

---
 .gitignore                                     |    2 + build/msvc/msvc-generate/Makefile.am           |    2 +- build/msvc/msvc-generate/msvc-generate.vcproj  |   74 --- build/msvc/msvc-generate/msvc-generate.vcxproj |   69 +++ msvc-build.bat                                 |   27 +- msvc-dev.bat                                   |   19 +- msvc-env.bat                                   |    7 +- openvpn.sln                                    |   90 ++-- src/compat/Makefile.am                         |    3 +- src/compat/compat.vcproj                       |  197 ------ src/compat/compat.vcxproj                      |   87 +++ src/compat/compat.vcxproj.filters              |   42 ++ src/openvpn/Makefile.am                        |    3 +- src/openvpn/openvpn.vcproj                     |  777
------------------------
 src/openvpn/openvpn.vcxproj                    |  261 ++++++++ src/openvpn/openvpn.vcxproj.filters            |  458 ++++++++++++++ src/openvpnserv/Makefile.am                    |    3 +- src/openvpnserv/openvpnserv.vcproj             |  209 ------- src/openvpnserv/openvpnserv.vcxproj            |  112 ++++ src/openvpnserv/openvpnserv.vcxproj.filters    |   35 ++

 20 files changed, 1153 insertions(+), 1324 deletions(-)
Quoted 11 lines

 delete mode 100644 build/msvc/msvc-generate/msvc-generate.vcproj create mode 100644 build/msvc/msvc-generate/msvc-generate.vcxproj delete mode 100644 src/compat/compat.vcproj
 create mode 100644 src/compat/compat.vcxproj
 create mode 100644 src/compat/compat.vcxproj.filters delete mode 100644 src/openvpn/openvpn.vcproj
 create mode 100644 src/openvpn/openvpn.vcxproj
 create mode 100644 src/openvpn/openvpn.vcxproj.filters delete mode 100644 src/openvpnserv/openvpnserv.vcproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj.filters

David,
What with this one?
No point in supporting visual studio 2008 at 2012....

Alon.

#165 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 36 lines · Alon Bar-Lev
Quoted 20 lines · Alon Bar-Lev
|    2 + build/msvc/msvc-generate/Makefile.am           |    2 +- 
build/msvc/msvc-generate/msvc-generate.vcproj  |   74 --- 
build/msvc/msvc-generate/msvc-generate.vcxproj |   69 +++ 
msvc-build.bat                                 |   27 +- 
msvc-dev.bat                                   |   19 +- 
msvc-env.bat                                   |    7 +- openvpn.sln
|   90 ++-- src/compat/Makefile.am                         |    3
+- src/compat/compat.vcproj                       |  197 ------ 
src/compat/compat.vcxproj                      |   87 +++ 
src/compat/compat.vcxproj.filters              |   42 ++ 
src/openvpn/Makefile.am                        |    3 +- 
src/openvpn/openvpn.vcproj                     |  777 
------------------------ src/openvpn/openvpn.vcxproj
|  261 ++++++++ src/openvpn/openvpn.vcxproj.filters            |
458 ++++++++++++++ src/openvpnserv/Makefile.am                    |
3 +- src/openvpnserv/openvpnserv.vcproj             |  209 ------- 
src/openvpnserv/openvpnserv.vcxproj            |  112 ++++ 
src/openvpnserv/openvpnserv.vcxproj.filters    |   35 ++ 20 files
Quoted 12 lines

changed, 1153 insertions(+), 1324 deletions(-) delete mode 100644 build/msvc/msvc-generate/msvc-generate.vcproj create mode 100644 build/msvc/msvc-generate/msvc-generate.vcxproj delete mode 100644 src/compat/compat.vcproj create mode 100644 src/compat/compat.vcxproj create mode 100644 src/compat/compat.vcxproj.filters delete mode 100644 src/openvpn/openvpn.vcproj create mode 100644 src/openvpn/openvpn.vcxproj create mode 100644 src/openvpn/openvpn.vcxproj.filters delete mode 100644 src/openvpnserv/openvpnserv.vcproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj.filters

Quoted 2 lines

David, What with this one? No point in supporting visual studio 2008 at 2012....

I don't have access to Visual Studio environments, so I'd rather see someone else ack this patch. But unless it doesn't get any NACKs within the next week, I'll pull it using the lazy-consensus approach.

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9zSrIACgkQDC186MBRfrrAjQCgkUjV2GUgso6PZPZMDaY3N0rl ONcAnixWsChRoFOjW/qkXpu1pnnQ2y2p
=FdA0
-----END PGP SIGNATURE-----

#166 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

In reply to Alon Bar-Lev

Hi,

This looks ok, provided we don't need Visual Studio for official releases anymore (signing the installer, openvpn.exe and tap-driver). The version I had to use for 2.3-alpha1 and earlier was VS2008. I doubt James minds either, as he's still using his old Python build system. When he's ready to move on, the upgrade license costs around $500[1] - provided that he even wants/needs to build with Visual Studio at that point.

ACK.

Samuli

[1]
<http://searchwindevelopment.techtarget.com/news/1347126/Microsoft-cuts-Visual-Studio-2008-upgrade-prices-as-VS-2010-looms>

Quoted 2,706 lines
---
 .gitignore                                     |    2 +
 build/msvc/msvc-generate/Makefile.am           |    2 +-
 build/msvc/msvc-generate/msvc-generate.vcproj  |   74 ---
 build/msvc/msvc-generate/msvc-generate.vcxproj |   69 +++
 msvc-build.bat                                 |   27 +-
 msvc-dev.bat                                   |   19 +-
 msvc-env.bat                                   |    7 +-
 openvpn.sln                                    |   90 ++--
 src/compat/Makefile.am                         |    3 +-
 src/compat/compat.vcproj                       |  197 ------
 src/compat/compat.vcxproj                      |   87 +++
 src/compat/compat.vcxproj.filters              |   42 ++
 src/openvpn/Makefile.am                        |    3 +-
 src/openvpn/openvpn.vcproj                     |  777 ------------------------
 src/openvpn/openvpn.vcxproj                    |  261 ++++++++
 src/openvpn/openvpn.vcxproj.filters            |  458 ++++++++++++++
 src/openvpnserv/Makefile.am                    |    3 +-
 src/openvpnserv/openvpnserv.vcproj             |  209 -------
 src/openvpnserv/openvpnserv.vcxproj            |  112 ++++
 src/openvpnserv/openvpnserv.vcxproj.filters    |   35 ++
 20 files changed, 1153 insertions(+), 1324 deletions(-)
 delete mode 100644 build/msvc/msvc-generate/msvc-generate.vcproj
 create mode 100644 build/msvc/msvc-generate/msvc-generate.vcxproj
 delete mode 100644 src/compat/compat.vcproj
 create mode 100644 src/compat/compat.vcxproj
 create mode 100644 src/compat/compat.vcxproj.filters
 delete mode 100644 src/openvpn/openvpn.vcproj
 create mode 100644 src/openvpn/openvpn.vcxproj
 create mode 100644 src/openvpn/openvpn.vcxproj.filters
 delete mode 100644 src/openvpnserv/openvpnserv.vcproj
 create mode 100644 src/openvpnserv/openvpnserv.vcxproj
 create mode 100644 src/openvpnserv/openvpnserv.vcxproj.filters
.gitignore +2 -0
index 2f72ed8..60b9433 100644
@@ -10,6 +10,8 @@
 *.suo
 *.ncb
 *.vcproj.*
+*.vcxproj.user
+*.sln.cache
 *.log
 Release
 Debug
build/msvc/msvc-generate/Makefile.am +1 -1
index 035ae22..539fb6c 100644
@@ -13,6 +13,6 @@ MAINTAINERCLEANFILES = \
        $(srcdir)/Makefile.in
 
 dist_noinst_DATA = \
-       msvc-generate.vcproj \
+       msvc-generate.vcxproj \
        Makefile.mak \
        msvc-generate.js
build/msvc/msvc-generate/msvc-generate.vcproj deleted +0 -74
deleted file mode 100644
index 3b7dc18..0000000
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-       ProjectType="Visual C++"
-       Version="9.00"
-       Name="msvc-generate"
-       ProjectGUID="{8598C2C8-34C4-47A1-99B0-7C295A890615}"
-       RootNamespace="msvc-generate"
-       Keyword="MakeFileProj"
-       TargetFrameworkVersion="196613"
-       >
-       <Platforms>
-               <Platform
-                       Name="Win32"
-               />
-       </Platforms>
-       <ToolFiles>
-       </ToolFiles>
-       <Configurations>
-               <Configuration
-                       Name="Debug|Win32"
-                       OutputDirectory="$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="0"
-                       >
-                       <Tool
-                               Name="VCNMakeTool"
-                               BuildCommandLine="nmake -f Makefile.mak all"
-                               ReBuildCommandLine="nmake -f Makefile.mak clean all"
-                               CleanCommandLine="nmake -f Makefile.mak clean"
-                               Output="config-msvc-version.h"
-                               PreprocessorDefinitions="WIN32;_DEBUG"
-                               IncludeSearchPath=""
-                               ForcedIncludes=""
-                               AssemblySearchPath=""
-                               ForcedUsingAssemblies=""
-                               CompileAsManaged=""
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|Win32"
-                       OutputDirectory="$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="0"
-                       >
-                       <Tool
-                               Name="VCNMakeTool"
-                               BuildCommandLine="nmake -f Makefile.mak all"
-                               ReBuildCommandLine="nmake -f Makefile.mak clean all"
-                               CleanCommandLine="nmake -f Makefile.mak clean"
-                               Output="config-msvc-version.h"
-                               PreprocessorDefinitions="WIN32;NDEBUG"
-                               IncludeSearchPath=""
-                               ForcedIncludes=""
-                               AssemblySearchPath=""
-                               ForcedUsingAssemblies=""
-                               CompileAsManaged=""
-                       />
-               </Configuration>
-       </Configurations>
-       <References>
-       </References>
-       <Files>
-               <File
-                       RelativePath=".\Makefile.mak"
-                       >
-               </File>
-               <File
-                       RelativePath=".\msc-generate.js"
-                       >
-               </File>
-       </Files>
-       <Globals>
-       </Globals>
-</VisualStudioProject>
build/msvc/msvc-generate/msvc-generate.vcxproj new file +69 -0
new file mode 100644
index 0000000..e6491ab
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{8598C2C8-34C4-47A1-99B0-7C295A890615}</ProjectGuid>
+    <RootNamespace>msvc-generate</RootNamespace>
+    <Keyword>MakeFileProj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Makefile</ConfigurationType>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Makefile</ConfigurationType>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake -f Makefile.mak all</NMakeBuildCommandLine>
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake -f Makefile.mak clean all</NMakeReBuildCommandLine>
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake -f Makefile.mak clean</NMakeCleanCommandLine>
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">config-msvc-version.h</NMakeOutput>
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake -f Makefile.mak all</NMakeBuildCommandLine>
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake -f Makefile.mak clean all</NMakeReBuildCommandLine>
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake -f Makefile.mak clean</NMakeCleanCommandLine>
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">config-msvc-version.h</NMakeOutput>
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+  </PropertyGroup>
+  <ItemDefinitionGroup>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="Makefile.mak" />
+    <None Include="msc-generate.js" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
msvc-build.bat +20 -7
index 02a396c..01417d1 100644
@@ -1,23 +1,37 @@
 @echo off
-
 rem Copyright (C) 2008-2012 Alon Bar-Lev <[email protected]...>
 
-call msvc-env.bat
-
 @rem this stupid command needed for SetEnv.cmd to operate
 setlocal ENABLEDELAYEDEXPANSION
 
+call msvc-env.bat
+
 set PLATFORMS=Win32
 set CONFIGURATIONS=Release
 
-call "%VCHOME%\bin\vcvars32.bat"
+if exist "%VCHOME%\vcvarsall.bat" (
+       call "%VCHOME%\vcvarsall.bat"
+) else if exist "%VCHOME%\bin\vcvars32.bat" (
+       call "%VCHOME%\bin\vcvars32.bat"
+) else (
+       echo Cannot detect visual studio
+       goto error
+)
+
+msbuild /help > nul 2>&1
+if errorlevel 1 set DO_VCBUILD=1
 
 for %%p in (%PLATFORMS%) do (
        for %%c in (%CONFIGURATIONS%) do (
                rmdir /q /s %SOURCEBASE%\%%p\%%c > nul 2>&1
 
-               vcbuild /errfile:error.log /showenv %SOLUTION% /rebuild /platform:%%p "%%c|%%p"
-               for %%f in (error.log) do if %%~zf GTR 0 goto error
+               if "%DO_VCBUILD%" NEQ "" (
+                       vcbuild /errfile:error.log /showenv "%SOLUTION%" /rebuild /platform:%%p "%%c|%%p"
+                       for %%f in (error.log) do if %%~zf GTR 0 goto error
+               ) else  (
+                       msbuild "%SOLUTION%" /p:Configuration="%%c" /p:Platform="%%p"
+                       if errorlevel 1 goto error
+               )
        )
 )
 
@@ -25,7 +39,6 @@ exit /b 0
 goto end
 
 :error
-if "%1" NEQ "batch" pause
 exit /b 1
 goto end
 
msvc-dev.bat +18 -1
index 671a56d..4dac172 100644
@@ -4,6 +4,23 @@ setlocal
 cd %0\..
 call msvc-env.bat
 
-start "" "%VSHOME%\Common7\IDE\devenv.exe" %SOLUTION%
+if exist "%VSHOME%\Common7\IDE\VCExpress.exe" (
+       set IDE=%VSHOME%\Common7\IDE\VCExpress.exe
+) else if exist "%VSHOME%\Common7\IDE\devenv.exe" (
+       set IDE=%VSHOME%\Common7\IDE\devenv.exe
+) else (
+       echo "Cannot detect visual studio environment"
+       goto error
+)
+start "" "%IDE%" "%SOLUTION%"
+
+exit /b 0
+goto end
+
+:error
+exit /b 1
+goto end
+
+:end
 
 endlocal
msvc-env.bat +4 -3
index e37757b..3c9eb5b 100644
@@ -6,9 +6,10 @@ rem Put your own settings at msvc-env-local.bat
 if exist msvc-env-local.bat call msvc-env-local.bat
 
 if "%ProgramFiles(x86)%"=="" set ProgramFiles(x86)=%ProgramFiles%
-if "%VS90COMNTOOLS%"=="" set VS90COMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\Common7\Tools\
-if "%VSHOME%"=="" set VSHOME=%VS90COMNTOOLS%..\..
-if "%VCHOME%"=="" set VCHOME=%VSHOME%\VC
+if "%VSCOMNTOOLS%"=="" SET VSCOMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\Tools
+if "%VSCOMNTOOLS%"=="" SET VSCOMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\Common7\Tools
+if "%VSHOME%"=="" SET VSHOME=%VSCOMNTOOLS%\..\..
+if "%VCHOME%"=="" SET VCHOME=%VSHOME%\VC
 
 set SOURCEBASE=%cd%
 set SOLUTION=openvpn.sln
openvpn.sln +38 -52
index be35d16..f832e7a 100644
@@ -1,52 +1,38 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpnserv", "src\openvpnserv\openvpnserv.vcproj", "{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}"
-       ProjectSection(ProjectDependencies) = postProject
-               {8598C2C8-34C4-47A1-99B0-7C295A890615} = {8598C2C8-34C4-47A1-99B0-7C295A890615}
-       EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpn", "src\openvpn\openvpn.vcproj", "{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}"
-       ProjectSection(ProjectDependencies) = postProject
-               {4B2E2719-E661-45D7-9203-F6F456B22F19} = {4B2E2719-E661-45D7-9203-F6F456B22F19}
-               {8598C2C8-34C4-47A1-99B0-7C295A890615} = {8598C2C8-34C4-47A1-99B0-7C295A890615}
-       EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{1AA03DE8-3F08-45B9-B4ED-D7769A445DF3}"
-       ProjectSection(SolutionItems) = preProject
-               config-msvc-version.h.in = config-msvc-version.h.in
-               config-msvc.h = config-msvc.h
-               version.m4 = version.m4
-       EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msvc-generate", "build\msvc\msvc-generate\msvc-generate.vcproj", "{8598C2C8-34C4-47A1-99B0-7C295A890615}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compat", "src\compat\compat.vcproj", "{4B2E2719-E661-45D7-9203-F6F456B22F19}"
-EndProject
-Global
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution
-               Debug|Win32 = Debug|Win32
-               Release|Win32 = Release|Win32
-       EndGlobalSection
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.ActiveCfg = Debug|Win32
-               {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.Build.0 = Debug|Win32
-               {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.ActiveCfg = Release|Win32
-               {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.Build.0 = Release|Win32
-               {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.ActiveCfg = Debug|Win32
-               {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.Build.0 = Debug|Win32
-               {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.ActiveCfg = Release|Win32
-               {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.Build.0 = Release|Win32
-               {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.ActiveCfg = Debug|Win32
-               {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.Build.0 = Debug|Win32
-               {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.ActiveCfg = Release|Win32
-               {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.Build.0 = Release|Win32
-               {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.ActiveCfg = Debug|Win32
-               {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.Build.0 = Debug|Win32
-               {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.ActiveCfg = Release|Win32
-               {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.Build.0 = Release|Win32
-       EndGlobalSection
-       GlobalSection(SolutionProperties) = preSolution
-               HideSolutionNode = FALSE
-       EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C++ Express 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpnserv", "src\openvpnserv\openvpnserv.vcxproj", "{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpn", "src\openvpn\openvpn.vcxproj", "{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msvc-generate", "build\msvc\msvc-generate\msvc-generate.vcxproj", "{8598C2C8-34C4-47A1-99B0-7C295A890615}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compat", "src\compat\compat.vcxproj", "{4B2E2719-E661-45D7-9203-F6F456B22F19}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Release|Win32 = Release|Win32
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.ActiveCfg = Debug|Win32
+               {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.Build.0 = Debug|Win32
+               {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.ActiveCfg = Release|Win32
+               {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.Build.0 = Release|Win32
+               {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.ActiveCfg = Debug|Win32
+               {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.Build.0 = Debug|Win32
+               {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.ActiveCfg = Release|Win32
+               {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.Build.0 = Release|Win32
+               {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.ActiveCfg = Debug|Win32
+               {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.Build.0 = Debug|Win32
+               {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.ActiveCfg = Release|Win32
+               {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.Build.0 = Release|Win32
+               {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.ActiveCfg = Debug|Win32
+               {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.Build.0 = Debug|Win32
+               {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.ActiveCfg = Release|Win32
+               {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.Build.0 = Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
src/compat/Makefile.am +2 -1
index 91b7f40..5ee35f7 100644
@@ -13,7 +13,8 @@ MAINTAINERCLEANFILES = \
        $(srcdir)/Makefile.in
 
 EXTRA_DIST = \
-       compat.vcproj
+       compat.vcxproj \
+       compat.vcxproj.filters
 
 noinst_LTLIBRARIES = libcompat.la
 
src/compat/compat.vcproj deleted +0 -197
deleted file mode 100644
index 43fc0c2..0000000
@@ -1,197 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-       ProjectType="Visual C++"
-       Version="9.00"
-       Name="compat"
-       ProjectGUID="{4B2E2719-E661-45D7-9203-F6F456B22F19}"
-       RootNamespace="compat"
-       Keyword="Win32Proj"
-       TargetFrameworkVersion="196613"
-       >
-       <Platforms>
-               <Platform
-                       Name="Win32"
-               />
-       </Platforms>
-       <ToolFiles>
-       </ToolFiles>
-       <Configurations>
-               <Configuration
-                       Name="Debug|Win32"
-                       OutputDirectory="$(SolutionDir)$(PlatformName)-Output\$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="4"
-                       CharacterSet="2"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               Optimization="0"
-                               AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
-                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB;$(CPPFLAGS)"
-                               MinimalRebuild="true"
-                               BasicRuntimeChecks="3"
-                               RuntimeLibrary="3"
-                               UsePrecompiledHeader="0"
-                               WarningLevel="3"
-                               DebugInformationFormat="4"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLibrarianTool"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|Win32"
-                       OutputDirectory="$(SolutionDir)$(PlatformName)-Output\$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="4"
-                       CharacterSet="2"
-                       WholeProgramOptimization="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               Optimization="2"
-                               EnableIntrinsicFunctions="true"
-                               AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
-                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;$(CPPFLAGS)"
-                               RuntimeLibrary="2"
-                               EnableFunctionLevelLinking="true"
-                               UsePrecompiledHeader="0"
-                               WarningLevel="3"
-                               DebugInformationFormat="3"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLibrarianTool"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-       </Configurations>
-       <References>
-       </References>
-       <Files>
-               <Filter
-                       Name="Source Files"
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-                       >
-                       <File
-                               RelativePath=".\compat-basename.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\compat-dirname.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\compat-gettimeofday.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\compat-inet_ntop.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\compat-inet_pton.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\compat-daemon.c"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="Header Files"
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-                       >
-                       <File
-                               RelativePath=".\compat.h"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="Resource Files"
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
-                       >
-               </Filter>
-       </Files>
-       <Globals>
-       </Globals>
-</VisualStudioProject>
src/compat/compat.vcxproj new file +87 -0
new file mode 100644
index 0000000..d872fa7
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{4B2E2719-E661-45D7-9203-F6F456B22F19}</ProjectGuid>
+    <RootNamespace>compat</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="compat-basename.c" />
+    <ClCompile Include="compat-dirname.c" />
+    <ClCompile Include="compat-gettimeofday.c" />
+    <ClCompile Include="compat-inet_ntop.c" />
+    <ClCompile Include="compat-inet_pton.c" />
+    <ClCompile Include="compat-daemon.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="compat.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
src/compat/compat.vcxproj.filters new file +42 -0
new file mode 100644
index 0000000..9576c51
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="compat-basename.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="compat-dirname.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="compat-gettimeofday.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="compat-inet_ntop.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="compat-inet_pton.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="compat-daemon.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="compat.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file
src/openvpn/Makefile.am +2 -1
index 1410021..4e485e7 100644
@@ -15,7 +15,8 @@ MAINTAINERCLEANFILES = \
        $(srcdir)/Makefile.in
 
 EXTRA_DIST = \
-       openvpn.vcproj
+       openvpn.vcxproj \
+       openvpn.vcxproj.filters
 
 INCLUDES = \
        -I$(top_srcdir)/include \
src/openvpn/openvpn.vcproj deleted +0 -777
deleted file mode 100644
index c1aa8a0..0000000
@@ -1,777 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-       ProjectType="Visual C++"
-       Version="9.00"
-       Name="openvpn"
-       ProjectGUID="{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}"
-       RootNamespace="openvpn"
-       Keyword="Win32Proj"
-       TargetFrameworkVersion="196613"
-       >
-       <Platforms>
-               <Platform
-                       Name="Win32"
-               />
-       </Platforms>
-       <ToolFiles>
-       </ToolFiles>
-       <Configurations>
-               <Configuration
-                       Name="Debug|Win32"
-                       OutputDirectory="$(SolutionDir)$(PlatformName)-Output\$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="1"
-                       CharacterSet="2"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               Optimization="0"
-                               AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
-                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS)"
-                               MinimalRebuild="true"
-                               BasicRuntimeChecks="3"
-                               RuntimeLibrary="3"
-                               UsePrecompiledHeader="0"
-                               WarningLevel="3"
-                               DebugInformationFormat="4"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               AdditionalIncludeDirectories="$(SOURCEBASE)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalDependencies="libeay32.lib ssleay32.lib lzo2.lib pkcs11-helper.dll.lib gdi32.lib ws2_32.lib wininet.lib crypt32.lib iphlpapi.lib winmm.lib shell32.lib"
-                               LinkIncremental="2"
-                               AdditionalLibraryDirectories="$(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib"
-                               GenerateDebugInformation="true"
-                               SubSystem="1"
-                               TargetMachine="1"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|Win32"
-                       OutputDirectory="$(SolutionDir)$(PlatformName)-Output\$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="1"
-                       CharacterSet="2"
-                       WholeProgramOptimization="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               Optimization="2"
-                               EnableIntrinsicFunctions="true"
-                               AdditionalIncludeDirectories="$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include"
-                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS)"
-                               RuntimeLibrary="2"
-                               EnableFunctionLevelLinking="true"
-                               UsePrecompiledHeader="0"
-                               WarningLevel="3"
-                               DebugInformationFormat="3"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               AdditionalIncludeDirectories="$(SOURCEBASE)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalDependencies="libeay32.lib ssleay32.lib lzo2.lib pkcs11-helper.dll.lib gdi32.lib ws2_32.lib wininet.lib crypt32.lib iphlpapi.lib winmm.lib shell32.lib"
-                               LinkIncremental="1"
-                               AdditionalLibraryDirectories="$(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib"
-                               GenerateDebugInformation="true"
-                               SubSystem="1"
-                               OptimizeReferences="2"
-                               EnableCOMDATFolding="2"
-                               TargetMachine="1"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-       </Configurations>
-       <References>
-       </References>
-       <Files>
-               <Filter
-                       Name="Source Files"
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-                       >
-                       <File
-                               RelativePath=".\base64.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\buffer.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\clinat.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\console.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\crypto.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\crypto_openssl.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\cryptoapi.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\dhcp.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\error.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\event.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\fdmisc.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\forward.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\fragment.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\gremlin.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\helper.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\httpdigest.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\init.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\interval.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\list.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\lladdr.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\lzo.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\manage.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mbuf.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\misc.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mroute.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mss.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mstats.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mtcp.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mtu.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mudp.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\multi.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ntlm.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\occ.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\openvpn.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\options.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\otime.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\packet_id.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\perf.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\pf.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ping.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\pkcs11.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\pkcs11_openssl.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\platform.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\plugin.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\pool.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\proto.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\proxy.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ps.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\push.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\reliable.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\route.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\schedule.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\session_id.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\shaper.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\sig.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\socket.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\socks.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ssl.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ssl_openssl.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ssl_verify.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ssl_verify_openssl.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\status.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\tun.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\win32.c"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="Header Files"
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-                       >
-                       <File
-                               RelativePath=".\base64.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\basic.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\buffer.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\circ_list.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\clinat.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\common.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\console.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\crypto.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\crypto_backend.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\crypto_openssl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\cryptoapi.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\dhcp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\errlevel.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\error.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\event.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\fdmisc.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\forward-inline.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\forward.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\fragment.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\gremlin.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\helper.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\httpdigest.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\init.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\integer.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\interval.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\list.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\lladdr.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\lzo.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\manage.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mbuf.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\memdbg.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\misc.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mroute.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mss.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mstats.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mtcp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mtu.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\mudp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\multi.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ntlm.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\occ-inline.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\occ.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\openvpn.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\options.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\otime.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\packet_id.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\perf.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\pf-inline.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\pf.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ping-inline.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ping.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\pkcs11.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\pkcs11_backend.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\platform.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\plugin.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\pool.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\proto.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\proxy.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ps.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\push.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\pushlist.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\reliable.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\route.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\schedule.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\session_id.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\shaper.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\sig.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\socket.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\socks.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ssl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ssl_backend.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ssl_common.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ssl_openssl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ssl_verify.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ssl_verify_backend.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\ssl_verify_openssl.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\status.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\syshead.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\tun.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\win32.h"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="Resource Files"
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
-                       >
-                       <File
-                               RelativePath=".\openvpn_win32_resources.rc"
-                               >
-                       </File>
-               </Filter>
-       </Files>
-       <Globals>
-       </Globals>
-</VisualStudioProject>
src/openvpn/openvpn.vcxproj new file +261 -0
new file mode 100644
index 0000000..51e19af
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}</ProjectGuid>
+    <RootNamespace>openvpn</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+    </ClCompile>
+    <ResourceCompile>
+      <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <Link>
+      <AdditionalDependencies>libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <ResourceCompile>
+      <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <Link>
+      <AdditionalDependencies>libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="base64.c" />
+    <ClCompile Include="buffer.c" />
+    <ClCompile Include="clinat.c" />
+    <ClCompile Include="console.c" />
+    <ClCompile Include="crypto.c" />
+    <ClCompile Include="crypto_openssl.c" />
+    <ClCompile Include="cryptoapi.c" />
+    <ClCompile Include="dhcp.c" />
+    <ClCompile Include="error.c" />
+    <ClCompile Include="event.c" />
+    <ClCompile Include="fdmisc.c" />
+    <ClCompile Include="forward.c" />
+    <ClCompile Include="fragment.c" />
+    <ClCompile Include="gremlin.c" />
+    <ClCompile Include="helper.c" />
+    <ClCompile Include="httpdigest.c" />
+    <ClCompile Include="init.c" />
+    <ClCompile Include="interval.c" />
+    <ClCompile Include="list.c" />
+    <ClCompile Include="lladdr.c" />
+    <ClCompile Include="lzo.c" />
+    <ClCompile Include="manage.c" />
+    <ClCompile Include="mbuf.c" />
+    <ClCompile Include="misc.c" />
+    <ClCompile Include="mroute.c" />
+    <ClCompile Include="mss.c" />
+    <ClCompile Include="mstats.c" />
+    <ClCompile Include="mtcp.c" />
+    <ClCompile Include="mtu.c" />
+    <ClCompile Include="mudp.c" />
+    <ClCompile Include="multi.c" />
+    <ClCompile Include="ntlm.c" />
+    <ClCompile Include="occ.c" />
+    <ClCompile Include="openvpn.c" />
+    <ClCompile Include="options.c" />
+    <ClCompile Include="otime.c" />
+    <ClCompile Include="packet_id.c" />
+    <ClCompile Include="perf.c" />
+    <ClCompile Include="pf.c" />
+    <ClCompile Include="ping.c" />
+    <ClCompile Include="pkcs11.c" />
+    <ClCompile Include="pkcs11_openssl.c" />
+    <ClCompile Include="platform.c" />
+    <ClCompile Include="plugin.c" />
+    <ClCompile Include="pool.c" />
+    <ClCompile Include="proto.c" />
+    <ClCompile Include="proxy.c" />
+    <ClCompile Include="ps.c" />
+    <ClCompile Include="push.c" />
+    <ClCompile Include="reliable.c" />
+    <ClCompile Include="route.c" />
+    <ClCompile Include="schedule.c" />
+    <ClCompile Include="session_id.c" />
+    <ClCompile Include="shaper.c" />
+    <ClCompile Include="sig.c" />
+    <ClCompile Include="socket.c" />
+    <ClCompile Include="socks.c" />
+    <ClCompile Include="ssl.c" />
+    <ClCompile Include="ssl_openssl.c" />
+    <ClCompile Include="ssl_verify.c" />
+    <ClCompile Include="ssl_verify_openssl.c" />
+    <ClCompile Include="status.c" />
+    <ClCompile Include="tun.c" />
+    <ClCompile Include="win32.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="base64.h" />
+    <ClInclude Include="basic.h" />
+    <ClInclude Include="buffer.h" />
+    <ClInclude Include="circ_list.h" />
+    <ClInclude Include="clinat.h" />
+    <ClInclude Include="common.h" />
+    <ClInclude Include="console.h" />
+    <ClInclude Include="crypto.h" />
+    <ClInclude Include="crypto_backend.h" />
+    <ClInclude Include="crypto_openssl.h" />
+    <ClInclude Include="cryptoapi.h" />
+    <ClInclude Include="dhcp.h" />
+    <ClInclude Include="errlevel.h" />
+    <ClInclude Include="error.h" />
+    <ClInclude Include="event.h" />
+    <ClInclude Include="fdmisc.h" />
+    <ClInclude Include="forward-inline.h" />
+    <ClInclude Include="forward.h" />
+    <ClInclude Include="fragment.h" />
+    <ClInclude Include="gremlin.h" />
+    <ClInclude Include="helper.h" />
+    <ClInclude Include="httpdigest.h" />
+    <ClInclude Include="init.h" />
+    <ClInclude Include="integer.h" />
+    <ClInclude Include="interval.h" />
+    <ClInclude Include="list.h" />
+    <ClInclude Include="lladdr.h" />
+    <ClInclude Include="lzo.h" />
+    <ClInclude Include="manage.h" />
+    <ClInclude Include="mbuf.h" />
+    <ClInclude Include="memdbg.h" />
+    <ClInclude Include="misc.h" />
+    <ClInclude Include="mroute.h" />
+    <ClInclude Include="mss.h" />
+    <ClInclude Include="mstats.h" />
+    <ClInclude Include="mtcp.h" />
+    <ClInclude Include="mtu.h" />
+    <ClInclude Include="mudp.h" />
+    <ClInclude Include="multi.h" />
+    <ClInclude Include="ntlm.h" />
+    <ClInclude Include="occ-inline.h" />
+    <ClInclude Include="occ.h" />
+    <ClInclude Include="openvpn.h" />
+    <ClInclude Include="options.h" />
+    <ClInclude Include="otime.h" />
+    <ClInclude Include="packet_id.h" />
+    <ClInclude Include="perf.h" />
+    <ClInclude Include="pf-inline.h" />
+    <ClInclude Include="pf.h" />
+    <ClInclude Include="ping-inline.h" />
+    <ClInclude Include="ping.h" />
+    <ClInclude Include="pkcs11.h" />
+    <ClInclude Include="pkcs11_backend.h" />
+    <ClInclude Include="platform.h" />
+    <ClInclude Include="plugin.h" />
+    <ClInclude Include="pool.h" />
+    <ClInclude Include="proto.h" />
+    <ClInclude Include="proxy.h" />
+    <ClInclude Include="ps.h" />
+    <ClInclude Include="push.h" />
+    <ClInclude Include="pushlist.h" />
+    <ClInclude Include="reliable.h" />
+    <ClInclude Include="route.h" />
+    <ClInclude Include="schedule.h" />
+    <ClInclude Include="session_id.h" />
+    <ClInclude Include="shaper.h" />
+    <ClInclude Include="sig.h" />
+    <ClInclude Include="socket.h" />
+    <ClInclude Include="socks.h" />
+    <ClInclude Include="ssl.h" />
+    <ClInclude Include="ssl_backend.h" />
+    <ClInclude Include="ssl_common.h" />
+    <ClInclude Include="ssl_openssl.h" />
+    <ClInclude Include="ssl_verify.h" />
+    <ClInclude Include="ssl_verify_backend.h" />
+    <ClInclude Include="ssl_verify_openssl.h" />
+    <ClInclude Include="status.h" />
+    <ClInclude Include="syshead.h" />
+    <ClInclude Include="tun.h" />
+    <ClInclude Include="win32.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="openvpn_win32_resources.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\build\msvc\msvc-generate\msvc-generate.vcxproj">
+      <Project>{8598c2c8-34c4-47a1-99b0-7c295a890615}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+    <ProjectReference Include="..\compat\compat.vcxproj">
+      <Project>{4b2e2719-e661-45d7-9203-f6f456b22f19}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
src/openvpn/openvpn.vcxproj.filters new file +458 -0
new file mode 100644
index 0000000..ec5e676
@@ -0,0 +1,458 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="base64.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="buffer.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="clinat.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="console.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="crypto.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="crypto_openssl.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="cryptoapi.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="dhcp.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="error.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="event.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="fdmisc.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="forward.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="fragment.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="gremlin.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="helper.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="httpdigest.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="init.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="interval.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="list.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="lladdr.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="lzo.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="manage.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mbuf.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="misc.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mroute.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mss.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mstats.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mtcp.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mtu.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mudp.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="multi.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ntlm.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="occ.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="openvpn.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="options.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="otime.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="packet_id.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="perf.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="pf.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ping.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="pkcs11.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="pkcs11_openssl.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="platform.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="plugin.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="pool.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="proto.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="proxy.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ps.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="push.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="reliable.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="route.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="schedule.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="session_id.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="shaper.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sig.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="socket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="socks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ssl.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ssl_openssl.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ssl_verify.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ssl_verify_openssl.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="status.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="tun.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="win32.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="base64.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="basic.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="buffer.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="circ_list.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="clinat.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="common.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="console.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="crypto.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="crypto_backend.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="crypto_openssl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="cryptoapi.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="dhcp.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="errlevel.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="error.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="event.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="fdmisc.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="forward-inline.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="forward.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="fragment.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="gremlin.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="helper.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="httpdigest.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="init.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="integer.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="interval.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="list.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="lladdr.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="lzo.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="manage.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="mbuf.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="memdbg.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="misc.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="mroute.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="mss.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="mstats.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="mtcp.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="mtu.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="mudp.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="multi.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ntlm.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="occ-inline.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="occ.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="openvpn.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="options.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="otime.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="packet_id.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="perf.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pf-inline.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pf.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ping-inline.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ping.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pkcs11.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pkcs11_backend.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="platform.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="plugin.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pool.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="proto.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="proxy.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ps.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="push.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pushlist.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="reliable.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="route.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="schedule.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="session_id.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="shaper.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="sig.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="socket.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="socks.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ssl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ssl_backend.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ssl_common.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ssl_openssl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ssl_verify.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ssl_verify_backend.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ssl_verify_openssl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="status.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="syshead.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="tun.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="win32.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="openvpn_win32_resources.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
src/openvpnserv/Makefile.am +2 -1
index 8584b06..a989c25 100644
@@ -14,7 +14,8 @@ include $(top_srcdir)/build/ltrc.inc
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
 
 EXTRA_DIST = \
-       openvpnserv.vcproj
+       openvpnserv.vcxproj \
+       openvpnserv.vcxproj.filters
 
 if WIN32
 sbin_PROGRAMS = openvpnserv
src/openvpnserv/openvpnserv.vcproj deleted +0 -209
deleted file mode 100644
index 4c55561..0000000
@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-       ProjectType="Visual C++"
-       Version="9.00"
-       Name="openvpnserv"
-       ProjectGUID="{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}"
-       RootNamespace="openvpnserv"
-       Keyword="Win32Proj"
-       TargetFrameworkVersion="196613"
-       >
-       <Platforms>
-               <Platform
-                       Name="Win32"
-               />
-       </Platforms>
-       <ToolFiles>
-       </ToolFiles>
-       <Configurations>
-               <Configuration
-                       Name="Debug|Win32"
-                       OutputDirectory="$(SolutionDir)$(PlatformName)-Output\$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="1"
-                       CharacterSet="2"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               Optimization="0"
-                               AdditionalIncludeDirectories="$(SOURCEBASE)"
-                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS)"
-                               MinimalRebuild="true"
-                               BasicRuntimeChecks="3"
-                               RuntimeLibrary="3"
-                               UsePrecompiledHeader="0"
-                               WarningLevel="3"
-                               DebugInformationFormat="4"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               AdditionalIncludeDirectories="$(SOURCEBASE)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               LinkIncremental="2"
-                               GenerateDebugInformation="true"
-                               SubSystem="1"
-                               TargetMachine="1"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|Win32"
-                       OutputDirectory="$(SolutionDir)$(PlatformName)-Output\$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="1"
-                       CharacterSet="2"
-                       WholeProgramOptimization="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               Optimization="2"
-                               EnableIntrinsicFunctions="true"
-                               AdditionalIncludeDirectories="$(SOURCEBASE)"
-                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS)"
-                               RuntimeLibrary="2"
-                               EnableFunctionLevelLinking="true"
-                               UsePrecompiledHeader="0"
-                               WarningLevel="3"
-                               DebugInformationFormat="3"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               AdditionalIncludeDirectories="$(SOURCEBASE)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               LinkIncremental="1"
-                               GenerateDebugInformation="true"
-                               SubSystem="1"
-                               OptimizeReferences="2"
-                               EnableCOMDATFolding="2"
-                               TargetMachine="1"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-       </Configurations>
-       <References>
-       </References>
-       <Files>
-               <Filter
-                       Name="Source Files"
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-                       >
-                       <File
-                               RelativePath=".\openvpnserv.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\service.c"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="Header Files"
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-                       >
-                       <File
-                               RelativePath=".\service.h"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="Resource Files"
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
-                       >
-                       <File
-                               RelativePath=".\openvpnserv_resources.rc"
-                               >
-                       </File>
-               </Filter>
-       </Files>
-       <Globals>
-       </Globals>
-</VisualStudioProject>
src/openvpnserv/openvpnserv.vcxproj new file +112 -0
new file mode 100644
index 0000000..f2c0071
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}</ProjectGuid>
+    <RootNamespace>openvpnserv</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+    </ClCompile>
+    <ResourceCompile>
+      <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <ResourceCompile>
+      <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ResourceCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="openvpnserv.c" />
+    <ClCompile Include="service.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="service.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="openvpnserv_resources.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\build\msvc\msvc-generate\msvc-generate.vcxproj">
+      <Project>{8598c2c8-34c4-47a1-99b0-7c295a890615}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
src/openvpnserv/openvpnserv.vcxproj.filters new file +35 -1
new file mode 100644
index 0000000..a6f8ecc
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="openvpnserv.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="service.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="service.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="openvpnserv_resources.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
--

1.7.3.4

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#167 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

2012/3/29 Samuli Seppänen <[email protected]...>:

Quoted 2 lines

When he's ready to move on, the upgrade license costs around $500[1] - provided that he even wants/needs to build with Visual Studio at that point.

You do not need to pay anything, the Visual Studio 2010 express is for free as much as I know.

Alon.

#168 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

In reply to Alon Bar-Lev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 19 lines · Alon Bar-Lev
|    2 + build/msvc/msvc-generate/Makefile.am           |    2 +- 
build/msvc/msvc-generate/msvc-generate.vcproj  |   74 --- 
build/msvc/msvc-generate/msvc-generate.vcxproj |   69 +++ 
msvc-build.bat                                 |   27 +- msvc-dev.bat
|   19 +- msvc-env.bat                                   |    7 +- 
openvpn.sln                                    |   90 ++-- 
src/compat/Makefile.am                         |    3 +- 
src/compat/compat.vcproj                       |  197 ------ 
src/compat/compat.vcxproj                      |   87 +++ 
src/compat/compat.vcxproj.filters              |   42 ++ 
src/openvpn/Makefile.am                        |    3 +- 
src/openvpn/openvpn.vcproj                     |  777
------------------------ src/openvpn/openvpn.vcxproj
|  261 ++++++++ src/openvpn/openvpn.vcxproj.filters            |  458
++++++++++++++ src/openvpnserv/Makefile.am                    |    3
+- src/openvpnserv/openvpnserv.vcproj             |  209 ------- 
src/openvpnserv/openvpnserv.vcxproj            |  112 ++++ 
src/openvpnserv/openvpnserv.vcxproj.filters    |   35 ++ 20 files
Quoted 11 lines

changed, 1153 insertions(+), 1324 deletions(-) delete mode 100644 build/msvc/msvc-generate/msvc-generate.vcproj create mode 100644 build/msvc/msvc-generate/msvc-generate.vcxproj delete mode 100644 src/compat/compat.vcproj create mode 100644 src/compat/compat.vcxproj create mode 100644 src/compat/compat.vcxproj.filters delete mode 100644 src/openvpn/openvpn.vcproj create mode 100644 src/openvpn/openvpn.vcxproj create mode 100644 src/openvpn/openvpn.vcxproj.filters delete mode 100644 src/openvpnserv/openvpnserv.vcproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj.filters

Applied to master branches on -testing and -stable trees.

commit 3c1971de878bb3658c38b0504f314d38b6b765d2

Author: Alon Bar-Lev <[email protected]...>
Date:   Sat Mar 24 09:58:36 2012 +0200
    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk90PW0ACgkQDC186MBRfroUVwCeLLO68J69XstVm9+0pm+I0PVc zysAnAgYqMa+Jp6UFQGa1H+vGQj98pxQ
=ZYPY
-----END PGP SIGNATURE-----

#169 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

This is not good.
Another issue of this MIME magic that should be avoided. VC files are CRLF, if we do not commit them this way, every time they change we see a complete rewrite.

If you do not want to pull, please do:

find . -name '*.sln' -or -name '*.vcxproj.*' | xargs unix2dos

And commit.

Quoted 67 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 19 lines · Alon Bar-Lev
|    2 + build/msvc/msvc-generate/Makefile.am           |    2 +-
build/msvc/msvc-generate/msvc-generate.vcproj  |   74 ---
build/msvc/msvc-generate/msvc-generate.vcxproj |   69 +++
msvc-build.bat                                 |   27 +- msvc-dev.bat
|   19 +- msvc-env.bat                                   |    7 +-
openvpn.sln                                    |   90 ++--
src/compat/Makefile.am                         |    3 +-
src/compat/compat.vcproj                       |  197 ------
src/compat/compat.vcxproj                      |   87 +++
src/compat/compat.vcxproj.filters              |   42 ++
src/openvpn/Makefile.am                        |    3 +-
src/openvpn/openvpn.vcproj                     |  777
------------------------ src/openvpn/openvpn.vcxproj
|  261 ++++++++ src/openvpn/openvpn.vcxproj.filters            |  458
++++++++++++++ src/openvpnserv/Makefile.am                    |    3
+- src/openvpnserv/openvpnserv.vcproj             |  209 -------
src/openvpnserv/openvpnserv.vcxproj            |  112 ++++
src/openvpnserv/openvpnserv.vcxproj.filters    |   35 ++ 20 files
Quoted 11 lines

changed, 1153 insertions(+), 1324 deletions(-) delete mode 100644 build/msvc/msvc-generate/msvc-generate.vcproj create mode 100644 build/msvc/msvc-generate/msvc-generate.vcxproj delete mode 100644 src/compat/compat.vcproj create mode 100644 src/compat/compat.vcxproj create mode 100644 src/compat/compat.vcxproj.filters delete mode 100644 src/openvpn/openvpn.vcproj create mode 100644 src/openvpn/openvpn.vcxproj create mode 100644 src/openvpn/openvpn.vcxproj.filters delete mode 100644 src/openvpnserv/openvpnserv.vcproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj.filters

Applied to master branches on -testing and -stable trees.

commit 3c1971de878bb3658c38b0504f314d38b6b765d2
Author: Alon Bar-Lev <[email protected]...>
Date:   Sat Mar 24 09:58:36 2012 +0200

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk90PW0ACgkQDC186MBRfroUVwCeLLO68J69XstVm9+0pm+I0PVc zysAnAgYqMa+Jp6UFQGa1H+vGQj98pxQ
=ZYPY
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#170 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 9 lines · Alon Bar-Lev

This is not good. Another issue of this MIME magic that should be avoided. VC files are CRLF, if we do not commit them this way, every time they change we see a complete rewrite.

If you do not want to pull, please do:

find . -name '*.sln' -or -name '*.vcxproj.*' | xargs unix2dos

And commit.

We had quite some clean-up rounds on CR/LF issues quite a while ago. After a lot of testing and searching the net, we found out that keeping the git tree NL only would be an advantage. And CR/LF issues would be avoided when setting 'git config --global core.autocrlf true' on Windows boxes. This makes git add CR/LF when checking out files from the repo automatically, and it will be stripped out when committing files.

It's also described here:
<https://community.openvpn.net/openvpn/wiki/GitCrashCourse#Otherneatfeaturestoenable>

Can you please double check if this works for you? Then we don't have to bother with the CR/LF issues at all, as it's mostly automatic.

kind regards,

David Sommerseth

Quoted 43 lines
Quoted 24 lines · Alon Bar-Lev
Quoted 24 lines
Quoted 24 lines

.gitignore | 2 + build/msvc/msvc-generate/Makefile.am

|    2 +- build/msvc/msvc-generate/msvc-generate.vcproj  |
74 --- build/msvc/msvc-generate/msvc-generate.vcxproj |   69
+++ msvc-build.bat                                 |   27 +-
msvc-dev.bat |   19 +- msvc-env.bat
|    7 +- openvpn.sln                                    |
90 ++-- src/compat/Makefile.am                         |    3
+- src/compat/compat.vcproj                       |  197
------ src/compat/compat.vcxproj                      |   87
+++ src/compat/compat.vcxproj.filters              |   42 ++ 
src/openvpn/Makefile.am                        |    3 +- 
src/openvpn/openvpn.vcproj                     |  777 
------------------------ src/openvpn/openvpn.vcxproj |  261
++++++++ src/openvpn/openvpn.vcxproj.filters            |
458 ++++++++++++++ src/openvpnserv/Makefile.am
|    3 +- src/openvpnserv/openvpnserv.vcproj             |
209 ------- src/openvpnserv/openvpnserv.vcxproj            |
112 ++++ src/openvpnserv/openvpnserv.vcxproj.filters    |

35 ++ 20 files changed, 1153 insertions(+), 1324 deletions(-) delete mode 100644 build/msvc/msvc-generate/msvc-generate.vcproj create mode 100644 build/msvc/msvc-generate/msvc-generate.vcxproj delete mode 100644 src/compat/compat.vcproj create mode 100644

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

src/compat/compat.vcxproj create mode 100644 src/compat/compat.vcxproj.filters delete mode 100644 src/openvpn/openvpn.vcproj create mode 100644 src/openvpn/openvpn.vcxproj create mode 100644 src/openvpn/openvpn.vcxproj.filters delete mode 100644 src/openvpnserv/openvpnserv.vcproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj create mode 100644 src/openvpnserv/openvpnserv.vcxproj.filters

Applied to master branches on -testing and -stable trees.

commit 3c1971de878bb3658c38b0504f314d38b6b765d2 Author: Alon
Bar-Lev <[email protected]...> Date: Sat Mar 24 09:58:36 2012
+0200

Quoted 12 lines

Samuli Seppänen <[email protected]...> Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth

Quoted 4 lines

------------------------------------------------------------------------------

This SF email is sponsosred by:

Quoted 6 lines
Quoted 5 lines

Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________ Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk90XOQACgkQDC186MBRfrriugCaA58VFgV1k15ebL/h0Uk4FExx u4MAnRL5oNuoLPym6qH3Jc/Rzf28ZcJP
=O/kG
-----END PGP SIGNATURE-----

#171 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

Quoted 22 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 9 lines · Alon Bar-Lev

This is not good. Another issue of this MIME magic that should be avoided. VC files are CRLF, if we do not commit them this way, every time they change we see a complete rewrite.

If you do not want to pull, please do:

find . -name '*.sln' -or -name '*.vcxproj.*' | xargs unix2dos

And commit.

We had quite some clean-up rounds on CR/LF issues quite a while ago. After a lot of testing and searching the net, we found out that keeping the git tree NL only would be an advantage.  And CR/LF issues would be avoided when setting 'git config --global core.autocrlf true' on Windows boxes.  This makes git add CR/LF when checking out files from the repo automatically, and it will be stripped out when committing files.

Quoted 5 lines

It's also described here:
<https://community.openvpn.net/openvpn/wiki/GitCrashCourse#Otherneatfeaturestoenable>

Can you please double check if this works for you?  Then we don't have to bother with the CR/LF issues at all, as it's mostly automatic.

No, this is no good.

First global configuration of repository is wrong, as people tend to have different global configurations.

Second, I don't trust the automatic detection of text files.

Third, there are files that must be CRLF no mater if I check it on cygwin, or Linux and use samba share to access the files I still need a valid configuration.

I suggest to remove this global setting and use local setting by suffix, something like:

.gitattributes
---
*.c eol=lf
*.h eol=lf
*.vc*proj* eol=crlf
*.sln eol=crlf
---

Alon.

#172 lore raw

PATCH 1/1 cleanup: add .gitattributes to control eol style explicitly

Having the text auto detection is a risk, as the detection may detect text files that are not text and vise versa.

Having global setting will create confusion and differentiate between users. So this patch also move this to local repository.

Having git to check out files differently in different OS is also a not correct, as checkouts may be used in shares or in *NIX emulation environments, so it have no effect.

Another issue is packaging, if we change out the tree differently in several OSes, we may have different package content, which is something that should be avoided.

Currently any editor of MS supports LF end of lines, so there is no need to convert source files while checking out.

The visual studio files should be stored as CRLF as they are generated by visual studio every save, in a way that CRLF are added.

I handled only the files that may be touch by MS users.

---
 .gitattributes |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
 create mode 100644 .gitattributes
.gitattributes new file +6 -0
new file mode 100644
index 0000000..7d779c7
@@ -0,0 +1,6 @@
+*.c eol=lf
+*.h eol=lf
+*.rc eol=lf
+*.txt eol=lf
+*.vc*proj* eol=crlf
+*.sln eol=crlf
Signature · 1 line
1.7.3.4
#173 lore raw

PATCH 1/1 cleanup: add .gitattributes to control eol style explicitly

Having the text auto detection is a risk, as the detection may detect text files that are not text and vise versa.

Having global setting will create confusion and differentiate between users. So this patch also move this to local repository.

Having git to check out files differently in different OS is also a not correct, as checkouts may be used in shares or in *NIX emulation environments, so it have no effect.

Another issue is packaging, if we change out the tree differently in several OSes, we may have different package content, which is something that should be avoided.

Currently any editor of MS supports LF end of lines, so there is no need to convert source files while checking out.

The visual studio files should be stored as CRLF as they are generated by visual studio every save, in a way that CRLF are added.

I handled only the files that may be touch by MS users.

---
 .gitattributes |    6 ++++++
 Makefile.am    |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)
 create mode 100644 .gitattributes
.gitattributes new file +6 -0
new file mode 100644
index 0000000..7d779c7
@@ -0,0 +1,6 @@
+*.c eol=lf
+*.h eol=lf
+*.rc eol=lf
+*.txt eol=lf
+*.vc*proj* eol=crlf
+*.sln eol=crlf
Makefile.am +1 -0
index 68aa0a8..ab3e3d2 100644
@@ -52,6 +52,7 @@ dist_doc_DATA = \
 
 dist_noinst_DATA = \
 	.gitignore \
+	.gitattributes \
 	PORTS \
 	README.IPv6 TODO.IPv6 \
 	README.polarssl \
Signature · 1 line
1.7.3.4
#174 lore raw

PATCH 1/1 cleanup: add .gitattributes to control eol style explicitly

Having the text auto detection is a risk, as the detection may detect text files that are not text and vise versa.

Having global setting will create confusion and differentiate between users. So this patch also move this to local repository.

Having git to check out files differently in different OS is also a not correct, as checkouts may be used in shares or in *NIX emulation environments, so it have no effect.

Another issue is packaging, if we change out the tree differently in several OSes, we may have different package content, which is something that should be avoided.

Currently any editor of MS supports LF end of lines, so there is no need to convert source files while checking out.

The visual studio files should be stored as CRLF as they are generated by visual studio every save, in a way that CRLF are added.

I handled only the files that may be touch by MS users.

---
 .gitattributes |    7 +++++++
 Makefile.am    |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)
 create mode 100644 .gitattributes
.gitattributes new file +7 -0
new file mode 100644
index 0000000..34463f9
@@ -0,0 +1,7 @@
+*.c eol=lf
+*.h eol=lf
+*.rc eol=lf
+*.txt eol=lf
+*.bat eol=lf
+*.vc*proj* eol=crlf
+*.sln eol=crlf
Makefile.am +1 -0
index 68aa0a8..ab3e3d2 100644
@@ -52,6 +52,7 @@ dist_doc_DATA = \
 
 dist_noinst_DATA = \
 	.gitignore \
+	.gitattributes \
 	PORTS \
 	README.IPv6 TODO.IPv6 \
 	README.polarssl \
Signature · 1 line
1.7.3.4
#175 lore raw

Re: [Openvpn-devel] [PATCH] cleanup: add .gitattributes to control eol style explicitly

Hi Alon,

2012/4/2 Alon Bar-Lev <[email protected]...>:

Quoted 5 lines

Having the text auto detection is a risk, as the detection may detect text files that are not text and vise versa.

Having global setting will create confusion and differentiate between users. So this patch also move this to local repository.

IMHO, this is a real benefit. Reduces the number of steps necessary to contribute and avoids line-ending mistakes for new contributions.

Quoted 8 lines

Having git to check out files differently in different OS is also a not correct, as checkouts may be used in shares or in *NIX emulation environments, so it have no effect.

Another issue is packaging, if we change out the tree differently in several OSes, we may have different package content, which is something that should be avoided.

Quoted 7 lines

Currently any editor of MS supports LF end of lines, so there is no need to convert source files while checking out.

The visual studio files should be stored as CRLF as they are generated by visual studio every save, in a way that CRLF are added.

I handled only the files that may be touch by MS users.

The rest I generally agree with, but don't have strong feelings about them.

.gitattributes line 7

Quoted 13 lines
.gitattributes new file +7 -0
new file mode 100644
index 0000000..34463f9
@@ -0,0 +1,7 @@
+*.c eol=lf
+*.h eol=lf
+*.rc eol=lf
+*.txt eol=lf
+*.bat eol=lf
+*.vc*proj* eol=crlf
+*.sln eol=crlf

Why not .rc and .bat as crlf too?

Apart from that, ACK.

Cheers
Fabian

#176 lore raw

Re: [Openvpn-devel] [PATCH] cleanup: add .gitattributes to control eol style explicitly

Quoted 30 lines · Fabian Knittel

Hi Alon,

2012/4/2 Alon Bar-Lev <[email protected]...>:

Quoted 5 lines

Having the text auto detection is a risk, as the detection may detect text files that are not text and vise versa.

Having global setting will create confusion and differentiate between users. So this patch also move this to local repository.

IMHO, this is a real benefit. Reduces the number of steps necessary to contribute and avoids line-ending mistakes for new contributions.

Quoted 8 lines

Having git to check out files differently in different OS is also a not correct, as checkouts may be used in shares or in *NIX emulation environments, so it have no effect.

Another issue is packaging, if we change out the tree differently in several OSes, we may have different package content, which is something that should be avoided.

Quoted 7 lines

Currently any editor of MS supports LF end of lines, so there is no need to convert source files while checking out.

The visual studio files should be stored as CRLF as they are generated by visual studio every save, in a way that CRLF are added.

I handled only the files that may be touch by MS users.

The rest I generally agree with, but don't have strong feelings about them.

Quoted 15 lines

.gitattributes line 7

Quoted 13 lines
.gitattributes new file +7 -0
new file mode 100644
index 0000000..34463f9
@@ -0,0 +1,7 @@
+*.c eol=lf
+*.h eol=lf
+*.rc eol=lf
+*.txt eol=lf
+*.bat eol=lf
+*.vc*proj* eol=crlf
+*.sln eol=crlf

Why not .rc and .bat as crlf too?

These sources are valid as LF only, unlike the .vc*, .sln they are not re-generated in different format every time saved, so keeping them in "UNIX" style will make it easier to maintain.

Quoted 5 lines

Apart from that, ACK.

Cheers
Fabian

#177 lore raw

Re: [Openvpn-devel] [PATCH] cleanup: add .gitattributes to control eol style explicitly

In reply to Alon Bar-Lev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 21 lines · Alon Bar-Lev

Having the text auto detection is a risk, as the detection may detect text files that are not text and vise versa.

Having global setting will create confusion and differentiate between users. So this patch also move this to local repository.

Having git to check out files differently in different OS is also a not correct, as checkouts may be used in shares or in *NIX emulation environments, so it have no effect.

Another issue is packaging, if we change out the tree differently in several OSes, we may have different package content, which is something that should be avoided.

Currently any editor of MS supports LF end of lines, so there is no need to convert source files while checking out.

The visual studio files should be stored as CRLF as they are generated by visual studio every save, in a way that CRLF are added.

Quoted 6 lines

I handled only the files that may be touch by MS users.

.gitattributes | 7 +++++++ Makefile.am | 1 + 2 files
changed, 8 insertions(+), 0 deletions(-) create mode 100644 .gitattributes

Applied to master branch on -testing and -stable trees.

commit f99d8fa79d538c42f2ebb54d8bc2a7f891ea09f9

Author: Alon Bar-Lev <[email protected]...>
Date:   Mon Apr 2 14:37:41 2012 +0300
    cleanup: add .gitattributes to control eol style explicitly

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Fabian Knittel <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+Znu8ACgkQDC186MBRfrpZzwCfUZuvmhJm+ms+vOHlOXYxjR11 ghAAn2GOKDPbywOBewTTt0T20P0TWNSx
=z9HY
-----END PGP SIGNATURE-----

#178 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

In reply to Alon Bar-Lev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 23 lines · Alon Bar-Lev
Quoted 21 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 9 lines · Alon Bar-Lev

This is not good. Another issue of this MIME magic that should be avoided. VC files are CRLF, if we do not commit them this way, every time they change we see a complete rewrite.

If you do not want to pull, please do:

find . -name '*.sln' -or -name '*.vcxproj.*' | xargs unix2dos

And commit.

We had quite some clean-up rounds on CR/LF issues quite a while ago. After a lot of testing and searching the net, we found out that keeping the git tree NL only would be an advantage. And CR/LF issues would be avoided when setting 'git config --global core.autocrlf true' on Windows boxes. This makes git add CR/LF when checking out files from the repo automatically, and it will be stripped out when committing files.

Quoted 5 lines
Quoted 5 lines

It's also described here:
<https://community.openvpn.net/openvpn/wiki/GitCrashCourse#Otherneatfeaturestoenable>

Can you please double check if this works for you? Then we don't have

Quoted 7 lines
Quoted 2 lines

to bother with the CR/LF issues at all, as it's mostly automatic.

No, this is no good.

First global configuration of repository is wrong, as people tend to have different global configurations.

By all means, remove the --global argument. That was an example taken from the git crash course, which is aimed at non-experienced people; But I'm sorry I didn't remove the --global part in the reply, that slipped my mind before sending it. I'm sure you understand the impact of --global far better than first time users, but lets not argue about such nit-picking.

Quoted 1 line

Second, I don't trust the automatic detection of text files.

So far we have had no problems with git in this regards. And as far as I can see, the only non-text file have in the git tree now is sample/sample-keys/pkcs12.p12.

We also found many places on the net suggesting this approach as sensible and recommended approach.

Quoted 3 lines

Third, there are files that must be CRLF no mater if I check it on cygwin, or Linux and use samba share to access the files I still need a valid configuration.

We have not had any complaints about these issues so far, and we did change all files to NL about a year ago.

Until there is a real issue among more git users and/or networked file systems and cross-platform developers, then I'm willing to look at this. Regarding cygwin, we did also run some tests there too before doing our switch, and at that point we didn't hit an issue either.

Lets rather fix real problems.

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk90bC8ACgkQDC186MBRfroFTgCdHZQL+HsEflz1tBwhl0ioa4wF rkgAoJjE707kh5vtKKhWtTtaWEIqJjLr
=caUc
-----END PGP SIGNATURE-----

#179 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

Quoted 57 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 23 lines · Alon Bar-Lev
Quoted 21 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 9 lines · Alon Bar-Lev

This is not good. Another issue of this MIME magic that should be avoided. VC files are CRLF, if we do not commit them this way, every time they change we see a complete rewrite.

If you do not want to pull, please do:

find . -name '*.sln' -or -name '*.vcxproj.*' | xargs unix2dos

And commit.

We had quite some clean-up rounds on CR/LF issues quite a while ago. After a lot of testing and searching the net, we found out that keeping the git tree NL only would be an advantage.  And CR/LF issues would be avoided when setting 'git config --global core.autocrlf true' on Windows boxes.  This makes git add CR/LF when checking out files from the repo automatically, and it will be stripped out when committing files.

Quoted 5 lines
Quoted 5 lines

It's also described here:
<https://community.openvpn.net/openvpn/wiki/GitCrashCourse#Otherneatfeaturestoenable>

Can you please double check if this works for you?  Then we don't have

Quoted 7 lines
Quoted 2 lines

to bother with the CR/LF issues at all, as it's mostly automatic.

No, this is no good.

First global configuration of repository is wrong, as people tend to have different global configurations.

By all means, remove the --global argument.  That was an example taken from the git crash course, which is aimed at non-experienced people; But I'm sorry I didn't remove the --global part in the reply, that slipped my mind before sending it.  I'm sure you understand the impact of --global far better than first time users, but lets not argue about such nit-picking.

Quoted 1 line

Second, I don't trust the automatic detection of text files.

So far we have had no problems with git in this regards.  And as far as I can see, the only non-text file have in the git tree now is sample/sample-keys/pkcs12.p12.

We also found many places on the net suggesting this approach as sensible and recommended approach.

Quoted 6 lines
Quoted 3 lines

Third, there are files that must be CRLF no mater if I check it on cygwin, or Linux and use samba share to access the files I still need a valid configuration.

We have not had any complaints about these issues so far, and we did change all files to NL about a year ago.

Because up until now you did not have a problem like these microsoft specific files.

Quoted 6 lines

Until there is a real issue among more git users and/or networked file systems and cross-platform developers, then I'm willing to look at this.  Regarding cygwin, we did also run some tests there too before doing our switch, and at that point we didn't hit an issue either.

Lets rather fix real problems.

I am asking to fix real problem!
Believe me that as much as I hate specific configurations, this is required. For people who use git and for those who are not.

For example...

at your end:
---
./configure
make
make dist
---

at other people end:
---
tar -xf <tarball>
cp -a openvpn* openvpn*.org
cd openvpn*
msvc-dev
<add a file to project>
<save all>
<quit>
cd ..
diff -urNp openvp* openvpn*.org
---

will result in a complete change of all microsoft specific files because of the new line issue.
is this enough problem?
It will also make the diffs of online files much harder without using git.

I am not trying to make things complex, on the contrary!

Alon.

#180 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

Hi,

Quoted 22 lines · Alon Bar-Lev

For example...

at your end:
---
./configure
make
make dist
---

at other people end:
---
tar -xf <tarball>
cp -a openvpn* openvpn*.org
cd openvpn*
msvc-dev
<add a file to project>
<save all>
<quit>
cd ..
diff -urNp openvp* openvpn*.org
---

Quoted 3 lines

will result in a complete change of all microsoft specific files because of the new line issue.
is this enough problem?

so why don't use --strip-trailing-cr (diffutils) or something similar to avoid this?

So as long as msvc-dev does accept eol=lf input files, storing them as eol=lf files is without issue?

Regards,
M. Braun
--
[1] http://stackoverflow.com/questions/1889559/git-diff-to-ignore-m

#181 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

Quoted 29 lines · michael-dev

Hi,

Quoted 22 lines · Alon Bar-Lev

For example...

at your end:
---
./configure
make
make dist
---

at other people end:
---
tar -xf <tarball>
cp -a openvpn* openvpn*.org
cd openvpn*
msvc-dev
<add a file to project>
<save all>
<quit>
cd ..
diff -urNp openvp* openvpn*.org
---

Quoted 3 lines

will result in a complete change of all microsoft specific files because of the new line issue.
is this enough problem?

Quoted 5 lines

so why don't use --strip-trailing-cr (diffutils) or something similar to avoid this?

So as long as msvc-dev does accept eol=lf input files, storing them as eol=lf files is without issue?

Hi,

Because I believe that file format should be as-is and these diff/git magic should be done only when forced, when invalid action was taken.

Of course all had been better if Microsoft supported keeping the line format, but this is not the case.

I want to see a "make dist" containing file format as it should be, and Microsoft solution and project files should be CRLFed.

I truly don't understand... there is a simple solution of git to explicit set eol style on specific files, why not use it?

And... also avoid using global setting of git, which is invalid anyway as we maintain several projects which should be independent.

Alon.

#182 lore raw

Re: [Openvpn-devel] [PATCH 4/6] build: msvc: upgrade to Visual Studio 2010 + fixups

Maybe it will be easier for you to treat the Microsoft generated files as binary blobs... these should remain as-is in all platforms, just like any other binary blob.
The gitattributes patch I submitted does exactly that, without interfering with the global setting if it you find this configuration helpful.

Quoted 54 lines · Alon Bar-Lev
Quoted 29 lines · michael-dev

Hi,

Quoted 22 lines · Alon Bar-Lev

For example...

at your end:
---
./configure
make
make dist
---

at other people end:
---
tar -xf <tarball>
cp -a openvpn* openvpn*.org
cd openvpn*
msvc-dev
<add a file to project>
<save all>
<quit>
cd ..
diff -urNp openvp* openvpn*.org
---

Quoted 3 lines

will result in a complete change of all microsoft specific files because of the new line issue.
is this enough problem?

Quoted 5 lines

so why don't use --strip-trailing-cr (diffutils) or something similar to avoid this?

So as long as msvc-dev does accept eol=lf input files, storing them as eol=lf files is without issue?

Hi,

Because I believe that file format should be as-is and these diff/git magic should be done only when forced, when invalid action was taken.

Of course all had been better if Microsoft supported keeping the line format, but this is not the case.

I want to see a "make dist" containing file format as it should be, and Microsoft solution and project files should be CRLFed.

I truly don't understand... there is a simple solution of git to explicit set eol style on specific files, why not use it?

And... also avoid using global setting of git, which is invalid anyway as we maintain several projects which should be independent.

Alon.

#183 lore raw

PATCH 5/6 build: enable lzo by default

In reply to David Sommerseth
---
 configure.ac |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
configure.ac +2 -2
index 9a6ff29..bd84c0f 100644
@@ -41,9 +41,9 @@ AC_USE_SYSTEM_EXTENSIONS
 
 AC_ARG_ENABLE(
 	[lzo],
-	[AS_HELP_STRING([--enable-lzo], [enable LZO compression support @<:@default=no@:>@])],
+	[AS_HELP_STRING([--disable-lzo], [disable LZO compression support @<:@default=yes@:>@])],
 	,
-	[enable_lzo="no"]
+	[enable_lzo="yes"]
 )
 
 AC_ARG_ENABLE(
Signature · 1 line
1.7.3.4
#184 lore raw

Re: [Openvpn-devel] [PATCH 5/6] build: enable lzo by default

Hi,

ACK, as per the discussion and majority of voices.

gert

Quoted 34 lines · Alon Bar-Lev
---
 configure.ac |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
configure.ac +2 -2
index 9a6ff29..bd84c0f 100644
@@ -41,9 +41,9 @@ AC_USE_SYSTEM_EXTENSIONS
 
 AC_ARG_ENABLE(
 	[lzo],
-	[AS_HELP_STRING([--enable-lzo], [enable LZO compression support @<:@default=no@:>@])],
+	[AS_HELP_STRING([--disable-lzo], [disable LZO compression support @<:@default=yes@:>@])],
 	,
-	[enable_lzo="no"]
+	[enable_lzo="yes"]
 )
 
 AC_ARG_ENABLE(
Signature · 11 lines
1.7.3.4


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#185 lore raw

Re: [Openvpn-devel] [PATCH 5/6] build: enable lzo by default

In reply to Alon Bar-Lev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Alon Bar-Lev

4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)

Applied to master branches on -testing and -stable.

commit 40a56e79d5d45c8e40c599f52349007155f7e475

Author: Alon Bar-Lev <[email protected]...>
Date:   Sat Mar 24 09:58:37 2012 +0200
    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Gert Doering <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAk9wYoMACgkQDC186MBRfrqXfQCVHaoshvk9jTtLCze/96i/EBGi QQCfXHGStb1UPHf7rQGAKO7bWUjNC3Y=
=ztj4
-----END PGP SIGNATURE-----

#186 lore raw

PATCH 6/6 build: windows: set vendor to openvpn project + cleanups

In reply to David Sommerseth

*NOTICE* This is Latin code page file, beware of conversion.

---
 src/openvpn/openvpn_win32_resources.rc   |    6 +++---
 src/openvpnserv/openvpnserv_resources.rc |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
src/openvpn/openvpn_win32_resources.rc +3 -3
index 6d77163..e1cd959 100644
@@ -24,11 +24,11 @@ BEGIN
     BEGIN
         BLOCK "040904b0"
         BEGIN
-            VALUE "CompanyName", "OpenVPN.net"
-            VALUE "FileDescription", "OpenVPN"
+            VALUE "CompanyName", "The OpenVPN Project"
+            VALUE "FileDescription", "OpenVPN Daemon"
             VALUE "FileVersion", PACKAGE_VERSION ".0"
             VALUE "InternalName", "OpenVPN"
-            VALUE "LegalCopyright", "Copyright ? OpenVPN Project" 
+            VALUE "LegalCopyright", "Copyright © The OpenVPN Project" 
             VALUE "OriginalFilename", "openvpn.exe"
             VALUE "ProductName", "OpenVPN"
             VALUE "ProductVersion", PACKAGE_VERSION ".0"
src/openvpnserv/openvpnserv_resources.rc +2 -2
index 7eac95b..9b79cb7 100644
@@ -24,11 +24,11 @@ BEGIN
     BEGIN
         BLOCK "040904b0"
         BEGIN
-            VALUE "CompanyName", "OpenVPN.net"
+            VALUE "CompanyName", "The OpenVPN Project"
             VALUE "FileDescription", "OpenVPN Service"
             VALUE "FileVersion", PACKAGE_VERSION ".0"
             VALUE "InternalName", "OpenVPN"
-            VALUE "LegalCopyright", "Copyright ? OpenVPN Project" 
+            VALUE "LegalCopyright", "Copyright © The OpenVPN Project" 
             VALUE "OriginalFilename", "openvpnserv.exe"
             VALUE "ProductName", "OpenVPN"
             VALUE "ProductVersion", PACKAGE_VERSION ".0"
Signature · 1 line
1.7.3.4
#187 lore raw

Re: [Openvpn-devel] [PATCH 6/6] build: windows: set vendor to openvpn project + cleanups

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 7 lines · Alon Bar-Lev

*NOTICE* This is Latin code page file, beware of conversion.

src/openvpn/openvpn_win32_resources.rc   |    6 +++--- 
src/openvpnserv/openvpnserv_resources.rc |    4 ++-- 2 files changed,

5 insertions(+), 5 deletions(-)

ACK! Applied to master branches on -testing and -stable trees.

commit 405f338783aee035c28209a8eeb203069e177b71

Author: Alon Bar-Lev <[email protected]...>
Date:   Sat Mar 24 08:43:50 2012 +0200
    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9wYy0ACgkQDC186MBRfrpEwQCeIZYmYg1pDKkdwzHghGPEX+PF rcAAnjMZhkFWUHuEo/69eBvAqD4jYRHF
=tKfX
-----END PGP SIGNATURE-----