This patch adds some example filters to libvirt. They are automatically installed into the proper directory for libvirt to pick them up. --- Makefile.am | 3 +- configure.ac | 3 +- examples/xml/nwfilter/Makefile.am | 29 ++++++++++++++++++++++++++ examples/xml/nwfilter/allow-arp.xml | 3 ++ examples/xml/nwfilter/allow-dhcp-server.xml | 24 +++++++++++++++++++++ examples/xml/nwfilter/allow-dhcp.xml | 21 ++++++++++++++++++ examples/xml/nwfilter/allow-ipv4.xml | 3 ++ examples/xml/nwfilter/clean-traffic.xml | 15 +++++++++++++ examples/xml/nwfilter/no-arp-spoofing.xml | 29 ++++++++++++++++++++++++++ examples/xml/nwfilter/no-ip-multicast.xml | 9 ++++++++ examples/xml/nwfilter/no-ip-spoofing.xml | 7 ++++++ examples/xml/nwfilter/no-mac-broadcast.xml | 8 +++++++ examples/xml/nwfilter/no-mac-spoofing.xml | 5 ++++ examples/xml/nwfilter/no-other-l2-traffic.xml | 7 ++++++ 14 files changed, 164 insertions(+), 2 deletions(-) Index: libvirt-acl/Makefile.am =================================================================== --- libvirt-acl.orig/Makefile.am +++ libvirt-acl/Makefile.am @@ -5,7 +5,8 @@ GENHTML = genhtml SUBDIRS = gnulib/lib include src daemon tools proxy docs gnulib/tests \ python tests po examples/domain-events/events-c examples/hellolibvirt \ - examples/dominfo examples/domsuspend examples/python examples/apparmor + examples/dominfo examples/domsuspend examples/python examples/apparmor \ + examples/xml/nwfilter ACLOCAL_AMFLAGS = -I m4 -I gnulib/m4 Index: libvirt-acl/examples/xml/nwfilter/no-mac-spoofing.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/no-mac-spoofing.xml @@ -0,0 +1,5 @@ + + + + + Index: libvirt-acl/configure.ac =================================================================== --- libvirt-acl.orig/configure.ac +++ libvirt-acl/configure.ac @@ -1987,7 +1987,8 @@ AC_OUTPUT(Makefile src/Makefile include/ examples/domsuspend/Makefile \ examples/dominfo/Makefile \ examples/python/Makefile \ - examples/hellolibvirt/Makefile) + examples/hellolibvirt/Makefile \ + examples/xml/nwfilter/Makefile) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Configuration summary]) Index: libvirt-acl/examples/xml/nwfilter/Makefile.am =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/Makefile.am @@ -0,0 +1,30 @@ + +FILTERS = \ + allow-arp.xml \ + allow-dhcp-server.xml \ + allow-dhcp.xml \ + allow-incoming-ipv4.xml \ + allow-ipv4.xml \ + clean-traffic.xml \ + no-arp-spoofing.xml \ + no-ip-multicast.xml \ + no-ip-spoofing.xml \ + no-mac-broadcast.xml \ + no-mac-spoofing.xml \ + no-other-l2-traffic.xml + +confdir = $(sysconfdir)/libvirt + +NWFILTER_DIR = "$(DESTDIR)$(sysconfdir)/libvirt/nwfilter" + +install-data-local: + $(MKDIR_P) "$(NWFILTER_DIR)" + for f in $(FILTERS); do \ + $(INSTALL_DATA) $$f "$(NWFILTER_DIR)"; \ + done + +uninstall-local:: + for f in $(FILTERS); do \ + rm -f "$(NWFILTER_DIR)/$$f"; \ + done + -test -z $(shell ls $(NWFILTER_DIR)) || rmdir $(NWFILTER_DIR) Index: libvirt-acl/examples/xml/nwfilter/no-arp-spoofing.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/no-arp-spoofing.xml @@ -0,0 +1,29 @@ + + f88f1932-debf-4aa1-9fbe-f10d3aa4bc95 + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: libvirt-acl/examples/xml/nwfilter/no-mac-broadcast.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/no-mac-broadcast.xml @@ -0,0 +1,8 @@ + + + + + + + + Index: libvirt-acl/examples/xml/nwfilter/no-ip-multicast.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/no-ip-multicast.xml @@ -0,0 +1,9 @@ + + + + + + + + + Index: libvirt-acl/examples/xml/nwfilter/no-ip-spoofing.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/no-ip-spoofing.xml @@ -0,0 +1,7 @@ + + + + + + + Index: libvirt-acl/examples/xml/nwfilter/allow-arp.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/allow-arp.xml @@ -0,0 +1,3 @@ + + + Index: libvirt-acl/examples/xml/nwfilter/allow-ipv4.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/allow-ipv4.xml @@ -0,0 +1,3 @@ + + + Index: libvirt-acl/examples/xml/nwfilter/allow-dhcp-server.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/allow-dhcp-server.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + Index: libvirt-acl/examples/xml/nwfilter/no-other-l2-traffic.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/no-other-l2-traffic.xml @@ -0,0 +1,7 @@ + + + + + + Index: libvirt-acl/examples/xml/nwfilter/allow-dhcp.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/allow-dhcp.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + Index: libvirt-acl/examples/xml/nwfilter/clean-traffic.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/clean-traffic.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + Index: libvirt-acl/examples/xml/nwfilter/allow-incoming-ipv4.xml =================================================================== --- /dev/null +++ libvirt-acl/examples/xml/nwfilter/allow-incoming-ipv4.xml @@ -0,0 +1,3 @@ + + +