/autom4te.cache
/build-arch-stamp
/build-indep-stamp
+/compile
/config.guess
/config.h
/config.h.in
--- /dev/null
+[submodule "ext"]
+ path = ext
+ url = ../openflowext
# -*- makefile -*-
AM_CPPFLAGS = $(SSL_CFLAGS)
-
-COMMON_FLAGS = -DVERSION=\"$(VERSION)\"
-if NDEBUG
-COMMON_FLAGS += -DNDEBUG -fomit-frame-pointer
+AM_CPPFLAGS += -I $(ofp_top_srcdir)/include
+if HAVE_EXT
+AM_CPPFLAGS += -I $(ofp_top_srcdir)/ext/include
endif
-AM_CFLAGS = $(COMMON_FLAGS)
-AM_CFLAGS += -Wstrict-prototypes -I $(top_srcdir)/include
+AM_CFLAGS = -DVERSION=\"$(VERSION)\"
+AM_CFLAGS += -Wstrict-prototypes
rundir = $(localstatedir)/run
AM_CFLAGS += -DRUNDIR=\"$(rundir)\"
-if !NDEBUG
+if NDEBUG
+AM_CFLAGS += -DNDEBUG -fomit-frame-pointer
+else
AM_LDFLAGS = -export-dynamic
endif
AUTOMAKE_OPTIONS=foreign
+ACLOCAL_AMFLAGS = -I m4
SUBDIRS = lib datapath secchan controller
if HAVE_IF_PACKET
SUBDIRS += switch
endif
SUBDIRS += utilities tests include third-party
+if HAVE_EXT
+SUBDIRS += ext
+endif
+
+EXTRA_DIST = README.hwtables
# advertising or publicity pertaining to the Software or any
# derivatives without specific, written prior permission.
-dnl --
-dnl CHECK_LINUX(OPTION, VERSION, VARIABLE, CONDITIONAL)
+dnl OFP_CHECK_LINUX(OPTION, VERSION, VARIABLE, CONDITIONAL)
dnl
dnl Configure linux kernel source tree
-dnl --
-AC_DEFUN([CHECK_LINUX], [
+AC_DEFUN([OFP_CHECK_LINUX], [
AC_ARG_WITH([$1],
[AC_HELP_STRING([--with-$1=/path/to/linux-$3],
[Specify the linux $3 kernel sources])],
fi
AM_CONDITIONAL($5, test -n "$path")
])
+
+dnl Checks for --enable-hw-tables and substitutes HW_TABLES to any
+dnl requested hardware table modules.
+AC_DEFUN([OFP_CHECK_HWTABLES],
+ [AC_ARG_ENABLE(
+ [hw-tables],
+ [AC_HELP_STRING([--enable-hw-tables=MODULE...],
+ [Configure and build the specified externally supplied
+ hardware table support modules])])
+ case "${enable_hw_tables}" in # (
+ yes)
+ AC_MSG_ERROR([--enable-hw-tables has a required argument])
+ ;; # (
+ ''|no)
+ hw_tables=
+ ;; # (
+ *)
+ hw_tables=`echo "$enable_hw_tables" | sed 's/,/ /g'`
+ ;;
+ esac
+ for d in $hw_tables; do
+ mk=datapath/hwtable_$d/Modules.mk
+ if test ! -e $srcdir/$mk; then
+ AC_MSG_ERROR([--enable-hw-tables=$d specified but $mk is missing])
+ fi
+ HW_TABLES="$HW_TABLES \$(top_srcdir)/$mk"
+ done
+ AC_SUBST(HW_TABLES)])
+
+dnl Checks for net/if_packet.h.
+AC_DEFUN([OFP_CHECK_IF_PACKET],
+ [AC_CHECK_HEADER([net/if_packet.h],
+ [HAVE_IF_PACKET=yes],
+ [HAVE_IF_PACKET=no])
+ AM_CONDITIONAL([HAVE_IF_PACKET], [test "$HAVE_IF_PACKET" = yes])
+ if test "$HAVE_IF_PACKET" = yes; then
+ AC_DEFINE([HAVE_IF_PACKET], [1],
+ [Define to 1 if net/if_packet.h is available.])
+ fi])
+
+dnl Enable OpenFlow extension submodule.
+AC_DEFUN([OFP_ENABLE_EXT],
+ [AC_ARG_ENABLE([ext],
+ AS_HELP_STRING([--enable-ext],
+ [use OpenFlow extensions
+ (default is yes if "ext" dir exists)]))
+ case "${enable_ext}" in
+ (yes)
+ HAVE_EXT=yes
+ ;;
+ (no)
+ HAVE_EXT=no
+ ;;
+ (*)
+ if test -d "$srcdir/ext"; then
+ HAVE_EXT=yes
+ else
+ HAVE_EXT=no
+ fi
+ ;;
+ esac
+ if test $HAVE_EXT = yes; then
+ if test -d "$srcdir/ext"; then
+ :
+ else
+ AC_MSG_ERROR([cannot configure extensions without "ext" directory])
+ fi
+ AC_CONFIG_SUBDIRS([ext])
+ AC_DEFINE([HAVE_EXT], [1],
+ [Whether the OpenFlow extensions submodule is available])
+ fi
+ AC_SUBST([ofp_top_srcdir], ['$(top_srcdir)'])
+ AM_CONDITIONAL([HAVE_EXT], [test $HAVE_EXT = yes])])
AC_PREREQ(2.59)
AC_INIT(openflow, v0.8.1, info@openflowswitch.org)
+AC_CONFIG_SRCDIR([README.hwtables])
+AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE
AC_MSG_ERROR([Perl interpreter not found in $PATH or $PERL.])
fi
-AC_USE_SYSTEM_EXTENSIONS
-
-AC_ARG_ENABLE(
- [ndebug],
- [AC_HELP_STRING([--enable-ndebug],
- [Disable debugging features for max performance])],
- [case "${enableval}" in # (
- yes) ndebug=true ;; # (
- no) ndebug=false ;; # (
- *) AC_MSG_ERROR([bad value ${enableval} for --enable-ndebug]) ;;
- esac],
- [ndebug=false])
-AM_CONDITIONAL([NDEBUG], [test x$ndebug = xtrue])
-
-AC_ARG_ENABLE(
- [hw-tables],
- [AC_HELP_STRING([--enable-hw-tables=MODULE...],
- [Configure and build the specified externally supplied
- hardware table support modules])])
-case "${enable_hw_tables}" in # (
- yes)
- AC_MSG_ERROR([--enable-hw-tables has a required argument])
- ;; # (
- ''|no)
- hw_tables=
- ;; # (
- *)
- hw_tables=`echo "$enable_hw_tables" | sed 's/,/ /g'`
- ;;
-esac
-for d in $hw_tables; do
- mk=datapath/hwtable_$d/Modules.mk
- if test ! -e $srcdir/$mk; then
- AC_MSG_ERROR([--enable-hw-tables=$d specified but $mk is missing])
- fi
- HW_TABLES="$HW_TABLES \$(top_srcdir)/$mk"
-done
-AC_SUBST(HW_TABLES)
+OFP_CHECK_LIBOPENFLOW
+OFP_CHECK_IF_PACKET
+OFP_CHECK_HWTABLES
AC_ARG_VAR(KARCH, [Kernel Architecture String])
AC_SUBST(KARCH)
-
-CHECK_LINUX(l26, 2.6, 2.6, KSRC26, L26_ENABLED)
-CHECK_LINUX(l24, 2.4, 2.4, KSRC24, L24_ENABLED)
-
-AC_CHECK_HEADER([linux/netlink.h],
- [HAVE_NETLINK=yes],
- [HAVE_NETLINK=no],
- [#include <sys/socket.h>
-#include <linux/types.h>])
-AM_CONDITIONAL([HAVE_NETLINK], [test "$HAVE_NETLINK" = yes])
-if test "$HAVE_NETLINK" = yes; then
- AC_DEFINE([HAVE_NETLINK], [1],
- [Define to 1 if Netlink protocol is available.])
-fi
-
-AC_CHECK_HEADER([net/if_packet.h],
- [HAVE_IF_PACKET=yes],
- [HAVE_IF_PACKET=no])
-AM_CONDITIONAL([HAVE_IF_PACKET], [test "$HAVE_IF_PACKET" = yes])
-if test "$HAVE_IF_PACKET" = yes; then
- AC_DEFINE([HAVE_IF_PACKET], [1],
- [Define to 1 if net/if_packet.h is available.])
-fi
-
-AC_ARG_ENABLE(
- [ssl],
- [AC_HELP_STRING([--enable-ssl],
- [Enable ssl support (requires libssl)])],
- [case "${enableval}" in # (
- yes) ssl=true ;; # (
- no) ssl=false ;; # (
- *) AC_MSG_ERROR([bad value ${enableval} for --enable-ssl]) ;;
- esac],
- [ssl=false])
-
-if test "$ssl" = true; then
-dnl Make sure that pkg-config is installed.
-m4_pattern_forbid([PKG_CHECK_MODULES])
-PKG_CHECK_MODULES([SSL], [libssl],
- [HAVE_OPENSSL=yes],
- [HAVE_OPENSSL=no
- AC_MSG_WARN([Cannot find libssl:
-
-$SSL_PKG_ERRORS
-
-OpenFlow will not support SSL connections.])])
-
-fi
-AM_CONDITIONAL([HAVE_OPENSSL], [test "$HAVE_OPENSSL" = yes])
-if test "$HAVE_OPENSSL" = yes; then
- AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if OpenSSL is installed.])
-fi
-
-AC_CHECK_LIB([socket], [connect])
-AC_SEARCH_LIBS([gethostbyname], [resolv], [RESOLVER_LIBS=-lresolv])
-AC_CHECK_LIB([dl], [dladdr], [FAULT_LIBS=-ldl])
-AC_SUBST([FAULT_LIBS])
+OFP_CHECK_LINUX(l26, 2.6, 2.6, KSRC26, L26_ENABLED)
+OFP_CHECK_LINUX(l24, 2.4, 2.4, KSRC24, L24_ENABLED)
CFLAGS="$CFLAGS -Wall -Wno-sign-compare"
+OFP_ENABLE_EXT
+
AC_CONFIG_FILES([Makefile
datapath/Makefile
lib/Makefile
--- /dev/null
+Subproject commit b3227406a713f5cae10d31a7be7249c6ebe16bff
vconn-ssl.h \
vconn-stream.h \
vlog-socket.h \
+ vlog-modules.def \
vlog.h \
xtoxll.h
--- /dev/null
+/* Modules that can emit log messages. */
+VLOG_MODULE(chain)
+VLOG_MODULE(controller)
+VLOG_MODULE(ctlpath)
+VLOG_MODULE(daemon)
+VLOG_MODULE(datapath)
+VLOG_MODULE(dhcp)
+VLOG_MODULE(dhcp_client)
+VLOG_MODULE(dpif)
+VLOG_MODULE(dpctl)
+VLOG_MODULE(fault)
+VLOG_MODULE(flow)
+VLOG_MODULE(learning_switch)
+VLOG_MODULE(mac_learning)
+VLOG_MODULE(netdev)
+VLOG_MODULE(netlink)
+VLOG_MODULE(ofp_discover)
+VLOG_MODULE(poll_loop)
+VLOG_MODULE(secchan)
+VLOG_MODULE(rconn)
+VLOG_MODULE(switch)
+VLOG_MODULE(terminal)
+VLOG_MODULE(socket_util)
+VLOG_MODULE(vconn_netlink)
+VLOG_MODULE(vconn_tcp)
+VLOG_MODULE(vconn_ssl)
+VLOG_MODULE(vconn_stream)
+VLOG_MODULE(vconn_unix)
+VLOG_MODULE(vconn)
+VLOG_MODULE(vlog)
+
+#ifdef HAVE_EXT
+#include "ext/vlogext-modules.def"
+#endif
+
+#undef VLOG_MODULE
const char *vlog_get_facility_name(enum vlog_facility);
enum vlog_facility vlog_get_facility_val(const char *name);
-/* Modules that can emit log messages. */
-#define VLOG_MODULES \
- VLOG_MODULE(chain) \
- VLOG_MODULE(controller) \
- VLOG_MODULE(ctlpath) \
- VLOG_MODULE(daemon) \
- VLOG_MODULE(datapath) \
- VLOG_MODULE(dhcp) \
- VLOG_MODULE(dhcp_client) \
- VLOG_MODULE(dpif) \
- VLOG_MODULE(dpctl) \
- VLOG_MODULE(fault) \
- VLOG_MODULE(flow) \
- VLOG_MODULE(learning_switch) \
- VLOG_MODULE(mac_learning) \
- VLOG_MODULE(netdev) \
- VLOG_MODULE(netlink) \
- VLOG_MODULE(ofp_discover) \
- VLOG_MODULE(poll_loop) \
- VLOG_MODULE(secchan) \
- VLOG_MODULE(rconn) \
- VLOG_MODULE(switch) \
- VLOG_MODULE(socket_util) \
- VLOG_MODULE(vconn_netlink) \
- VLOG_MODULE(vconn_tcp) \
- VLOG_MODULE(vconn_ssl) \
- VLOG_MODULE(vconn_stream) \
- VLOG_MODULE(vconn_unix) \
- VLOG_MODULE(vconn) \
- VLOG_MODULE(vlog) \
-
/* VLM_ constant for each vlog module. */
enum vlog_module {
#define VLOG_MODULE(NAME) VLM_##NAME,
- VLOG_MODULES
-#undef VLOG_MODULE
+#include "vlog-modules.def"
VLM_N_MODULES,
VLM_ANY_MODULE = -1
};
/* Name for each logging module */
static const char *module_names[VLM_N_MODULES] = {
#define VLOG_MODULE(NAME) #NAME,
- VLOG_MODULES
-#undef VLOG_MODULES
+#include "vlog-modules.def"
};
static int levels[VLM_N_MODULES][VLF_N_FACILITIES];
--- /dev/null
+# Copyright (c) 2008 The Board of Trustees of The Leland Stanford
+# Junior University
+#
+# We are making the OpenFlow specification and associated documentation
+# (Software) available for public use and benefit with the expectation
+# that others will use, modify and enhance the Software and contribute
+# those enhancements back to the community. However, since we would
+# like to make the Software available for broadest use, with as few
+# restrictions as possible permission is hereby granted, free of
+# charge, to any person obtaining a copy of this Software to deal in
+# the Software under the copyrights without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# The name and trademarks of copyright holder(s) may NOT be used in
+# advertising or publicity pertaining to the Software or any
+# derivatives without specific, written prior permission.
+
+dnl Checks for --enable-ndebug and defines NDEBUG if it is specified.
+AC_DEFUN([OFP_CHECK_NDEBUG],
+ [AC_ARG_ENABLE(
+ [ndebug],
+ [AC_HELP_STRING([--enable-ndebug],
+ [Disable debugging features for max performance])],
+ [case "${enableval}" in
+ (yes) ndebug=true ;;
+ (no) ndebug=false ;;
+ (*) AC_MSG_ERROR([bad value ${enableval} for --enable-ndebug]) ;;
+ esac],
+ [ndebug=false])
+ AM_CONDITIONAL([NDEBUG], [test x$ndebug = xtrue])])
+
+dnl Checks for Netlink support.
+AC_DEFUN([OFP_CHECK_NETLINK],
+ [AC_CHECK_HEADER([linux/netlink.h],
+ [HAVE_NETLINK=yes],
+ [HAVE_NETLINK=no],
+ [#include <sys/socket.h>
+ #include <linux/types.h>
+ ])
+ AM_CONDITIONAL([HAVE_NETLINK], [test "$HAVE_NETLINK" = yes])
+ if test "$HAVE_NETLINK" = yes; then
+ AC_DEFINE([HAVE_NETLINK], [1],
+ [Define to 1 if Netlink protocol is available.])
+ fi])
+
+dnl Checks for OpenSSL, if --enable-ssl is passed in.
+AC_DEFUN([OFP_CHECK_OPENSSL],
+ [AC_ARG_ENABLE(
+ [ssl],
+ [AC_HELP_STRING([--enable-ssl],
+ [Enable ssl support (requires libssl)])],
+ [case "${enableval}" in
+ (yes) ssl=true ;;
+ (no) ssl=false ;;
+ (*) AC_MSG_ERROR([bad value ${enableval} for --enable-ssl]) ;;
+ esac],
+ [ssl=false])
+
+ if test "$ssl" = true; then
+ dnl Make sure that pkg-config is installed.
+ m4_pattern_forbid([PKG_CHECK_MODULES])
+ PKG_CHECK_MODULES([SSL], [libssl],
+ [HAVE_OPENSSL=yes],
+ [HAVE_OPENSSL=no
+ AC_MSG_WARN([Cannot find libssl:
+
+ $SSL_PKG_ERRORS
+
+ OpenFlow will not support SSL connections.])])
+
+ fi
+ AM_CONDITIONAL([HAVE_OPENSSL], [test "$HAVE_OPENSSL" = yes])
+ if test "$HAVE_OPENSSL" = yes; then
+ AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if OpenSSL is installed.])
+ fi])
+
+dnl Checks for libraries needed by lib/fault.c.
+AC_DEFUN([OFP_CHECK_FAULT_LIBS],
+ [AC_CHECK_LIB([dl], [dladdr], [FAULT_LIBS=-ldl])
+ AC_SUBST([FAULT_LIBS])])
+
+dnl Checks for libraries needed by lib/socket-util.c.
+AC_DEFUN([OFP_CHECK_SOCKET_LIBS],
+ [AC_CHECK_LIB([socket], [connect])
+ AC_SEARCH_LIBS([gethostbyname], [resolv], [RESOLVER_LIBS=-lresolv])])
+
+dnl Runs the checks required to include the headers in include/ and
+dnl link against lib/libopenflow.a.
+AC_DEFUN([OFP_CHECK_LIBOPENFLOW],
+ [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([OFP_CHECK_NDEBUG])
+ AC_REQUIRE([OFP_CHECK_NETLINK])
+ AC_REQUIRE([OFP_CHECK_OPENSSL])
+ AC_REQUIRE([OFP_CHECK_FAULT_LIBS])
+ AC_REQUIRE([OFP_CHECK_SOCKET_LIBS])])
+