From: David Sommerseth <d...@users.sourceforge.net>

Added a new function, warn_deprecated_features(), which is located in
deprecated.[ch].  All deprecated features should present a warning here.
This function will be called during start-up and will show all warnings
after the OpenVPN title string.

Included a deprecated feature warning for the resolv-random feature.

Signed-off-by: David Sommerseth <d...@users.sourceforge.net>
---
 Makefile.am  |    3 ++-
 deprecated.c |   36 ++++++++++++++++++++++++++++++++++++
 deprecated.h |   30 ++++++++++++++++++++++++++++++
 openvpn.c    |    5 +++++
 4 files changed, 73 insertions(+), 1 deletions(-)
 create mode 100644 deprecated.c
 create mode 100644 deprecated.h

diff --git a/Makefile.am b/Makefile.am
index 7bccc11..e199b17 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -138,7 +138,8 @@ openvpn_SOURCES = \
        thread.c thread.h \
        tun.c tun.h \
        win32.h win32.c \
-       cryptoapi.h cryptoapi.c
+       cryptoapi.h cryptoapi.c \
+       deprecated.h deprecated.c


 dist-hook:
diff --git a/deprecated.c b/deprecated.c
new file mode 100644
index 0000000..832413a
--- /dev/null
+++ b/deprecated.c
@@ -0,0 +1,36 @@
+/*
+ *  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) 2010  David Sommerseth <d...@users.sourceforge.net>
+ *
+ *  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
+ */
+
+#include "syshead.h"
+#include "error.h"
+
+
+inline void
+warn_deprecated_features (void)
+{
+#ifdef DEPRECATED_RANDOM_RESOLV
+  msg (M_INFO, "[DEPRECATED FEATURE ENABLED: random-resolv] Resolving 
hostnames will use randomisation if more than one IP address is found");
+#endif
+}
+
diff --git a/deprecated.h b/deprecated.h
new file mode 100644
index 0000000..cbe74ee
--- /dev/null
+++ b/deprecated.h
@@ -0,0 +1,30 @@
+/*
+ *  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) 2010  David Sommerseth <d...@users.sourceforge.net>
+*
+ *  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 DEPRECATED_H
+#define DEPRECATED_H
+
+inline void warn_deprecated_features (void);
+
+#endif
diff --git a/openvpn.c b/openvpn.c
index 451fbe4..6e12873 100644
--- a/openvpn.c
+++ b/openvpn.c
@@ -28,6 +28,7 @@
 #include "forward.h"
 #include "multi.h"
 #include "win32.h"
+#include "deprecated.h"

 #include "memdbg.h"

@@ -181,6 +182,10 @@ main (int argc, char *argv[])
          /* print version number */
          msg (M_INFO, "%s", title_string);

+          /* All deprecated features should present a warning
+             in this function, found in deprecated.c */
+         warn_deprecated_features ();
+
          /* misc stuff */
          pre_setup (&c.options);

-- 
1.6.6


Reply via email to