diff options
author | Frode Nordahl <frode.nordahl@canonical.com> | 2022-07-14 17:55:40 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-07-15 13:45:55 +0200 |
commit | 9990322610f627118e20c54ad749caeb3e99358a (patch) | |
tree | 1c31a606fd5ce9ae7c4c123efe2c541a1189d391 | |
parent | 9f4f2bb7dc1df888878902e8b11fef886af928a2 (diff) | |
download | openvswitch-9990322610f627118e20c54ad749caeb3e99358a.tar.gz |
debian: Update packaging source from Debian/Ubuntu.
* Update upstream OVS debian packaging to be on par with package
source in Debian/Ubuntu:
- Provide a openvswitch-switch-dpdk package that integrates with
the dpdk package in the distributions so that end users can opt
into a DPDK-enabled Open vSwitch binary.
- Provide systemd service files.
- Provide openvswitch-source package for reproducible integrated
build of for example OVN.
- Stop building shared library and subsequently remove
libopenvswitch and libopenvswitch-dev binary packages.
Co-authored-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Co-authored-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Co-authored-by: James Page <james.page@ubuntu.com>
Signed-off-by: James Page <james.page@ubuntu.com>
Co-authored-by: Corey Bryant <corey.bryant@canonical.com>
Signed-off-by: Corey Bryant <corey.bryant@canonical.com>
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
70 files changed, 3485 insertions, 2 deletions
@@ -62,6 +62,15 @@ Post-v2.17.0 * Add build time configure command to enable auto-validator as default actions implementation at build time. * Add AVX512 implementation of actions. + - Debian packaging updated to be on par with package source in Debian/Ubuntu. + * Provided an openvswitch-switch-dpdk package that integrates with the + dpdk package in the distributions so that end users can opt into a + DPDK-enabled Open vSwitch binary. + * Provided systemd service files. + * Provided openvswitch-source package for reproducible integrated build of + for example OVN. + * Shared library and subsequently libopenvswitch and libopenvswitch-dev + binary packages are no longer built. - Linux datapath: * Add offloading meter tc police. * Add support for offloading the check_pkt_len action. diff --git a/build-aux/initial-tab-allowed-files b/build-aux/initial-tab-allowed-files index 1e9573c69..6a9968e32 100644 --- a/build-aux/initial-tab-allowed-files +++ b/build-aux/initial-tab-allowed-files @@ -13,5 +13,8 @@ ^third-party/ ^windows/ ^xenserver/ -^debian/rules.modules$ +^debian/README.Debian$ +^debian/copyright.in$ +^debian/openvswitch-switch.init$ +^debian/openvswitch-switch.postinst$ ^debian/rules$ diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 000000000..4671f4ae2 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,36 @@ +Here's an example configuration for your /etc/network/interfaces +using a simple ovsbr0 bridge for eth0, with dhcp for ipv4 and ipv6. +This was taken from https://bugs.debian.org/860786. + +auto ovsbr0 +iface ovsbr0 inet dhcp + ovs_type OVSBridge + ovs_ports eth0 + +auto ovsbr0 +iface ovsbr0 inet6 dhcp + ovs_type OVSBridge + ovs_ports eth0 + +autobr0 eth0 +iface eth0 inet manual + ovs_bridge ovsbr0 + ovs_type OVSPort + +However, this didn't work for me. Instead, this worked: + +auto br0 +iface br0 inet dhcp + ovs_type OVSBridge + ovs_port enp0s3 + +auto enp0s3 +iface enp0s3 inet manual + ovs_bridge br0 + ovs_type OVSPort + up ip address add 0/0 dev enp0s3 + up ip link set enp0s3 up + up dhclient br0 + down ip link set enp0s3 down + + -- Antoine Beaupré <anarcat@debian.org>, Wed, 22 Jun 2022 12:02:39 -0400 diff --git a/debian/automake.mk b/debian/automake.mk index ce11fd040..afba5b0e4 100644 --- a/debian/automake.mk +++ b/debian/automake.mk @@ -1,2 +1,91 @@ EXTRA_DIST += \ - debian/changelog + debian/README.Debian \ + debian/changelog \ + debian/clean \ + debian/control \ + debian/copyright \ + debian/copyright.in \ + debian/dirs \ + debian/gbp.conf \ + debian/ifupdown.sh \ + debian/ltmain-whole-archive.diff \ + debian/not-installed \ + debian/openvswitch-common.dirs \ + debian/openvswitch-common.install \ + debian/openvswitch-common.lintian-overrides \ + debian/openvswitch-doc.doc-base \ + debian/openvswitch-doc.install \ + debian/openvswitch-ipsec.init \ + debian/openvswitch-ipsec.install \ + debian/openvswitch-ipsec.service \ + debian/openvswitch-pki.dirs \ + debian/openvswitch-pki.postinst \ + debian/openvswitch-pki.postrm \ + debian/openvswitch-source.dirs \ + debian/openvswitch-source.docs \ + debian/openvswitch-source.install \ + debian/openvswitch-switch-dpdk.README.Debian \ + debian/openvswitch-switch-dpdk.install \ + debian/openvswitch-switch-dpdk.postinst \ + debian/openvswitch-switch-dpdk.prerm \ + debian/openvswitch-switch.README.Debian \ + debian/openvswitch-switch.default \ + debian/openvswitch-switch.dirs \ + debian/openvswitch-switch.init \ + debian/openvswitch-switch.install \ + debian/openvswitch-switch.links \ + debian/openvswitch-switch.lintian-overrides \ + debian/openvswitch-switch.logrotate \ + debian/openvswitch-switch.ovs-record-hostname.service \ + debian/openvswitch-switch.ovs-vswitchd.service \ + debian/openvswitch-switch.ovsdb-server.service \ + debian/openvswitch-switch.postinst \ + debian/openvswitch-switch.postrm \ + debian/openvswitch-switch.preinst \ + debian/openvswitch-switch.prerm \ + debian/openvswitch-switch.service \ + debian/openvswitch-test.install \ + debian/openvswitch-testcontroller.README.Debian \ + debian/openvswitch-testcontroller.default \ + debian/openvswitch-testcontroller.dirs \ + debian/openvswitch-testcontroller.init \ + debian/openvswitch-testcontroller.install \ + debian/openvswitch-testcontroller.postinst \ + debian/openvswitch-testcontroller.postrm \ + debian/openvswitch-vtep.default \ + debian/openvswitch-vtep.dirs \ + debian/openvswitch-vtep.init \ + debian/openvswitch-vtep.install \ + debian/ovs-systemd-reload \ + debian/patches/ovs-ctl-ipsec.patch \ + debian/patches/series \ + debian/rules \ + debian/source/format \ + debian/source/lintian-overrides \ + debian/tests/control \ + debian/tests/dpdk \ + debian/tests/openflow.py \ + debian/tests/vanilla \ + debian/watch + +check-debian-changelog-version: + @DEB_VERSION=`echo '$(VERSION)' | sed 's/pre/~pre/'`; \ + if $(FGREP) '($(DEB_VERSION)' $(srcdir)/debian/changelog >/dev/null; \ + then \ + :; \ + else \ + echo "Update debian/changelog to mention version $(VERSION)"; \ + exit 1; \ + fi +ALL_LOCAL += check-debian-changelog-version +DIST_HOOKS += check-debian-changelog-version + +$(srcdir)/debian/copyright: AUTHORS.rst debian/copyright.in + $(AM_V_GEN) \ + { sed -n -e '/%AUTHORS%/q' -e p < $(srcdir)/debian/copyright.in; \ + sed '34,/^$$/d' $(srcdir)/AUTHORS.rst | \ + sed -n -e '/^$$/q' -e 's/^/ /p'; \ + sed -e '34,/%AUTHORS%/d' $(srcdir)/debian/copyright.in; \ + } > $@ + +DISTCLEANFILES += debian/copyright diff --git a/debian/changelog b/debian/changelog index cba7ac85b..c4a28b42c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,15 @@ openvswitch (2.17.90-1) unstable; urgency=low * New upstream version + * Update debian packaging to be on par with package source in Debian/Ubuntu: + - Provide a openvswitch-switch-dpdk package that integrates with the dpdk + package in the distributions so that end users can opt into a + DPDK-enabled Open vSwitch binary. + - Provide systemd service files. + - Provide openvswitch-source package for reproducible integrated build of + for example OVN. + - Stop building shared library and subsequently remove libopenvswitch and + libopenvswitch-dev binary packages. -- Open vSwitch team <dev@openvswitch.org> Tue, 18 Jan 2022 20:14:01 +0100 diff --git a/debian/clean b/debian/clean new file mode 100644 index 000000000..3b2e48901 --- /dev/null +++ b/debian/clean @@ -0,0 +1,2 @@ +_debian +_dpdk diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..a813d7cc7 --- /dev/null +++ b/debian/control @@ -0,0 +1,296 @@ +Source: openvswitch +Section: net +Priority: optional +Maintainer: Open vSwitch developers <dev@openvswitch.org> +Uploaders: + Simon Horman <horms@debian.org>, + Thomas Goirand <zigo@debian.org>, + Michal Arbet <michal.arbet@ultimum.io>, + Luca Boccassi <bluca@debian.org>, + Christian Ehrhardt <christian.ehrhardt@canonical.com>, +Build-Depends: + autoconf (>= 2.64), + automake (>= 1.10), + bzip2, + debhelper-compat (= 13), + dh-exec, + dh-python, + dh-sequence-python3, + dh-sequence-sphinxdoc, + graphviz, + iproute2, + libcap-ng-dev, + libdbus-1-dev [amd64 i386 ppc64el arm64], + libdpdk-dev (>= 21.11) [amd64 i386 ppc64el arm64], + libnuma-dev [amd64 i386 ppc64el arm64], + libpcap-dev [amd64 i386 ppc64el arm64], + libssl-dev, + libtool, + libunbound-dev, + openssl, + pkg-config, + procps, + python3-all-dev, + python3-setuptools, + python3-sortedcontainers, + python3-sphinx, +Standards-Version: 4.6.1 +Rules-Requires-Root: no +Homepage: http://openvswitch.org/ +Vcs-Browser: https://salsa.debian.org/openstack-team/third-party/openvswitch/-/tree/debian/experimental +Vcs-Git: https://salsa.debian.org/openstack-team/third-party/openvswitch.git + +Package: openvswitch-common +Architecture: linux-any +Depends: + openssl, + ${misc:Depends}, + ${python3:Depends}, + ${shlibs:Depends}, +Suggests: + ethtool, + openvswitch-doc, +Breaks: + openvswitch-switch (<< 2.13~), +Replaces: + openvswitch-switch (<< 2.13~), +Description: Open vSwitch common components + Open vSwitch is a production quality, multilayer, software-based, + Ethernet virtual switch. It is designed to enable massive network + automation through programmatic extension, while still supporting + standard management interfaces and protocols (e.g. NetFlow, IPFIX, + sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed + to support distribution across multiple physical servers similar to + VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. + . + openvswitch-common provides components required by both openvswitch-switch + and openvswitch-testcontroller. + +Package: openvswitch-doc +Section: doc +Architecture: all +Depends: + ${misc:Depends}, + ${sphinxdoc:Depends}, +Description: Open vSwitch documentation + Open vSwitch is a production quality, multilayer, software-based, + Ethernet virtual switch. It is designed to enable massive network + automation through programmatic extension, while still supporting + standard management interfaces and protocols (e.g. NetFlow, IPFIX, + sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed + to support distribution across multiple physical servers similar to + VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. + . + This package provides documentation for configuration and use + of Open vSwitch. + +Package: openvswitch-ipsec +Architecture: linux-any +Pre-Depends: ${misc:Pre-Depends} +Depends: + iproute2, + openvswitch-common (= ${binary:Version}), + openvswitch-switch (= ${binary:Version}), + python3-openvswitch (= ${source:Version}), + strongswan, + ${misc:Depends}, + ${shlibs:Depends}, +Suggests: python3:any +Breaks: + openvswitch-common (<< 2.17~), +Replaces: + openvswitch-common (<< 2.17~), +Description: Open vSwitch IPsec tunneling support + Open vSwitch is a production quality, multilayer, software-based, + Ethernet virtual switch. It is designed to enable massive network + automation through programmatic extension, while still supporting + standard management interfaces and protocols (e.g. NetFlow, IPFIX, + sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed + to support distribution across multiple physical servers similar to + VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. + . + This package provides IPsec tunneling support for OVS tunnels. + +Package: openvswitch-pki +Architecture: all +Depends: + openvswitch-common (<< ${source:Version}.1~), + openvswitch-common (>= ${source:Version}), + ${misc:Depends}, +Description: Open vSwitch public key infrastructure dependency package + Open vSwitch is a production quality, multilayer, software-based, + Ethernet virtual switch. It is designed to enable massive network + automation through programmatic extension, while still supporting + standard management interfaces and protocols (e.g. NetFlow, IPFIX, + sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed + to support distribution across multiple physical servers similar to + VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. + . + openvswitch-pki provides PKI (public key infrastructure) support for + Open vSwitch switches and controllers, reducing the risk of + man-in-the-middle attacks on the Open vSwitch network infrastructure. + +Package: openvswitch-source +Architecture: all +Depends: + ${misc:Depends}, +Description: Open vSwitch source code + Open vSwitch is a production quality, multilayer, software-based, + Ethernet virtual switch. It is designed to enable massive network + automation through programmatic extension, while still supporting + standard management interfaces and protocols (e.g. NetFlow, IPFIX, + sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed + to support distribution across multiple physical servers similar to + VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. + . + This package contains the full Open vSwitch source code to support + use with the Open Virtual Network (OVN) build. + +Package: openvswitch-switch +Architecture: linux-any +Pre-Depends: ${misc:Pre-Depends}, +Depends: + kmod | module-init-tools, + netbase, + openvswitch-common (= ${binary:Version}), + procps, + python3-netifaces, + python3-openvswitch (>= ${source:Version}), + uuid-runtime, + ${misc:Depends}, + ${python3:Depends}, + ${shlibs:Depends}, +Breaks: + openvswitch-common (<< 2.17~), +Replaces: + openvswitch-common (<< 2.17~), +Description: Open vSwitch switch implementations + Open vSwitch is a production quality, multilayer, software-based, + Ethernet virtual switch. It is designed to enable massive network + automation through programmatic extension, while still supporting + standard management interfaces and protocols (e.g. NetFlow, IPFIX, + sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed + to support distribution across multiple physical servers similar to + VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. + . + openvswitch-switch provides the userspace components and utilities for + the Open vSwitch kernel-based switch. + +Package: openvswitch-switch-dpdk +Architecture: amd64 arm64 i386 ppc64el +Pre-Depends: ${misc:Pre-Depends}, +Depends: + dpdk, + openvswitch-switch (= ${binary:Version}), + ${misc:Depends}, + ${python3:Depends}, + ${shlibs:Depends}, +Enhances: + openvswitch-switch, +Description: DPDK enabled Open vSwitch switch implementation + Open vSwitch is a production quality, multilayer, software-based, + Ethernet virtual switch. It is designed to enable massive network + automation through programmatic extension, while still supporting + standard management interfaces and protocols (e.g. NetFlow, IPFIX, + sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed + to support distribution across multiple physical servers similar to + VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. + . + openvswitch-switch provides the userspace components and utilities for + the Open vSwitch kernel-based switch. + . + DPDK is a set of libraries for fast packet processing. Applications run + in user-space and communicate directly with dedicated network interfaces. + . + This package provides a DPDK enabled implementation of the ovs-vswitchd + binary. + +Package: openvswitch-test +Architecture: all +Depends: + python3-twisted, + ${misc:Depends}, + ${python3:Depends}, +Breaks: + python3-openvswitch (<< 2.17~), + openvswitch-common (<< 2.17~), +Replaces: + python3-openvswitch (<< 2.17~), + openvswitch-common (<< 2.17~), +Description: Open vSwitch test package + Open vSwitch is a production quality, multilayer, software-based, + Ethernet virtual switch. It is designed to enable massive network + automation through programmatic extension, while still supporting + standard management interfaces and protocols (e.g. NetFlow, IPFIX, + sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed + to support distribution across multiple physical servers similar to + VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. + . + This package contains utilities that are useful to diagnose + performance and connectivity issues in Open vSwitch setup. + +Package: openvswitch-testcontroller +Architecture: linux-any +Breaks: + openvswitch-common (<< 2.17~), +Replaces: + openvswitch-common (<< 2.17~), +Pre-Depends: ${misc:Pre-Depends} +Depends: + lsb-base, + openvswitch-common (= ${binary:Version}), + openvswitch-pki (= ${source:Version}), + ${misc:Depends}, + ${shlibs:Depends}, +Description: Simple controller for testing OpenFlow setups + This controller enables OpenFlow switches that connect to it to act + as MAC-learning Ethernet switches. It can be used for initial + testing of OpenFlow networks. It is not a necessary or desirable + part of a production OpenFlow deployment. + +Package: openvswitch-vtep +Architecture: linux-any +Pre-Depends: ${misc:Pre-Depends} +Depends: + lsb-base, + lsb-release, + openvswitch-common (>= ${binary:Version}), + openvswitch-switch (>= ${binary:Version}), + python3-openvswitch (>= ${source:Version}), + ${misc:Depends}, + ${python3:Depends}, + ${shlibs:Depends}, +Suggests: python3:any +Breaks: + openvswitch-common (<< 2.17~), +Replaces: + openvswitch-common (<< 2.17~), +Description: Open vSwitch VTEP utilities + Open vSwitch is a production quality, multilayer, software-based, Ethernet + virtual switch. It is designed to enable massive network automation through + programmatic extension, while still supporting standard management interfaces + and protocols (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In + addition, it is designed to support distribution across multiple physical + servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus + 1000V. + . + This package provides utilities that are useful to interact with a + VTEP-configured database and a VTEP emulator. + +Package: python3-openvswitch +Architecture: all +Section: python +Depends: + ${misc:Depends}, + ${python3:Depends}, +Description: Python 3 bindings for Open vSwitch + Open vSwitch is a production quality, multilayer, software-based, + Ethernet virtual switch. It is designed to enable massive network + automation through programmatic extension, while still supporting + standard management interfaces and protocols (e.g. NetFlow, IPFIX, + sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed + to support distribution across multiple physical servers similar to + VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. + . + This package contains the full Python 3 bindings for Open vSwitch + database. diff --git a/debian/copyright.in b/debian/copyright.in new file mode 100644 index 000000000..64d23795d --- /dev/null +++ b/debian/copyright.in @@ -0,0 +1,792 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: OpenVSwitch +Source: http://openvswitch.org/ + +Upstream Authors (from AUTHORS.rst): + +%AUTHORS% + +Files: * +Copyright: (c) 2007-2019 Nicira, Inc. + (c) 2010 Jean Tourrilhes - HP-Labs. + (c) 2008,2009,2010 Citrix Systems, Inc. + (c) 2011 Gaetano Catalli + (c) 2000-2003 Geoffrey Wossum <gwossum@acm.org> + (c) 2000 The NetBSD Foundation, Inc. + (c) 1995, 1996, 1997, and 1998 USAGI/WIDE Project. + (c) 1982, 1986, 1990, 1993 The Regents of the University of California. + (c) 2008, 2012 Vincent Bernat <bernat@luffy.cx> + (c) 2014 Michael Chapman + (c) 2014 WindRiver, Inc. + (c) 2014 Avaya, Inc. + (c) 2001 Daniel Hartmeier + (c) 2002 - 2008 Henning Brauer + (c) 2012 Gleb Smirnoff <glebius@FreeBSD.org> + (c) 6WIND S.A. + (c) Alexandru Copot <alex.mihai.c@gmail.com>, with support from IXIA. + (c) Alexey I. Froloff. + (c) Amir Vadai <amir@vadai.me> + (c) Arm Limited + (c) Benjamin Kosnik <bkoz@redhat.com> + (c) Cisco Systems, Inc + (c) Cloudbase Solutions Srl + (c) Cumulus Netowkrs + (c) Daniel Baluta <dbaluta@ixiacom.com> + (c) Dan Nicholson <dbn.lists@gmail.com> + (c) Dustin J. Mitchell <dustin@zmanda.com> + (c) Ed Maste + (c) Eelco Chaudron + (c) Ericsson AB + (c) Free Software Foundation, Inc., + (c) Gary S. Brown. + (c) Grant Jenks + (c) Hewlett Packard Enterprise Development LP + (c) Horms Solutions Ltd. + (c) IBM + (c) Ilya Maximets <i.maximets@samsung.com> + (c) Javier Fernandez-Sanguino <jfs@debian.org> + (c) Jiri Pirko <jiri@resnulli.us> + (c) Kmindg <kmindg@gmail.com> + (c) Krzesimir Nowak <qdlacz@gmail.com> + (c) M3S, Srl - Italy + (c) Mark Pilgrim + (c) Mellanox Technologies, Ltd. + (c) Moritz Klammler + (c) Netronome + (c) Open Networking Foundation + (c) Paolo Abeni <pabeni@redhat.com> + (c) Paul Norman <penorman@mac.com> + (c) Red Hat, Inc. + (c) Roy Stogner <roystgnr@ices.utexas.edu> + (c) Samsung Electronics Co.,Ltd. + (c) Scott James Remnant <scott@netsplit.com> + (c) Scott Pakin <pakin@uiuc.edu> + (c) Siemens AG + (c) Sten Spans <sten@blinkenlights.nl> + (c) Stephen Finucane <stephen@that.guru> + (c) The Board of Trustees of The Leland Stanford Junior University + (c) The University of Waikato + (c) VMware, Inc. + (c) WIDE Project. + (c) YAMAMOTO Takashi + (c) Zack Weinberg <zackw@panix.com> + (c) Zmanda Inc. <http://www.zmanda.com/> +License: Apache-2.0 + +Files: + include/windows/netinet/icmp6.h + include/windows/netinet/ip6.h + lib/strsep.c +Copyright: (c) 1990,1993, The Regents of the University of California +License: BSD-3-clause + +Files: + datapath/linux/compat/include/linux/openvswitch.h +Copyright: (c) 2007-2017 Nicira, Inc. +License: Apache-2.0-or-GPL-2.0 + +Files: + build-aux/cccl +Copyright: (C) 2000-2003 Geoffrey Wossum <gwossum@acm.org> +License: GPL-2 + +Files: lib/getopt_long.c + include/windows/getopt.h + datapath-windows/ovsext/Conntrack-tcp.c + lib/conntrack-tcp.c +Copyright: (c) 2001 Daniel Hartmeier + (c) 2002 - 2008 Henning Brauer + (c) 2012 Gleb Smirnoff <glebius@FreeBSD.org> + (c) 2015, 2016 Nicira, Inc. +License: BSD-2-clause + +Files: + utilities/bugtool/ovs-bugtool-* + utilities/bugtool/plugins/kernel-info/openvswitch.xml + utilities/bugtool/plugins/network-status/openvswitch.xml + utilities/bugtool/plugins/system-configuration.xml + utilities/bugtool/plugins/system-configuration/openvswitch.xml +Copyright: (c) 2011 Nicira, Inc. +License: LGPL-2.1 + +Files: xenserver/etc_xensource_scripts_vif + xenserver/opt_xensource_libexec_InterfaceReconfigure.py + xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py + xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py + xenserver/opt_xensource_libexec_interface-reconfigure + xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py +Copyright: (c) 2008,2009 Citrix Systems, Inc. +License: LGPL-2.1-with-exception + +Files: + lib/sflow.h + lib/sflow_agent.c + lib/sflow_api.h + lib/sflow_poller.c + lib/sflow_receiver.c + lib/sflow_sampler.c +Copyright: (c) 2002-2009 InMon Corp. +License: Sun-Industry-Standard-or-InMon-sFlow-License + +Files: lib/crc32c.c +Copyright: (c) 1986 Gary S. Brown. +License: without-restriction + You may use this program, or code or tables extracted from it, as desired + without restriction. + +Files: lib/ovs.tmac +Copyright: (c) 2007, Eric S. Raymond <esr@thyrsus.com> + (c) 2007, Werner Lemberg <wl@gnu.org> + (c) 2007, 2009, 2011 Free Software Foundation, Inc. +License: freely-use-modify-distribute + You may freely use, modify and/or distribute this file. + +Files: m4/absolute-header.m4 + m4/include_next.m4 +Copyright: (c) Derek Price + (c) Paul Eggert + (c) 2006-2013 Free Software Foundation, Inc. +License: file-is-free-software + This file is free software; the Free Software Foundation + gives unlimited permission to copy and/or distribute it, + with or without modifications, as long as this notice is preserved. + +Files: + lib/lldp/aa-structs.h + lib/lldp/lldpd.c + lib/lldp/lldpd.h + lib/lldp/lldpd-structs.c + lib/lldp/lldpd-structs.h + lib/lldp/lldp.c + lib/lldp/lldp-tlv.h + lib/lldp/lldp-const.h +Copyright: (c) 2015 Nicira, Inc. + (c) 2008 Vincent Bernat <bernat@luffy.cx> +License: ISC-license + +License: Sun-Industry-Standard-or-InMon-sFlow-License + Retrieved from http://host-sflow.sourceforge.net/sissl.html, 2011-12-12: + . + Sun Industry Standards Source License - Version 1.1 + . + 1.0 DEFINITIONS + . + 1.1 "Commercial Use" means distribution or otherwise making the + Original Code available to a third party. + . + 1.2 "Contributor Version" means the combination of the Original Code, + and the Modifications made by that particular Contributor. + . + 1.3 "Electronic Distribution Mechanism" means a mechanism generally + accepted in the software development community for the electronic + transfer of data. + . + 1.4 "Executable" means Original Code in any form other than Source + Code. + . + 1.5 "Initial Developer" means the individual or entity identified as + the Initial Developer in the Source Code notice required by Exhibit A. + . + 1.6 "Larger Work" means a work which combines Original Code or portions + thereof with code not governed by the terms of this License. + . + 1.7 "License" means this document. + . + 1.8 "Licensable" means having the right to grant, to the maximum extent + possible, whether at the time of the initial grant or subsequently + acquired, any and all of the rights conveyed herein. + . + 1.9 "Modifications" means any addition to or deletion from the + substance or structure of either the Original Code or any previous + Modifications. A Modification is: + . + A. Any addition to or deletion from the contents of a file containing + Original Code or previous Modifications. + . + B. Any new file that contains any part of the Original Code or previous + Modifications. + . + 1.10 "Original Code" means Source Code of computer software code which + is described in the Source Code notice required by Exhibit A as + Original Code. + . + 1.11 "Patent Claims" means any patent claim(s), now owned or hereafter + acquired, including without limitation, method, process, and apparatus + claims, in any patent Licensable by grantor. + . + 1.12 "Source Code" means the preferred form of the Original Code for + making modifications to it, including all modules it contains, plus any + associated interface definition files, or scripts used to control + compilation and installation of an Executable. + . + 1.13 "Standards" means the standards identified in Exhibit B. + . + 1.14 "You" (or "Your") means an individual or a legal entity exercising + rights under, and complying with all of the terms of, this License or a + future version of this License issued under Section 6.1. For legal + entities, "You'' includes any entity which controls, is controlled by, + or is under common control with You. For purposes of this definition, + "control'' means (a) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + . + 2.0 SOURCE CODE LICENSE + . + 2.1 The Initial Developer Grant + The Initial Developer hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + . + (a) under intellectual property rights (other than patent or trademark) + Licensable by Initial Developer to use, reproduce, modify, display, + perform, sublicense and distribute the Original Code (or portions + thereof) with or without Modifications, and/or as part of a Larger + Work; and + . + (b) under Patents Claims infringed by the making, using or selling of + Original Code, to make, have made, use, practice, sell, and offer for + sale, and/or otherwise dispose of the Original Code (or portions + thereof). + . + (c) the licenses granted in this Section 2.1(a) and (b) are effective + on the date Initial Developer first distributes Original Code under the + terms of this License. + . + (d) Notwithstanding Section 2.1(b) above, no patent license is granted: + 1) for code that You delete from the Original Code; 2) separate from + the Original Code; or 3) for infringements caused by: i) the + modification of the Original Code or ii) the combination of the + Original Code with other software or devices, including but not limited + to Modifications. + 3.0 DISTRIBUTION OBLIGATIONS + . + 3.1 Application of License. + The Source Code version of Original Code may be distributed only under + the terms of this License or a future version of this License released + under Section 6.1, and You must include a copy of this License with + every copy of the Source Code You distribute. You may not offer or + impose any terms on any Source Code version that alters or restricts + the applicable version of this License or the recipients' rights + hereunder. Your license for shipment of the Contributor Version is + conditioned upon Your full compliance with this Section. The + Modifications which You create must comply with all requirements set + out by the Standards body in effect one hundred twenty (120) days + before You ship the Contributor Version. In the event that the + Modifications do not meet such requirements, You agree to publish + either (i) any deviation from the Standards protocol resulting from + implementation of Your Modifications and a reference implementation of + Your Modifications or (ii) Your Modifications in Source Code form, and + to make any such deviation and reference implementation or + Modifications available to all third parties under the same terms as + this license on a royalty free basis within thirty (30) days of Your + first customer shipment of Your Modifications. + . + 3.2 Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source + Code. If it is not possible to put such notice in a particular Source + Code file due to its structure, then You must include such notice in a + location (such as a relevant directory) where a user would be likely to + look for such a notice. If You created one or more Modification(s) You + may add Your name as a Contributor to the notice described in Exhibit + A. You must also duplicate this License in any documentation for the + Source Code where You describe recipients' rights or ownership rights + relating to Initial Code. You may choose to offer, and to charge a fee + for, warranty, support, indemnity or liability obligations to one or + more recipients of Your version of the Code. However, You may do so + only on Your own behalf, and not on behalf of the Initial Developer. + You must make it absolutely clear than any such warranty, support, + indemnity or liability obligation is offered by You alone, and You + hereby agree to indemnify the Initial Developer for any liability + incurred by the Initial Developer as a result of warranty, support, + indemnity or liability terms You offer. + . + 3.3 Distribution of Executable Versions. + You may distribute Original Code in Executable and Source form only if + the requirements of Sections 3.1 and 3.2 have been met for that + Original Code, and if You include a notice stating that the Source Code + version of the Original Code is available under the terms of this + License. The notice must be conspicuously included in any notice in an + Executable or Source versions, related documentation or collateral in + which You describe recipients' rights relating to the Original Code. + You may distribute the Executable and Source versions of Your version + of the Code or ownership rights under a license of Your choice, which + may contain terms different from this License, provided that You are in + compliance with the terms of this License. If You distribute the + Executable and Source versions under a different license You must make + it absolutely clear that any terms which differ from this License are + offered by You alone, not by the Initial Developer. You hereby agree to + indemnify the Initial Developer for any liability incurred by the + Initial Developer as a result of any such terms You offer. + . + 3.4 Larger Works. + You may create a Larger Work by combining Original Code with other code + not governed by the terms of this License and distribute the Larger + Work as a single product. In such a case, You must make sure the + requirements of this License are fulfilled for the Original Code. + . + 4.0 INABILITY TO COMPLY DUE TO STATUTE OR REGULATION + . + If it is impossible for You to comply with any of the terms of this + License with respect to some or all of the Original Code due to + statute, judicial order, or regulation then You must: (a) comply with + the terms of this License to the maximum extent possible; and (b) + describe the limitations and the code they affect. Such description + must be included in the LEGAL file described in Section 3.2 and must be + included with all distributions of the Source Code. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + . + 5.0 APPLICATION OF THIS LICENSE + . + This License applies to code to which the Initial Developer has + attached the notice in Exhibit A and to related Modifications as set + out in Section 3.1. + . + 6.0 VERSIONS OF THE LICENSE + . + 6.1 New Versions. + Sun may publish revised and/or new versions of the License from time to + time. Each version will be given a distinguishing version number. + . + 6.2 Effect of New Versions. + Once Original Code has been published under a particular version of the + License, You may always continue to use it under the terms of that + version. You may also choose to use such Original Code under the terms + of any subsequent version of the License published by Sun. No one other + than Sun has the right to modify the terms applicable to Original Code. + . + 7.0 DISCLAIMER OF WARRANTY + . + ORIGINAL CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + WITHOUT LIMITATION, WARRANTIES THAT THE ORIGINAL CODE IS FREE OF + DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. + THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE ORIGINAL CODE + IS WITH YOU. SHOULD ANY ORIGINAL CODE PROVE DEFECTIVE IN ANY RESPECT, + YOU (NOT THE INITIAL DEVELOPER) ASSUME THE COST OF ANY NECESSARY + SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY + CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY ORIGINAL + CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + . + 8.0 TERMINATION + . + 8.1 This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to cure + such breach within 30 days of becoming aware of the breach. All + sublicenses to the Original Code which are properly granted shall + survive any termination of this License. Provisions which, by their + nature, must remain in effect beyond the termination of this License + shall survive. + . + 8.2 In the event of termination under Section 8.1 above, all end user + license agreements (excluding distributors and resellers) which have + been validly granted by You or any distributor hereunder prior to + termination shall survive termination. + . + 9.0 LIMIT OF LIABILITY + . + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL + DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF ORIGINAL CODE, + OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY + INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY + CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, + WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY + RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW + PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE + EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS + EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + . + 10.0 U.S. GOVERNMENT END USERS + . + U.S. Government: If this Software is being acquired by or on behalf of + the U.S. Government or by a U.S. Government prime contractor or + subcontractor (at any tier), then the Government's rights in the + Software and accompanying documentation shall be only as set forth in + this license; this is in accordance with 48 C.F.R. 227.7201 through + 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 + C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). + . + 11.0 MISCELLANEOUS + . + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed by + California law provisions (except to the extent applicable law, if any, + provides otherwise), excluding its conflict-of-law provisions. With + respect to disputes in which at least one party is a citizen of, or an + entity chartered or registered to do business in the United States of + America, any litigation relating to this License shall be subject to + the jurisdiction of the Federal Courts of the Northern District of + California, with venue lying in Santa Clara County, California, with + the losing party responsible for costs, including without limitation, + court costs and reasonable attorneys' fees and expenses. The + application of the United Nations Convention on Contracts for the + International Sale of Goods is expressly excluded. Any law or + regulation which provides that the language of a contract shall be + construed against the drafter shall not apply to this License. + . + EXHIBIT A - Sun Standards License + . + "The contents of this file are subject to the Sun Standards + License Version 1.1 (the "License"); + You may not use this file except in compliance with the + License. You may obtain a copy of the + License at http://host-sflow.sourceforge.net/sissl.html. + . + Software distributed under the License is distributed on + an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either + express or implied. See the License for the specific + language governing rights and limitations under the License. + . + The Original Code is sFlow Agent Library. + . + The Initial Developer of the Original Code is: + InMon Corp. + . + Portions created by: _______________________________________ + . + are Copyright (C): _______________________________________ + . + All Rights Reserved. + . + Contributor(s): _______________________________________ + . + EXHIBIT B - Standards + . + The Standard is defined as the following: + . + sFlow Specification, located at http://sflow.org/developers/specifications.php + --- + Retrieved from http://www.inmon.com/technology/sflowlicense.txt, 2011-12-12: + . + LICENSE AGREEMENT + . + PLEASE READ THIS LICENSE AGREEMENT ("AGREEMENT") CAREFULLY BEFORE REPRODUCING OR IN ANY WAY + UTILIZING THE sFlow(R) SOFTWARE ("SOFTWARE") AND/OR ANY ACCOMPANYING DOCUMENTATION + ("DOCUMENTATION") AND/OR THE RELATED SPECIFICATIONS ("SPECIFICATIONS"). YOUR REPRODUCTION + OR USE OF THE SOFTWARE AND/OR THE DOCUMENTATION AND/OR THE SPECIFICATIONS CONSTITUTES YOUR + ACCEPTANCE OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO BE BOUND + BY THE TERMS AND CONDITIONS OF THIS AGREEMENT, YOU MAY NOT REPRODUCE OR IN ANY WAY UTILIZE + THE SOFTWARE OR THE DOCUMENTATION OR THE SPECIFICATIONS. + . + 1. Definitions. + . + "Documentation" means the user manuals, training materials, and operating materials, if any, + InMon provides to Licensee under this Agreement. + . + "InMon" means InMon Corporation, its affiliates and subsidiaries. + . + "Intellectual Property Rights" means any trade secrets, patents, including without + limitation any patents covering the Software, copyrights, know-how, moral rights and + similar rights of any type under the laws of any governmental authority, domestic or + foreign, including all applications and registrations relating to any of the foregoing. + . + "Licensee Hardware" means all computers, routers, or other equipment owned or controlled by + or on behalf of Licensee. + . + "Products" means any and all software applications, computers, routers, or other equipment + manufactured by or on behalf of Licensee for the purpose of resale or lease to any other + third party, or otherwise made available by Licensee free of charge. + . + "Software" means the sFlow(R) software programs, in source or binary code format, that + Licensee licenses from InMon under this Agreement and any bug fixes or error corrections + which InMon may provide to Licensee. + . + "Specifications" means the published specifications provided or otherwise made available by + InMon at: http://www.sflow.org. + . + "Trademark" means InMon's "sFlow(R)" trademark. + . + 2. License Grant. + . + 2.1 Software, Documentation and Specifications License Grant. InMon hereby grants to + Licensee, under all of InMon's Intellectual Property Rights therein, a perpetual (subject + to InMon's termination rights under Section 7 below), nonexclusive, royalty-free, worldwide, + transferable, sublicensable license, to: (i) use and reproduce the Software, the + Documentation, and the Specifications; (ii) modify the Software; (iii) implement the + Specifications in the Products; (iv) install the Software, or software in which the + Specifications have been implemented, on Licensee Hardware and Products, and (v) distribute + any Products that include the Software, the Documentation, or software in which the + Specifications have been implemented. + . + 2.2 Trademark License. InMon hereby grants to Licensee a perpetual (subject to InMon's + termination rights under Section 7 below), nonexclusive, royalty-free, worldwide, + transferable, sublicensable license to use the Trademark on or in connection with the + Software, the Documentation, the Specifications and any software that implements the + Specifications. + . + 2.3 Restrictions. Licensee agrees that it will not use the Software in a way + inconsistent with the license granted in Section 2.1. Further, Licensee agrees that, in + exercising its rights under the license granted to it in this Agreement, Licensee will: + (i) strictly adhere to and fully comply with the Specifications; (ii) use the Trademark, + and no other mark, to identify the Software, the Documentation, the Specifications and any + Products that implement the Specifications; (iii) place, in a font or graphic design + designated by InMon, the phrase "sFlow(R)" on any technical documentation, + sales/marketing materials, catalogs, or other such materials relating to products it + manufactures or markets which it has configured to be compatible with the Software or + otherwise implement the Specifications; (iv) in connection with any Products shipped to or + sold in other countries that include the Software or any software that implements the + Specifications, comply with the patent and trademark laws and practice of such other + country; and (v) not alter or impair any acknowledgment of copyright or trademark rights of + InMon that may appear in or on the Software, the Documentation or the Specifications. In + the event InMon determines that Licensee is not complying with its obligations under + clauses (i)-(v) above, InMon shall notify Licensee of such non-compliance, and if Licensee + fails to correct such non-compliance within three (3) months, InMon may immediately + terminate this Agreement as provided under paragraph 7 below and pursue any and all + actions and remedies as it deems necessary, including, but not limited to breach of + contract. + . + 3. Ownership. Except for the license expressly granted in Section 2, Inmon hereby + retains all right, title, and interest in and to the Trademark and all its Intellectual + Property Rights in the Software, the Documentation and the Specifications. Licensee + obtains no rights hereunder in the Trademark, Software, Documentation or Specifications by + implication, estoppel or otherwise. Licensee acknowledges that the Trademark, Software, + Documentation and Specifications are being licensed and not sold under this Agreement, and + that this Agreement does not transfer title in the Trademark, Software, Documentation or + Specifications, or any copy thereof, to Licensee. + . + 4. Support. Inmon shall have no obligation under this Agreement to (a) supply + maintenance or support, bug fixes or error corrections to the Licensed Software, + (b) supply future versions of the Licensed Software or (c) provide Licensed Software + development tools to Licensee. + . + 5. Warranty. INMON HEREBY DISCLAIMS ALL WARRANTIES, EITHER EXPRESS, IMPLIED OR + STATUTORY, WITH RESPECT TO THE TRADEMARK, THE SOFTWARE, THE DOCUMENTATION, THE + SPECIFICATIONS. OR OTHERWISE, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF ANY INTELLECTUAL + PROPERTY RIGHTS. + . + 6. Limitation of Liability. IN NO EVENT SHALL INMON OR ITS SUPPLIERS OR LICENSORS BE + LIABLE FOR ANY CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT OR EXEMPLARY DAMAGES WHATSOEVER, + WHETHER RELATED TO OR ARISING OUT OF THIS AGREEMENT, THE TRADEMARK, THE SOFTWARE, THE + DOCUMENTATION, THE SPECIFICATIONS, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, DAMAGES FOR + LOSS OF PROFITS, BUSINESS INTERRUPTION, LOSS OF DATA, COSTS OF PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES OR FOR ANY CLAIM OR DEMAND AGAINST LICENSEE BY ANY OTHER PARTY, OR OTHER + PECUNIARY LOSS, EVEN IF INMON HAS BEEN ADVISED OF OR KNOWS OF THE POSSIBILITY OF SUCH + DAMAGES. + . + 7. Term and Termination. The term of this Agreement will begin on the Effective Date, + which shall be deemed to be the date of delivery of the Software and/or Documentation and/or + Specifications to Licensee, and shall continue indefinitely unless and until terminated by + Licensee's giving written notice of termination to InMon, or by InMon pursuant to InMon's + termination rights as set forth in Section 2.3 above. Upon any termination of this + Agreement, Licensee shall cease exercising its license rights under this Agreement, + including the right to distribute Products that incorporate the Software or Documentation + or that implement the Specifications. The rights and obligations contained in Sections 1, + 3, 5, 6, 7, and 8 shall survive any termination of this Agreement. + . + 8. General Provisions. + . + 8.1 Assignment. This Agreement shall be binding upon and inure to the benefit of the + parties hereto and their permitted successors and permitted assigns. InMon will have the + right to assign this Agreement without notice to Licensee. Licensee may assign or transfer + (whether by merger, operation of law or in any other manner) any of its rights or delegate + any of its obligations hereunder without the prior written consent of InMon, provided the + assignee assumes in writing all of Licensee's obligations hereunder. + . + 8.2 Notices. All notices permitted or required under this Agreement shall be in + writing and shall be delivered in person or mailed by first class, registered or certified + mail, postage prepaid, to the address of the party specified in this Agreement or such + other address as either party may specify in writing. Such notice shall be deemed to have + been given upon receipt. + . + 8.3 Non-Waiver. No term or provision hereof shall be deemed waived, and no breach + excused, unless such waiver or consent shall be in writing and signed by the party claimed + to have waived or consented. Any consent or waiver, whether express or implied, shall not + constitute a consent or waiver of, or excuse for any separate, different or subsequent + breach. + . + 8.4 Independent Contractor. The parties' relationship shall be solely that of + independent contractors, and nothing contained in this Agreement shall be construed to make + either party an agent, partner, representative or principal of the other for any purpose. + . + 8.5 Choice of Law and Forum. This Agreement shall be governed by and construed under + the laws of the State of California, without giving effect to such state's conflict of laws + principles. The parties hereby submit to the personal jurisdiction of, and agree that any + legal proceeding with respect to or arising under this Agreement shall be brought in, the + United States District Court for the Northern District of California or the state courts + of the State of California for the County of San Francisco. + . + 8.6 U.S. Government Licenses. The Software and Documentation are considered a + "commercial item" as that term is defined at 48 C.F.R 2.101, or "commercial computer + software" and "commercial computer software documentation" as such terms are used in + 48 C.F.R 12.212 of the Federal Acquisition Regulations and its successors, and + 48 C.F.R. 227.7202 of the DoD FAR Supplement and its successors. + . + 8.7 Severability. If any provision of this Agreement is held to be unenforceable under + applicable law, then such provision shall be excluded from this Agreement and the balance + of this Agreement shall be interpreted as if such provision were so excluded and shall be + enforceable in accordance with its terms. The court in its discretion may substitute for + the excluded provision an enforceable provision which in economic substance reasonably + approximates the excluded provision. + . + 8.8 Compliance With Law. Licensee shall comply with all applicable laws and + regulations (including privacy laws and regulations) having application to or governing its + use and/or operation of the Software and agrees to indemnify and hold InMon harmless from + and against any claims, damages, losses or obligations suffered or incurred by InMon + arising from its failure to so comply. + . + 8.9 Entire Agreement; Amendment. This Agreement constitutes the final, complete and + entire agreement between the parties with respect to the subject matter hereof, and + supersedes any previous proposals, negotiations, agreements, or arrangements, whether + verbal or written, made between the parties with respect to such subject matter. This + Agreement shall control over any additional or conflicting terms in any of Licensee's + purchase orders or other business forms. This Agreement may only be amended or modified + by mutual agreement of authorized representatives of the parties in writing. + . + InMon Corp. + 1 Sansome Street, 35th Floor, San Francisco, CA 94104 + Phone: (415) 946-8901 + URL: www.inmon.com + Email: info@inmon.com + +License: BSD-3-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +License: GPL-2 + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + . + 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; if not, write to the Free Software Foundation, Inc., 51 Franklin + St, Fifth Floor, Boston, MA 02110-1301 USA + . + On Debian systems, the complete text of the GNU General Public License v2 + (GPL) can be found in /usr/share/common-licenses/GPL-2. + +License: Apache-2.0-or-GPL-2.0 + This file is offered under your choice of two licenses: Apache 2.0 or GNU + GPL 2.0 or later. The permission statements for each of these licenses is + given below. You may license your modifications to this file under either + of these licenses or both. If you wish to license your modifications under + only one of these licenses, delete the permission text for the other + license. + . + On Debian systems, the complete text of the GNU General Public License + version 2 can be found in `/usr/share/common-licenses/GPL-2'. + On Debian systems, the complete text of the Apache License version 2.0 + can be found in '/usr/share/common-licenses/Apache-2.0'. + +License: BSD-2-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +License: LGPL-2.1 + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation; either version 2.1 of the License. + . + This library 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 Lesser General Public License for more + details. + . + You should have received a copy of the GNU Lesser General Public License along + with this library; if not, write to the Free Software Foundation, Inc., 51 + Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + . + On Debian systems, the complete text of the GNU Lesser General Public License + (LGPL) may be found in /usr/share/common-licenses/LGPL-2. + +License: LGPL-2.1-with-exception + On Debian systems, the complete text of the + GNU Lesser General Public License version 2.1 can be found in + `/usr/share/common-licenses/LGPL-2.1' + . + The exception clause pre-amble reads: + . + As a special exception to the GNU Lesser General Public License, you + may link, statically or dynamically, a "work that uses the Library" + with a publicly distributed version of the Library to produce an + executable file containing portions of the Library, and distribute + that executable file under terms of your choice, without any of the + additional requirements listed in clause 6 of the GNU Lesser General + Public License. By "a publicly distributed version of the Library", + we mean either the unmodified Library as distributed, or a + modified version of the Library that is distributed under the + conditions defined in clause 3 of the GNU Library General Public + License. This exception does not however invalidate any other reasons + why the executable file might be covered by the GNU Lesser General + Public License. + +License: ISC-license + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + . + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 000000000..ca882bbb7 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 000000000..dd7b7dab6 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,8 @@ +[DEFAULT] +debian-branch = master +upstream-branch = upstream +pristine-tar = True + +[import-orig] +filter = debian/* +upstream-vcs-tag = v%(version)s diff --git a/debian/ifupdown.sh b/debian/ifupdown.sh new file mode 100755 index 000000000..b53237e50 --- /dev/null +++ b/debian/ifupdown.sh @@ -0,0 +1,114 @@ +#! /bin/sh + +# Copyright (c) 2012, 2013 Nicira, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Have a look at /usr/share/doc/openvswitch-switch/README.Debian +# for more information about configuring the /etc/network/interfaces. + +if [ -z "${IF_OVS_TYPE}" ]; then + exit 0 +fi + +ovs_vsctl() { + ovs-vsctl --timeout=5 "$@" +} + +if (ovs_vsctl --version) > /dev/null 2>&1; then :; else + exit 0 +fi + +SERVICE_UNIT=/lib/systemd/system/openvswitch-switch.service +if [ -f $SERVICE_UNIT ] && [ -x /bin/systemctl ]; then + if ! systemctl --quiet is-active openvswitch-switch.service; then + systemctl start openvswitch-switch.service + fi +else + if service openvswitch-switch status > /dev/null 2>&1; then + service openvswitch-switch start + fi +fi + +if [ "${MODE}" = "start" ]; then + eval OVS_EXTRA=\"${IF_OVS_EXTRA}\" + + case "${IF_OVS_TYPE}" in + OVSBridge) + ovs_vsctl -- --may-exist add-br "${IFACE}" ${IF_OVS_OPTIONS}\ + ${OVS_EXTRA+-- $OVS_EXTRA} + + if [ ! -z "${IF_OVS_PORTS}" ]; then + ifup --allow="${IFACE}" ${IF_OVS_PORTS} + fi + ;; + OVSPort) + ovs_vsctl -- --may-exist add-port "${IF_OVS_BRIDGE}"\ + "${IFACE}" ${IF_OVS_OPTIONS} \ + ${OVS_EXTRA+-- $OVS_EXTRA} + + ip link set dev "${IFACE}" up + ;; + OVSIntPort) + ovs_vsctl -- --may-exist add-port "${IF_OVS_BRIDGE}"\ + "${IFACE}" ${IF_OVS_OPTIONS} -- set Interface "${IFACE}"\ + type=internal ${OVS_EXTRA+-- $OVS_EXTRA} + + ip link set dev "${IFACE}" up + ;; + OVSBond) + ovs_vsctl -- --fake-iface add-bond "${IF_OVS_BRIDGE}"\ + "${IFACE}" ${IF_OVS_BONDS} ${IF_OVS_OPTIONS} \ + ${OVS_EXTRA+-- $OVS_EXTRA} + + ip link set dev "${IFACE}" up + for secondary in ${IF_OVS_BONDS} + do + ip link set dev "${secondary}" up + done + ;; + OVSPatchPort) + ovs_vsctl -- --may-exist add-port "${IF_OVS_BRIDGE}"\ + "${IFACE}" ${IF_OVS_OPTIONS} -- set Interface "${IFACE}" \ + type=patch options:peer="${IF_OVS_PATCH_PEER}" \ + ${OVS_EXTRA+-- $OVS_EXTRA} + ;; + OVSTunnel) + ovs_vsctl -- --may-exist add-port "${IF_OVS_BRIDGE}"\ + "${IFACE}" ${IF_OVS_OPTIONS} -- set Interface "${IFACE}" \ + type=${IF_OVS_TUNNEL_TYPE} ${IF_OVS_TUNNEL_OPTIONS} \ + ${OVS_EXTRA+-- $OVS_EXTRA} + ;; + *) + exit 0 + ;; + esac +elif [ "${MODE}" = "stop" ]; then + case "${IF_OVS_TYPE}" in + OVSBridge) + if [ ! -z "${IF_OVS_PORTS}" ]; then + ifdown --allow="${IFACE}" ${IF_OVS_PORTS} + fi + + ovs_vsctl -- --if-exists del-br "${IFACE}" + ;; + OVSPort|OVSIntPort|OVSBond|OVSPatchPort|OVSTunnel) + ovs_vsctl -- --if-exists del-port "${IF_OVS_BRIDGE}" "${IFACE}" + ;; + *) + exit 0 + ;; + esac +fi + +exit 0 diff --git a/debian/ltmain-whole-archive.diff b/debian/ltmain-whole-archive.diff new file mode 100644 index 000000000..4c730502c --- /dev/null +++ b/debian/ltmain-whole-archive.diff @@ -0,0 +1,30 @@ +--- a/build-aux/ltmain.sh ++++ b/build-aux/ltmain.sh +@@ -7296,6 +7296,11 @@ + continue + ;; + ++ -Wl,--whole-archive|-Wl,--no-whole-archive) ++ deplibs="$deplibs $arg" ++ continue ++ ;; ++ + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result +@@ -7735,6 +7740,15 @@ + fi + continue + ;; ++ -Wl,--whole-archive|-Wl,--no-whole-archive) ++ if test "$linkmode,$pass" = "prog,link"; then ++ compile_deplibs="$deplib $compile_deplibs" ++ finalize_deplibs="$deplib $finalize_deplibs" ++ else ++ deplibs="$deplib $deplibs" ++ fi ++ continue ++ ;; + -l*) + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" diff --git a/debian/not-installed b/debian/not-installed new file mode 100644 index 000000000..900b36570 --- /dev/null +++ b/debian/not-installed @@ -0,0 +1,8 @@ +# We provide the openvswitch-source binary package for reproducible integrated +# builds with sibling projects instead of a -dev package. +usr/include/* +usr/lib/* + +# The OVS Python bits are put in place in debian/rules and the bits left in +# debian/tmp are to be ignored. +usr/share/openvswitch/python/* diff --git a/debian/openvswitch-common.dirs b/debian/openvswitch-common.dirs new file mode 100644 index 000000000..be9ed2f03 --- /dev/null +++ b/debian/openvswitch-common.dirs @@ -0,0 +1 @@ +var/log/openvswitch diff --git a/debian/openvswitch-common.install b/debian/openvswitch-common.install new file mode 100644 index 000000000..9bdb43a6f --- /dev/null +++ b/debian/openvswitch-common.install @@ -0,0 +1,28 @@ +etc/bash_completion.d/ovs-appctl-bashcomp.bash usr/share/bash-completion/completions +usr/bin/ovs-appctl +usr/bin/ovs-docker +usr/bin/ovs-ofctl +usr/bin/ovs-parse-backtrace +usr/bin/ovs-pki +usr/bin/ovsdb-client +usr/bin/ovsdb-tool +usr/sbin/ovs-bugtool +usr/sbin/ovsdb-server +usr/share/man/man1/ovsdb-client.1 +usr/share/man/man1/ovsdb-server.1 +usr/share/man/man1/ovsdb-tool.1 +usr/share/man/man5/ovsdb-server.5 +usr/share/man/man5/ovsdb.5 +usr/share/man/man5/ovsdb.local-config.5 +usr/share/man/man7/ovs-actions.7 +usr/share/man/man7/ovs-fields.7 +usr/share/man/man7/ovsdb-server.7 +usr/share/man/man7/ovsdb.7 +usr/share/man/man8/ovs-appctl.8 +usr/share/man/man8/ovs-bugtool.8 +usr/share/man/man8/ovs-ofctl.8 +usr/share/man/man8/ovs-parse-backtrace.8 +usr/share/man/man8/ovs-pki.8 +usr/share/openvswitch/bugtool-plugins +usr/share/openvswitch/scripts/ovs-bugtool-* +usr/share/openvswitch/scripts/ovs-lib diff --git a/debian/openvswitch-common.lintian-overrides b/debian/openvswitch-common.lintian-overrides new file mode 100644 index 000000000..f043753af --- /dev/null +++ b/debian/openvswitch-common.lintian-overrides @@ -0,0 +1,2 @@ +# False positive +openvswitch-common: spelling-error-in-readme-debian diff --git a/debian/openvswitch-doc.doc-base b/debian/openvswitch-doc.doc-base new file mode 100644 index 000000000..6ee373f32 --- /dev/null +++ b/debian/openvswitch-doc.doc-base @@ -0,0 +1,10 @@ +Document: openvswitch-doc +Title: Open vSwitch Documentation +Author: N/A +Abstract: Sphinx documentation for Open vSwitch +Section: Network/Communication + +Format: HTML +Index: /usr/share/doc/openvswitch-doc/html/index.html +Files: /usr/share/doc/openvswitch-doc/html/* + diff --git a/debian/openvswitch-doc.install b/debian/openvswitch-doc.install new file mode 100644 index 000000000..b0aef354a --- /dev/null +++ b/debian/openvswitch-doc.install @@ -0,0 +1 @@ +_debian/Documentation/_build/html/* /usr/share/doc/openvswitch-doc/html/ diff --git a/debian/openvswitch-ipsec.init b/debian/openvswitch-ipsec.init new file mode 100755 index 000000000..aa6838454 --- /dev/null +++ b/debian/openvswitch-ipsec.init @@ -0,0 +1,181 @@ +#!/bin/sh +# +# Copyright (c) 2007, 2009 Javier Fernandez-Sanguino <jfs@debian.org> +# +# This is free software; you may redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2, +# or (at your option) any later version. +# +# This 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 with +# the Debian operating system, in /usr/share/common-licenses/GPL; if +# not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA +# +### BEGIN INIT INFO +# Provides: openvswitch-ipsec +# Required-Start: $network $local_fs $remote_fs openvswitch-switch +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Open vSwitch GRE-over-IPsec daemon +# Description: The ovs-monitor-ipsec script provides support for +# encrypting GRE tunnels with IPsec. +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +DAEMON=/usr/share/openvswitch/scripts/ovs-monitor-ipsec # Daemon's location +NAME=ovs-monitor-ipsec # Introduce the short server's name here +LOGDIR=/var/log/openvswitch # Log directory to use +DATADIR=/usr/share/openvswitch + +PIDFILE=/var/run/openvswitch/$NAME.pid + +test -x $DAEMON || exit 0 + +. /lib/lsb/init-functions + +DODTIME=10 # Time to wait for the server to die, in seconds + # If this value is set too low you might not + # let some servers to die gracefully and + # 'restart' will not work + +set -e + +running_pid() { +# Check if a given process pid's cmdline matches a given name + pid=$1 + name=$2 + [ -z "$pid" ] && return 1 + [ ! -d /proc/$pid ] && return 1 + cmd=`cat /proc/$pid/cmdline | tr "\000" " "|cut -d " " -f 2` + # Is this the expected server + [ "$cmd" != "$name" ] && return 1 + return 0 +} + +running() { +# Check if the process is running looking at /proc +# (works for all users) + + # No pidfile, probably no daemon present + [ ! -f "$PIDFILE" ] && return 1 + pid=`cat $PIDFILE` + running_pid $pid $DAEMON || return 1 + return 0 +} + +start_server() { + ${DATADIR}/scripts/ovs-ctl --ike-daemon=strongswan start-ovs-ipsec + return 0 +} + +stop_server() { + ${DATADIR}/scripts/ovs-ctl stop-ovs-ipsec + return 0 +} + +force_stop() { +# Force the process to die killing it manually + [ ! -e "$PIDFILE" ] && return + if running ; then + kill -15 $pid + # Is it really dead? + sleep "$DODTIME" + if running ; then + kill -9 $pid + sleep "$DODTIME" + if running ; then + echo "Cannot kill $NAME (pid=$pid)!" + exit 1 + fi + fi + fi + rm -f $PIDFILE +} + + +case "$1" in + start) + log_daemon_msg "Starting $NAME" + # Check if it's running first + if running ; then + log_progress_msg "apparently already running" + log_end_msg 0 + exit 0 + fi + if start_server && running ; then + # It's ok, the server started and is running + log_end_msg 0 + else + # Either we could not start it or it is not running + # after we did + # NOTE: Some servers might die some time after they start, + # this code does not try to detect this and might give + # a false positive (use 'status' for that) + log_end_msg 1 + fi + ;; + stop) + log_daemon_msg "Stopping $NAME" + if running ; then + # Only stop the server if we see it running + stop_server + log_end_msg $? + else + # If it's not running don't do anything + log_progress_msg "apparently not running" + log_end_msg 0 + exit 0 + fi + ;; + force-stop) + # First try to stop gracefully the program + $0 stop + if running; then + # If it's still running try to kill it more forcefully + log_daemon_msg "Stopping (force) $NAME" + force_stop + log_end_msg $? + fi + ;; + restart|force-reload) + log_daemon_msg "Restarting $NAME" + stop_server + # Wait some sensible amount, some server need this + [ -n "$DODTIME" ] && sleep $DODTIME + start_server + running + log_end_msg $? + ;; + status) + log_daemon_msg "Checking status of $NAME" + if running ; then + log_progress_msg "running" + log_end_msg 0 + else + log_progress_msg "apparently not running" + log_end_msg 1 + exit 1 + fi + ;; + # Use this if the daemon cannot reload + reload) + log_warning_msg "Reloading $NAME daemon: not implemented, as the" + log_warning_msg "deamon cannot re-read the config file (use restart)." + ;; + *) + N=/etc/init.d/openvswitch-ipsec + echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" \ + >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/debian/openvswitch-ipsec.install b/debian/openvswitch-ipsec.install new file mode 100644 index 000000000..31a8945e2 --- /dev/null +++ b/debian/openvswitch-ipsec.install @@ -0,0 +1 @@ +usr/share/openvswitch/scripts/ovs-monitor-ipsec diff --git a/debian/openvswitch-ipsec.service b/debian/openvswitch-ipsec.service new file mode 100644 index 000000000..608a6a618 --- /dev/null +++ b/debian/openvswitch-ipsec.service @@ -0,0 +1,14 @@ +[Unit] +Description=Open vSwitch IPsec daemon +Requires=openvswitch-switch.service +After=openvswitch-switch.service + +[Service] +Type=forking +PIDFile=/run/openvswitch/ovs-monitor-ipsec.pid +ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \ + --ike-daemon=strongswan start-ovs-ipsec +ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop-ovs-ipsec + +[Install] +WantedBy=multi-user.target diff --git a/debian/openvswitch-pki.dirs b/debian/openvswitch-pki.dirs new file mode 100644 index 000000000..84f7b3704 --- /dev/null +++ b/debian/openvswitch-pki.dirs @@ -0,0 +1 @@ +/var/lib/openvswitch diff --git a/debian/openvswitch-pki.postinst b/debian/openvswitch-pki.postinst new file mode 100755 index 000000000..75b477736 --- /dev/null +++ b/debian/openvswitch-pki.postinst @@ -0,0 +1,41 @@ +#!/bin/sh +# postinst script for openvswitch-pki +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <postinst> `abort-remove' +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + # Create certificate authorities. + if test ! -e /var/lib/openvswitch/pki; then + ovs-pki init + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 + + diff --git a/debian/openvswitch-pki.postrm b/debian/openvswitch-pki.postrm new file mode 100755 index 000000000..5db4d6be6 --- /dev/null +++ b/debian/openvswitch-pki.postrm @@ -0,0 +1,43 @@ +#!/bin/sh +# postrm script for openvswitch-pki +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postrm> `remove' +# * <postrm> `purge' +# * <old-postrm> `upgrade' <new-version> +# * <new-postrm> `failed-upgrade' <old-version> +# * <new-postrm> `abort-install' +# * <new-postrm> `abort-install' <old-version> +# * <new-postrm> `abort-upgrade' <old-version> +# * <disappearer's-postrm> `disappear' <overwriter> +# <overwriter-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + rm -f /var/log/openvswitch/ovs-pki.log* || true + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/openvswitch-source.dirs b/debian/openvswitch-source.dirs new file mode 100644 index 000000000..564a2ddb8 --- /dev/null +++ b/debian/openvswitch-source.dirs @@ -0,0 +1 @@ +usr/src/openvswitch diff --git a/debian/openvswitch-source.docs b/debian/openvswitch-source.docs new file mode 100644 index 000000000..6d5ee1d05 --- /dev/null +++ b/debian/openvswitch-source.docs @@ -0,0 +1 @@ +NOTICE diff --git a/debian/openvswitch-source.install b/debian/openvswitch-source.install new file mode 100644 index 000000000..9488a1e77 --- /dev/null +++ b/debian/openvswitch-source.install @@ -0,0 +1 @@ +_debian/openvswitch.tar.gz /usr/src/openvswitch diff --git a/debian/openvswitch-switch-dpdk.README.Debian b/debian/openvswitch-switch-dpdk.README.Debian new file mode 100644 index 000000000..35d432171 --- /dev/null +++ b/debian/openvswitch-switch-dpdk.README.Debian @@ -0,0 +1,62 @@ +openvswitch-switch-dpdk +----------------------- + +This package provides a DPDK enabled version of the OpenvSwitch vswitchd +binary; by default, the ovs-vswitchd binary from openvswitch-switch will +be used: + + $ update-alternatives --query ovs-vswitchd + Name: ovs-vswitchd + Link: /usr/sbin/ovs-vswitchd + Status: auto + Best: /usr/lib/openvswitch-switch/ovs-vswitchd + Value: /usr/lib/openvswitch-switch/ovs-vswitchd + + Alternative: /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk + Priority: 50 + + Alternative: /usr/lib/openvswitch-switch/ovs-vswitchd + Priority: 100 + +DPDK provides fast packet processing in userspace, and has some specific +requirements in terms of system configuration. + +DPDK has a minimum CPU feature set of SSE3, so is not appropriate for all +amd64 CPU types hence is not enabled by default. + +To switch to the DPDK version: + + sudo update-alternatives --set ovs-vswitchd \ + /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk + sudo service openvswitch-switch restart + +and to switch back: + + sudo update-alternatives --set ovs-vswitchd \ + /usr/lib/openvswitch-switch/ovs-vswitchd + sudo service openvswitch-switch restart + + -- James Page <james.page@ubuntu.com> Tue, 21 Jul 2015 12:06:49 +0100 + +Since Open vSwitch >= 2.6 the configuration of DPDK features has changed. +Instead of providing DPDK_OPTS in /etc/default/openvswitch-switch one now has +to use ovs-vsctl to enter the config into the database. + +An example basic configuration workflow might look like: + # Enable DPDK + $ ovs-vsctl set Open_vSwitch . "other_config:dpdk-init=true" + # run on cores 3,4 8,9 + $ ovs-vsctl set Open_vSwitch . "other_config:dpdk-lcore-mask=0x318" + # Allocate 2G huge pages (not Numa node aware) + $ ovs-vsctl set Open_vSwitch . "other_config:dpdk-alloc-mem=2048" + # group/permissions for vhost-user sockets (required to work with libvirt/qemu) + $ ovs-vsctl set Open_vSwitch . \ + "other_config:dpdk-extra=--vhost-owner libvirt-qemu:kvm --vhost-perm 0666" + +There are also tunables like: + $ ovs-vsctl set Open_vSwitch . "other_config:pmd-cpu-mask=0x318" + $ ovs-vsctl set Open_vSwitch . "other_config:n-dpdk-rxqs=4" + +Any of those changes require openvswitch to be restarted to take effect. + + -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Tue, 04 Oct 2016 11:17:12 +0200 diff --git a/debian/openvswitch-switch-dpdk.install b/debian/openvswitch-switch-dpdk.install new file mode 100755 index 000000000..98e555c3c --- /dev/null +++ b/debian/openvswitch-switch-dpdk.install @@ -0,0 +1,2 @@ +#!/usr/bin/dh-exec +_dpdk/vswitchd/ovs-vswitchd => /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk diff --git a/debian/openvswitch-switch-dpdk.postinst b/debian/openvswitch-switch-dpdk.postinst new file mode 100644 index 000000000..d468e40f4 --- /dev/null +++ b/debian/openvswitch-switch-dpdk.postinst @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + update-alternatives --install /usr/sbin/ovs-vswitchd ovs-vswitchd \ + /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk 50 + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/openvswitch-switch-dpdk.prerm b/debian/openvswitch-switch-dpdk.prerm new file mode 100644 index 000000000..dc897dc3f --- /dev/null +++ b/debian/openvswitch-switch-dpdk.prerm @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +case "$1" in + remove) + update-alternatives --remove ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk + ;; + + deconfigure|upgrade|failed-upgrade) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 + diff --git a/debian/openvswitch-switch.README.Debian b/debian/openvswitch-switch.README.Debian new file mode 100644 index 000000000..cb6567ec8 --- /dev/null +++ b/debian/openvswitch-switch.README.Debian @@ -0,0 +1,286 @@ +README.Debian for openvswitch-switch +--------------------------------- + +The Linux kernel 3.3 or later has an integrated Open vSwitch kernel +module. Theis Linux kernel module lacks a few features that are in +the third-party module. For details, please see the FAQ, "What +features are not available in the Open vSwitch kernel datapath that +ships as part of the upstream Linux kernel?". If you need the +additional features, you will need to build and install a Linux kernel +module by hand from the openvswitch source package. + + +Debian network scripts (ifupdown) integration +------------------------------------------------ +This package lets a user to optionally configure Open vSwitch bridges +and ports from /etc/network/interfaces. Please refer to the interfaces(5) +manpage for more details regarding /etc/network/interfaces. + +The stanzas that configure the OVS bridges should begin with "allow-ovs" +followed by name of the bridge. Here is an example. +allow-ovs br0 + +The stanzas that configure the OVS ports should begin with +"allow-${bridge-name}" followed by name of the port. Here is an example. +allow-br0 eth0 + +The following OVS specific "command" options are supported: + + - ovs_type: This can either be OVSBridge, OVSPort, OVSIntPort, OVSBond, + OVSPatchPort or OVSTunnel depending on whether you configure a bridge, + port, an internal port, a bond, a patch port or a tunnel. This is a + required option. + + - ovs_ports: This option specifies all the ports that belong to a bridge. + + - ovs_bridge: This options specifies a bridge to which a port belongs. + This is a required option for a port. + + - ovs_bonds: This option specifies the list of physical interfaces to be + bonded together. + + - ovs_patch_peer: For "OVSPatchPort" interfaces, this field specifies + the patch's peer on the other bridge. + + - ovs_tunnel_type: For "OVSTunnel" interfaces, the type of the tunnel. + For example, "gre", "vxlan", etc. + + - ovs_tunnel_options: For "OVSTunnel" interfaces, this field should be + used to specify the tunnel options like remote_ip, key, etc. + + - ovs_options: This option lets you add extra arguments to a ovs-vsctl + command. See examples. + + - ovs_extra: This option lets you run additional ovs-vsctl commands, + separated by "--" (double dash). Variables can be part of the "ovs_extra" + option. You can provide all the standard environmental variables + described in the interfaces(5) man page. You can also pass shell + commands. + +More implementation specific details can be seen in the examples. + +Examples: +-------- +ex 1: A standalone bridge. + +allow-ovs br0 +iface br0 inet static + address 192.168.1.1 + netmask 255.255.255.0 + ovs_type OVSBridge + +ex 2: A bridge with one port. + +allow-ovs br0 +iface br0 inet dhcp + ovs_type OVSBridge + ovs_ports eth0 + +allow-br0 eth0 +iface eth0 inet manual + ovs_bridge br0 + ovs_type OVSPort + +ex 3: A bridge with multiple physical ports. + +allow-ovs br0 +iface br0 inet dhcp + ovs_type OVSBridge + ovs_ports eth0 eth1 + +allow-br0 eth0 +iface eth0 inet manual + ovs_bridge br0 + ovs_type OVSPort + +allow-br0 eth1 +iface eth1 inet manual + ovs_bridge br0 + ovs_type OVSPort + +ex 4: A bridge with an OVS internal port. + +allow-ovs br1 +iface br1 inet static + address 192.168.1.1 + netmask 255.255.255.0 + ovs_type OVSBridge + ovs_ports vlan100 + +allow-br1 vlan100 +iface vlan100 inet manual + ovs_bridge br1 + ovs_type OVSIntPort + ovs_options tag=100 + ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s) + +ex 5: Bonding. + +allow-ovs br2 +iface br2 inet static + address 192.170.1.1 + netmask 255.255.255.0 + ovs_type OVSBridge + ovs_ports bond0 + +allow-br2 bond0 +iface bond0 inet manual + ovs_bridge br2 + ovs_type OVSBond + ovs_bonds eth2 eth3 + ovs_options bond_mode=balance-tcp lacp=active + +ex 6: Patch ports. + +allow-ovs br0 +iface br0 inet manual + ovs_type OVSBridge + ovs_ports patch0 + +allow-br0 patch0 +iface patch0 inet manual + ovs_bridge br0 + ovs_type OVSPatchPort + ovs_patch_peer patch1 + +allow-ovs br1 +iface br1 inet manual + ovs_type OVSBridge + ovs_ports patch1 + +allow-br1 patch1 +iface patch1 inet manual + ovs_bridge br1 + ovs_type OVSPatchPort + ovs_patch_peer patch0 + +ex 7: Tunnel. + +allow-ovs br1 +iface br1 inet static + address 192.168.1.1 + netmask 255.255.255.0 + ovs_type OVSBridge + ovs_ports gre1 + +allow-br1 gre1 +iface gre1 inet manual + ovs_bridge br1 + ovs_type OVSTunnel + ovs_tunnel_type gre + ovs_tunnel_options options:remote_ip=182.168.1.2 options:key=1 + +ex 8: Create and destroy bridges. + +ifup --allow=ovs $list_of_bridges +ifdown --allow=ovs $list_of_bridges + +Open vSwitch integration with systemd-networkd +----------------------------------------------- + +There is no native integration of OVS with systemd-networkd. That is, +you cannot create OVS bridges, ports and bonds by simply writing configuration +files in /etc/systemd/network. But, you can create OVS devices using ovs-vsctl +and then write configuration files to provide them IP addresses. + +As soon as a OVS device is visible, systemd-networkd will provide that device +an IP address. Since OVS database is persistent across reboots, the OVS +devices will get re-created after a reboot as soon as OVS startup script is +invoked. And systemd-networkd will immediately assign the configuration defined +in /etc/systemd/network. + +Example: + +If you have a physical ethernet device "ens160" which has been configured with +DHCP, your systemd-networkd's .network config file will look something like +this: + +``` +[Match] +Name=ens160 + +[Network] +DHCP=ipv4 + +[DHCP] +ClientIdentifier=mac +``` + +Please note how the DHCP ClientIdentifier above has been configured with the +mac address. + +To create a OVS bridge "br-ens160" and add "ens160" as a port of that +bridge, you can change the .network configuration for "ens160" to look like: + +``` +[Match] +Name=ens160 +``` + +Now create a new .network configuration file for "br-ens160". Something like: + +``` +[Match] +Name=br-ens160 + +[Network] +DHCP=ipv4 + +[DHCP] +ClientIdentifier=mac +``` + +Now, use ovs-vsctl to create br-ens160 and add ens160 as a port of it. You +will also have to flush the IP address of ens160 and restart systemd-networkd +in the same line. It is important to let br-ens160 have the same mac address as +ens160 to get the same IP address to br-ens160 from the DHCP server. In the +below command, "$mac_of_ens160" holds the mac address of ens160. For e.g: + +``` +mac_of_ens160='"00:0c:29:77:27:7a"' +ovs-vsctl --may-exist add-br br-ens160 -- \ + --may-exist add-port br-ens160 ens160 -- \ + set interface br-ens160 mac="$mac_of_ens160"; ip addr flush dev ens160; \ + systemctl restart systemd-networkd +``` + +br-ens160 should now have the same DHCP IP. It should also have the correct +DNS resolution servers configured. + +Notes on dependencies: +--------------------- + +openvswitch-switch depends on $network, $named $remote_fs and $syslog to start. +This creates some startup dependency issues. + +* Since openvswitch utilities are placed in /usr and /usr can be mounted +through NFS, openvswitch has to start after it. But if a user uses openvswitch +for all his networking needs and hence to mount NFS, there will be a deadlock. +So, if /usr is mounted through NFS and openvswitch is used for all networking, +the administrator should figure out a way to mount NFS before starting OVS. +One way to do this is in initramfs. + +* Since openvswitch starts after $network, $remote_fs and $syslog, any startup +script that depends on openvswitch but starts before it, needs to be changed +to depend on openvswitch-switch too. + +* Ideally, an admin should not add openvswitch bridges in the 'auto' +section of the 'interfaces' file (i.e., if "br0" is a OVS bridge, you should +not have a line "auto br0"). This is because, when ifupdown starts +working on bridges listed in 'auto', openvswitch has not yet started. + +But, if the admin wants to go down this route and adds openvswitch bridges +in the 'auto' section, openvswitch-switch will forcefully be started when +ifupdown kicks in. In a case like this, the admin needs to make sure that /usr +has already been mounted and that a remote $syslog (if used) is ready to +receive openvswitch logs. + +* With systemd, adding openvswitch bridges in the 'auto' section of the +'interfaces' file can cause race conditions (i.e., if "br0" is a OVS bridge, +you should not have a line "auto br0"). Debian systems have added a +systemd ifup@.service file. This file will call ifdown and ifup on interfaces +in "auto" section automatically when the interfaces disappear and appear +respectively. This will cause race conditions if you delete and add the same +bridges using tools like "ovs-vsctl" or "ovs-dpctl". This is also a problem +when you upgrade your openvswitch kernel module using commands like +'force-reload-kmod'. diff --git a/debian/openvswitch-switch.default b/debian/openvswitch-switch.default new file mode 100644 index 000000000..41b8e805c --- /dev/null +++ b/debian/openvswitch-switch.default @@ -0,0 +1,17 @@ +# This is a POSIX shell fragment -*- sh -*- + +# FORCE_COREFILES: If 'yes' then core files will be enabled. +# FORCE_COREFILES=yes + +# OVS_CTL_OPTS: Extra options to pass to ovs-ctl. This is, for example, +# a suitable place to specify --ovs-vswitchd-wrapper=valgrind. +# OVS_CTL_OPTS= + +# DPDK options are now configured via ovs-vsctl/ovsdb. +# dpdk-extra is the fallback for users who formerly set e.g. +# '--vhost-owner libvirt-qemu:kvm --vhost-perm 0664' +# here or any other DPDK EAL arguments via DPDK_OPTS which are not covered by +# the default switches provided by ovs-vsctl. +# This is an arbitrary string that will get appended to the EAL commandline. +# For more on the new ovsdb based configuration of DPDK features, see: +# `man ovs-vswitchd.conf.db` diff --git a/debian/openvswitch-switch.dirs b/debian/openvswitch-switch.dirs new file mode 100644 index 000000000..0b1f281ef --- /dev/null +++ b/debian/openvswitch-switch.dirs @@ -0,0 +1,2 @@ +/etc/openvswitch +/usr/share/openvswitch/switch diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init new file mode 100755 index 000000000..7b9fbf61e --- /dev/null +++ b/debian/openvswitch-switch.init @@ -0,0 +1,143 @@ +#! /bin/sh +# +# Copyright (C) 2011, 2012, 2016 Nicira, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +### BEGIN INIT INFO +# Provides: openvswitch-switch +# Required-Start: $network $named $remote_fs $syslog +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Open vSwitch switch +# Description: openvswitch-switch provides the userspace components and utilities for +# the Open vSwitch kernel-based switch. +### END INIT INFO + +(test -x /usr/sbin/ovs-vswitchd && test -x /usr/sbin/ovsdb-server) || exit 0 + +SYSTEMCTL_SKIP_REDIRECT=yes + +. /lib/lsb/init-functions + +. /usr/share/openvswitch/scripts/ovs-lib +test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch + +network_interfaces () { + INTERFACES="/etc/network/interfaces" + [ -e "${INTERFACES}" ] || return + bridges=`ifquery --allow ovs --list` + [ -n "${bridges}" ] && $1 --allow=ovs ${bridges} +} + +load_kmod () { + ovs_ctl load-kmod || exit $? +} + +start () { + if ovs_ctl load-kmod; then + : + else + echo "Module has probably not been built for this kernel." + echo "Please install Linux 3.3 or later with openvswitch kernel support." + + if test X"$OVS_MISSING_KMOD_OK" = Xyes; then + # We're being invoked by the package postinst. Do not + # fail package installation just because the kernel module + # is not available. + exit 0 + fi + fi + set ovs_ctl ${1-start} --system-id=random + if test X"$FORCE_COREFILES" != X; then + set "$@" --force-corefiles="$FORCE_COREFILES" + fi + set "$@" $OVS_CTL_OPTS + "$@" || exit $? + if [ "$2" = "start" ] && [ "$READ_INTERFACES" != "no" ]; then + network_interfaces ifup + fi +} + +stop () { + [ "$READ_INTERFACES" != "no" ] && network_interfaces ifdown + ovs_ctl stop +} + +restart () { + # OVS_FORCE_RELOAD_KMOD can be set by package postinst script. + if [ "$1" = "--save-flows=yes" ] || \ + [ "${OVS_FORCE_RELOAD_KMOD}" = "no" ]; then + start restart + elif [ "${OVS_FORCE_RELOAD_KMOD}" = "yes" ]; then + depmod -a + + if [ -e /sys/module/openvswitch ]; then + LOADED_SRCVERSION=`cat /sys/module/openvswitch/srcversion \ + 2>/dev/null` + LOADED_VERSION=`cat /sys/module/openvswitch/version \ + 2>/dev/null` + fi + SRCVERSION=`modinfo -F srcversion openvswitch 2>/dev/null` + VERSION=`modinfo -F version openvswitch 2>/dev/null` + + ovs_ctl_log "Package upgrading:\n"\ + "Loaded version: ${LOADED_VERSION} ${LOADED_SRCVERSION}.\n"\ + "Version on disk: ${VERSION} ${SRCVERSION}." + + # If the kernel module was previously loaded and it is different than + # the kernel module on disk, then do a 'force-reload-kmod'. + if [ -n "${LOADED_SRCVERSION}" ] && [ -n "${SRCVERSION}" ] && \ + [ "${SRCVERSION}" != "${LOADED_SRCVERSION}" ]; then + start force-reload-kmod + else + start restart + fi + else + READ_INTERFACES="no" stop + READ_INTERFACES="no" start + fi +} + +case $1 in + start) + start + ;; + stop | force-stop) + stop + ;; + reload | force-reload) + # The OVS daemons keep up-to-date. + ;; + restart) + shift + restart "$@" + ;; + status) + ovs_ctl status + exit $? + ;; + force-reload-kmod) + start force-reload-kmod + ;; + load-kmod) + load_kmod + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload|status|force-stop|force-reload-kmod|load-kmod}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/debian/openvswitch-switch.install b/debian/openvswitch-switch.install new file mode 100755 index 000000000..213c83bfe --- /dev/null +++ b/debian/openvswitch-switch.install @@ -0,0 +1,30 @@ +#!/usr/bin/dh-exec +debian/ifupdown.sh usr/share/openvswitch/scripts +debian/openvswitch-switch.default => /usr/share/openvswitch/switch/default.template +debian/ovs-systemd-reload /usr/share/openvswitch/scripts +etc/bash_completion.d/ovs-vsctl-bashcomp.bash usr/share/bash-completion/completions +usr/bin/ovs-dpctl +usr/bin/ovs-dpctl-top +usr/bin/ovs-pcap +usr/bin/ovs-tcpdump +usr/bin/ovs-tcpundump +usr/bin/ovs-vlan-test +usr/bin/ovs-vsctl +usr/sbin/ovs-vswitchd usr/lib/openvswitch-switch/ +usr/share/man/man1/ovs-pcap.1 +usr/share/man/man1/ovs-tcpundump.1 +usr/share/man/man5/ovs-vswitchd.conf.db.5 +usr/share/man/man8/ovs-ctl.8 +usr/share/man/man8/ovs-dpctl-top.8 +usr/share/man/man8/ovs-dpctl.8 +usr/share/man/man8/ovs-kmod-ctl.8 +usr/share/man/man8/ovs-tcpdump.8 +usr/share/man/man8/ovs-vlan-test.8 +usr/share/man/man8/ovs-vsctl.8 +usr/share/man/man8/ovs-vswitchd.8 +usr/share/openvswitch/scripts/ovs-check-dead-ifs +usr/share/openvswitch/scripts/ovs-ctl +usr/share/openvswitch/scripts/ovs-kmod-ctl +usr/share/openvswitch/scripts/ovs-save +usr/share/openvswitch/vswitch.ovsschema +usr/share/openvswitch/local-config.ovsschema diff --git a/debian/openvswitch-switch.links b/debian/openvswitch-switch.links new file mode 100644 index 000000000..cf58073ff --- /dev/null +++ b/debian/openvswitch-switch.links @@ -0,0 +1,2 @@ +usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-post-down.d/openvswitch +usr/share/openvswitch/scripts/ifupdown.sh etc/network/if-pre-up.d/openvswitch diff --git a/debian/openvswitch-switch.lintian-overrides b/debian/openvswitch-switch.lintian-overrides new file mode 100644 index 000000000..541e7366e --- /dev/null +++ b/debian/openvswitch-switch.lintian-overrides @@ -0,0 +1,4 @@ +# Lintian is bad at figuring out manpages +openvswitch-switch: spare-manual-page +# There are init scripts, they have different names +openvswitch-switch: package-supports-alternative-init-but-no-init.d-script diff --git a/debian/openvswitch-switch.logrotate b/debian/openvswitch-switch.logrotate new file mode 100644 index 000000000..f42029d0c --- /dev/null +++ b/debian/openvswitch-switch.logrotate @@ -0,0 +1,16 @@ +/var/log/openvswitch/*.log { + daily + compress + sharedscripts + create 640 root adm + missingok + rotate 30 + postrotate + # Tell Open vSwitch daemons to reopen their log files + if [ -d /var/run/openvswitch ]; then + for ctl in /var/run/openvswitch/*.ctl; do + ovs-appctl -t "$ctl" vlog/reopen 2>/dev/null || : + done + fi + endscript +} diff --git a/debian/openvswitch-switch.ovs-record-hostname.service b/debian/openvswitch-switch.ovs-record-hostname.service new file mode 100644 index 000000000..c415d1360 --- /dev/null +++ b/debian/openvswitch-switch.ovs-record-hostname.service @@ -0,0 +1,18 @@ +[Unit] +Description=Open vSwitch Record Hostname +After=ovsdb-server.service ovs-vswitchd.service network-online.target +Requires=ovsdb-server.service +Requires=ovs-vswitchd.service +Requires=network-online.target +AssertPathIsReadWrite=/var/run/openvswitch/db.sock + +[Service] +Type=oneshot +ExecStart=/usr/share/openvswitch/scripts/ovs-ctl record-hostname-if-not-set +ExecStop=/bin/true +ExecReload=/usr/share/openvswitch/scripts/ovs-ctl record-hostname-if-not-set +TimeoutSec=300 +RemainAfterExit=yes + +[Install] +RequiredBy=openvswitch-switch.service diff --git a/debian/openvswitch-switch.ovs-vswitchd.service b/debian/openvswitch-switch.ovs-vswitchd.service new file mode 100644 index 000000000..519d80d8e --- /dev/null +++ b/debian/openvswitch-switch.ovs-vswitchd.service @@ -0,0 +1,26 @@ +[Unit] +Description=Open vSwitch Forwarding Unit +After=ovsdb-server.service network-pre.target systemd-udev-settle.service +Before=network.target networking.service +Requires=ovsdb-server.service +ReloadPropagatedFrom=ovsdb-server.service +AssertPathIsReadWrite=/var/run/openvswitch/db.sock +PartOf=openvswitch-switch.service +DefaultDependencies=no + +[Service] +LimitNOFILE=1048576 +Type=forking +Restart=on-failure +Environment=HOME=/var/run/openvswitch +EnvironmentFile=-/etc/default/openvswitch-switch +ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \ + --no-ovsdb-server --no-monitor --system-id=random \ + --no-record-hostname \ + start $OVS_CTL_OPTS +ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server stop +ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server \ + --no-monitor --system-id=random \ + --no-record-hostname \ + restart $OVS_CTL_OPTS +TimeoutSec=300 diff --git a/debian/openvswitch-switch.ovsdb-server.service b/debian/openvswitch-switch.ovsdb-server.service new file mode 100644 index 000000000..339665b25 --- /dev/null +++ b/debian/openvswitch-switch.ovsdb-server.service @@ -0,0 +1,23 @@ +[Unit] +Description=Open vSwitch Database Unit +After=systemd-journald.socket network-pre.target dpdk.service local-fs.target +Before=network.target networking.service +PartOf=openvswitch-switch.service +DefaultDependencies=no + +[Service] +LimitNOFILE=1048576 +Type=forking +Restart=on-failure +EnvironmentFile=-/etc/default/openvswitch-switch +ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \ + --no-ovs-vswitchd --no-monitor --system-id=random \ + --no-record-hostname \ + start $OVS_CTL_OPTS +ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop +ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd \ + --no-record-hostname \ + --no-monitor restart $OVS_CTL_OPTS +RuntimeDirectory=openvswitch +RuntimeDirectoryMode=0755 +RuntimeDirectoryPreserve=yes diff --git a/debian/openvswitch-switch.postinst b/debian/openvswitch-switch.postinst new file mode 100755 index 000000000..042e671d5 --- /dev/null +++ b/debian/openvswitch-switch.postinst @@ -0,0 +1,70 @@ +#!/bin/sh +# postinst script for openvswitch-switch +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <postinst> `abort-remove' +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + update-alternatives --install /usr/sbin/ovs-vswitchd ovs-vswitchd \ + /usr/lib/openvswitch-switch/ovs-vswitchd 100 + mkdir -p /var/lib/openvswitch + + conffile="/etc/default/openvswitch-switch" + if [ -f "${conffile}.dpkg-bak" ]; then + # Old conffile was modified, retain old content + mv "${conffile}.dpkg-bak" "${conffile}" + fi + + # Ensure that /etc/openvswitch/conf.db links to /var/lib/openvswitch, + # moving an existing file if there is one. + # + # Ditto for .conf.db.~lock~. + for base in conf.db .conf.db.~lock~; do + new=/var/lib/openvswitch/$base + old=/etc/openvswitch/$base + if test -f $old && test ! -e $new; then + mv $old $new + fi + if test ! -e $old && test ! -h $old; then + ln -s $new $old + fi + done + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# Do not fail package installation just because the kernel module +# is not available. +OVS_MISSING_KMOD_OK=yes +export OVS_MISSING_KMOD_OK + +# force-reload-kmod during upgrade. If a user wants to override this, +# they can set the variable OVS_FORCE_RELOAD_KMOD=no while installing. +[ -z "${OVS_FORCE_RELOAD_KMOD}" ] && OVS_FORCE_RELOAD_KMOD=yes || true +export OVS_FORCE_RELOAD_KMOD + +#DEBHELPER# + +exit 0 diff --git a/debian/openvswitch-switch.postrm b/debian/openvswitch-switch.postrm new file mode 100755 index 000000000..a306abc7c --- /dev/null +++ b/debian/openvswitch-switch.postrm @@ -0,0 +1,56 @@ +#!/bin/sh +# postrm script for openvswitch-switch +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postrm> `remove' +# * <postrm> `purge' +# * <old-postrm> `upgrade' <new-version> +# * <new-postrm> `failed-upgrade' <old-version> +# * <new-postrm> `abort-install' +# * <new-postrm> `abort-install' <old-version> +# * <new-postrm> `abort-upgrade' <old-version> +# * <disappearer's-postrm> `disappear' <overwriter> +# <overwriter-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + rm -f /etc/openvswitch/conf.db + rm -f /etc/openvswitch/.conf.db.~lock~ + rm -f /etc/default/openvswitch-switch + rm -f /var/log/openvswitch/ovs-vswitchd.log* || true + rm -f /var/log/openvswitch/ovsdb-server.log* || true + rm -f /etc/openvswitch/system-id.conf + ;; + + abort-upgrade) + conffile="/etc/default/openvswitch-switch" + if [ -f "${conffile}.dpkg-bak" ] && [ ! -f "${conffile}" ]; then + # we backed up the old conffile, but upgrade is aborted - restore + mv "${conffile}.dpkg-bak" "${conffile}" + fi + ;; + + remove|upgrade|failed-upgrade|abort-install|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/openvswitch-switch.preinst b/debian/openvswitch-switch.preinst new file mode 100755 index 000000000..de8607e5e --- /dev/null +++ b/debian/openvswitch-switch.preinst @@ -0,0 +1,50 @@ +#!/bin/sh +# preinst script for openvswitch-switch +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <new-preinst> `install' +# * <new-preinst> `install' <old-version> +# * <new-preinst> `upgrade' <old-version> +# * <old-preinst> `abort-upgrade' <new-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + install|upgrade) + if dpkg --compare-versions "$2" lt-nl "2.17.2-1"; then + # the conffile was not owned by the pkg before if it had any + # custom content, retain as is to avoid an upgrade error or + # conffile prompt we back it up in that case and restore it + # in the postinst + # Since it wasn#t owned we can't query the old checksum via + # dpkg-query -W -f='${Conffiles}' as one usually would + conffile="/etc/default/openvswitch-switch" + md5olddebian="167668db26d5b29ec1469413b12d9bbe" + md5oldubuntu="ae4d44b501cfb1eb362d87644a1bae0d" + md5new="$(md5sum ${conffile} | sed -e 's/ .*//')" + if [ "${md5olddebian}" = "${md5new}" ]; then + # was unmodified, remove - will drop the new at unpack + rm -f "${conffile}" + else + if [ ! "${md5oldubuntu}" = "${md5new}" ]; then + # neither matches old default Debian, nor Ubuntu. + # move to restore in postinst after taking conffile ownership + mv "${conffile}" "${conffile}.dpkg-bak" + fi + fi + fi + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/openvswitch-switch.prerm b/debian/openvswitch-switch.prerm new file mode 100644 index 000000000..28f36ba9a --- /dev/null +++ b/debian/openvswitch-switch.prerm @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +case "$1" in + remove) + update-alternatives --remove ovs-vswitchd /usr/lib/openvswitch-switch/ovs-vswitchd + + if [ -x /usr/lib/openvswitch-switch/ovs-vswitchd-dpdk ]; then + update-alternatives --remove ovs-vswitchd /usr/lib/openvswitch-switch/ovs-vswitchd-dpdk + fi + ;; + + deconfigure|upgrade|failed-upgrade) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + + +#DEBHELPER# + +exit 0 + diff --git a/debian/openvswitch-switch.service b/debian/openvswitch-switch.service new file mode 100644 index 000000000..ef928b3c1 --- /dev/null +++ b/debian/openvswitch-switch.service @@ -0,0 +1,18 @@ +[Unit] +Description=Open vSwitch +Before=network.target +After=network-pre.target ovsdb-server.service ovs-vswitchd.service +PartOf=network.target +Requires=ovsdb-server.service +Requires=ovs-vswitchd.service + +[Service] +Type=oneshot +ExecStart=/bin/true +ExecReload=/usr/share/openvswitch/scripts/ovs-systemd-reload +ExecStop=/bin/true +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target +Also=ovs-record-hostname.service diff --git a/debian/openvswitch-test.install b/debian/openvswitch-test.install new file mode 100644 index 000000000..b3a80d86a --- /dev/null +++ b/debian/openvswitch-test.install @@ -0,0 +1,4 @@ +usr/bin/ovs-l3ping +usr/bin/ovs-test +usr/share/man/man8/ovs-l3ping.8 +usr/share/man/man8/ovs-test.8 diff --git a/debian/openvswitch-testcontroller.README.Debian b/debian/openvswitch-testcontroller.README.Debian new file mode 100644 index 000000000..0548826ef --- /dev/null +++ b/debian/openvswitch-testcontroller.README.Debian @@ -0,0 +1,12 @@ +README.Debian for openvswitch-testcontroller +-------------------------------------------- + +The controller in this package enables OpenFlow switches that connect +to it to act as MAC-learning Ethernet switches. It can be used for +initial testing of OpenFlow networks. It is not a necessary or +desirable part of a production OpenFlow deployment. + +To (re)configure the controller, edit /etc/default/openvswitch-testcontroller +and run "/etc/init.d/openvswitch-testcontroller restart". + + -- Ben Pfaff <pfaffben@debian.org>, Thu, 14 Aug 2014 10:49:34 -0700 diff --git a/debian/openvswitch-testcontroller.default b/debian/openvswitch-testcontroller.default new file mode 100644 index 000000000..c6db59570 --- /dev/null +++ b/debian/openvswitch-testcontroller.default @@ -0,0 +1,29 @@ +# This is a POSIX shell fragment -*- sh -*- + +# LISTEN: What OpenFlow connection methods should the controller listen on? +# +# This is a space-delimited list of connection methods: +# +# * "pssl:[PORT]": Listen for SSL connections on the specified PORT +# (default: 6653). The private key, certificate, and CA certificate +# must be specified below. +# +# * "ptcp:[PORT]": Listen for TCP connections on the specified PORT +# (default: 6653). Not recommended for security reasons. +# +LISTEN="pssl:" + +# PRIVKEY: Name of file containing controller's private key. +# Required if SSL enabled. +PRIVKEY=/etc/openvswitch-testcontroller/privkey.pem + +# CERT: Name of file containing certificate for private key. +# Required if SSL enabled. +CERT=/etc/openvswitch-testcontroller/cert.pem + +# CACERT: Name of file containing switch CA certificate. +# Required if SSL enabled. +CACERT=/etc/openvswitch-testcontroller/cacert.pem + +# Additional options to pass to ovs-testcontroller, e.g. "--hub" +DAEMON_OPTS="" diff --git a/debian/openvswitch-testcontroller.dirs b/debian/openvswitch-testcontroller.dirs new file mode 100644 index 000000000..d8d4f775f --- /dev/null +++ b/debian/openvswitch-testcontroller.dirs @@ -0,0 +1 @@ +etc/openvswitch-testcontroller diff --git a/debian/openvswitch-testcontroller.init b/debian/openvswitch-testcontroller.init new file mode 100755 index 000000000..67b7a994f --- /dev/null +++ b/debian/openvswitch-testcontroller.init @@ -0,0 +1,278 @@ +#!/bin/sh +# +# Copyright (c) 2011, 2014 Nicira, Inc. +# Copyright (c) 2007, 2009 Javier Fernandez-Sanguino <jfs@debian.org> +# +# This is free software; you may redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2, +# or (at your option) any later version. +# +# This 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 with +# the Debian operating system, in /usr/share/common-licenses/GPL; if +# not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA +# +### BEGIN INIT INFO +# Provides: openvswitch-testcontroller +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: $remote_fs +# Should-Start: $named +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Simple OpenFlow controller for testing +# Description: This controller enables OpenFlow switches that connect to +# it to act as MAC-learning Ethernet switches. +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +DAEMON=/usr/bin/ovs-testcontroller # Introduce the server's location here +NAME=ovs-testcontroller # Introduce the short server's name here +DESC=ovs-testcontroller # Introduce a short description here +LOGDIR=/var/log/openvswitch # Log directory to use + +PIDFILE=/var/run/openvswitch/$NAME.pid + +test -x $DAEMON || exit 0 + +. /lib/lsb/init-functions + +# Default options, these can be overriden by the information +# at /etc/default/openvswitch-testcontroller +DAEMON_OPTS="" # Additional options given to the server + +DODTIME=10 # Time to wait for the server to die, in seconds + # If this value is set too low you might not + # let some servers to die gracefully and + # 'restart' will not work + +LOGFILE=$LOGDIR/$NAME.log # Server logfile +#DAEMONUSER= # User to run the daemons as. If this value + # is set start-stop-daemon will chuid the server + +# Include defaults if available +default=/etc/default/openvswitch-testcontroller +if [ -f $default ] ; then + . $default +fi + +# Check that the user exists (if we set a user) +# Does the user exist? +if [ -n "$DAEMONUSER" ] ; then + if getent passwd | grep -q "^$DAEMONUSER:"; then + # Obtain the uid and gid + DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'` + DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'` + else + log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist." + exit 1 + fi +fi + + +set -e + +running_pid() { +# Check if a given process pid's cmdline matches a given name + pid=$1 + name=$2 + [ -z "$pid" ] && return 1 + [ ! -d /proc/$pid ] && return 1 + cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` + # Is this the expected server + [ "$cmd" != "$name" ] && return 1 + return 0 +} + +running() { +# Check if the process is running looking at /proc +# (works for all users) + + # No pidfile, probably no daemon present + [ ! -f "$PIDFILE" ] && return 1 + pid=`cat $PIDFILE` + running_pid $pid $DAEMON || return 1 + return 0 +} + +start_server() { + if [ -z "$LISTEN" ]; then + echo "$default: No connection methods configured, controller disabled" >&2 + exit 0 + fi + + if [ ! -d /var/run/openvswitch ]; then + install -d -m 755 -o root -g root /var/run/openvswitch + fi + + SSL_OPTS= + case $LISTEN in + *ssl*) + : ${PRIVKEY:=/etc/openvswitch-testcontroller/privkey.pem} + : ${CERT:=/etc/openvswitch-testcontroller/cert.pem} + : ${CACERT:=/etc/openvswitch-testcontroller/cacert.pem} + if test ! -e "$PRIVKEY" || test ! -e "$CERT" || + test ! -e "$CACERT"; then + if test ! -e "$PRIVKEY"; then + echo "$PRIVKEY: private key missing" >&2 + fi + if test ! -e "$CERT"; then + echo "$CERT: certificate for private key missing" >&2 + fi + if test ! -e "$CACERT"; then + echo "$CACERT: CA certificate missing" >&2 + fi + exit 1 + fi + SSL_OPTS="--private-key=$PRIVKEY --certificate=$CERT --ca-cert=$CACERT" + ;; + esac + +# Start the process using the wrapper + if [ -z "$DAEMONUSER" ] ; then + start-stop-daemon --start --pidfile $PIDFILE \ + --exec $DAEMON -- --detach --pidfile=$PIDFILE \ + $LISTEN $DAEMON_OPTS $SSL_OPTS + errcode=$? + else +# if we are using a daemonuser then change the user id + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --chuid $DAEMONUSER --exec $DAEMON -- \ + --detach --pidfile=$PIDFILE $LISTEN $DAEMON_OPTS \ + $SSL_OPTS + errcode=$? + fi + return $errcode +} + +stop_server() { +# Stop the process using the wrapper + if [ -z "$DAEMONUSER" ] ; then + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $DAEMON + errcode=$? + else +# if we are using a daemonuser then look for process that match + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --user $DAEMONUSER --exec $DAEMON + errcode=$? + fi + + return $errcode +} + +reload_server() { + [ ! -f "$PIDFILE" ] && return 1 + pid=`cat $PIDFILE` # This is the daemon's pid + # Send a SIGHUP + kill -1 $pid + return $? +} + +force_stop() { +# Force the process to die killing it manually + [ ! -e "$PIDFILE" ] && return + if running ; then + kill -15 $pid + # Is it really dead? + sleep "$DODTIME" + if running ; then + kill -9 $pid + sleep "$DODTIME" + if running ; then + echo "Cannot kill $NAME (pid=$pid)!" + exit 1 + fi + fi + fi + rm -f $PIDFILE +} + + +case "$1" in + start) + log_daemon_msg "Starting $DESC " "$NAME" + # Check if it's running first + if running ; then + log_progress_msg "apparently already running" + log_end_msg 0 + exit 0 + fi + if start_server && running ; then + # It's ok, the server started and is running + log_end_msg 0 + else + # Either we could not start it or it is not running + # after we did + # NOTE: Some servers might die some time after they start, + # this code does not try to detect this and might give + # a false positive (use 'status' for that) + log_end_msg 1 + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + if running ; then + # Only stop the server if we see it running + stop_server + log_end_msg $? + else + # If it's not running don't do anything + log_progress_msg "apparently not running" + log_end_msg 0 + exit 0 + fi + ;; + force-stop) + # First try to stop gracefully the program + $0 stop + if running; then + # If it's still running try to kill it more forcefully + log_daemon_msg "Stopping (force) $DESC" "$NAME" + force_stop + log_end_msg $? + fi + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + if running; then + stop_server + # Wait some sensible amount, some server need this. + [ -n "$DODTIME" ] && sleep $DODTIME + fi + start_server + running + log_end_msg $? + ;; + status) + + log_daemon_msg "Checking status of $DESC" "$NAME" + if running ; then + log_progress_msg "running" + log_end_msg 0 + else + log_progress_msg "apparently not running" + log_end_msg 1 + exit 1 + fi + ;; + # Use this if the daemon cannot reload + reload) + log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" + log_warning_msg "cannot re-read the config file (use restart)." + ;; + *) + N=/etc/init.d/openvswitch-testcontroller + echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/debian/openvswitch-testcontroller.install b/debian/openvswitch-testcontroller.install new file mode 100644 index 000000000..5595401db --- /dev/null +++ b/debian/openvswitch-testcontroller.install @@ -0,0 +1,2 @@ +usr/bin/ovs-testcontroller +usr/share/man/man8/ovs-testcontroller.8 diff --git a/debian/openvswitch-testcontroller.postinst b/debian/openvswitch-testcontroller.postinst new file mode 100755 index 000000000..7a25083f2 --- /dev/null +++ b/debian/openvswitch-testcontroller.postinst @@ -0,0 +1,52 @@ +#!/bin/sh +# postinst script for openvswitch-testcontroller +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <postinst> `abort-remove' +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + cd /etc/openvswitch-testcontroller + if ! test -e cacert.pem; then + ln -s /var/lib/openvswitch/pki/switchca/cacert.pem cacert.pem + fi + if ! test -e privkey.pem || ! test -e cert.pem; then + oldumask=$(umask) + umask 077 + ovs-pki req+sign tmp controller >/dev/null + mv tmp-privkey.pem privkey.pem + mv tmp-cert.pem cert.pem + mv tmp-req.pem req.pem + chmod go+r cert.pem req.pem + umask $oldumask + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 + + diff --git a/debian/openvswitch-testcontroller.postrm b/debian/openvswitch-testcontroller.postrm new file mode 100755 index 000000000..afca1bbf0 --- /dev/null +++ b/debian/openvswitch-testcontroller.postrm @@ -0,0 +1,44 @@ +#!/bin/sh +# postrm script for openvswitch-testcontroller +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postrm> `remove' +# * <postrm> `purge' +# * <old-postrm> `upgrade' <new-version> +# * <new-postrm> `failed-upgrade' <old-version> +# * <new-postrm> `abort-install' +# * <new-postrm> `abort-install' <old-version> +# * <new-postrm> `abort-upgrade' <old-version> +# * <disappearer's-postrm> `disappear' <overwriter> +# <overwriter-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + if cd /etc/openvswitch-testcontroller; then + rm -f cacert.pem cert.pem privkey.pem req.pem + rm -f tmp-privkey.pem tmp-cert.pem tmp-req.pem + fi + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/openvswitch-vtep.default b/debian/openvswitch-vtep.default new file mode 100644 index 000000000..2e888e726 --- /dev/null +++ b/debian/openvswitch-vtep.default @@ -0,0 +1,4 @@ +# This is a POSIX shell fragment -*- sh -*- + +# ENABLE_OVS_VTEP: Whether to start ovs-vtep. +ENABLE_OVS_VTEP="false" diff --git a/debian/openvswitch-vtep.dirs b/debian/openvswitch-vtep.dirs new file mode 100644 index 000000000..b0a8f64dd --- /dev/null +++ b/debian/openvswitch-vtep.dirs @@ -0,0 +1 @@ +/usr/share/openvswitch diff --git a/debian/openvswitch-vtep.init b/debian/openvswitch-vtep.init new file mode 100644 index 000000000..445cc8007 --- /dev/null +++ b/debian/openvswitch-vtep.init @@ -0,0 +1,81 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: openvswitch-vtep +# Required-Start: $network $named $remote_fs $syslog +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Open vSwitch VTEP emulator +# Description: Initializes the Open vSwitch VTEP emulator +### END INIT INFO + +SYSTEMCTL_SKIP_REDIRECT=yes + +. /lib/lsb/init-functions + +# Include defaults if available +default=/etc/default/openvswitch-vtep +if [ -f $default ] ; then + . $default +fi + +start () { + if [ "$ENABLE_OVS_VTEP" = "false" ]; then + exit 0 + fi + + update-rc.d -f openvswitch-switch remove >/dev/null 2>&1 + /etc/init.d/openvswitch-switch stop + + mkdir -p "/var/run/openvswitch" + + if [ ! -e "/etc/openvswitch/conf.db" ]; then + ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema + fi + + if [ ! -e "/etc/openvswitch/vtep.db" ]; then + ovsdb-tool create /etc/openvswitch/vtep.db /usr/share/openvswitch/vtep.ovsschema + fi + + if [ ! -e "/etc/openvswitch/ovsclient-cert.pem" ]; then + export RANDFILE="/root/.rnd" + cd /etc/openvswitch && ovs-pki req ovsclient && ovs-pki self-sign ovsclient + fi + + ovsdb-server --pidfile --detach --log-file --remote \ + punix:/var/run/openvswitch/db.sock \ + --remote=db:hardware_vtep,Global,managers \ + --private-key=/etc/openvswitch/ovsclient-privkey.pem \ + --certificate=/etc/openvswitch/ovsclient-cert.pem \ + --bootstrap-ca-cert=/etc/openvswitch/vswitchd.cacert \ + /etc/openvswitch/conf.db /etc/openvswitch/vtep.db + + modprobe openvswitch + + ovs-vswitchd --pidfile --detach --log-file \ + unix:/var/run/openvswitch/db.sock +} + +stop () { + /etc/init.d/openvswitch-switch stop +} + +case $1 in + start) + start + ;; + stop) + stop + ;; + restart|force-reload) + stop + start + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/debian/openvswitch-vtep.install b/debian/openvswitch-vtep.install new file mode 100644 index 000000000..09e9108c3 --- /dev/null +++ b/debian/openvswitch-vtep.install @@ -0,0 +1,5 @@ +usr/bin/vtep-ctl +usr/share/man/man5/vtep.5 +usr/share/man/man8/vtep-ctl.8 +usr/share/openvswitch/scripts/ovs-vtep +usr/share/openvswitch/vtep.ovsschema diff --git a/debian/ovs-systemd-reload b/debian/ovs-systemd-reload new file mode 100755 index 000000000..894df0427 --- /dev/null +++ b/debian/ovs-systemd-reload @@ -0,0 +1,49 @@ +#! /bin/sh + +# Copyright (c) 2017 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +case $0 in + */*) dir0=`echo "$0" | sed 's,/[^/]*$,,'` ;; + *) dir0=./ ;; +esac +. "$dir0/ovs-lib" || exit 1 + +stop_ovsdb() { + systemctl --job-mode=ignore-dependencies stop ovsdb-server +} + +start_ovsdb() { + systemctl --job-mode=ignore-dependencies start ovsdb-server +} + +stop_forwarding() { + systemctl --job-mode=ignore-dependencies stop ovs-vswitchd +} + +start_forwarding() { + systemctl --job-mode=ignore-dependencies start ovs-vswitchd +} + +add_managers() { + : +} + +if [ "$1" = "force-reload-kmod" ]; then + force_reload_kmod +else + restart +fi + +exit 0 diff --git a/debian/patches/ovs-ctl-ipsec.patch b/debian/patches/ovs-ctl-ipsec.patch new file mode 100644 index 000000000..63375cd47 --- /dev/null +++ b/debian/patches/ovs-ctl-ipsec.patch @@ -0,0 +1,18 @@ +Description: Don't monitor ipsec daemon + For Ubuntu systemd will monitor the ovs-monitor-ipsec daemon so + there is no need to spawn a separate monitor thread to deal with + restarts. Doing so has the side effect of confusing systemd into + monitoring the wrong process. +Author: James Page <james.page@ubuntu.com> +Forwarded: not-needed + +--- a/utilities/ovs-ctl.in ++++ b/utilities/ovs-ctl.in +@@ -245,7 +245,7 @@ start_ovs_ipsec () { + --pidfile=${rundir}/ovs-monitor-ipsec.pid \ + --ike-daemon=$IKE_DAEMON \ + $no_restart \ +- --log-file --detach --monitor unix:${rundir}/db.sock || return 1 ++ --log-file --detach unix:${rundir}/db.sock || return 1 + return 0 + } diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 000000000..87a2a1d97 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +ovs-ctl-ipsec.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000..f24801d14 --- /dev/null +++ b/debian/rules @@ -0,0 +1,126 @@ +#!/usr/bin/make -f +# -*- makefile -*- +#export DH_VERBOSE=1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +%: + dh $@ + +execute_after_dh_autoreconf: + patch -f --no-backup-if-mismatch -i $(CURDIR)/debian/ltmain-whole-archive.diff build-aux/ltmain.sh + +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +PARALLEL = -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +else +PARALLEL = +endif + +PYTHON3S:=$(shell py3versions -vr) +DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH) + +override_dh_auto_configure: + test -d _debian || mkdir _debian + cd _debian && ( \ + test -e Makefile || \ + ../configure --prefix=/usr --localstatedir=/var --enable-ssl \ + --sysconfdir=/etc \ + $(DATAPATH_CONFIGURE_OPTS) \ + $(EXTRA_CONFIGURE_OPTS) \ + ) +ifneq (,$(filter i386 amd64 ppc64el arm64, $(DEB_HOST_ARCH))) + test -d _dpdk || mkdir _dpdk + cd _dpdk && ( \ + test -e Makefile || \ + ../configure --prefix=/usr --localstatedir=/var --enable-ssl \ + --with-dpdk=shared --sysconfdir=/etc \ + $(DATAPATH_CONFIGURE_OPTS) \ + $(EXTRA_CONFIGURE_OPTS) \ + ) +endif + + +# NOTE(jamespage): by default, just run all tests +TEST_LIST = +TEST_LIST_DPDK = + +# armhf: +# 30: bfd - check that BFD works together with RSTP FAILED (bfd.at:829) +ifneq (,$(filter armhf, $(DEB_HOST_ARCH))) +TEST_LIST = 1-29 31- +TEST_LIST_DPDK = $(TEST_LIST) +endif # armhf + +override_dh_auto_test: +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) + if $(MAKE) -C _debian check TESTSUITEFLAGS='$(PARALLEL) $(TEST_LIST)' || \ + $(MAKE) -C _debian check TESTSUITEFLAGS='--recheck'; then :; \ + else \ + cat _debian/tests/testsuite.log; \ + exit 1; \ + fi +# Skip DPDK testing on arm64 as builders don't have crc32 support +# which is used in aarch64 based crc optimization in ovs >= 2.12.0~ +ifneq (,$(filter i386 amd64 ppc64el, $(DEB_HOST_ARCH))) + if $(MAKE) -C _dpdk check TESTSUITEFLAGS='$(PARALLEL) $(TEST_LIST_DPDK)' || \ + $(MAKE) -C _dpdk check TESTSUITEFLAGS='--recheck'; then :; \ + else \ + cat _dpdk/tests/testsuite.log; \ + exit 1; \ + fi +endif # i386/amd64/ppc64el +endif # nocheck + +override_dh_auto_build: + dh_auto_build --sourcedirectory=_debian -- dist distdir=openvswitch + dh_auto_build --sourcedirectory=_debian +ifneq (,$(filter i386 amd64 ppc64el arm64, $(DEB_HOST_ARCH))) + dh_auto_build --sourcedirectory=_dpdk +endif + +execute_before_dh_auto_clean: + find . -name "*.pyc" -delete + +override_dh_auto_install: + dh_auto_install --sourcedirectory=_debian + +execute_after_dh_install: + set -e && for pyvers in $(PYTHON3S); do \ + cd python && python$$pyvers setup.py install --install-layout=deb \ + --root $(CURDIR)/debian/python3-openvswitch; cd ..; \ + mkdir -p $(CURDIR)/debian/openvswitch-test/usr/lib/python$$pyvers/dist-packages/ovstest; \ + install -v -D -m 644 python/ovstest/*.py \ + $(CURDIR)/debian/openvswitch-test/usr/lib/python$$pyvers/dist-packages/ovstest; \ + done + +override_dh_installinit: + dh_installinit --restart-after-upgrade + dh_installinit -popenvswitch-switch --name=ovsdb-server --no-start + dh_installinit -popenvswitch-switch --name=ovs-vswitchd --no-start + dh_installinit -popenvswitch-switch --name=ovs-record-hostname --no-start + +override_dh_installsystemd: + dh_installsystemd -popenvswitch-switch --name=ovsdb-server --no-start + dh_installsystemd -popenvswitch-switch --name=ovs-vswitchd --no-start + dh_installsystemd -popenvswitch-switch --name=ovs-record-hostname --no-start + dh_installsystemd --restart-after-upgrade -Xovs-vswitchd.service -Xovsdb-server.service -Xovs-record-hostname.service + +override_dh_strip: + dh_strip --dbgsym-migration='openvswitch-dbg (<< 2.17~)' + +override_dh_python3: + dh_python3 --shebang=/usr/bin/python3 + +# Helper target for creating snapshots from upstream git +DATE=$(shell date +%Y%m%d) +# Upstream branch to track +BRANCH=branch-2.17 +VERSION=2.17.0 + +get-orig-snapshot: + rm -Rf openvswitch-upstream + git clone --branch $(BRANCH) --depth 1 https://github.com/openvswitch/ovs openvswitch-upstream + cd openvswitch-upstream && \ + export COMMIT=`git rev-parse --short HEAD` && \ + git archive --format tgz --prefix=openvswitch-$(VERSION)~git$(DATE).$$COMMIT/ \ + -o ../../openvswitch_$(VERSION)~git$(DATE).$$COMMIT.orig.tar.gz $(BRANCH) + rm -Rf openvswitch-upstream diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides new file mode 100644 index 000000000..5cd0550a0 --- /dev/null +++ b/debian/source/lintian-overrides @@ -0,0 +1,5 @@ +openvswitch source: very-long-line-length-in-source-file +openvswitch source: source-contains-autogenerated-visual-c++-file +# Until https://bugs.debian.org/1009163 is fixed we cannot add the +ds suffix +# as gbp does not support it +openvswitch source: repackaged-source-not-advertised diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 000000000..b481ed53c --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,8 @@ +Tests: vanilla dpdk +Depends: + iperf, + mininet (>= 2.2.0~), + openvswitch-switch, + openvswitch-switch-dpdk [amd64 i386], + openvswitch-testcontroller, +Restrictions: needs-root rw-build-tree isolation-machine diff --git a/debian/tests/dpdk b/debian/tests/dpdk new file mode 100755 index 000000000..2aabae050 --- /dev/null +++ b/debian/tests/dpdk @@ -0,0 +1,45 @@ +#!/bin/sh + +set -e + +if [ ! -x /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk ]; then + echo "DPDK enabled binary not detected - skipping" + exit 0 +fi + +sse3flag=$(sed -n "/^flags.*sse3/p" < /proc/cpuinfo | wc -l) +if [ "${sse3flag}" -eq 0 ]; then + echo "sse3 not available in test environment" + echo "for adt-virt-qemu please consider adding --qemu-options='-cpu qemu64,+ssse3'" + echo "SKIPPING" + exit 0 +fi + +update-alternatives --set ovs-vswitchd \ + /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk +service openvswitch-switch restart + +modprobe openvswitch || true + +echo "kernel modules loaded: " +# Check that ovs loaded +lsmod | grep "openvswitch" +echo "OK" + +echo "Checking daemons: " +pgrep ovs-vswitchd +pgrep ovsdb-server +echo "OK" + +echo "stop conflicting openvswitch testcontroller" +systemctl stop openvswitch-testcontroller || true + +if dpkg --compare-versions "$(dpkg-query --showformat '${Version}\n' --show mininet)" ge "2.3.0-1"; then + PYCMD="python3" +else + PYCMD="python2" +fi + +printf "running openflow tests using mininet" +${PYCMD} `dirname $0`/openflow.py 2>&1 +echo "OK" diff --git a/debian/tests/openflow.py b/debian/tests/openflow.py new file mode 100755 index 000000000..216b57cf4 --- /dev/null +++ b/debian/tests/openflow.py @@ -0,0 +1,66 @@ +import unittest +import logging +from mininet.net import Mininet +import mininet.log as log +from mininet.node import OVSController, OVSKernelSwitch + +Switch = OVSKernelSwitch +Controller = OVSController +logging.basicConfig(level=logging.DEBUG) +log.setLogLevel('info') + + +class BasicOpenflowTest(unittest.TestCase): + + def addHost(self, N): + logging.debug("Creating host h%s and add to net.", N) + name = 'h%d' % N + ip = '10.0.0.%d' % N + return self.net.addHost(name, ip=ip) + + def setUp(self): + self.net = Mininet(controller=Controller, switch=Switch) + + logging.info("Creating controllers") + self.net.addController('c1', command='ovs-testcontroller') + + logging.info("Creating switches") + s1 = self.net.addSwitch('s1', protocols="OpenFlow10") + s2 = self.net.addSwitch('s2', protocols="OpenFlow10") + + logging.info("Creating hosts (7 on each switch)") + hosts1 = [self.addHost(n) for n in (1, 2, 3, 4, 5, 6, 7)] + hosts2 = [self.addHost(n) for n in (8, 9, 10, 11, 12, 13, 14)] + + logging.info("Creating links") + for h in hosts1: + self.net.addLink(s1, h) + for h in hosts2: + self.net.addLink(s2, h) + self.net.addLink(s1, s2) + + logging.info("Starting network") + self.net.start() + + def testPingAll(self): + logging.info("Testing network") + packetLoss = self.net.pingAll() + self.assertTrue( + packetLoss == 0, + "Packet loss during ping test %s" % + packetLoss) + + def testIPerfTCP(self): + logging.info("Running TCP performance test") + self.net.iperf() + + def testIPerfUDP(self): + logging.info("Running UDP performance test") + self.net.iperf(l4Type='UDP') + + def tearDown(self): + logging.info("Stopping network") + self.net.stop() + +if __name__ == '__main__': + unittest.main() diff --git a/debian/tests/vanilla b/debian/tests/vanilla new file mode 100755 index 000000000..80304f4df --- /dev/null +++ b/debian/tests/vanilla @@ -0,0 +1,29 @@ +#!/bin/sh + +set -e + +echo "Checking service status right after install: " +# for transparency we want to see all status and then fail if one is inactive +systemctl status ovsdb-server.service || true +systemctl status ovs-vswitchd.service || true +systemctl status openvswitch-switch.service || true +systemctl is-active ovs-vswitchd.service ovsdb-server.service openvswitch-switch.service +echo "OK" + +echo "Checking daemon pids to exist: " +pgrep ovs-vswitchd +pgrep ovsdb-server +echo "OK" + +echo "stop conflicting openvswitch testcontroller" +systemctl stop openvswitch-testcontroller || true + +if dpkg --compare-versions "$(dpkg-query --showformat '${Version}\n' --show mininet)" ge "2.3.0-1"; then + PYCMD="python3" +else + PYCMD="python2" +fi + +printf "running openflow tests using mininet" +${PYCMD} `dirname $0`/openflow.py 2>&1 +echo "OK" diff --git a/debian/watch b/debian/watch new file mode 100644 index 000000000..5b7e3827d --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=4 +http://www.openvswitch.org/download/ https://www.openvswitch.org/releases/openvswitch-(.*).tar.gz |