├── linux ├── dsrtools │ ├── tests │ │ ├── ip4.l2.000.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip4.l2.001.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip4.l3.000.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip4.l3.001.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip4.l3.002.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip4.l3.003.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ └── 20-vip.conf │ │ ├── ip4.l3.004.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── 20-vip.conf │ │ │ ├── tinfo │ │ │ ├── 30-vip.conf │ │ │ ├── expected.status.1 │ │ │ └── trun.sh │ │ ├── ip4.l3.007.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.status.2 │ │ │ ├── expected.status.4 │ │ │ ├── expected.status.6 │ │ │ ├── expected.status.5 │ │ │ ├── expected.status.1.template │ │ │ ├── expected.status.3.template │ │ │ └── trun.sh │ │ ├── ip4.l3.008.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.status.2 │ │ │ ├── expected.status.4 │ │ │ ├── expected.status.6 │ │ │ ├── expected.status.1.template │ │ │ ├── expected.status.3.template │ │ │ ├── expected.status.5.template │ │ │ └── trun.sh │ │ ├── ip4.l3.009.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.status.2 │ │ │ ├── expected.status.4 │ │ │ ├── expected.status.6 │ │ │ ├── expected.status.1.template │ │ │ ├── expected.status.3.template │ │ │ ├── expected.status.5.template │ │ │ └── trun.sh │ │ ├── ip4.l3.010.d │ │ │ ├── expected.restart.1 │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.status.1 │ │ │ ├── expected.status.2 │ │ │ ├── expected.status.3 │ │ │ └── trun.sh │ │ ├── ip4.l3.011.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf.template │ │ │ ├── expected.status.1.template │ │ │ └── trun.sh │ │ ├── ip4.l3.012.d │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.status.2 │ │ │ ├── expected.status.1.template │ │ │ └── trun.sh │ │ ├── ip4.l3.013.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.status.1 │ │ │ ├── expected.status.2.template │ │ │ └── trun.sh │ │ ├── ip4.l3.500.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ └── 20-vip.conf │ │ ├── ip4.validation.d │ │ │ ├── expected.stop.1 │ │ │ ├── expected.stop.9 │ │ │ ├── expected.start.1 │ │ │ ├── expected.start.6 │ │ │ ├── expected.start.9 │ │ │ ├── 22-vip.conf │ │ │ ├── expected.start.2 │ │ │ ├── expected.status.3 │ │ │ ├── expected.stop.10 │ │ │ ├── expected.stop.12 │ │ │ ├── expected.boomer.4 │ │ │ ├── expected.stop.11 │ │ │ ├── expected.stop.13 │ │ │ ├── expected.stop.14 │ │ │ ├── expected.status.7 │ │ │ ├── expected.status.6 │ │ │ ├── expected.status.8 │ │ │ ├── 21-vip.conf │ │ │ ├── 23-vip.conf │ │ │ ├── 20-v i p.conf │ │ │ ├── tinfo │ │ │ ├── expected.status.1 │ │ │ ├── expected.status.9 │ │ │ ├── expected.stop.5 │ │ │ └── trun.sh │ │ ├── ip46.l2.000.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip46.l23.000.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip46.l23.001.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── trun.sh │ │ │ └── expected.status.1 │ │ ├── ip46.l3.000.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip46.l3.001.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 10-vip.conf │ │ │ ├── 40-vip.conf │ │ │ ├── 60-vip.conf │ │ │ ├── 20-vip.conf │ │ │ ├── 30-vip.conf │ │ │ ├── 50-vip.conf │ │ │ ├── 70-vip.conf │ │ │ ├── trun.sh │ │ │ └── expected.status.1 │ │ ├── ip46.l3.002.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── trun.sh │ │ │ └── expected.status.1 │ │ ├── ip46.l3.003.d │ │ │ ├── expected.start.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.stop.2 │ │ │ ├── expected.stop.1 │ │ │ ├── expected.status.3 │ │ │ ├── expected.status.5 │ │ │ ├── expected.status.6 │ │ │ ├── expected.status.1 │ │ │ ├── expected.status.4.template │ │ │ ├── expected.status.2.template │ │ │ └── trun.sh │ │ ├── ip46.l3.004.d │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.status.1 │ │ │ └── trun.sh │ │ ├── ip46.l3.005.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.status.2 │ │ │ ├── expected.status.4 │ │ │ ├── expected.status.1.template │ │ │ ├── expected.status.3.template │ │ │ └── trun.sh │ │ ├── ip6.l2.000.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip6.l2.001.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip6.l3.000.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip6.l3.001.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip6.l3.002.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ └── expected.status.1 │ │ ├── ip6.l3.500.d │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ ├── tinfo │ │ │ └── 20-vip.conf │ │ ├── ip4.verbose.d │ │ │ ├── tinfo │ │ │ ├── 30-vip.conf │ │ │ ├── 20-vip.conf │ │ │ ├── expected.status.1.template │ │ │ ├── expected.stop.1.template │ │ │ ├── expected.start.1.template │ │ │ ├── expected.start.6.template │ │ │ ├── expected.status.2.template │ │ │ ├── expected.stop.2.template │ │ │ ├── trun │ │ │ ├── trun.sh │ │ │ ├── expected.start.2.template │ │ │ ├── expected.status.5.template │ │ │ ├── expected.status.3.template │ │ │ ├── expected.stop.3.template │ │ │ ├── expected.start.3.template │ │ │ └── expected.status.4.template │ │ ├── ip46.verbose.d │ │ │ ├── tinfo │ │ │ ├── 30-vip.conf │ │ │ ├── 20-vip.conf │ │ │ ├── expected.status.1.template │ │ │ ├── expected.stop.1.template │ │ │ ├── expected.start.1.template │ │ │ ├── expected.start.6.template │ │ │ ├── trun.sh │ │ │ ├── expected.status.5.template │ │ │ └── expected.status.4.template │ │ ├── ip46.l23.002.d │ │ │ ├── expected.status.6 │ │ │ ├── 24-vip.conf │ │ │ ├── 22-vip.conf │ │ │ ├── 23-vip.conf │ │ │ ├── expected.status.1 │ │ │ ├── expected.status.2 │ │ │ ├── expected.status.3 │ │ │ ├── expected.status.4 │ │ │ ├── expected.status.5 │ │ │ ├── 21-vip.conf │ │ │ ├── 20-vip.conf │ │ │ ├── tinfo │ │ │ ├── 25-vip.conf │ │ │ └── trun.sh │ │ ├── ip4.l23.000.d │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ └── expected.status.1 │ │ ├── ip4.l3.200.d │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ └── expected.status.1 │ │ ├── ip4.l3.005.d │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.start.1 │ │ │ ├── expected.stop.1 │ │ │ └── expected.status.1 │ │ ├── ip4.l3.006.d │ │ │ ├── tinfo │ │ │ ├── 20-vip.conf │ │ │ ├── expected.stop.1 │ │ │ ├── expected.start.1 │ │ │ └── expected.status.1 │ │ ├── runtest.sh │ │ ├── Makefile │ │ └── README │ ├── README │ ├── src │ │ ├── files.mk │ │ ├── dsr.service.sed │ │ ├── README.txt │ │ ├── dsrrc.sh │ │ ├── dsr.conf.5.sed │ │ └── Makefile │ ├── package.mk │ ├── USING │ ├── tar │ │ └── Makefile │ ├── Makefile │ ├── rpm │ │ ├── rpmdefs.mk │ │ └── Makefile │ ├── macros.mk │ ├── INSTALL │ └── mock │ │ └── Makefile └── iptables-daddr │ ├── kmod-xt │ ├── files.mk │ ├── Makefile │ └── xt_DADDR.h │ ├── extensions-1.4 │ ├── files.mk │ └── Makefile │ ├── README │ ├── rpm │ ├── iptables-daddr.files │ ├── rpmdefs.mk │ └── Makefile │ ├── package.mk │ ├── tar │ └── Makefile │ ├── Makefile │ ├── macros.mk │ ├── USING │ └── INSTALL ├── docs └── nanog51.pdf ├── freebsd ├── kmod │ └── Makefile ├── README ├── CHANGES └── LICENSE ├── yvipagent ├── README ├── LICENSE ├── Makefile ├── doc │ └── yvip.conf.5 └── CHANGES └── README /linux/dsrtools/tests/ip4.l2.000.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l2.000.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l2.001.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l2.001.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.000.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.000.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.001.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.001.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.002.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.002.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.003.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.003.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.004.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.004.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.007.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.007.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.008.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.008.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.009.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.009.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.010.d/expected.restart.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.010.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.010.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.011.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.011.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.012.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.013.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.013.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.500.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.500.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.stop.9: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l2.000.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l2.000.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.000.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.000.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.001.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.001.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.000.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.000.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.002.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.002.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.004.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.005.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.005.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l2.000.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l2.000.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l2.001.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l2.001.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.000.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.000.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.001.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.001.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.002.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.002.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.500.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.500.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.start.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.start.6: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.start.9: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l2.000.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="one IPv4 L2DSR VIP" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l2.001.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="two IPv4 L2DSR VIPs" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.000.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="one IPv4 L3DSR VIP" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.001.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="two IPv4 L3DSR VIPs" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="Test verbose output" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.verbose.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="Test verbose output" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l2.000.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="one IPv6 L2DSR VIP" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l2.001.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="two IPv6 L2DSR VIPs" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.000.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="one IPv6 L3DSR VIP" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.001.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="two IPv6 L3DSR VIPs" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.002.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="two IPv6 L3DSR VIPs" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.011.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="IPv4 L3DSR FQDN, long FQDN" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/22-vip.conf: -------------------------------------------------------------------------------- 1 | now.is.the.time.com=34 2 | -------------------------------------------------------------------------------- /docs/nanog51.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahoo/l3dsr/master/docs/nanog51.pdf -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.002.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="the same IPv4 VIP has two DSCPs" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.010.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="IPv4 L3DSR restart action test" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l2.000.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="mix of IPv4/IPv6 L2DSR VIPs" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/expected.status.6: -------------------------------------------------------------------------------- 1 | No configured DSRs found. 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.000.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="mix of IPv4/IPv6 L3DSR VIPs" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l2.000.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # one IPv4 L2DSR VIP 2 | 188.125.67.68 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l23.000.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="two duplicate IPv4 L2DSR/L3DSR VIPs" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.004.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # one valid L3DSR 2 | 188.125.67.1=1 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.012.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="two IPv4 L3DSR VIPs in partial state" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.500.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="max number of IPv4 L3DSR VIPs (63)" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.start.2: -------------------------------------------------------------------------------- 1 | dsrctl: -z: unknown option 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.status.3: -------------------------------------------------------------------------------- 1 | dsrctl: -b: unknown option 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.stop.10: -------------------------------------------------------------------------------- 1 | Invalid sleep argument (foo). 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.stop.12: -------------------------------------------------------------------------------- 1 | Invalid sleep argument (.:.). 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.000.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="mix of IPv4/IPv6 L2DSR/L3DSR VIPs" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.001.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="idempotency of dsrctl start/stop" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.500.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="max number of IPv6 L3DSR VIPs (63)" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.000.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # One IPv4 L3DSR VIP. 2 | 188.125.67.68=28 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.004.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="use two IPv4 conf files, use one hex DSCP" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.boomer.4: -------------------------------------------------------------------------------- 1 | Invalid action provided (boomer). 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.stop.11: -------------------------------------------------------------------------------- 1 | Invalid sleep argument (0:foo). 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.stop.13: -------------------------------------------------------------------------------- 1 | Invalid sleep argument (foo:.4). 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.stop.14: -------------------------------------------------------------------------------- 1 | Invalid sleep argument (.4:bar). 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.003.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="the same IPv4 VIP has the max number of DSCPs" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.013.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="mix of IPv4/IPv6 L3DSR VIPs with IPv6 disabled" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.200.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="IPv4 L3DSR DSCP too large" 2 | TRV_start_1=1 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="Multiple identical iptables/ip6tables rules" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.004.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="two IPv4/IPv6 L3DSR VIPs in partial state" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l2.000.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # one IPv6 L2DSR VIP 2 | 2a00:1288:110:21b::4002 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.007.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="IPv4 L3DSR with other loopbacks already created" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.011.d/20-vip.conf.template: -------------------------------------------------------------------------------- 1 | # IPv4 L3DSR FQDN, long FQDN 2 | NODE=20 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="mix of IPv4/IPv6 L3DSR VIPs with one VIP per file" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.002.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="octal/decimal/hex DSCP values, accept comments" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.000.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # one IPv6 L3DSR VIP 2 | 2a00:1288:110:21b::4002=19 3 | -------------------------------------------------------------------------------- /freebsd/kmod/Makefile: -------------------------------------------------------------------------------- 1 | 2 | KMOD= dscp_rewrite 3 | SRCS= dscp_rewrite.c 4 | 5 | .include 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l2.001.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # two IPv4 L2DSR VIPs 2 | 188.125.67.68 3 | 188.125.67.69 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.001.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # Two IPv4 VIPs. 2 | 188.125.67.68=28 3 | 188.125.82.38=19 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.004.d/30-vip.conf: -------------------------------------------------------------------------------- 1 | # one valid L3DSR with hex value 2 | 188.125.67.2=0x34 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.008.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="IPv4 L3DSR with other iptables rules already running" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.012.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # Two IPv4 VIPs. 2 | 188.125.67.68=28 3 | 188.125.82.38=19 4 | 5 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/10-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4/IPv6 VIPs with one VIP per file 2 | 188.125.67.68=28 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/40-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4/IPv6 VIPs with one VIP per file 2 | 188.125.82.196=43 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/60-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4/IPv6 VIPs with one VIP per file 2 | 188.125.82.253=17 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.009.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="IPv4 L3DSR with other loopbacks and iptables rules already running" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.002.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # the same IPv4 VIP has two DSCPs 2 | 188.125.67.1=1 3 | 188.125.67.1=2 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/24-vip.conf: -------------------------------------------------------------------------------- 1 | # Bad input file. 2 | # Can't use double equals. 3 | 124.23.25.12==34 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # mix IPv4/IPv6 L3DSR VIPs with one VIP per file 2 | 188.125.82.38=19 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/30-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4/IPv6 VIPs with one VIP per file 2 | 2a00:1288:110:21b::4002=19 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/50-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4/IPv6 VIPs with one VIP per file 2 | 2a00:1288:110:21b::4005=43 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/70-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4/IPv6 VIPs with one VIP per file 2 | 2a00:1288:110:21b::4006=17 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/22-vip.conf: -------------------------------------------------------------------------------- 1 | # Bad input file. 2 | # Invalid line with a comment. 3 | 1.1.1.1=7 4 | = 5 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/23-vip.conf: -------------------------------------------------------------------------------- 1 | # Bad input file. 2 | # We don't support /8 nomenclature. 3 | 10.0.0.0/8=34 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l2.001.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # two IPv6 L2DSR VIPs 2 | 2a00:1288:110:21b::4002 3 | 2a00:1288:110:21b::4005 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/30-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4 L3DSRs 2 | 3 | 188.125.67.1=10 4 | 188.125.67.2=11 5 | 188.125.67.3=12 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.001.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # two IPv6 L3DSR VIPs 2 | 2a00:1288:110:21b::4002=32 3 | 2a00:1288:110:21b::4005=35 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.005.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="IPv4 L3DSRs with duplicate DSCPs (dec, oct, hex)" 2 | TRV_start_1=1 3 | TRV_status_1=1 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.006.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="IPv4 L3DSR with same DSCP followed by good L3DSR" 2 | TRV_start_1=1 3 | TRV_status_1=1 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.status.7: -------------------------------------------------------------------------------- 1 | Cannot read the configuration file (foo.conf). 2 | No configured DSRs found. 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.005.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="IPv4 and Ipv6 L3DSR with other iptables rules in different chains already running" 2 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.010.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4 L3DSR test of restart 2 | 3 | 188.125.67.1=10 4 | 188.125.67.2=11 5 | 188.125.67.3=12 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/expected.status.1: -------------------------------------------------------------------------------- 1 | Invalid config line at 20-vip.conf, line 3. Unrecognized VIP/DSCP. 2 | Aborting. 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/expected.status.2: -------------------------------------------------------------------------------- 1 | Invalid config line at 21-vip.conf, line 3. Unrecognized VIP/DSCP. 2 | Aborting. 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/expected.status.3: -------------------------------------------------------------------------------- 1 | Invalid config line at 22-vip.conf, line 4. Unrecognized VIP/DSCP. 2 | Aborting. 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/expected.status.4: -------------------------------------------------------------------------------- 1 | Invalid config line at 23-vip.conf, line 3. Unrecognized VIP/DSCP. 2 | Aborting. 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/expected.status.5: -------------------------------------------------------------------------------- 1 | Invalid config line at 24-vip.conf, line 3. Unrecognized VIP/DSCP. 2 | Aborting. 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.status.6: -------------------------------------------------------------------------------- 1 | Cannot convert fqdn "now.is.the.time.com" to an IPv4 address. 2 | No configured DSRs found. 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/21-vip.conf: -------------------------------------------------------------------------------- 1 | # Bad input file. 2 | # Invalid line with a comment. 3 | Now we are gathered = at the site 4 | -------------------------------------------------------------------------------- /linux/iptables-daddr/kmod-xt/files.mk: -------------------------------------------------------------------------------- 1 | srcfiles += \ 2 | kmod-xt/files.mk \ 3 | kmod-xt/Makefile \ 4 | kmod-xt/xt_DADDR.h \ 5 | kmod-xt/xt_DADDR.c 6 | -------------------------------------------------------------------------------- /linux/iptables-daddr/extensions-1.4/files.mk: -------------------------------------------------------------------------------- 1 | srcfiles += \ 2 | extensions-1.4/Makefile \ 3 | extensions-1.4/files.mk \ 4 | extensions-1.4/libxt_DADDR.c 5 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l23.000.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # two duplicate IPv4 L2DSR/L3DSR VIPs 2 | 188.125.67.68=28 3 | 188.125.67.68=28 4 | 188.125.67.69 5 | 188.125.67.69 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.007.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4 L3DSR with same DSCP followed by good L3DSR 2 | 3 | 188.125.67.1=10 4 | 188.125.67.2=11 5 | 188.125.67.3=12 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.008.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4 L3DSR with same DSCP followed by good L3DSR 2 | 3 | 188.125.67.1=10 4 | 188.125.67.2=11 5 | 188.125.67.3=12 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.009.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4 L3DSR with same DSCP followed by good L3DSR 2 | 3 | 188.125.67.1=10 4 | 188.125.67.2=11 5 | 188.125.67.3=12 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.status.8: -------------------------------------------------------------------------------- 1 | Cannot find the configuration directory (baddir). Is dsrtools installed? 2 | No configured DSRs found. 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # Mix of IPv4 L2DSR/L3DSR VIPs 2 | 188.125.67.68=28 3 | 188.125.82.38 4 | 188.125.82.196= 43 5 | 188.125.82.253 = 17 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.verbose.d/30-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4 L3DSR with same DSCP followed by good L3DSR 2 | 3 | 188.125.67.1=10 4 | 188.125.67.2=11 5 | 188.125.67.3=12 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.006.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4 L3DSR with same DSCP followed by good L3DSR 2 | 3 | 188.125.67.1=10 4 | 188.125.67.2=10 5 | 6 | 188.125.67.3=013 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/21-vip.conf: -------------------------------------------------------------------------------- 1 | # Mix of IPv4 L2DSR/L3DSR VIPs 2 | 188.125.67.68=28 3 | 188.125.82.38 4 | 188.125.82.196= 43 5 | 188.125.82.253 = 17 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/23-vip.conf: -------------------------------------------------------------------------------- 1 | # mix of IPv4/IPv6 L2DSR/L3DSR VIPs 2 | 188.125.67.68=28 3 | 188.125.82.38 4 | 188.125.82.196= 43 5 | 188.125.82.253 = 17 -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # Bad input file. 2 | # Invalid line with a comment. 3 | Now is the time for all good men. # This is a comment. 4 | -------------------------------------------------------------------------------- /linux/iptables-daddr/kmod-xt/Makefile: -------------------------------------------------------------------------------- 1 | obj-m += xt_DADDR.o 2 | 3 | EXTRA_CFLAGS := -I$(src)/../../.. 4 | 5 | xt_DADDR.o: $(src)/xt_DADDR.c $(src)/../../../xt_DADDR.h 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/runtest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | rv=0 6 | RunTest "$@" || rv=$? 7 | (( ErrIgnore == 0 )) || rv=0 8 | 9 | exit $rv 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="completely invalid config file" 2 | TRV_status_1=1 3 | TRV_status_2=1 4 | TRV_status_3=1 5 | TRV_status_4=1 6 | TRV_status_5=1 7 | -------------------------------------------------------------------------------- /linux/dsrtools/README: -------------------------------------------------------------------------------- 1 | See "INSTALL" for help with building and installing the dsrtools 2 | software. 3 | 4 | See "USING" for information and examples for using dsrtools 5 | software. 6 | -------------------------------------------------------------------------------- /linux/dsrtools/src/files.mk: -------------------------------------------------------------------------------- 1 | srcfiles += \ 2 | src/Makefile \ 3 | src/dsr.conf.5.sed \ 4 | src/dsrctl.8.sed \ 5 | src/dsrrc.sh \ 6 | src/dsr.service.sed \ 7 | src/dsrctl.sh \ 8 | src/README.txt 9 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/20-v i p.conf: -------------------------------------------------------------------------------- 1 | # Mix of IPv4 L2DSR/L3DSR VIPs in a file name that has spaces 2 | 188.125.67.68=28 3 | 188.125.82.38 4 | 188.125.82.196= 43 5 | 188.125.82.253 = 17 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # Multiple identical iptables/ip6tables rules 2 | 188.125.67.68=28 3 | 188.125.67.69=29 4 | 2a00:1288:110:21b::4002=19 5 | 2a00:1288:110:21b::4005=20 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.005.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # Create a few normal IPv4 and IPv6 VIPs. 2 | 2a00:1288:110:021b::4002=32 3 | 2b00:1288:110:021b::4005=35 4 | 5 | 188.125.67.1=20 6 | 188.125.67.2=21 7 | -------------------------------------------------------------------------------- /linux/iptables-daddr/README: -------------------------------------------------------------------------------- 1 | See "INSTALL" for help with building and installing the iptables-daddr 2 | software. 3 | 4 | See "USING" for information and examples for using iptables-daddr 5 | software. 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.006.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | Conflicting DSRs (IP=188.125.67.1, IP=188.125.67.2) found with DSCP 10. 2 | - Prev: L3DSR at "20-vip.conf", line 3. 3 | - Dup: L3DSR at "20-vip.conf", line 4. 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/expected.stop.2: -------------------------------------------------------------------------------- 1 | Duplicate iptables rules found for VIP 2a00:1288:110:21b::4003=0x14 count=4 2 | Duplicate iptables rules found for VIP 2a00:1288:110:21b::4004=0x15 count=5 3 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.006.d/expected.start.1: -------------------------------------------------------------------------------- 1 | Conflicting DSRs (IP=188.125.67.1, IP=188.125.67.2) found with DSCP 10. 2 | - Prev: L3DSR at "20-vip.conf", line 3. 3 | - Dup: L3DSR at "20-vip.conf", line 4. 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/tinfo: -------------------------------------------------------------------------------- 1 | TDESC="Validation tests" 2 | TRV_start_2=1 3 | TRV_status_3=1 4 | TRV_boomer_4=1 5 | TRV_stop_10=1 6 | TRV_stop_11=1 7 | TRV_stop_12=1 8 | TRV_stop_13=1 9 | TRV_stop_14=1 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l2.000.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # mix of IPv4/IPv6 L2DSR VIPs 2 | 188.125.67.68 3 | 188.125.82.38 4 | 2a00:1288:110:21b::4002 5 | 188.125.82.196 6 | 2a00:1288:110:21b::4005 7 | 188.125.82.253 8 | 2a00:1288:110:21b::4006 9 | -------------------------------------------------------------------------------- /linux/iptables-daddr/rpm/iptables-daddr.files: -------------------------------------------------------------------------------- 1 | %defattr(644,root,root,755) 2 | /lib/modules/%2-%1 3 | %if %{with_mangle} 4 | /etc/modprobe.d/%{pkgko}.conf 5 | %endif 6 | %if %{with_override} 7 | /etc/depmod.d/%{name}.conf 8 | %endif 9 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l2.000.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============= ============= ==== ======== ======== 3 | l2dsr started 188.125.67.68 188.125.67.68 -- lo:1 -- 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.000.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============= ============= ==== ======== ======== 3 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.011.d/expected.status.1.template: -------------------------------------------------------------------------------- 1 | type state NAME_HDR IPADDR_HDR dscp loopback iptables 2 | ===== ======= NAME_HDR_EQUALS IPADDR_HDR_EQUALS ==== ======== ======== 3 | l3dsr started NAME_VAL IPADDR_VAL 20 lo:1 up 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.013.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # mix of IPv4/IPv6 L3DSR VIPs 2 | 188.125.67.68=28 3 | 188.125.82.38=19 4 | 2a00:1288:110:21b::4002=19 5 | 188.125.82.196=43 6 | 2a00:1288:110:21b::4005=43 7 | 188.125.82.253=17 8 | 2a00:1288:110:21b::4006=17 9 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.004.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # Normal L3DSR VIPs, incompletely started 2 | # This situation actually occurred in production. 3 | 4 | 87.248.118.12=20 5 | 87.248.118.14=21 6 | 2A00:1288:0080:800::5001=22 7 | 2A00:1288:0080:800::5003=23 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.001.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # mix of IPv4/IPv6 L2DSR/L3DSR VIPs 2 | 188.125.67.68=28 3 | 188.125.82.38 4 | 2a00:1288:110:21b::4002=19 5 | 188.125.82.196=43 6 | 2a00:1288:110:21b::4005 7 | 188.125.82.253=17 8 | 2a00:1288:110:21b::4006=17 9 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/25-vip.conf: -------------------------------------------------------------------------------- 1 | # All comments. 2 | # Comment 1. 3 | # Comment 2. 4 | # Comment 3. 5 | ### Comment 4. 6 | #!@#$%^&*()_+-=[]{}~`\|'"/?><,Comment 5. 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.000.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # mix of IPv4/IPv6 L3DSR VIPs 2 | 188.125.67.68=28 3 | 188.125.82.38=19 4 | 2a00:1288:110:21b::4002=19 5 | 188.125.82.196=43 6 | 2a00:1288:110:21b::4005=43 7 | 188.125.82.253=17 8 | 2a00:1288:110:21b::4006=17 9 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.200.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4 L3DSR with DSCP too large. 2 | 188.125.67.68=64 3 | 188.125.67.69=65 4 | 188.125.67.70 = 0x41 5 | 188.125.67.71= 0101 6 | 188.125.67.72 = 1000 7 | 188.125.67.73 = 0xffffffff 8 | 188.125.67.74 = 0x100000000 9 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | Duplicate iptables rules found for VIP 188.125.67.68=28 count=4 2 | Duplicate iptables rules found for VIP 188.125.67.69=29 count=2 3 | Duplicate iptables rules found for VIP 2a00:1288:110:21b::4002=19 count=3 4 | -------------------------------------------------------------------------------- /linux/dsrtools/package.mk: -------------------------------------------------------------------------------- 1 | package = dsrtools 2 | version = 1.5.1 3 | 4 | pkg_vers = $(package)-$(version) 5 | srctardestdir = $(pkg_vers) 6 | srctarfile = $(pkg_vers).tar 7 | zsrctarfile = $(srctarfile).xz 8 | 9 | sinclude package-local.mk 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.000.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # mix of IPv4/IPv6 L2DSR/L3DSR VIPs 2 | 188.125.67.68=28 3 | 188.125.82.38 4 | 2a00:1288:110:21b::4002 =19 5 | 188.125.82.196= 43 6 | 2a00:1288:110:21b::4005 7 | 188.125.82.253 = 17 8 | 2a00:1288:110:21b::4006 = 17 9 | -------------------------------------------------------------------------------- /freebsd/README: -------------------------------------------------------------------------------- 1 | The software in this directory comprises a very simple packet filter that 2 | is able to rewrite the source address of IP packets by using the DSCP/TOS 3 | field as an index into a configurable sysctl table. 4 | 5 | It is licensed under a 3-clause BSD license. 6 | -------------------------------------------------------------------------------- /linux/iptables-daddr/package.mk: -------------------------------------------------------------------------------- 1 | package = iptables-daddr 2 | version = 0.10.1 3 | 4 | pkg_vers = $(package)-$(version) 5 | srctardestdir = $(pkg_vers) 6 | srctarfile = $(pkg_vers).tar 7 | zsrctarfile = $(srctarfile).xz 8 | 9 | sinclude package-local.mk 10 | -------------------------------------------------------------------------------- /linux/iptables-daddr/kmod-xt/xt_DADDR.h: -------------------------------------------------------------------------------- 1 | #ifndef _LINUX_NETFILTER_XT_DADDR_H 2 | #define _LINUX_NETFILTER_XT_DADDR_H 3 | 4 | #include 5 | 6 | struct xt_daddr_tginfo { 7 | union nf_inet_addr daddr; 8 | }; 9 | 10 | #endif /* _LINUX_NETFILTER_XT_DADDR_H */ 11 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.verbose.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # mix of IPv4/IPv6 L2DSR/L3DSR VIPs in a file name that has spaces 2 | 188.125.67.68=28 3 | 188.125.82.38 4 | 2a00:1288:110:21b::4002 =19 5 | 188.125.82.196= 43 6 | 2a00:1288:110:21b::4005 7 | 188.125.82.253 = 17 8 | 2a00:1288:110:21b::4006 = 17 9 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l23.000.d/expected.start.1: -------------------------------------------------------------------------------- 1 | Duplicate DSRs found for 188.125.67.68. 2 | - Prev: L3DSR at "20-vip.conf", line 2. 3 | - Dup: L3DSR at "20-vip.conf", line 3. 4 | Duplicate DSRs found for 188.125.67.69. 5 | - Prev: L2DSR at "20-vip.conf", line 4. 6 | - Dup: L2DSR at "20-vip.conf", line 5. 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l23.000.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | Duplicate DSRs found for 188.125.67.68. 2 | - Prev: L3DSR at "20-vip.conf", line 2. 3 | - Dup: L3DSR at "20-vip.conf", line 3. 4 | Duplicate DSRs found for 188.125.67.69. 5 | - Prev: L2DSR at "20-vip.conf", line 4. 6 | - Dup: L2DSR at "20-vip.conf", line 5. 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.002.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr started 188.125.67.1 188.125.67.1 1 lo:1 up 4 | l3dsr started 188.125.67.1 188.125.67.1 2 lo:1 up 5 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.004.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr started 188.125.67.1 188.125.67.1 1 lo:1 up 4 | l3dsr started 188.125.67.2 188.125.67.2 0x34 lo:2 up 5 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l2.000.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l2dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 -- lo -- 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.000.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l3dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 lo up 4 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l2.001.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============= ============= ==== ======== ======== 3 | l2dsr started 188.125.67.68 188.125.67.68 -- lo:1 -- 4 | l2dsr started 188.125.67.69 188.125.67.69 -- lo:2 -- 5 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.001.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============= ============= ==== ======== ======== 3 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 4 | l3dsr started 188.125.82.38 188.125.82.38 19 lo:2 up 5 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.012.d/expected.status.2: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============= ============= ==== ======== ======== 3 | l3dsr partial 188.125.67.68 188.125.67.68 28 lo:1 -- 4 | l3dsr partial 188.125.82.38 188.125.82.38 19 -- up 5 | -------------------------------------------------------------------------------- /yvipagent/README: -------------------------------------------------------------------------------- 1 | This is the "yvipagent" tool. Install it on a host that participates in a 2 | Layer-3 DSR VIP. It provides a system startup service and command-line 3 | tool to configure the host for participation in one or more VIPs according 4 | to a flat configuration file. 5 | 6 | yvipagent is released under a 3-clause BSD license. 7 | -------------------------------------------------------------------------------- /linux/dsrtools/src/dsr.service.sed: -------------------------------------------------------------------------------- 1 | # dsrtools version __VERSION__ 2 | 3 | [Unit] 4 | Description=DSR control 5 | After=network.service 6 | Documentation=man:dsrctl(8) 7 | 8 | [Service] 9 | Type=oneshot 10 | ExecStart=/usr/sbin/dsrctl start 11 | ExecStop=/usr/sbin/dsrctl stop 12 | RemainAfterExit=yes 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.007.d/expected.status.2: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.007.d/expected.status.4: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr started 188.125.67.1 188.125.67.1 10 lo:3 up 4 | l3dsr started 188.125.67.2 188.125.67.2 11 lo:4 up 5 | l3dsr started 188.125.67.3 188.125.67.3 12 lo:5 up 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.007.d/expected.status.6: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.008.d/expected.status.2: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.008.d/expected.status.4: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr started 188.125.67.1 188.125.67.1 10 lo:1 up 4 | l3dsr started 188.125.67.2 188.125.67.2 11 lo:2 up 5 | l3dsr started 188.125.67.3 188.125.67.3 12 lo:3 up 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.008.d/expected.status.6: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.009.d/expected.status.2: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.009.d/expected.status.4: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr started 188.125.67.1 188.125.67.1 10 lo:3 up 4 | l3dsr started 188.125.67.2 188.125.67.2 11 lo:4 up 5 | l3dsr started 188.125.67.3 188.125.67.3 12 lo:5 up 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.009.d/expected.status.6: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.010.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.010.d/expected.status.2: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr started 188.125.67.1 188.125.67.1 10 lo:1 up 4 | l3dsr started 188.125.67.2 188.125.67.2 11 lo:2 up 5 | l3dsr started 188.125.67.3 188.125.67.3 12 lo:3 up 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.010.d/expected.status.3: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============ ============ ==== ======== ======== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- 6 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l2.001.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l2dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 -- lo -- 4 | l2dsr started 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 -- lo -- 5 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.001.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l3dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 32 lo up 4 | l3dsr started 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 35 lo up 5 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.012.d/expected.status.1.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 2 | ===== ======= ============= ============= ==== ======== ======== IPTBL_HDR_EQUALS ==== 3 | l3dsr partial 188.125.67.68 188.125.67.68 28 lo:1 -- IPTBL_VAL conf 4 | l3dsr partial 188.125.82.38 188.125.82.38 19 -- up IPTBL_VAL conf 5 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.004.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | # Run tests. 11 | typeset rv=0 12 | 13 | (( $rv && ! ErrIgnore )) || docmd start "" d:. 1 || rv=1 14 | (( $rv && ! ErrIgnore )) || docmd status "" d:. 1 || rv=1 15 | (( $rv && ! ErrIgnore )) || docmd stop "" d:. 1 || rv=1 16 | 17 | dsrcleanup 18 | 19 | exit $rv 20 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | # Run tests. 11 | typeset rv=0 12 | 13 | (( rv && ! ErrIgnore )) || docmd start "" d:. 1 || rv=1 14 | (( rv && ! ErrIgnore )) || docmd status "" d:. 1 || rv=1 15 | (( rv && ! ErrIgnore )) || docmd stop "" d:. 1 || rv=1 16 | 17 | dsrcleanup 18 | 19 | exit $rv 20 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============== ============== ==== ======== ======== 3 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 4 | l2dsr started 188.125.82.38 188.125.82.38 -- lo:2 -- 5 | l3dsr started 188.125.82.196 188.125.82.196 43 lo:3 up 6 | l3dsr started 188.125.82.253 188.125.82.253 17 lo:4 up 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.status.9: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ============== ============== ==== ======== ======== 3 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 4 | l2dsr started 188.125.82.38 188.125.82.38 -- lo:2 -- 5 | l3dsr started 188.125.82.196 188.125.82.196 43 lo:3 up 6 | l3dsr started 188.125.82.253 188.125.82.253 17 lo:4 up 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.006.d/expected.status.1: -------------------------------------------------------------------------------- 1 | Conflicting DSRs (IP=188.125.67.1, IP=188.125.67.2) found with DSCP 10. 2 | - Prev: L3DSR at "20-vip.conf", line 3. 3 | - Dup: L3DSR at "20-vip.conf", line 4. 4 | type state name ipaddr dscp loopback iptables 5 | ===== ======= ============ ============ ==== ======== ======== 6 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 7 | l3dsr stopped 188.125.67.3 188.125.67.3 013 -- -- 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.002.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # Test all kinds of IPv6 L3DSR VIPs 2 | 2A00:1288:110:21b::4002=32 3 | 2B00:1288:110:021b::4005=35 4 | 2c00:1288:0110:021b::4006=36 5 | 2f00:1288:0080:021b::4007=37 6 | 2a00:1288:0008:021b::4008=38 7 | 2a00:1288:0009:0::4009=39 8 | 2a00:1288:000A:0:0:0:0:400a=0x35 9 | 2a00:1288:000A:0:0:0:0:0=0x3f 10 | 2a00:1288:000A:0:0:0:0:0=0x3E 11 | 0:0:B:0:0:0:2:1=42 12 | 0:0:B::=43 13 | 1:0:0:0:0:0:0:0=47 14 | 0005:2:0:0:0:0:0:0=48 15 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.002.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # octal/decimal/hex DSCP values, accept comments 2 | 188.125.67.68=28#188.125.67.68=29 3 | 188.125.67.69=014 # one space 4 | 188.125.67.70=0x23 # one tab 5 | 188.125.67.71=0X24 # multiple spaces/tabs 6 | 2a00:1288:110:21b::4002=19#2a00:1288:110:21b::4002=20 7 | 2a00:1288:110:21b::4005=024 # one space 8 | 2a00:1288:110:21b::4006=0x34 # one tab 9 | 2a00:1288:110:21b::4007=0X35 # multiple spaces/tabs 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.002.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | # Run tests. 11 | typeset rv=0 12 | 13 | (( rv && ! ErrIgnore )) || docmd status "" n:20 1 || rv=1 14 | (( rv && ! ErrIgnore )) || docmd status "" n:21 2 || rv=1 15 | (( rv && ! ErrIgnore )) || docmd status "" n:22 3 || rv=1 16 | (( rv && ! ErrIgnore )) || docmd status "" n:23 4 || rv=1 17 | (( rv && ! ErrIgnore )) || docmd status "" n:24 5 || rv=1 18 | 19 | dsrcleanup 20 | 21 | exit $rv 22 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.status.1.template: -------------------------------------------------------------------------------- 1 | +ip -o addr show lo 2 | +iptables -L -t TABLE -n 3 | IPV6ONLY:+ip6tables -L -t TABLE -n 4 | type state name ipaddr dscp loopback iptables 5 | ===== ======= ============== ============== ==== ======== ======== 6 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 7 | l2dsr started 188.125.82.38 188.125.82.38 -- lo:2 -- 8 | l3dsr started 188.125.82.196 188.125.82.196 43 lo:3 up 9 | l3dsr started 188.125.82.253 188.125.82.253 17 lo:4 up 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/expected.status.3: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l3dsr stopped 188.125.67.68 188.125.67.68 28 -- -- 4 | l3dsr stopped 188.125.67.69 188.125.67.69 29 -- -- 5 | l3dsr stopped 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 -- -- 6 | l3dsr stopped 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 20 -- -- 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/expected.status.5: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l3dsr stopped 188.125.67.68 188.125.67.68 28 -- -- 4 | l3dsr stopped 188.125.67.69 188.125.67.69 29 -- -- 5 | l3dsr stopped 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 -- -- 6 | l3dsr stopped 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 20 -- -- 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.004.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================== ======================== ==== ======== ======== 3 | l3dsr partial 87.248.118.12 87.248.118.12 20 lo:1 -- 4 | l3dsr started 87.248.118.14 87.248.118.14 21 lo:2 up 5 | l3dsr started 2A00:1288:0080:800::5001 2A00:1288:0080:800::5001 22 lo up 6 | l3dsr partial 2A00:1288:0080:800::5003 2A00:1288:0080:800::5003 23 lo -- 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.005.d/expected.status.2: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================== ======================== ==== ======== ======== 3 | l3dsr stopped 2a00:1288:110:021b::4002 2a00:1288:110:021b::4002 32 -- -- 4 | l3dsr stopped 2b00:1288:110:021b::4005 2b00:1288:110:021b::4005 35 -- -- 5 | l3dsr stopped 188.125.67.1 188.125.67.1 20 -- -- 6 | l3dsr stopped 188.125.67.2 188.125.67.2 21 -- -- 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.005.d/expected.status.4: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================== ======================== ==== ======== ======== 3 | l3dsr started 2a00:1288:110:021b::4002 2a00:1288:110:021b::4002 32 lo up 4 | l3dsr started 2b00:1288:110:021b::4005 2b00:1288:110:021b::4005 35 lo up 5 | l3dsr started 188.125.67.1 188.125.67.1 20 lo:1 up 6 | l3dsr started 188.125.67.2 188.125.67.2 21 lo:2 up 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.200.d/expected.start.1: -------------------------------------------------------------------------------- 1 | Invalid DSCP value at "20-vip.conf", line 2. "64" too large (max=63). 2 | Invalid DSCP value at "20-vip.conf", line 3. "65" too large (max=63). 3 | Invalid DSCP value at "20-vip.conf", line 4. "0x41" too large (max=63). 4 | Invalid DSCP value at "20-vip.conf", line 5. "0101" too large (max=63). 5 | Invalid DSCP value at "20-vip.conf", line 6. "1000" too large (max=63). 6 | Invalid DSCP value at "20-vip.conf", line 7. "0xffffffff" too large (max=63). 7 | Invalid DSCP value at "20-vip.conf", line 8. "0x100000000" too large (max=63). 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.200.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | Invalid DSCP value at "20-vip.conf", line 2. "64" too large (max=63). 2 | Invalid DSCP value at "20-vip.conf", line 3. "65" too large (max=63). 3 | Invalid DSCP value at "20-vip.conf", line 4. "0x41" too large (max=63). 4 | Invalid DSCP value at "20-vip.conf", line 5. "0101" too large (max=63). 5 | Invalid DSCP value at "20-vip.conf", line 6. "1000" too large (max=63). 6 | Invalid DSCP value at "20-vip.conf", line 7. "0xffffffff" too large (max=63). 7 | Invalid DSCP value at "20-vip.conf", line 8. "0x100000000" too large (max=63). 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l23.000.d/expected.status.1: -------------------------------------------------------------------------------- 1 | Duplicate DSRs found for 188.125.67.68. 2 | - Prev: L3DSR at "20-vip.conf", line 2. 3 | - Dup: L3DSR at "20-vip.conf", line 3. 4 | Duplicate DSRs found for 188.125.67.69. 5 | - Prev: L2DSR at "20-vip.conf", line 4. 6 | - Dup: L2DSR at "20-vip.conf", line 5. 7 | type state name ipaddr dscp loopback iptables 8 | ===== ======= ============= ============= ==== ======== ======== 9 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 10 | l2dsr started 188.125.67.69 188.125.67.69 -- lo:2 -- 11 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.007.d/expected.status.5: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables iptbl src 2 | ===== ======= ============= ============= ==== ======== ======== ===== ==== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- -- conf 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- -- conf 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- -- conf 6 | loopb started 188.125.67.68 188.125.67.68 -- lo:1 -- -- disc 7 | loopb started 188.125.67.69 188.125.67.69 -- lo:2 -- -- disc 8 | -------------------------------------------------------------------------------- /linux/dsrtools/src/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains configuration files for the dsrtools package. Only 2 | files that end in ".conf" are configuration files. dsrctl ignores all other 3 | files. 4 | 5 | An example L3DSR configuration might look like this. 6 | # VIP=DSCP 7 | 98.139.235.245=28 # this is the best L3DSR ever 8 | 201F::0080:1d0:f8=29 # this is a good one, too 9 | 10 | An example L2DSR configuration might look like this. 11 | # VIP 12 | 98.139.235.245 # this is the best L2DSR ever 13 | 201F::0080:1d0:f8 # this is a good one, too 14 | 15 | See dsr.conf(5) for more information. 16 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.200.d/expected.status.1: -------------------------------------------------------------------------------- 1 | Invalid DSCP value at "20-vip.conf", line 2. "64" too large (max=63). 2 | Invalid DSCP value at "20-vip.conf", line 3. "65" too large (max=63). 3 | Invalid DSCP value at "20-vip.conf", line 4. "0x41" too large (max=63). 4 | Invalid DSCP value at "20-vip.conf", line 5. "0101" too large (max=63). 5 | Invalid DSCP value at "20-vip.conf", line 6. "1000" too large (max=63). 6 | Invalid DSCP value at "20-vip.conf", line 7. "0xffffffff" too large (max=63). 7 | Invalid DSCP value at "20-vip.conf", line 8. "0x100000000" too large (max=63). 8 | No configured DSRs found. 9 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.008.d/expected.status.1.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 2 | ===== ======= ============ ============ ==== ======== ======== IPTBL_HDR_EQUALS ==== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- IPTBL_VAL conf 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- IPTBL_VAL conf 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- IPTBL_VAL conf 6 | iptbl started 188.125.66.1 188.125.66.1 0x14 -- up IPTBL_VAL disc 7 | iptbl started 188.125.66.2 188.125.66.2 0x15 -- up IPTBL_VAL disc 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.008.d/expected.status.3.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 2 | ===== ======= ============ ============ ==== ======== ======== IPTBL_HDR_EQUALS ==== 3 | l3dsr started 188.125.67.1 188.125.67.1 10 lo:1 up IPTBL_VAL conf 4 | l3dsr started 188.125.67.2 188.125.67.2 11 lo:2 up IPTBL_VAL conf 5 | l3dsr started 188.125.67.3 188.125.67.3 12 lo:3 up IPTBL_VAL conf 6 | iptbl started 188.125.66.1 188.125.66.1 0x14 -- up IPTBL_VAL disc 7 | iptbl started 188.125.66.2 188.125.66.2 0x15 -- up IPTBL_VAL disc 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.008.d/expected.status.5.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 2 | ===== ======= ============ ============ ==== ======== ======== IPTBL_HDR_EQUALS ==== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- IPTBL_VAL conf 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- IPTBL_VAL conf 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- IPTBL_VAL conf 6 | iptbl started 188.125.66.1 188.125.66.1 0x14 -- up IPTBL_VAL disc 7 | iptbl started 188.125.66.2 188.125.66.2 0x15 -- up IPTBL_VAL disc 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.009.d/expected.status.1.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 2 | ===== ======= ============ ============ ==== ======== ======== IPTBL_HDR_EQUALS ==== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- IPTBL_VAL conf 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- IPTBL_VAL conf 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- IPTBL_VAL conf 6 | l3dsr started 188.125.66.2 188.125.66.2 20 lo:1 up IPTBL_VAL disc 7 | l3dsr started 188.125.66.3 188.125.66.3 21 lo:2 up IPTBL_VAL disc 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.009.d/expected.status.3.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 2 | ===== ======= ============ ============ ==== ======== ======== IPTBL_HDR_EQUALS ==== 3 | l3dsr started 188.125.67.1 188.125.67.1 10 lo:3 up IPTBL_VAL conf 4 | l3dsr started 188.125.67.2 188.125.67.2 11 lo:4 up IPTBL_VAL conf 5 | l3dsr started 188.125.67.3 188.125.67.3 12 lo:5 up IPTBL_VAL conf 6 | l3dsr started 188.125.66.2 188.125.66.2 20 lo:1 up IPTBL_VAL disc 7 | l3dsr started 188.125.66.3 188.125.66.3 21 lo:2 up IPTBL_VAL disc 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.009.d/expected.status.5.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 2 | ===== ======= ============ ============ ==== ======== ======== IPTBL_HDR_EQUALS ==== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- IPTBL_VAL conf 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- IPTBL_VAL conf 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- IPTBL_VAL conf 6 | l3dsr started 188.125.66.2 188.125.66.2 20 lo:1 up IPTBL_VAL disc 7 | l3dsr started 188.125.66.3 188.125.66.3 21 lo:2 up IPTBL_VAL disc 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.011.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | TmpFiles+=( 20-vip.conf ) 11 | sed -e "s/NODE/$Node/" \ 12 | 20-vip.conf.template > 20-vip.conf 13 | 14 | Tmplts=( expected.status.1 ) 15 | 16 | expand_templates Tmplts "$Table" 17 | 18 | # Run tests. 19 | typeset rv=0 20 | 21 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 22 | 23 | (( rv && ! ErrIgnore )) || docmd status "" n:20 1 || rv=1 24 | 25 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 26 | 27 | # Stop 28 | dsrcleanup 29 | 30 | exit $rv 31 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/expected.status.6: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables iptbl src 2 | ===== ======= ======================= ======================= ==== ======== ======== ===== ==== 3 | l3dsr stopped 188.125.67.68 188.125.67.68 28 -- -- -- conf 4 | l3dsr stopped 188.125.67.69 188.125.67.69 29 -- -- -- conf 5 | l3dsr stopped 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 -- -- -- conf 6 | l3dsr stopped 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 20 -- -- -- conf 7 | -------------------------------------------------------------------------------- /linux/dsrtools/USING: -------------------------------------------------------------------------------- 1 | The dsrtools package provides support for configuring L2DSR and L3DSR 2 | on a server. By creating a configuration file that is typically stored 3 | in /etc/dsr.d, the DSR configuration is started whenever the host 4 | boots. 5 | 6 | dsrtools is supported on RHEL6 and later. 7 | 8 | Man pages are available in dsr.conf(5) and dsrctl(8). 9 | 10 | 11 | Examples 12 | 13 | # Start/Stop configured DSRs. 14 | sudo dsrctl start 15 | sudo dsrctl stop 16 | 17 | # See commands run when starting/stopping configured DSRs. 18 | sudo dsrctl -v start 19 | sudo dsrctl -v stop 20 | 21 | # Display configured DSRs. 22 | sudo dsrctl status 23 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.007.d/expected.status.1.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 2 | ===== ======= ============= ============= ==== ======== ======== IPTBL_HDR_EQUALS ==== 3 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- IPTBL_VAL conf 4 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- IPTBL_VAL conf 5 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- IPTBL_VAL conf 6 | loopb started 188.125.67.68 188.125.67.68 -- lo:1 -- IPTBL_NONE disc 7 | loopb started 188.125.67.69 188.125.67.69 -- lo:2 -- IPTBL_NONE disc 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.007.d/expected.status.3.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 2 | ===== ======= ============= ============= ==== ======== ======== IPTBL_HDR_EQUALS ==== 3 | l3dsr started 188.125.67.1 188.125.67.1 10 lo:3 up IPTBL_VAL conf 4 | l3dsr started 188.125.67.2 188.125.67.2 11 lo:4 up IPTBL_VAL conf 5 | l3dsr started 188.125.67.3 188.125.67.3 12 lo:5 up IPTBL_VAL conf 6 | loopb started 188.125.67.68 188.125.67.68 -- lo:1 -- IPTBL_NONE disc 7 | loopb started 188.125.67.69 188.125.67.69 -- lo:2 -- IPTBL_NONE disc 8 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.stop.1.template: -------------------------------------------------------------------------------- 1 | +ip -o addr show lo 2 | +iptables -L -t TABLE -n 3 | IPV6ONLY:+ip6tables -L -t TABLE -n 4 | +iptables -t TABLE -D PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=188.125.82.253 5 | +ip addr del 188.125.82.253/32 dev lo label lo:4 6 | +iptables -t TABLE -D PREROUTING -m dscp --dscp 43 -j DADDR --set-daddr=188.125.82.196 7 | +ip addr del 188.125.82.196/32 dev lo label lo:3 8 | +ip addr del 188.125.82.38/32 dev lo label lo:2 9 | +iptables -t TABLE -D PREROUTING -m dscp --dscp 28 -j DADDR --set-daddr=188.125.67.68 10 | +ip addr del 188.125.67.68/32 dev lo label lo:1 11 | +modprobe -r xt_DADDR 12 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.012.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | Tmplts=( expected.status.1 ) 11 | 12 | expand_templates Tmplts "$Table" 13 | 14 | # Run tests. 15 | typeset rv=0 16 | 17 | (( rv && ! ErrIgnore )) || start_one_loopback 188.125.67.68 1 || rv=1 18 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.82.38 19 || rv=1 19 | 20 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 1 || rv=1 21 | (( rv && ! ErrIgnore )) || docmd status "" n:20 2 || rv=1 22 | 23 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 24 | 25 | dsrcleanup 26 | 27 | exit $rv 28 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.001.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | # Run tests. 11 | typeset rv=0 12 | 13 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 14 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 15 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 16 | 17 | (( rv && ! ErrIgnore )) || docmd status "" n:20 1 || rv=1 18 | 19 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 20 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 21 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 22 | 23 | dsrcleanup 24 | 25 | exit $rv 26 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.002.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | # Run tests. 11 | typeset rv=0 12 | 13 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 14 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 15 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 16 | 17 | (( rv && ! ErrIgnore )) || docmd status "" n:20 1 || rv=1 18 | 19 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 20 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 21 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 22 | 23 | dsrcleanup 24 | 25 | exit $rv 26 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.005.d/expected.status.1.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 2 | ===== ======= ======================== ======================== ==== ======== ======== IPTBL_HDR_EQUALS ==== 3 | l3dsr stopped 2a00:1288:110:021b::4002 2a00:1288:110:021b::4002 32 -- -- IPTBL_VAL conf 4 | l3dsr stopped 2b00:1288:110:021b::4005 2b00:1288:110:021b::4005 35 -- -- IPTBL_VAL conf 5 | l3dsr stopped 188.125.67.1 188.125.67.1 20 -- -- IPTBL_VAL conf 6 | l3dsr stopped 188.125.67.2 188.125.67.2 21 -- -- IPTBL_VAL conf 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.005.d/expected.status.3.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 2 | ===== ======= ======================== ======================== ==== ======== ======== IPTBL_HDR_EQUALS ==== 3 | l3dsr started 2a00:1288:110:021b::4002 2a00:1288:110:021b::4002 32 lo up IPTBL_VAL conf 4 | l3dsr started 2b00:1288:110:021b::4005 2b00:1288:110:021b::4005 35 lo up IPTBL_VAL conf 5 | l3dsr started 188.125.67.1 188.125.67.1 20 lo:1 up IPTBL_VAL conf 6 | l3dsr started 188.125.67.2 188.125.67.2 21 lo:2 up IPTBL_VAL conf 7 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.010.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | # Run tests. 11 | typeset rv=0 12 | 13 | (( rv && ! ErrIgnore )) || docmd status "" n:20 1 || rv=1 14 | 15 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 16 | 17 | (( rv && ! ErrIgnore )) || docmd status "" n:20 2 || rv=1 18 | 19 | (( rv && ! ErrIgnore )) || docmd restart "" n:20 1 || rv=1 20 | 21 | (( rv && ! ErrIgnore )) || docmd status "" n:20 2 || rv=1 22 | 23 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 24 | 25 | (( rv && ! ErrIgnore )) || docmd status "" n:20 3 || rv=1 26 | 27 | dsrcleanup 28 | 29 | exit $rv 30 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.start.1.template: -------------------------------------------------------------------------------- 1 | +ip -o addr show lo 2 | +iptables -L -t TABLE -n 3 | IPV6ONLY:+ip6tables -L -t TABLE -n 4 | +iptables -t TABLE -A PREROUTING -m dscp --dscp 28 -j DADDR --set-daddr=188.125.67.68 5 | +ip -o addr show lo 6 | +ip addr add 188.125.67.68/32 dev lo label lo:1 7 | +ip -o addr show lo 8 | +ip addr add 188.125.82.38/32 dev lo label lo:2 9 | +iptables -t TABLE -A PREROUTING -m dscp --dscp 43 -j DADDR --set-daddr=188.125.82.196 10 | +ip -o addr show lo 11 | +ip addr add 188.125.82.196/32 dev lo label lo:3 12 | +iptables -t TABLE -A PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=188.125.82.253 13 | +ip -o addr show lo 14 | +ip addr add 188.125.82.253/32 dev lo label lo:4 15 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.005.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # IPv4 L3DSRs with duplicate DSCPs (dec, oct, hex) 2 | 3 | 188.125.67.1=10 4 | 188.125.67.2=10 5 | 6 | 188.125.67.3=013 7 | 188.125.67.4=013 8 | 9 | 188.125.67.5=0xc 10 | 188.125.67.6=0Xc 11 | 12 | 188.125.67.7=0xD 13 | 188.125.67.8=0Xd 14 | 15 | 188.125.67.9=0Xe 16 | 188.125.67.10=0xE 17 | 18 | 188.125.67.11=0XF 19 | 188.125.67.12=0XF 20 | 21 | 188.125.67.13=0x10 22 | 188.125.67.14=0x10 23 | 24 | 188.125.67.15=17 25 | 188.125.67.16=0x11 26 | 27 | 188.125.67.17=0x12 28 | 188.125.67.18=18 29 | 30 | 188.125.67.19=19 31 | 188.125.67.20=023 32 | 33 | 188.125.67.19=024 34 | 188.125.67.20=20 35 | 36 | 188.125.67.21=0x15 37 | 188.125.67.22=025 38 | 39 | 188.125.67.23=026 40 | 188.125.67.24=0x16 41 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.start.6.template: -------------------------------------------------------------------------------- 1 | +modprobe xt_DADDR 2 | +ip -o addr show lo 3 | +iptables -L -t TABLE -n 4 | IPV6ONLY:+ip6tables -L -t TABLE -n 5 | +iptables -t TABLE -I PREROUTING -m dscp --dscp 28 -j DADDR --set-daddr=188.125.67.68 6 | +ip -o addr show lo 7 | +ip addr add 188.125.67.68/32 dev lo label lo:1 8 | +ip -o addr show lo 9 | +ip addr add 188.125.82.38/32 dev lo label lo:2 10 | +iptables -t TABLE -I PREROUTING -m dscp --dscp 43 -j DADDR --set-daddr=188.125.82.196 11 | +ip -o addr show lo 12 | +ip addr add 188.125.82.196/32 dev lo label lo:3 13 | +iptables -t TABLE -I PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=188.125.82.253 14 | +ip -o addr show lo 15 | +ip addr add 188.125.82.253/32 dev lo label lo:4 16 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/expected.status.1: -------------------------------------------------------------------------------- 1 | Duplicate iptables rules found for VIP 188.125.67.68=28 count=4 2 | Duplicate iptables rules found for VIP 188.125.67.69=29 count=2 3 | Duplicate iptables rules found for VIP 2a00:1288:110:21b::4002=19 count=3 4 | type state name ipaddr dscp loopback iptables 5 | ===== ======= ======================= ======================= ==== ======== ======== 6 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 7 | l3dsr started 188.125.67.69 188.125.67.69 29 lo:2 up 8 | l3dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 lo up 9 | l3dsr started 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 20 lo up 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tar/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makes the source tarball. 3 | # 4 | 5 | include ../macros.mk ../package.mk 6 | 7 | subdirs = \ 8 | src \ 9 | tests 10 | 11 | include $(addsuffix /files.mk,$(addprefix ../,$(subdirs))) 12 | 13 | srcfiles += \ 14 | LICENSE \ 15 | README \ 16 | INSTALL \ 17 | USING \ 18 | Makefile \ 19 | macros.mk \ 20 | package.mk 21 | 22 | clean_files = $(zsrctarfile) 23 | clobber_files = $(clean_files) 24 | distclean_files = $(clobber_files) 25 | 26 | 27 | all: tar 28 | 29 | tar: $(zsrctarfile) 30 | 31 | $(zsrctarfile): 32 | tar -cJf '$@' -C .. --transform='s:^:$(srctardestdir)/:' $(srcfiles) 33 | 34 | clean clobber distclean: 35 | $(call scrub_files_call,$($@_files)) 36 | 37 | .PHONY: all tar clean clobber distclean 38 | .DELETE_ON_ERROR: 39 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.013.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l3dsr stopped 188.125.67.68 188.125.67.68 28 -- -- 4 | l3dsr stopped 188.125.82.38 188.125.82.38 19 -- -- 5 | l3dsr stopped 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 -- -- 6 | l3dsr stopped 188.125.82.196 188.125.82.196 43 -- -- 7 | l3dsr stopped 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 43 -- -- 8 | l3dsr stopped 188.125.82.253 188.125.82.253 17 -- -- 9 | l3dsr stopped 2a00:1288:110:21b::4006 2a00:1288:110:21b::4006 17 -- -- 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l2.000.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l2dsr started 188.125.67.68 188.125.67.68 -- lo:1 -- 4 | l2dsr started 188.125.82.38 188.125.82.38 -- lo:2 -- 5 | l2dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 -- lo -- 6 | l2dsr started 188.125.82.196 188.125.82.196 -- lo:3 -- 7 | l2dsr started 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 -- lo -- 8 | l2dsr started 188.125.82.253 188.125.82.253 -- lo:4 -- 9 | l2dsr started 2a00:1288:110:21b::4006 2a00:1288:110:21b::4006 -- lo -- 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.000.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 4 | l2dsr started 188.125.82.38 188.125.82.38 -- lo:2 -- 5 | l3dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 lo up 6 | l3dsr started 188.125.82.196 188.125.82.196 43 lo:3 up 7 | l2dsr started 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 -- lo -- 8 | l3dsr started 188.125.82.253 188.125.82.253 17 lo:4 up 9 | l3dsr started 2a00:1288:110:21b::4006 2a00:1288:110:21b::4006 17 lo up 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l23.001.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 4 | l2dsr started 188.125.82.38 188.125.82.38 -- lo:2 -- 5 | l3dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 lo up 6 | l3dsr started 188.125.82.196 188.125.82.196 43 lo:3 up 7 | l2dsr started 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 -- lo -- 8 | l3dsr started 188.125.82.253 188.125.82.253 17 lo:4 up 9 | l3dsr started 2a00:1288:110:21b::4006 2a00:1288:110:21b::4006 17 lo up 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.000.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 4 | l3dsr started 188.125.82.38 188.125.82.38 19 lo:2 up 5 | l3dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 lo up 6 | l3dsr started 188.125.82.196 188.125.82.196 43 lo:3 up 7 | l3dsr started 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 43 lo up 8 | l3dsr started 188.125.82.253 188.125.82.253 17 lo:4 up 9 | l3dsr started 2a00:1288:110:21b::4006 2a00:1288:110:21b::4006 17 lo up 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.001.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 4 | l3dsr started 188.125.82.38 188.125.82.38 19 lo:2 up 5 | l3dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 lo up 6 | l3dsr started 188.125.82.196 188.125.82.196 43 lo:3 up 7 | l3dsr started 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 43 lo up 8 | l3dsr started 188.125.82.253 188.125.82.253 17 lo:4 up 9 | l3dsr started 2a00:1288:110:21b::4006 2a00:1288:110:21b::4006 17 lo up 10 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.013.d/expected.status.2.template: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 4 | l3dsr started 188.125.82.38 188.125.82.38 19 lo:2 up 5 | l3dsr STATE 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 LOOPBACK IPTSTATE 6 | l3dsr started 188.125.82.196 188.125.82.196 43 lo:3 up 7 | l3dsr STATE 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 43 LOOPBACK IPTSTATE 8 | l3dsr started 188.125.82.253 188.125.82.253 17 lo:4 up 9 | l3dsr STATE 2a00:1288:110:21b::4006 2a00:1288:110:21b::4006 17 LOOPBACK IPTSTATE 10 | -------------------------------------------------------------------------------- /linux/iptables-daddr/tar/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makes the source tarball. 3 | # 4 | 5 | include ../macros.mk ../package.mk 6 | 7 | subdirs = \ 8 | extensions-1.4 \ 9 | kmod-xt 10 | 11 | include $(addsuffix /files.mk,$(addprefix ../,$(subdirs))) 12 | 13 | srcfiles += \ 14 | LICENSE \ 15 | README \ 16 | INSTALL \ 17 | USING \ 18 | Makefile \ 19 | macros.mk \ 20 | package.mk 21 | 22 | clean_files = $(zsrctarfile) 23 | clobber_files = $(clean_files) 24 | distclean_files = $(clobber_files) 25 | 26 | 27 | all: tar 28 | 29 | tar: $(zsrctarfile) 30 | 31 | $(zsrctarfile): $(addprefix ../,$(srcfiles)) $(MAKEFILE_LIST) 32 | tar -cJf '$@' -C .. --transform='s:^:$(srctardestdir)/:' $(srcfiles) 33 | 34 | clean clobber distclean: 35 | $(call scrub_files_call,$($@_files)) 36 | 37 | .PHONY: all tar clean clobber distclean 38 | .DELETE_ON_ERROR: 39 | -------------------------------------------------------------------------------- /linux/dsrtools/src/dsrrc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # dsr: dsr starts up the DSR configuration for this machine. 4 | # 5 | # chkconfig: 2345 99 01 6 | # 7 | # description: dsr initializes this machine to support DSR (direct server 8 | # return) based on the configuration files in /etc/dsr.d. 9 | # 10 | 11 | # Source function library. 12 | . /etc/init.d/functions 13 | 14 | RETVAL=0 15 | case "$1" in 16 | restart) 17 | action "Restart DSR:" /usr/sbin/dsrctl restart 18 | ;; 19 | 20 | start) 21 | action "Start DSR:" /usr/sbin/dsrctl start 22 | ;; 23 | 24 | stop) 25 | action "Stop DSR:" /usr/sbin/dsrctl stop 26 | ;; 27 | 28 | status) 29 | /usr/sbin/dsrctl check 30 | RETVAL=$? 31 | ;; 32 | 33 | *) 34 | echo $"Usage: $0 {restart|start|stop|status}" >&2 35 | RETVAL=1 36 | esac 37 | 38 | exit $RETVAL 39 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.002.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= ======================= ======================= ==== ======== ======== 3 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 4 | l3dsr started 188.125.67.69 188.125.67.69 014 lo:2 up 5 | l3dsr started 188.125.67.70 188.125.67.70 0x23 lo:3 up 6 | l3dsr started 188.125.67.71 188.125.67.71 0X24 lo:4 up 7 | l3dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 lo up 8 | l3dsr started 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 024 lo up 9 | l3dsr started 2a00:1288:110:21b::4006 2a00:1288:110:21b::4006 0x34 lo up 10 | l3dsr started 2a00:1288:110:21b::4007 2a00:1288:110:21b::4007 0X35 lo up 11 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.verbose.d/expected.status.1.template: -------------------------------------------------------------------------------- 1 | +ip -o addr show lo 2 | +iptables -L -t TABLE -n 3 | +ip6tables -L -t TABLE -n 4 | type state name ipaddr dscp loopback iptables 5 | ===== ======= ======================= ======================= ==== ======== ======== 6 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 7 | l2dsr started 188.125.82.38 188.125.82.38 -- lo:2 -- 8 | l3dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 lo up 9 | l3dsr started 188.125.82.196 188.125.82.196 43 lo:3 up 10 | l2dsr started 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 -- lo -- 11 | l3dsr started 188.125.82.253 188.125.82.253 17 lo:4 up 12 | l3dsr started 2a00:1288:110:21b::4006 2a00:1288:110:21b::4006 17 lo up 13 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.013.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | Tmplts=( expected.status.2 11 | ) 12 | 13 | expand_templates Tmplts "$Table" 14 | 15 | 16 | # 17 | # This test is placed in the ip4 set of tests because it needs to run 18 | # whether IPv6 is enabled or disabled. The test is intended to test 19 | # when IPv6 is disabled that dsrctl prints appropriate output even 20 | # though it is never calling ip6tables. 21 | # 22 | 23 | # Run tests. 24 | typeset rv=0 25 | 26 | (( rv && ! ErrIgnore )) || docmd status "" n:20 1 || rv=1 27 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 28 | (( rv && ! ErrIgnore )) || docmd status "" n:20 2 || rv=1 29 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 30 | (( rv && ! ErrIgnore )) || docmd status "" n:20 1 || rv=1 31 | 32 | dsrcleanup 33 | 34 | exit $rv 35 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.004.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | # Run tests. 11 | typeset rv=0 12 | 13 | # Create DSRs and partial state. 14 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 87.248.118.14 21 || rv=1 15 | (( rv && ! ErrIgnore )) || start_one_loopback 87.248.118.12 1 || rv=1 16 | (( rv && ! ErrIgnore )) || start_one_loopback 87.248.118.14 2 || rv=1 17 | 18 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2A00:1288:0080:800::5001 22 || rv=1 19 | (( rv && ! ErrIgnore )) || start_one_loopback 2A00:1288:0080:800::5001 - || rv=1 20 | (( rv && ! ErrIgnore )) || start_one_loopback 2A00:1288:0080:800::5003 - || rv=1 21 | 22 | (( rv && ! ErrIgnore )) || docmd status "" n:20 1 || rv=1 23 | 24 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 25 | 26 | dsrcleanup 27 | 28 | exit $rv 29 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.verbose.d/expected.stop.1.template: -------------------------------------------------------------------------------- 1 | +ip -o addr show lo 2 | +iptables -L -t TABLE -n 3 | +ip6tables -L -t TABLE -n 4 | +ip6tables -t TABLE -D PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=2a00:1288:110:21b::4006 5 | +ip addr del 2a00:1288:110:21b::4006/128 dev lo 6 | +iptables -t TABLE -D PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=188.125.82.253 7 | +ip addr del 188.125.82.253/32 dev lo label lo:4 8 | +ip addr del 2a00:1288:110:21b::4005/128 dev lo 9 | +iptables -t TABLE -D PREROUTING -m dscp --dscp 43 -j DADDR --set-daddr=188.125.82.196 10 | +ip addr del 188.125.82.196/32 dev lo label lo:3 11 | +ip6tables -t TABLE -D PREROUTING -m dscp --dscp 19 -j DADDR --set-daddr=2a00:1288:110:21b::4002 12 | +ip addr del 2a00:1288:110:21b::4002/128 dev lo 13 | +ip addr del 188.125.82.38/32 dev lo label lo:2 14 | +iptables -t TABLE -D PREROUTING -m dscp --dscp 28 -j DADDR --set-daddr=188.125.67.68 15 | +ip addr del 188.125.67.68/32 dev lo label lo:1 16 | +modprobe -r xt_DADDR 17 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.007.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | Tmplts=( expected.status.1 11 | expected.status.3 12 | ) 13 | expand_templates Tmplts "$Table" 14 | 15 | # Run tests. 16 | typeset rv=0 17 | 18 | (( rv && ! ErrIgnore )) || start_one_loopback 188.125.67.68 1 || rv=1 19 | (( rv && ! ErrIgnore )) || start_one_loopback 188.125.67.69 2 || rv=1 20 | 21 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 1 || rv=1 22 | (( rv && ! ErrIgnore )) || docmd status "" n:20 2 || rv=1 23 | 24 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 25 | 26 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 3 || rv=1 27 | (( rv && ! ErrIgnore )) || docmd status "" n:20 4 || rv=1 28 | 29 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 30 | 31 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 5 || rv=1 32 | (( rv && ! ErrIgnore )) || docmd status "" n:20 6 || rv=1 33 | 34 | dsrcleanup 35 | 36 | exit $rv 37 | -------------------------------------------------------------------------------- /linux/dsrtools/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Main makefile for building dsrtools and its packages. 3 | # 4 | # To build the source: 5 | # $ make 6 | # 7 | # To build the packages, specify the package platform with the "spkg" or 8 | # "pkgs" targets as given in "PPS". For example: 9 | # $ make rpm-pkgs 10 | # 11 | # See INSTALL for further examples. 12 | # 13 | 14 | include macros.mk 15 | 16 | PPS += rpm mock 17 | 18 | $(eval \ 19 | $(foreach pp,$(PPS),\ 20 | $(pp)-%: PP=$(pp)$(nl)\ 21 | $(pp)-%: %;$(nl))\ 22 | ) 23 | 24 | all install: 25 | $(MAKE) -C src '$@' 26 | 27 | tar: 28 | $(MAKE) -C '$@' all 29 | 30 | tests: all 31 | $(MAKE) -C '$@' all 32 | 33 | src-% tar-%: 34 | $(MAKE) -C '$(subst -$*,,$@)' '$*' 35 | 36 | spkg pkgs print_spkg print_pkgs: 37 | $(if $(PP),$(MAKE) -C '$(PP)' $@) 38 | 39 | clean clobber distclean: 40 | $(if $(PP),$(MAKE) -C '$(PP)' $@) 41 | $(MAKE) -C tar $@ 42 | $(MAKE) -C src $@ 43 | $(MAKE) -C tests $@ 44 | 45 | 46 | .PHONY: all install tar spkg pkgs print_spkg print_pkgs 47 | .PHONY: clean clobber distclean 48 | .DELETE_ON_ERROR: 49 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.verbose.d/expected.start.1.template: -------------------------------------------------------------------------------- 1 | +ip -o addr show lo 2 | +iptables -L -t TABLE -n 3 | +ip6tables -L -t TABLE -n 4 | +iptables -t TABLE -A PREROUTING -m dscp --dscp 28 -j DADDR --set-daddr=188.125.67.68 5 | +ip -o addr show lo 6 | +ip addr add 188.125.67.68/32 dev lo label lo:1 7 | +ip -o addr show lo 8 | +ip addr add 188.125.82.38/32 dev lo label lo:2 9 | +ip6tables -t TABLE -A PREROUTING -m dscp --dscp 19 -j DADDR --set-daddr=2a00:1288:110:21b::4002 10 | +ip -o addr show lo 11 | +ip addr add 2a00:1288:110:21b::4002/128 dev lo 12 | +iptables -t TABLE -A PREROUTING -m dscp --dscp 43 -j DADDR --set-daddr=188.125.82.196 13 | +ip -o addr show lo 14 | +ip addr add 188.125.82.196/32 dev lo label lo:3 15 | +ip -o addr show lo 16 | +ip addr add 2a00:1288:110:21b::4005/128 dev lo 17 | +iptables -t TABLE -A PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=188.125.82.253 18 | +ip -o addr show lo 19 | +ip addr add 188.125.82.253/32 dev lo label lo:4 20 | +ip6tables -t TABLE -A PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=2a00:1288:110:21b::4006 21 | +ip -o addr show lo 22 | +ip addr add 2a00:1288:110:21b::4006/128 dev lo 23 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/expected.status.4.template: -------------------------------------------------------------------------------- 1 | Duplicate iptables rules found for VIP 2a00:1288:110:21b::4003=0x14 count=4 2 | Duplicate iptables rules found for VIP 2a00:1288:110:21b::4004=0x15 count=5 3 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 4 | ===== ======= ======================= ======================= ==== ======== ======== IPTBL_HDR_EQUALS ==== 5 | l3dsr stopped 188.125.67.68 188.125.67.68 28 -- -- IPTBL_VAL conf 6 | l3dsr stopped 188.125.67.69 188.125.67.69 29 -- -- IPTBL_VAL conf 7 | l3dsr stopped 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 -- -- IPTBL_VAL conf 8 | l3dsr stopped 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 20 -- -- IPTBL_VAL conf 9 | iptbl started 188.125.67.70 188.125.67.70 0x1e -- up IPTBL_VAL disc 10 | iptbl started 2a00:1288:110:21b::4003 2a00:1288:110:21b::4003 0x14 -- up IPTBL_VAL disc 11 | iptbl started 2a00:1288:110:21b::4004 2a00:1288:110:21b::4004 0x15 -- up IPTBL_VAL disc 12 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.verbose.d/expected.start.6.template: -------------------------------------------------------------------------------- 1 | +modprobe xt_DADDR 2 | +ip -o addr show lo 3 | +iptables -L -t TABLE -n 4 | +ip6tables -L -t TABLE -n 5 | +iptables -t TABLE -I PREROUTING -m dscp --dscp 28 -j DADDR --set-daddr=188.125.67.68 6 | +ip -o addr show lo 7 | +ip addr add 188.125.67.68/32 dev lo label lo:1 8 | +ip -o addr show lo 9 | +ip addr add 188.125.82.38/32 dev lo label lo:2 10 | +ip6tables -t TABLE -I PREROUTING -m dscp --dscp 19 -j DADDR --set-daddr=2a00:1288:110:21b::4002 11 | +ip -o addr show lo 12 | +ip addr add 2a00:1288:110:21b::4002/128 dev lo 13 | +iptables -t TABLE -I PREROUTING -m dscp --dscp 43 -j DADDR --set-daddr=188.125.82.196 14 | +ip -o addr show lo 15 | +ip addr add 188.125.82.196/32 dev lo label lo:3 16 | +ip -o addr show lo 17 | +ip addr add 2a00:1288:110:21b::4005/128 dev lo 18 | +iptables -t TABLE -I PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=188.125.82.253 19 | +ip -o addr show lo 20 | +ip addr add 188.125.82.253/32 dev lo label lo:4 21 | +ip6tables -t TABLE -I PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=2a00:1288:110:21b::4006 22 | +ip -o addr show lo 23 | +ip addr add 2a00:1288:110:21b::4006/128 dev lo 24 | -------------------------------------------------------------------------------- /linux/iptables-daddr/extensions-1.4/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -O2 -g -Wall -Wunused -fPIC 2 | INCPATH = ../kmod-xt 3 | CPPFLAGS = $(addprefix -I,$(INCPATH)) 4 | LINK.so = $(LINK.o) -shared 5 | 6 | vpath %.h $(INCPATH) 7 | 8 | dflt_ipt_libdir = $(firstword $(wildcard \ 9 | $(addsuffix /xtables,\ 10 | $(addprefix $(DESTDIR),\ 11 | /usr/lib64 /lib64 /usr/lib /lib)))) 12 | 13 | ipt_libdir ?= $(if $(libdir),$(libdir)/xtables,$(dflt_ipt_libdir)) 14 | 15 | ifeq ($(ipt_libdir),) 16 | $(error Must set libdir or ipt_libdir) 17 | endif 18 | 19 | iptplugin = libxt_DADDR.so 20 | 21 | instiptplugin = $(ipt_libdir)/$(iptplugin) 22 | 23 | all_targets = $(iptplugin) 24 | install_targets = $(instiptplugin) 25 | clean_targets = $(all_targets) 26 | 27 | 28 | all: $(all_targets) 29 | 30 | install: $(install_targets) 31 | 32 | clean: 33 | rm -rf -- $($@_targets) 34 | 35 | lib%.so: lib%.o 36 | $(LINK.so) $(OUTPUT_OPTION) $^ 37 | 38 | lib%.o: lib%.c %.h 39 | $(COMPILE.c) $(OUTPUT_OPTION) $< 40 | 41 | $(ipt_libdir)/%: % | $(ipt_libdir) 42 | cp -fp -- '$<' '$@' 43 | 44 | $(ipt_libdir): 45 | mkdir -p -- '$@' 46 | 47 | 48 | .PHONY: all install clean 49 | .DELETE_ON_ERROR: 50 | -------------------------------------------------------------------------------- /freebsd/CHANGES: -------------------------------------------------------------------------------- 1 | Version 1.2.0 2 | * apply slightly modified patch from adam.twardowski@gmail.com to make 3 | this compile _and work_ on FreeBSD >= 7.x 4 | 5 | Version 1.1.1 (2011-07-12) 6 | * wrap inet_aton in a #if block as inet_aton is present in 8.x; 7 | patch submitted by ashish@FreeBSD.org 8 | 9 | Version 1.0.9 (2011-02-17) 10 | * fix version restriction introduced in 1.0.6 that made 11 | this package fail on FreeBSD 6.x 12 | 13 | Version 1.0.8 (2010-11-09) 14 | * move unload-busy test to a point where we know the module was actually 15 | loaded 16 | 17 | Version 1.0.7 (2010-11-08) 18 | * prevent unloading of the kernel module if any vips are 19 | configured 20 | 21 | Version 1.0.6 (2010-10-05): 22 | * make this package available for FreeBSD7 by making it os 23 | version independent and bailing out in the install script if the major 24 | version is too low 25 | 26 | Version 1.0.5 27 | * Bug 3149934 28 | 29 | Version 1.0.4 30 | * Build in a temporary directory to avoid confusing yinst or 31 | leaving stale files. 32 | 33 | Version 1.0.3 34 | * Guess again at bugzilla component specification 35 | 36 | Version 1.0.2 37 | * Bugzilla component 38 | 39 | Version 1.0.1 40 | * Cosmetic packaging tweaks 41 | 42 | Version 1.0.0 43 | * Initial release 44 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.009.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | Tmplts=( expected.status.1 11 | expected.status.3 12 | expected.status.5 13 | ) 14 | 15 | expand_templates Tmplts "$Table" 16 | 17 | # Run tests. 18 | typeset rv=0 19 | 20 | # Initialize loopbacks and iptables rules. 21 | (( rv && ! ErrIgnore )) || start_one_loopback 188.125.66.2 1 || rv=1 22 | (( rv && ! ErrIgnore )) || start_one_loopback 188.125.66.3 2 || rv=1 23 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.66.2 20 || rv=1 24 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.66.3 21 || rv=1 25 | 26 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 1 || rv=1 27 | (( rv && ! ErrIgnore )) || docmd status "" n:20 2 || rv=1 28 | 29 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 30 | 31 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 3 || rv=1 32 | (( rv && ! ErrIgnore )) || docmd status "" n:20 4 || rv=1 33 | 34 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 35 | 36 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 5 || rv=1 37 | (( rv && ! ErrIgnore )) || docmd status "" n:20 6 || rv=1 38 | 39 | dsrcleanup 40 | 41 | exit $rv 42 | -------------------------------------------------------------------------------- /linux/dsrtools/rpm/rpmdefs.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Sourced by Makefiles for setting default macro definitions for rpm builds. 3 | # 4 | # Rarely set optional macros used by spec file: 5 | # DIST %{dist} for rpmbuild or '""' for unsetting it 6 | # PACKAGE name of package 7 | # RELEASE release of package 8 | # BUILD_ID build id, appended to release 9 | # OSMACRO see below 10 | # OSMACROVER see below 11 | # URL URL included in package's information 12 | # EXTRA_BUILD_DEFS additional build defs 13 | # 14 | # For OSMACRO and OSMACROVER these are distribution flavor and code 15 | # borrowed from Open Build Service: 16 | # https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto 17 | # 18 | 19 | specfile = $(package).spec 20 | 21 | rpmtarfile = $(srctarfile) 22 | zrpmtarfile = $(rpmtarfile).xz 23 | 24 | build_defs = \ 25 | $(strip \ 26 | $(if $(DIST),\ 27 | --define 'dist $(if $(subst x"",,x$(DIST)),$(DIST),%{nil})') \ 28 | $(if $(PACKAGE),--define 'pkg_name $(PACKAGE)') \ 29 | $(if $(VERSION),--define 'pkg_version $(VERSION)') \ 30 | $(if $(RELEASE),--define 'pkg_release $(RELEASE)') \ 31 | $(if $(BUILD_ID),--define 'build_id $(BUILD_ID)') \ 32 | $(if $(OSMACRO),--define '$(OSMACRO) $(OSMACROVER)') \ 33 | $(if $(URL),--define 'url $(URL)') \ 34 | $(EXTRA_BUILD_DEFS)) 35 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/expected.status.2.template: -------------------------------------------------------------------------------- 1 | Duplicate iptables rules found for VIP 188.125.67.68=28 count=4 2 | Duplicate iptables rules found for VIP 188.125.67.69=29 count=2 3 | Duplicate iptables rules found for VIP 2a00:1288:110:21b::4002=19 count=3 4 | Duplicate iptables rules found for VIP 2a00:1288:110:21b::4003=0x14 count=4 5 | Duplicate iptables rules found for VIP 2a00:1288:110:21b::4004=0x15 count=5 6 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 7 | ===== ======= ======================= ======================= ==== ======== ======== IPTBL_HDR_EQUALS ==== 8 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up IPTBL_VAL conf 9 | l3dsr started 188.125.67.69 188.125.67.69 29 lo:2 up IPTBL_VAL conf 10 | l3dsr started 2a00:1288:110:21b::4002 2a00:1288:110:21b::4002 19 lo up IPTBL_VAL conf 11 | l3dsr started 2a00:1288:110:21b::4005 2a00:1288:110:21b::4005 20 lo up IPTBL_VAL conf 12 | iptbl started 188.125.67.70 188.125.67.70 0x1e -- up IPTBL_VAL disc 13 | iptbl started 2a00:1288:110:21b::4003 2a00:1288:110:21b::4003 0x14 -- up IPTBL_VAL disc 14 | iptbl started 2a00:1288:110:21b::4004 2a00:1288:110:21b::4004 0x15 -- up IPTBL_VAL disc 15 | -------------------------------------------------------------------------------- /linux/iptables-daddr/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Main makefile for building iptables-daddr and its packages. 3 | # 4 | # To build the source: 5 | # $ make 6 | # 7 | # To build the packages, specify the package platform with the "spkg" or 8 | # "pkgs" targets as given in "PPS". For example: 9 | # $ make rpm-pkgs 10 | # 11 | # See INSTALL for further examples. 12 | # 13 | 14 | include macros.mk package.mk 15 | 16 | MAKEFLAGS += -I.. 17 | 18 | PPS += rpm mock 19 | 20 | $(eval \ 21 | $(foreach pp,$(PPS),\ 22 | $(pp)-%: PP=$(pp)$(nl)\ 23 | $(pp)-%: %;$(nl))\ 24 | ) 25 | 26 | def_kmoddir ?= kmod-xt 27 | def_lmoddir ?= extensions-1.4 28 | 29 | uname_r := $(shell uname -r) 30 | kmod_make_dir = /lib/modules/$(uname_r)/build 31 | kmod_make_args = -C '$(kmod_make_dir)' M='$(CURDIR)/$(def_kmoddir)' 32 | 33 | all: 34 | $(MAKE) $(kmod_make_args) 35 | $(MAKE) -C '$(def_lmoddir)' 36 | 37 | install: 38 | $(MAKE) $(kmod_make_args) modules_install 39 | $(MAKE) -C '$(def_lmoddir)' $@ 40 | 41 | tar: 42 | $(MAKE) -C $@ 43 | 44 | spkg pkgs print_spkg print_pkgs: 45 | $(if $(PP),$(MAKE) -C '$(PP)' $@) 46 | 47 | clean clobber distclean: 48 | $(if $(PP),$(MAKE) -C '$(PP)' $@) 49 | $(if $(PP),,$(MAKE) -C '$(def_lmoddir)' clean) 50 | $(if $(PP),,$(MAKE) $(kmod_make_args) clean) 51 | 52 | 53 | .PHONY: all install tar spkg pkgs print_spkg print_pkgs clean clobber distclean 54 | .DELETE_ON_ERROR: 55 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.500.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # max number of IPv4 L3DSR VIPs (63) 2 | 188.125.67.1=1 3 | 188.125.67.2=2 4 | 188.125.67.3=3 5 | 188.125.67.4=4 6 | 188.125.67.5=5 7 | 188.125.67.6=6 8 | 188.125.67.7=7 9 | 188.125.67.8=8 10 | 188.125.67.9=9 11 | 188.125.67.10=10 12 | 188.125.67.11=11 13 | 188.125.67.12=12 14 | 188.125.67.13=13 15 | 188.125.67.14=14 16 | 188.125.67.15=15 17 | 188.125.67.16=16 18 | 188.125.67.17=17 19 | 188.125.67.18=18 20 | 188.125.67.19=19 21 | 188.125.67.20=20 22 | 188.125.67.21=21 23 | 188.125.67.22=22 24 | 188.125.67.23=23 25 | 188.125.67.24=24 26 | 188.125.67.25=25 27 | 188.125.67.26=26 28 | 188.125.67.27=27 29 | 188.125.67.28=28 30 | 188.125.67.29=29 31 | 188.125.67.30=30 32 | 188.125.67.31=31 33 | 188.125.67.32=32 34 | 188.125.67.33=33 35 | 188.125.67.34=34 36 | 188.125.67.35=35 37 | 188.125.67.36=36 38 | 188.125.67.37=37 39 | 188.125.67.38=38 40 | 188.125.67.39=39 41 | 188.125.67.40=40 42 | 188.125.67.41=41 43 | 188.125.67.42=42 44 | 188.125.67.43=43 45 | 188.125.67.44=44 46 | 188.125.67.45=45 47 | 188.125.67.46=46 48 | 188.125.67.47=47 49 | 188.125.67.48=48 50 | 188.125.67.49=49 51 | 188.125.67.50=50 52 | 188.125.67.51=51 53 | 188.125.67.52=52 54 | 188.125.67.53=53 55 | 188.125.67.54=54 56 | 188.125.67.55=55 57 | 188.125.67.56=56 58 | 188.125.67.57=57 59 | 188.125.67.58=58 60 | 188.125.67.59=59 61 | 188.125.67.60=60 62 | 188.125.67.61=61 63 | 188.125.67.62=62 64 | 188.125.67.63=63 65 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.002.d/expected.status.1: -------------------------------------------------------------------------------- 1 | type state name ipaddr dscp loopback iptables 2 | ===== ======= =========================== =========================== ==== ======== ======== 3 | l3dsr started 2A00:1288:110:21b::4002 2A00:1288:110:21b::4002 32 lo up 4 | l3dsr started 2B00:1288:110:021b::4005 2B00:1288:110:021b::4005 35 lo up 5 | l3dsr started 2c00:1288:0110:021b::4006 2c00:1288:0110:021b::4006 36 lo up 6 | l3dsr started 2f00:1288:0080:021b::4007 2f00:1288:0080:021b::4007 37 lo up 7 | l3dsr started 2a00:1288:0008:021b::4008 2a00:1288:0008:021b::4008 38 lo up 8 | l3dsr started 2a00:1288:0009:0::4009 2a00:1288:0009:0::4009 39 lo up 9 | l3dsr started 2a00:1288:000A:0:0:0:0:400a 2a00:1288:000A:0:0:0:0:400a 0x35 lo up 10 | l3dsr started 2a00:1288:000A:0:0:0:0:0 2a00:1288:000A:0:0:0:0:0 0x3f lo up 11 | l3dsr started 2a00:1288:000A:0:0:0:0:0 2a00:1288:000A:0:0:0:0:0 0x3E lo up 12 | l3dsr started 0:0:B:0:0:0:2:1 0:0:B:0:0:0:2:1 42 lo up 13 | l3dsr started 0:0:B:: 0:0:B:: 43 lo up 14 | l3dsr started 1:0:0:0:0:0:0:0 1:0:0:0:0:0:0:0 47 lo up 15 | l3dsr started 0005:2:0:0:0:0:0:0 0005:2:0:0:0:0:0:0 48 lo up 16 | -------------------------------------------------------------------------------- /linux/dsrtools/macros.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Include file of common macros for makefiles. 3 | # 4 | 5 | define nl 6 | 7 | 8 | endef 9 | 10 | define pound 11 | # 12 | endef 13 | 14 | comma := , 15 | empty := 16 | space := $(empty) $(empty) 17 | 18 | 19 | # Ensure the macro named is set to a non-empty value. 20 | varchk_call = $(if $($(1)),,$(error $(1) is not set from calling environment)) 21 | 22 | # Ensure all the macros named in the list are set to a non-empty value. 23 | varchklist_call = $(foreach v,$(1),$(call varchk_call,$v)) 24 | 25 | # Quote the argument with double quotes escaping shell metacharacters. 26 | shdq_call = "$(subst ",\",$(subst `,\`,$(subst $$,\$$,$(subst \,\\,$(1)))))" 27 | 28 | # For each macro named in the $(2) list, prepare it to be passed via 29 | # the shell to another command after expanding the name with the suffix 30 | # passed in $(1). For example, $(call mkargs2_call,_rhel4,VAR) expands 31 | # to VAR="$(VAR_rhel4)" with the string properly escaped. 32 | mkargs2_call = $(foreach v,$(2),$v=$(call shdq_call,$($v$(1)))) 33 | 34 | # For each macro named in the $(1) list, prepare it to be passed via 35 | # the shell to another command. For example, $(call mkargs_call,VAR) 36 | # expands to VAR="$(VAR)" with the string properly escaped. 37 | mkargs_call = $(call mkargs2_call,,$(1)) 38 | 39 | copy_file_call = cp -a -- '$(1)' '$(2)'$(nl) 40 | 41 | scrub_files_call = $(foreach f,$(wildcard $(1)),$(RM) -r -- '$f'$(nl)) 42 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.003.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # the same IPv4 VIP has the max number of DSCPs (63) 2 | 188.125.67.10=1 3 | 188.125.67.10=2 4 | 188.125.67.10=3 5 | 188.125.67.10=4 6 | 188.125.67.10=5 7 | 188.125.67.10=6 8 | 188.125.67.10=7 9 | 188.125.67.10=8 10 | 188.125.67.10=9 11 | 188.125.67.10=10 12 | 188.125.67.10=11 13 | 188.125.67.10=12 14 | 188.125.67.10=13 15 | 188.125.67.10=14 16 | 188.125.67.10=15 17 | 188.125.67.10=16 18 | 188.125.67.10=17 19 | 188.125.67.10=18 20 | 188.125.67.10=19 21 | 188.125.67.10=20 22 | 188.125.67.10=21 23 | 188.125.67.10=22 24 | 188.125.67.10=23 25 | 188.125.67.10=24 26 | 188.125.67.10=25 27 | 188.125.67.10=26 28 | 188.125.67.10=27 29 | 188.125.67.10=28 30 | 188.125.67.10=29 31 | 188.125.67.10=30 32 | 188.125.67.10=31 33 | 188.125.67.10=32 34 | 188.125.67.10=33 35 | 188.125.67.10=34 36 | 188.125.67.10=35 37 | 188.125.67.10=36 38 | 188.125.67.10=37 39 | 188.125.67.10=38 40 | 188.125.67.10=39 41 | 188.125.67.10=40 42 | 188.125.67.10=41 43 | 188.125.67.10=42 44 | 188.125.67.10=43 45 | 188.125.67.10=44 46 | 188.125.67.10=45 47 | 188.125.67.10=46 48 | 188.125.67.10=47 49 | 188.125.67.10=48 50 | 188.125.67.10=49 51 | 188.125.67.10=50 52 | 188.125.67.10=51 53 | 188.125.67.10=52 54 | 188.125.67.10=53 55 | 188.125.67.10=54 56 | 188.125.67.10=55 57 | 188.125.67.10=56 58 | 188.125.67.10=57 59 | 188.125.67.10=58 60 | 188.125.67.10=59 61 | 188.125.67.10=60 62 | 188.125.67.10=61 63 | 188.125.67.10=62 64 | 188.125.67.10=63 65 | -------------------------------------------------------------------------------- /linux/iptables-daddr/macros.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Include file of common macros for makefiles. 3 | # 4 | 5 | define nl 6 | 7 | 8 | endef 9 | 10 | define pound 11 | # 12 | endef 13 | 14 | comma := , 15 | empty := 16 | space := $(empty) $(empty) 17 | 18 | 19 | # Ensure the macro named is set to a non-empty value. 20 | varchk_call = $(if $($(1)),,$(error $(1) is not set from calling environment)) 21 | 22 | # Ensure all the macros named in the list are set to a non-empty value. 23 | varchklist_call = $(foreach v,$(1),$(call varchk_call,$v)) 24 | 25 | # Quote the argument with double quotes escaping shell metacharacters. 26 | shdq_call = "$(subst ",\",$(subst `,\`,$(subst $$,\$$,$(subst \,\\,$(1)))))" 27 | 28 | # For each macro named in the $(2) list, prepare it to be passed via 29 | # the shell to another command after expanding the name with the suffix 30 | # passed in $(1). For example, $(call mkargs2_call,_rhel4,VAR) expands 31 | # to VAR="$(VAR_rhel4)" with the string properly escaped. 32 | mkargs2_call = $(foreach v,$(2),$v=$(call shdq_call,$($v$(1)))) 33 | 34 | # For each macro named in the $(1) list, prepare it to be passed via 35 | # the shell to another command. For example, $(call mkargs_call,VAR) 36 | # expands to VAR="$(VAR)" with the string properly escaped. 37 | mkargs_call = $(call mkargs2_call,,$(1)) 38 | 39 | copy_file_call = cp -a -- '$(1)' '$(2)'$(nl) 40 | 41 | scrub_files_call = $(foreach f,$(wildcard $(1)),$(RM) -r -- '$f'$(nl)) 42 | -------------------------------------------------------------------------------- /freebsd/LICENSE: -------------------------------------------------------------------------------- 1 | Redistribution and use of this software in source and binary forms, 2 | with or without modification, are permitted provided that the following 3 | conditions are met: 4 | 5 | * Redistributions of source code must retain the above 6 | copyright notice, this list of conditions and the 7 | following disclaimer. 8 | 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the 11 | following disclaimer in the documentation and/or other 12 | materials provided with the distribution. 13 | 14 | * Neither the name of Yahoo! Inc. nor the names of its 15 | contributors may be used to endorse or promote products 16 | derived from this software without specific prior 17 | written permission of Yahoo! Inc. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 20 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 22 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /yvipagent/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009,2010,2011,2012 Yahoo! Inc. All rights reserved. 2 | 3 | Redistribution and use of this software in source and binary forms, with 4 | or without modification, are permitted provided that the following 5 | conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | * Neither the name of Yahoo! Inc. nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without 16 | specific prior written permission of Yahoo! Inc. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 19 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 20 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 22 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 25 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 26 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/expected.stop.5: -------------------------------------------------------------------------------- 1 | Usage: dsrctl [-d ] [-f ] [-ahnvx] 2 | -a For status, print status for all discovered loopbacks 3 | and iptables rules, not just configured DSRs. 4 | -d dir Specify DSR config directory. Defaults to /etc/dsr.d. 5 | -f file Read a single DSR config from this file. 6 | The -d option is ignored if -f is used. 7 | -h Print a usage statement and exit. 8 | -i Insert rules at the top of the iptables chain instead 9 | of appending. The default is to append the rules. 10 | -k Keep the xt_DADDR module loaded when stopping DSRs. 11 | The xt_DADDR module is removed by default when running 12 | the stop action. 13 | -n Don't actually perform the operations. This option 14 | is useful with the verbose option. 15 | -s v:v Set the sleep values for removing the xt_DADDR module. 16 | The first value is the number of seconds to wait before 17 | attempting the first modprobe. The second value is 18 | the number of seconds to wait before all subsequent 19 | attempts to remove the module. Floating point values 20 | are allowed. 21 | -v Be verbose. More -v options get more verbose output. 22 | -x Don't print the header. 23 | Run the requested action. Supported actions are: 24 | check 25 | restart 26 | status 27 | start 28 | stop 29 | -------------------------------------------------------------------------------- /yvipagent/Makefile: -------------------------------------------------------------------------------- 1 | # $Id: Makefile 467 2011-03-08 17:20:08Z jans $ 2 | # $URL: svn+ssh://svn.corp.yahoo.com/yahoo/ops/yvip/agent/branches/l3dsr-open-source/Makefile $ 3 | # 4 | # This Makefile is used to create a single tarball containig the various 5 | # bits and pieces that make up the server side code of our L3DSR 6 | # architecture. As such, it reacher over into a few other repositories; 7 | # the result is a tarball without any SVN information. 8 | 9 | TARBALL=l3dsr.tar.gz 10 | DOCDIR=${HOME}/dev/svn/yvip/doc 11 | LINUXDIR=${HOME}/dev/svn/packages/iptables-daddr/branches/l3dsr-open-source/iptables-daddr.el5 12 | FREEBSDDIR=${HOME}/dev/svn/dscp_rewrite/branches/l3dsr-open-source 13 | YVIPAGENTDIR=${HOME}/dev/svn/yvip/agent/branches/l3dsr-open-source 14 | 15 | all: ${TARBALL} 16 | 17 | ${TARBALL}: doc-up freebsd-up linux-up yvipagent-up 18 | ( cd .build && tar zcf ../${TARBALL} l3dsr ) 19 | 20 | doc-up: 21 | ( cd ${DOCDIR} && svn up ) 22 | mkdir -p .build/l3dsr/docs 23 | cp ${DOCDIR}/README .build/l3dsr/README 24 | cp ${DOCDIR}/nanog51/nanog51.pdf .build/l3dsr/docs/nanog51.pdf 25 | 26 | freebsd-up: 27 | ( cd ${FREEBSDDIR} && svn up ) 28 | mkdir -p .build/l3dsr/freebsd 29 | ( cd ${FREEBSDDIR} && pax -rw -s '/.*\.svn.*//' . ${YVIPAGENTDIR}/.build/l3dsr/freebsd/. ) 30 | 31 | linux-up: 32 | ( cd ${LINUXDIR} && svn up ) 33 | mkdir -p .build/l3dsr/linux 34 | ( cd ${LINUXDIR} && pax -rw -s '/.*\.svn.*//' . ${YVIPAGENTDIR}/.build/l3dsr/linux/. ) 35 | 36 | yvipagent-up: 37 | ( cd ${YVIPAGENTDIR} && svn up ) 38 | mkdir -p .build/l3dsr/yvipagent 39 | ( cd ${YVIPAGENTDIR} && pax -rw -s '/.*\.svn.*//' -s '/.*\.build.*//' . ${YVIPAGENTDIR}/.build/l3dsr/yvipagent/. ) 40 | 41 | clean: 42 | rm -fr .build ${TARBALL} 43 | -------------------------------------------------------------------------------- /yvipagent/doc/yvip.conf.5: -------------------------------------------------------------------------------- 1 | .\" This manual page was originally written by Jan Schaumann 2 | .\" in September 2009. 3 | .Dd September 26, 2013 4 | .Dt YVIP 5 5 | .Os 6 | .Sh NAME 7 | .Nm yvip 8 | .Nd VIP configuration file 9 | .Sh DESRIPTION 10 | This manual page describes the configuration file syntax for files used by 11 | the 12 | .Pa /usr/local/etc/rc.d/yvip 13 | system startup script. 14 | These files are found under 15 | .Pa /usr/local/etc/yvip/vips 16 | and may contain any number of VIP configurations. 17 | By convention in version 3.0 and above, the 18 | .Pa yvipagent 19 | package installs all VIP configuration into 20 | .Pa /usr/local/etc/yvip/vips/config . 21 | .Pp 22 | The syntax of these configuration files is as follows: 23 | .Bl -bullet -compact -offset indent 24 | .It 25 | empty lines are ignored 26 | .It 27 | anything including and following the '#' character is ignored 28 | .It 29 | all other content must be in the format 30 | .Dv ip[=dscp] 31 | .It 32 | any other content is a syntax error 33 | .El 34 | .Sh EXAMPLES 35 | .Pp 36 | The following example configures a traditional DSR VIP on the address 37 | 66.163.166.28, the IP address 69.147.125.65 for participation in an L3 DSR 38 | VIP using the DSCP value 41, as well as the IP address 69.147.125.66 for 39 | participation in an L3 DSR VIP using the DSCP value 42: 40 | .Bd -literal 41 | 66.163.166.28 42 | 69.147.125.65=41 43 | 69.147.125.66=42 44 | .Ed 45 | .Pp 46 | Note that the 47 | .Dv key=value 48 | pairs are unquoted. 49 | .Sh HISTORY 50 | The 51 | .Nm 52 | maintainer is 53 | .An Ben Haga 54 | .Aq bhaga@yahoo-inc.com . 55 | .Pp 56 | The 57 | .Nm 58 | utility was originally written by 59 | .An Jan Schaumann 60 | .Aq jschauma@yahoo-inc.com 61 | in September 2009. 62 | -------------------------------------------------------------------------------- /linux/dsrtools/INSTALL: -------------------------------------------------------------------------------- 1 | These packages supply the dsrtools software that provides control 2 | of L2DSR and L3DSR VIPs. 3 | 4 | To build the software, type: 5 | 6 | $ make 7 | 8 | 9 | For RPM-based distros, to build the source package, type: 10 | 11 | $ make rpm-spkg 12 | 13 | For RPM-based distros, to build the binary package, type: 14 | 15 | $ make rpm-pkgs 16 | 17 | The RPMs will be under: 18 | 19 | $ ls -lR `rpm -E %_topdir`/{RPMS,SRPMS} 20 | 21 | You may want to override %_topdir by setting the make macro TOPDIR: 22 | 23 | $ make TOPDIR=$PWD/topdir rpm-spkg rpm-pkgs 24 | 25 | 26 | If you have mock installed, type: 27 | 28 | $ make mock-pkgs 29 | 30 | You may want to add the macro definition MOCK="sudo mock" to the line. 31 | 32 | The RPMs will be in: 33 | 34 | $ ls -lR mock/results_*/*.rpm 35 | 36 | 37 | If you want to build packages for a system using something other 38 | than the provided "rpm" or "mock", you can create your own directory 39 | and add your packaging files there then provide the directory to the 40 | Makefile to call it with the PPS make macro. For example, if your 41 | directory is "deb", you could call it with: 42 | 43 | $ make PPS=deb deb-pkgs 44 | 45 | If you are happy with your efforts, please submit a pull request to 46 | include your new files in the repository. 47 | 48 | If you need to provide new make macros or change the default settings 49 | for existing ones, you may optionally provide at the top level a 50 | "package-local.mk" file which will be automatically included by 51 | subdirectory Makefiles. 52 | 53 | With the PPS macro and "package-local.mk", these should substantially 54 | reduce the need to modify provided files when building source or 55 | packages for your environment. 56 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/Makefile: -------------------------------------------------------------------------------- 1 | include ../macros.mk 2 | 3 | alltests = $(sort $(wildcard *.d)) 4 | alltestnames = $(basename $(alltests)) 5 | alltesttypes = $(basename $(alltestnames)) 6 | alltrun = $(patsubst %.sh,%,$(wildcard $(addsuffix /trun.sh,$(alltests)))) 7 | myid := $(shell id -u) 8 | 9 | KMOD = xt_DADDR 10 | 11 | DSRCTL ?= ../../src/dsrctl 12 | VERBOSEARG = $(if $(V),-v) 13 | REPLACEARG = $(if $(REPLACE),-r) 14 | KEEPARG = $(if $(KEEP),-k) 15 | ERRIGNARG = $(if $(ERRIGN),-i) 16 | ALLARGS = $(strip $(VERBOSEARG) $(REPLACEARG) $(KEEPARG) $(ERRIGNARG)) 17 | 18 | 19 | # Determine if the xt_DADDR.ko supports the use of any table. 20 | # The modinfo works whether the module is loaded or not. 21 | TableList=mangle 22 | SupportAnyTable=0 23 | ifneq ($(strip $(shell modinfo --field parm xt_DADDR 2>/dev/null)),) 24 | TableList += raw 25 | SupportAnyTable=1 26 | endif 27 | 28 | testall=$(foreach tbl,$(TableList),$(foreach tst,$(alltests),$(tbl)-$(tst))) 29 | 30 | 31 | all test: rootcheck runtest $(alltrun) $(testall) 32 | 33 | rootcheck: 34 | @[ $(myid) = "0" ] || { echo "Must be root to run tests."; false; } 35 | 36 | %: %.sh 37 | cp -fp -- '$<' '$@' 38 | chmod -w+x -- '$@' 39 | 40 | 41 | mangle-%: 42 | cd '$*' && DSRCTL='$(DSRCTL)' Tname='$*' ../runtest -t mangle $(ALLARGS) 43 | 44 | raw-%: 45 | cd '$*' && DSRCTL='$(DSRCTL)' Tname='$*' ../runtest -t raw $(ALLARGS) 46 | 47 | clean_targets = runtest $(alltrun) 48 | clobber_targets = $(clean_targets) 49 | distclean_targets = $(clobber_targets) 50 | 51 | clean clobber distclean: 52 | $(foreach file,\ 53 | $(filter $(wildcard $($(@)_targets)),$($(@)_targets)),\ 54 | rm -rf -- '$(file)'\ 55 | $(nl)\ 56 | ) 57 | 58 | .PHONY: all clean clobber distclean force rootcheck test 59 | -------------------------------------------------------------------------------- /linux/iptables-daddr/rpm/rpmdefs.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Sourced by Makefiles for setting default macro definitions for rpm builds. 3 | # 4 | # Rarely set optional macros used by spec file: 5 | # PACKAGE name of package 6 | # RELEASE release of package 7 | # BUILD_ID build id, appended to release 8 | # OSMACRO see below 9 | # OSMACROVER see below 10 | # KVARIANTS kernel variants to build (e.g. xen) 11 | # KVERREL kernel version and release (e.g. 3.10.0-123.el7) 12 | # WITHOUT_KMOD build without kmod package 13 | # WITH_MANGLE build kmod package to default to mangle table 14 | # WITH_OVERRIDE build kmod package without override file 15 | # URL URL included in package's information 16 | # EXTRA_BUILD_DEFS additional build defs 17 | # 18 | # For OSMACRO and OSMACROVER these are distribution flavor and code 19 | # borrowed from Open Build Service: 20 | # https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto 21 | # 22 | 23 | specfile = $(package).spec 24 | 25 | extrasrcfiles = \ 26 | $(package).files 27 | 28 | rpmtarfile = $(srctarfile) 29 | zrpmtarfile = $(rpmtarfile).xz 30 | 31 | build_defs = \ 32 | $(if $(dist),--define 'dist $(dist)') \ 33 | $(if $(PACKAGE),--define 'kmod_name $(PACKAGE)') \ 34 | $(if $(VERSION),--define 'kmod_driver_version $(VERSION)') \ 35 | $(if $(RELEASE),--define 'kmod_rpm_release $(RELEASE)') \ 36 | $(if $(BUILD_ID),--define 'build_id $(BUILD_ID)') \ 37 | $(if $(OSMACRO),--define '$(OSMACRO) $(OSMACROVER)') \ 38 | $(if $(KVARIANTS),--define 'kvariants $(subst ",\",$(KVARIANTS))') \ 39 | $(if $(KVERREL),--define 'kmod_kernel_version $(KVERREL)') \ 40 | $(if $(WITHOUT_KMOD),--define '_without_kmod 1') \ 41 | $(if $(WITH_MANGLE),--define '_with_mangle 1') \ 42 | $(if $(WITH_OVERRIDE),--define '_with_override 1') \ 43 | $(if $(URL),--define 'url $(URL)') \ 44 | $(EXTRA_BUILD_DEFS) 45 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Direct Server Return (DSR) load balancing is a common way to distribute 2 | network traffic using an approach that currently requires the load 3 | balancer and all hosts behind the Virtual IP (VIP) to be within the same 4 | Layer 2 broadcast domain. This is a severe limitation that hinders 5 | scaling VIPs beyond a single contiguous subnet. To overcome this 6 | limitation, we present a method to perform DSR load balancing across Layer 7 | 3 boundaries (``L3DSR''), a solution that allows Yahoo! to serve up to ten 8 | times as many VIPs on a single hardware Load Balancer compared to other 9 | Layer 3 load balancing methods. 10 | 11 | In order to overcome Layer 2 limitations, we use the 6-bit Differentiated 12 | Services Code Point (DSCP) field of the IPv4 header used for packet 13 | classification to relay information to the server. The server inspects 14 | the header and rewrites the destination address based on the value of the 15 | DSCP field and according to its own mapping of DSCP values to destination 16 | addresses. 17 | 18 | L3DSR is currently supported by: 19 | - A10 AX3200 >= 2.2.5 20 | - Brocade ADX Series >= 12.1d 21 | - Brocade/Foundry ServerIron 450 22 | - M7 and JetCore blades 23 | - >= 12.2.01p 24 | - Citrix Netscaler running 8.x, 9.x 25 | - Radware Alteon 4408, 4416, 5412 26 | - SW versions 27 and above 27 | - Radware AppDirector (All platforms) 28 | - 2.10 and above, requires the optional BWM license 29 | 30 | On the server, L3DSR is currently supported by: 31 | - FreeBSD >= 6.x 32 | - RHEL4 >= 4.7 (IPv4 only), RHEL5 >= 5.4 (IPv6 >= 5.9), 33 | RHEL6 >= 6.0, and Fedora 17 34 | 35 | L3DSR was developed at Yahoo! Inc. If you have questions or comments, 36 | please contact: 37 | Jan Schaumann (overall design), 38 | Carl Stanley (LBs), 39 | Quentin Barnes (iptables-daddr), or 40 | Wayne Badger (dsrtools/yvipagent). 41 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.validation.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | # Run tests. 11 | typeset rv=0 12 | 13 | # Test for conf file with spaces in the name. 14 | (( rv && ! ErrIgnore )) || docmd start "" "f:20-v i p.conf" 1 || rv=1 15 | (( rv && ! ErrIgnore )) || docmd status "" "f:20-v i p.conf" 1 || rv=1 16 | (( rv && ! ErrIgnore )) || docmd stop "" "f:20-v i p.conf" 1 || rv=1 17 | 18 | # Test for bad options. 19 | (( rv && ! ErrIgnore )) || docmd start "-z" n:21 2 || rv=1 20 | (( rv && ! ErrIgnore )) || docmd status "-b abc" n:21 3 || rv=1 21 | (( rv && ! ErrIgnore )) || docmd boomer "" n:21 4 || rv=1 22 | (( rv && ! ErrIgnore )) || docmd stop "-h" n:21 5 || rv=1 23 | (( rv && ! ErrIgnore )) || docmd stop "-sfoo" n:21 10 || rv=1 24 | (( rv && ! ErrIgnore )) || docmd stop "-s0:foo" n:21 11 || rv=1 25 | (( rv && ! ErrIgnore )) || docmd stop "-s.:." n:21 12 || rv=1 26 | (( rv && ! ErrIgnore )) || docmd stop "-sfoo:.4" n:21 13 || rv=1 27 | (( rv && ! ErrIgnore )) || docmd stop "-s.4:bar" n:21 14 || rv=1 28 | 29 | # Test for nonexistent FQDN. 30 | (( rv && ! ErrIgnore )) || docmd status "" n:22 6 || rv=1 31 | 32 | # Test for nonexistent config file. 33 | (( rv && ! ErrIgnore )) || docmd status "" f:foo.conf 7 || rv=1 34 | 35 | # Test for nonexistent config dir. 36 | (( rv && ! ErrIgnore )) || docmd status "" d:baddir 8 || rv=1 37 | 38 | # Test for conf file with no terminating newline. 39 | (( rv && ! ErrIgnore )) || docmd start "" "f:23-vip.conf" 9 || rv=1 40 | (( rv && ! ErrIgnore )) || docmd status "" "f:23-vip.conf" 9 || rv=1 41 | (( rv && ! ErrIgnore )) || docmd stop "" "f:23-vip.conf" 9 || rv=1 42 | 43 | dsrcleanup 44 | 45 | exit $rv 46 | -------------------------------------------------------------------------------- /yvipagent/CHANGES: -------------------------------------------------------------------------------- 1 | Version 4.5 (2013-09-26) 2 | * Bump version 3 | * Add IPv6 VIP configuration support for Linux 4 | * Clean up code 5 | * General bug fixes in configuration code 6 | * Updated documentation 7 | 8 | Version 1.3 (2012-11-05) 9 | * Linux: Disable explicit loading of kernel modules via yvipagent. iptables 10 | will load the appropriate modules as required. 11 | * Minor documentation updates 12 | 13 | Version 1.2 (2010-11-08) 14 | * on FreeBSD, also explicitly set the dscp_rewrite.enabled 15 | sysctl to zero 16 | 17 | Version 1.1 (2010-11-07) 18 | * properly strip trailing whitespace (also fixed 19 | commentary handling) 20 | * print affirmative reassuring comments on successful exit 21 | * really make 'ip' mandatory in the yvip.conf files 22 | * add an example to yvip.conf.5 23 | 24 | Version 1.0 (2010-10-05) 25 | * add support for RHEL5 by installing RPMs we depend on 26 | via yum in post-activation and explicitly conflicting with what used to 27 | be our yinst dependencies 28 | 29 | Version 0.6.1 (2010-01-18) 30 | * tiny version bump to fix dist_install fubar 31 | 32 | Version 0.6 (2010-01-18) 33 | * include DSCP bit in verbose output 34 | * ensure yvipagent bails out appropriately if an already 35 | configured vip is tried to be configured again 36 | 37 | Version 0.5 (2009-11-05) 38 | * don't touch system config files, as we're run at yinst 39 | start time anyway 40 | * unconfigure all l3-dsr configs 41 | 42 | Version 0.4 (2009-10-30) 43 | * install iptables rules into PREROUTING, not INPUT 44 | 45 | Version 0.3 (2009-10-27) 46 | * more clearly document yvipagent's requirement of 47 | exclusive control over vip management 48 | * yvipagent shouldn't try to unload kernel modules 49 | * ignore invalid ifcfg-file names 50 | * only delete firewall rules that are actually installed 51 | 52 | Version 0.2 (2009-10-06) 53 | * add "check" command 54 | * exit successfully explicitly if all's peachy 55 | * only process firewall files if they exist 56 | 57 | Version 0.1 (2009-09-29) 58 | * Initial version 59 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip6.l3.500.d/20-vip.conf: -------------------------------------------------------------------------------- 1 | # max number (0-63) of IPv6 L3DSR VIPs 2 | 2a00:1288:110:21b::4000=0 3 | 2a00:1288:110:21b::4001=1 4 | 2a00:1288:110:21b::4002=2 5 | 2a00:1288:110:21b::4003=3 6 | 2a00:1288:110:21b::4004=4 7 | 2a00:1288:110:21b::4005=5 8 | 2a00:1288:110:21b::4006=6 9 | 2a00:1288:110:21b::4007=7 10 | 2a00:1288:110:21b::4008=8 11 | 2a00:1288:110:21b::4009=9 12 | 2a00:1288:110:21b::4010=10 13 | 2a00:1288:110:21b::4011=11 14 | 2a00:1288:110:21b::4012=12 15 | 2a00:1288:110:21b::4013=13 16 | 2a00:1288:110:21b::4014=14 17 | 2a00:1288:110:21b::4015=15 18 | 2a00:1288:110:21b::4016=16 19 | 2a00:1288:110:21b::4017=17 20 | 2a00:1288:110:21b::4018=18 21 | 2a00:1288:110:21b::4019=19 22 | 2a00:1288:110:21b::4020=20 23 | 2a00:1288:110:21b::4021=21 24 | 2a00:1288:110:21b::4022=22 25 | 2a00:1288:110:21b::4023=23 26 | 2a00:1288:110:21b::4024=24 27 | 2a00:1288:110:21b::4025=25 28 | 2a00:1288:110:21b::4026=26 29 | 2a00:1288:110:21b::4027=27 30 | 2a00:1288:110:21b::4028=28 31 | 2a00:1288:110:21b::4029=29 32 | 2a00:1288:110:21b::4030=30 33 | 2a00:1288:110:21b::4031=31 34 | 2a00:1288:110:21b::4032=32 35 | 2a00:1288:110:21b::4033=33 36 | 2a00:1288:110:21b::4034=34 37 | 2a00:1288:110:21b::4035=35 38 | 2a00:1288:110:21b::4036=36 39 | 2a00:1288:110:21b::4037=37 40 | 2a00:1288:110:21b::4038=38 41 | 2a00:1288:110:21b::4039=39 42 | 2a00:1288:110:21b::4040=40 43 | 2a00:1288:110:21b::4041=41 44 | 2a00:1288:110:21b::4042=42 45 | 2a00:1288:110:21b::4043=43 46 | 2a00:1288:110:21b::4044=44 47 | 2a00:1288:110:21b::4045=45 48 | 2a00:1288:110:21b::4046=46 49 | 2a00:1288:110:21b::4047=47 50 | 2a00:1288:110:21b::4048=48 51 | 2a00:1288:110:21b::4049=49 52 | 2a00:1288:110:21b::4050=50 53 | 2a00:1288:110:21b::4051=51 54 | 2a00:1288:110:21b::4052=52 55 | 2a00:1288:110:21b::4053=53 56 | 2a00:1288:110:21b::4054=54 57 | 2a00:1288:110:21b::4055=55 58 | 2a00:1288:110:21b::4056=56 59 | 2a00:1288:110:21b::4057=57 60 | 2a00:1288:110:21b::4058=58 61 | 2a00:1288:110:21b::4059=59 62 | 2a00:1288:110:21b::4060=60 63 | 2a00:1288:110:21b::4061=61 64 | 2a00:1288:110:21b::4062=62 65 | 2a00:1288:110:21b::4063=63 66 | -------------------------------------------------------------------------------- /linux/iptables-daddr/USING: -------------------------------------------------------------------------------- 1 | A practical application of this software is to do L3DSR (Level 3 2 | Direct Server Return). For an overview, see Jan Schaumann's slides, 3 | l3dsr/docs/nanog51.pdf. 4 | 5 | For example, to use iptables-daddr you have two Load Balancers (LBs) 6 | with two VIPs (e.g. 72.30.38.140 and 98.139.183.24) and several 7 | servers behind them. The LBs must be able to rewrite the DSCP field 8 | of incoming, forwarded packets (or in some way mark the packets such 9 | that an iptables match rule on the servers can identify them). 10 | 11 | For example, the first VIP will set the DSCP field to 1 for its 12 | packets going to the servers, where the second VIP will set the 13 | DSCP field to 2. This will allow the servers to know what to set 14 | the destination address to in reply packets they send directly 15 | to client machines. 16 | 17 | On each server, create lookback interfaces corresponding to the VIPs 18 | and iptables rules to set the return address on the packets: 19 | # ifconfig lo:1 72.30.38.140 netmask 255.255.255.255 20 | # ifconfig lo:2 98.139.183.24 netmask 255.255.255.255 21 | # iptables -t raw -A INPUT -m dscp --dscp 1 -j DADDR --set-daddr=72.30.38.140 22 | # iptables -t raw -A INPUT -m dscp --dscp 2 -j DADDR --set-daddr=98.139.183.24 23 | 24 | An example for IPv6: 25 | # ifconfig lo:3 add fc00:1000:0:6::10/128 26 | # ifconfig lo:4 add fc00:1000:0:6::21/128 27 | # ip6tables -t raw -A INPUT -m dscp --dscp 10 -j DADDR --set-daddr=fc00:1000:0:6::10 28 | # ip6tables -t raw -A INPUT -m dscp --dscp 11 -j DADDR --set-daddr=fc00:1000:0:6::21 29 | 30 | As of 0.9.0, the default table was switched from "mangle" to "raw". 31 | If the old behavior is still desired, the xt_DADDR kernel module can 32 | be manually loaded with the option "table=mangle" or by creating a 33 | file /etc/modprobe.d/xt_DADDR.conf with the single line: 34 | options xt_DADDR table=mangle 35 | 36 | If you find it necessary to switch the table back to "mangle" please 37 | contact Quentin Barnes with your use case. 38 | Before attempting to push the code upstream, we want to learn of any 39 | cases at all where "raw" does not fully work. 40 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.005.d/expected.start.1: -------------------------------------------------------------------------------- 1 | Conflicting DSRs (IP=188.125.67.1, IP=188.125.67.2) found with DSCP 10. 2 | - Prev: L3DSR at "20-vip.conf", line 3. 3 | - Dup: L3DSR at "20-vip.conf", line 4. 4 | Conflicting DSRs (IP=188.125.67.3, IP=188.125.67.4) found with DSCP 013. 5 | - Prev: L3DSR at "20-vip.conf", line 6. 6 | - Dup: L3DSR at "20-vip.conf", line 7. 7 | Conflicting DSRs (IP=188.125.67.5, IP=188.125.67.6) found with DSCP 0Xc. 8 | - Prev: L3DSR at "20-vip.conf", line 9. 9 | - Dup: L3DSR at "20-vip.conf", line 10. 10 | Conflicting DSRs (IP=188.125.67.7, IP=188.125.67.8) found with DSCP 0Xd. 11 | - Prev: L3DSR at "20-vip.conf", line 12. 12 | - Dup: L3DSR at "20-vip.conf", line 13. 13 | Conflicting DSRs (IP=188.125.67.9, IP=188.125.67.10) found with DSCP 0xE. 14 | - Prev: L3DSR at "20-vip.conf", line 15. 15 | - Dup: L3DSR at "20-vip.conf", line 16. 16 | Conflicting DSRs (IP=188.125.67.11, IP=188.125.67.12) found with DSCP 0XF. 17 | - Prev: L3DSR at "20-vip.conf", line 18. 18 | - Dup: L3DSR at "20-vip.conf", line 19. 19 | Conflicting DSRs (IP=188.125.67.13, IP=188.125.67.14) found with DSCP 0x10. 20 | - Prev: L3DSR at "20-vip.conf", line 21. 21 | - Dup: L3DSR at "20-vip.conf", line 22. 22 | Conflicting DSRs (IP=188.125.67.15, IP=188.125.67.16) found with DSCP 0x11. 23 | - Prev: L3DSR at "20-vip.conf", line 24. 24 | - Dup: L3DSR at "20-vip.conf", line 25. 25 | Conflicting DSRs (IP=188.125.67.17, IP=188.125.67.18) found with DSCP 18. 26 | - Prev: L3DSR at "20-vip.conf", line 27. 27 | - Dup: L3DSR at "20-vip.conf", line 28. 28 | Conflicting DSRs (IP=188.125.67.19, IP=188.125.67.20) found with DSCP 023. 29 | - Prev: L3DSR at "20-vip.conf", line 30. 30 | - Dup: L3DSR at "20-vip.conf", line 31. 31 | Conflicting DSRs (IP=188.125.67.19, IP=188.125.67.20) found with DSCP 20. 32 | - Prev: L3DSR at "20-vip.conf", line 33. 33 | - Dup: L3DSR at "20-vip.conf", line 34. 34 | Conflicting DSRs (IP=188.125.67.21, IP=188.125.67.22) found with DSCP 025. 35 | - Prev: L3DSR at "20-vip.conf", line 36. 36 | - Dup: L3DSR at "20-vip.conf", line 37. 37 | Conflicting DSRs (IP=188.125.67.23, IP=188.125.67.24) found with DSCP 0x16. 38 | - Prev: L3DSR at "20-vip.conf", line 39. 39 | - Dup: L3DSR at "20-vip.conf", line 40. 40 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.005.d/expected.stop.1: -------------------------------------------------------------------------------- 1 | Conflicting DSRs (IP=188.125.67.1, IP=188.125.67.2) found with DSCP 10. 2 | - Prev: L3DSR at "20-vip.conf", line 3. 3 | - Dup: L3DSR at "20-vip.conf", line 4. 4 | Conflicting DSRs (IP=188.125.67.3, IP=188.125.67.4) found with DSCP 013. 5 | - Prev: L3DSR at "20-vip.conf", line 6. 6 | - Dup: L3DSR at "20-vip.conf", line 7. 7 | Conflicting DSRs (IP=188.125.67.5, IP=188.125.67.6) found with DSCP 0Xc. 8 | - Prev: L3DSR at "20-vip.conf", line 9. 9 | - Dup: L3DSR at "20-vip.conf", line 10. 10 | Conflicting DSRs (IP=188.125.67.7, IP=188.125.67.8) found with DSCP 0Xd. 11 | - Prev: L3DSR at "20-vip.conf", line 12. 12 | - Dup: L3DSR at "20-vip.conf", line 13. 13 | Conflicting DSRs (IP=188.125.67.9, IP=188.125.67.10) found with DSCP 0xE. 14 | - Prev: L3DSR at "20-vip.conf", line 15. 15 | - Dup: L3DSR at "20-vip.conf", line 16. 16 | Conflicting DSRs (IP=188.125.67.11, IP=188.125.67.12) found with DSCP 0XF. 17 | - Prev: L3DSR at "20-vip.conf", line 18. 18 | - Dup: L3DSR at "20-vip.conf", line 19. 19 | Conflicting DSRs (IP=188.125.67.13, IP=188.125.67.14) found with DSCP 0x10. 20 | - Prev: L3DSR at "20-vip.conf", line 21. 21 | - Dup: L3DSR at "20-vip.conf", line 22. 22 | Conflicting DSRs (IP=188.125.67.15, IP=188.125.67.16) found with DSCP 0x11. 23 | - Prev: L3DSR at "20-vip.conf", line 24. 24 | - Dup: L3DSR at "20-vip.conf", line 25. 25 | Conflicting DSRs (IP=188.125.67.17, IP=188.125.67.18) found with DSCP 18. 26 | - Prev: L3DSR at "20-vip.conf", line 27. 27 | - Dup: L3DSR at "20-vip.conf", line 28. 28 | Conflicting DSRs (IP=188.125.67.19, IP=188.125.67.20) found with DSCP 023. 29 | - Prev: L3DSR at "20-vip.conf", line 30. 30 | - Dup: L3DSR at "20-vip.conf", line 31. 31 | Conflicting DSRs (IP=188.125.67.19, IP=188.125.67.20) found with DSCP 20. 32 | - Prev: L3DSR at "20-vip.conf", line 33. 33 | - Dup: L3DSR at "20-vip.conf", line 34. 34 | Conflicting DSRs (IP=188.125.67.21, IP=188.125.67.22) found with DSCP 025. 35 | - Prev: L3DSR at "20-vip.conf", line 36. 36 | - Dup: L3DSR at "20-vip.conf", line 37. 37 | Conflicting DSRs (IP=188.125.67.23, IP=188.125.67.24) found with DSCP 0x16. 38 | - Prev: L3DSR at "20-vip.conf", line 39. 39 | - Dup: L3DSR at "20-vip.conf", line 40. 40 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/README: -------------------------------------------------------------------------------- 1 | This directory contains tests for L3DSR. Each subdirectory is a test where 2 | the name identifies whether the test uses IPv4/IPv6/both and L2DSR/L3DSR/both. 3 | IPv4: ip4 4 | IPv6: ip6 5 | both: ip46 6 | 7 | L2DSR: l2 8 | L3DSR: l3 9 | both: l23 10 | 11 | The tests exercise the configuration of L3DSR using dsrctl and in so doing, 12 | create and delete iptables rules and loopbacks so the tests should not be run 13 | on a host actively participating in L3DSR. 14 | 15 | These tests do not test end-to-end L3DSR functionality where packets are sent 16 | among the participant hosts. That testing is beyond the scope of this set of 17 | tests. 18 | 19 | 20 | Run all of the tests using ../../src/dsrctl: 21 | make 22 | 23 | Run all of the tests using specific dsrctl: 24 | make DSRCTL= 25 | 26 | Run all of the tests using /usr/sbin/dsrctl: 27 | make DSRCTL=/usr/sbin/dsrctl 28 | 29 | Run the tests in a single directory: 30 | make DSRCTL= mangle-ip46.l23.000.d 31 | make DSRCTL= raw-ip46.l23.000.d 32 | 33 | Run the tests in a single directory with verbose output: 34 | make V=1 DSRCTL= mangle-ip46.l23.000.d 35 | make V=1 DSRCTL= raw-ip46.l23.000.d 36 | 37 | The Makefile determines whether mangle, raw, or both can be run and runs 38 | the appropriate set of tests unless you specify a particular table. 39 | 40 | Each directory of tests contains a tinfo file that provides information about 41 | the tests. The format of the file is a sourceable ksh file. It must contain 42 | a line that provides a definition of a TDESC variable that contains a short, 43 | one line description of the tests. For example, 44 | TDESC="IPv4 L3DSRs with duplicate DSCPs (dec, oct, hex)" 45 | 46 | Additional lines indicate the expected return value of the dsrctl command. 47 | The format of the expected return value variable name is 48 | TRV__ 49 | 50 | For example, if the action for the given command is "status", this is test 51 | number 5, and the expected return value is 1, then the following line would be 52 | correct. 53 | TRV_status_5=1 54 | 55 | If the expected return value is 0, then you don't need to specify it in the 56 | tinfo file. 57 | -------------------------------------------------------------------------------- /linux/dsrtools/rpm/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makes the SRPM and RPM packages. 3 | # 4 | # Optionally takes: 5 | # TOPDIR top directory for rpmbuild 6 | # DIST %{dist} for rpmbuild or '""' for unsetting it 7 | # EXTRA_RPMBUILD_ARGS extra arguments to add to rpmbuild commands 8 | # 9 | # Also see rpmdefs.mk for rarely set optional macros. 10 | # 11 | 12 | include ../package.mk rpmdefs.mk 13 | 14 | ifdef TOPDIR 15 | topdir = $(TOPDIR) 16 | else 17 | topdir := $(shell rpm -E '%{_topdir}') 18 | ifeq ($(topdir),%{_topdir}) 19 | $(error Cannot determine topdir) 20 | endif 21 | endif 22 | 23 | rpmpkgs := $(shell rpm -q $(build_defs) --specfile '$(specfile)' 2> /dev/null) 24 | 25 | pkgarches = $(foreach p,$(rpmpkgs),$(lastword $(subst ., ,$p))) 26 | rpmdirs = $(foreach a,$(pkgarches),$(topdir)/RPMS/$a/) 27 | rpms = $(addsuffix .rpm,$(join $(rpmdirs),$(rpmpkgs))) 28 | 29 | srpmpkg = $(patsubst %.$(firstword $(pkgarches)),%,$(firstword $(rpmpkgs))) 30 | srpm = $(topdir)/SRPMS/$(srpmpkg).src.rpm 31 | 32 | tardir = ../tar 33 | 34 | rpmbuild_defs = $(build_defs) \ 35 | $(if $(TOPDIR),--define '_topdir $(TOPDIR)') 36 | 37 | rpmbuild_args = $(rpmbuild_defs) \ 38 | $(EXTRA_RPMBUILD_ARGS) 39 | 40 | clean_files = $(rpms) $(srpm) $(zrpmtarfile) $(rpmtarfile) 41 | clobber_files = $(clean_files) $(TOPDIR) 42 | distclean_files = $(clobber_files) 43 | 44 | 45 | all: spkg pkgs 46 | 47 | spkg: $(srpm) 48 | 49 | pkgs: $(rpms) 50 | 51 | zrpmtar: $(zrpmtarfile) 52 | 53 | $(tardir)/$(zsrctarfile): 54 | $(MAKE) -C '$(@D)' '$(@F)' 55 | 56 | $(rpmtarfile): $(tardir)/$(zsrctarfile) $(extrasrcfiles) $(specfile) 57 | xz -cdk '$<' > '$@' 58 | tar -rf '$@' $(extrasrcfiles) '$(specfile)' 59 | 60 | $(zrpmtarfile): $(rpmtarfile) 61 | xz -czk '$<' > '$@' 62 | 63 | $(srpm): $(zrpmtarfile) 64 | rpmbuild -ts --target=noarch $(rpmbuild_args) '$<' 65 | 66 | $(rpms): $(zrpmtarfile) 67 | rpmbuild -tb $(rpmbuild_args) '$<' 68 | 69 | $(srpm) $(rpms): $(MAKEFILE_LIST) 70 | 71 | print_spkg: 72 | @echo '$(srpm)' 73 | 74 | print_pkgs: 75 | @echo '$(rpms)' 76 | 77 | clean clobber distclean: 78 | $(RM) -r -- $($@_files) 79 | $(MAKE) -C '$(tardir)' $@ 80 | 81 | 82 | .PHONY: all spkg pkgs zrpmtar print_spkg print_pkgs clean clobber distclean 83 | .DELETE_ON_ERROR: 84 | -------------------------------------------------------------------------------- /linux/iptables-daddr/INSTALL: -------------------------------------------------------------------------------- 1 | These packages supply an Iptables plugin and kernel module and that 2 | allow rewriting of the destination IP address for IPv4 and IPv6. 3 | 4 | To build both components of the software, type: 5 | 6 | $ make 7 | 8 | To install the components, you need to specify the base library path 9 | with the "libdir" make macro. Set it to where your system has its 10 | iptables library modules. This example assumes it is "/usr/lib64" 11 | (common for some distros running on 64-bit architectures): 12 | 13 | $ sudo make libdir=/usr/lib64 install 14 | 15 | If the directory name used for iptables library modules is incorrect 16 | for your system, you may need override it by giving the full path 17 | for the library modules using "ipt_libdir". For example: 18 | 19 | $ sudo make ipt_libdir=/usr/lib/iptables install 20 | 21 | 22 | For RPM-based distros, to build the binary packages, type: 23 | 24 | $ make rpm-pkgs 25 | 26 | The RPMs will be under: 27 | 28 | $ ls -lR `rpm -E %_topdir`/{RPMS,SRPMS} 29 | 30 | You may want to override %_topdir by setting the make macro TOPDIR: 31 | 32 | $ make TOPDIR=$PWD/topdir rpm-pkgs 33 | 34 | 35 | If you have mock installed, type: 36 | 37 | $ make mock-pkgs 38 | 39 | You may want to add the macro definition MOCK="sudo mock" to the line. 40 | 41 | The RPMs will be in: 42 | 43 | $ ls -lR mock/results_*/*.rpm 44 | 45 | 46 | If you want to build packages for a system using something other 47 | than the provided "rpm" or "mock", you can create your own directory 48 | and add your packaging files there then provide the directory to the 49 | Makefile to call it with the PPS make macro. For example, if your 50 | directory is "deb", you could call it with: 51 | 52 | $ make PPS=deb deb-pkgs 53 | 54 | If you are happy with your efforts, please submit a pull request to 55 | include your new files in the repository. 56 | 57 | If you need to provide new make macros or change the default settings 58 | for existing ones, you may optionally provide at the top level a 59 | "package-local.mk" file which will be automatically included by 60 | subdirectory Makefiles. 61 | 62 | With the PPS macro and "package-local.mk", these should substantially 63 | reduce the need to modify provided files when building source or 64 | packages for your environment. 65 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.008.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | Tmplts=( expected.status.1 11 | expected.status.3 12 | expected.status.5 13 | ) 14 | 15 | expand_templates Tmplts "$Table" 16 | 17 | # Run tests. 18 | typeset rv=0 19 | 20 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.66.1 20 || rv=1 21 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.66.2 21 || rv=1 22 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables OUTPUT 188.125.66.1 20 || rv=1 23 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables OUTPUT 188.125.66.2 21 || rv=1 24 | 25 | # These are the same IP as in 20-vip.conf. 26 | # The OUTPUT chain rules should not conflict with the VIP rules. 27 | # Note that I'm choosing to use the OUTPUT chain because it exists for both 28 | # the raw and mangle tables. 29 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables OUTPUT 188.125.67.1 10 || rv=1 30 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables OUTPUT 188.125.67.2 11 || rv=1 31 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables OUTPUT 188.125.67.3 12 || rv=1 32 | 33 | 34 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 1 || rv=1 35 | (( rv && ! ErrIgnore )) || docmd status "" n:20 2 || rv=1 36 | 37 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 38 | 39 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 3 || rv=1 40 | (( rv && ! ErrIgnore )) || docmd status "" n:20 4 || rv=1 41 | 42 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 43 | 44 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 5 || rv=1 45 | (( rv && ! ErrIgnore )) || docmd status "" n:20 6 || rv=1 46 | 47 | dsrcleanup 48 | 49 | # dsrcleanup (dsrctl -a stop) only touches PREROUTING rules, 50 | # so we need to clean up the OUTPUTrules we started here. 51 | stop_one_iptables_rule iptables OUTPUT 188.125.66.1 20 || true 52 | stop_one_iptables_rule iptables OUTPUT 188.125.66.2 21 || true 53 | stop_one_iptables_rule iptables OUTPUT 188.125.67.1 10 || true 54 | stop_one_iptables_rule iptables OUTPUT 188.125.67.2 11 || true 55 | stop_one_iptables_rule iptables OUTPUT 188.125.67.3 12 || true 56 | 57 | exit $rv 58 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.status.2.template: -------------------------------------------------------------------------------- 1 | 20161014-13:51:31: ===== Iptables Table is TABLE (TABLE_CMT) 2 | 20161014-13:51:31: ===== Loading config file 20-vip.conf 3 | 20161014-13:51:31: ====== Config File Start 4 | 20161014-13:51:31: ====== Number of DSRs = 4 5 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.67.68 dscp=28 6 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.82.38 dscp= 7 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.82.196 dscp=43 8 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.82.253 dscp=17 9 | 20161014-13:51:31: ====== Config File End 10 | 20161014-13:51:31: +ip -o addr show lo 11 | 20161014-13:51:31: ====== Loopbacks Start 12 | 20161014-13:51:31: ====== Number of loopbacks = 4 13 | 20161014-13:51:31: ====== loopback4: configured started vip=188.125.67.68 1 14 | 20161014-13:51:31: ====== loopback4: configured started vip=188.125.82.38 2 15 | 20161014-13:51:31: ====== loopback4: configured started vip=188.125.82.196 3 16 | 20161014-13:51:31: ====== loopback4: configured started vip=188.125.82.253 4 17 | 20161014-13:51:31: ====== Loopbacks End 18 | 20161014-13:51:31: +iptables -L -t TABLE -n 19 | IPV6ONLY:20161014-13:51:31: +ip6tables -L -t TABLE -n 20 | 20161014-13:51:31: ====== Iptables Start 21 | 20161014-13:51:31: ====== Number of iptables rules = 3 22 | 20161014-13:51:31: ====== iptables4: configured started vip=188.125.67.68 dscp=28 23 | 20161014-13:51:31: ====== iptables4: configured started vip=188.125.82.196 dscp=43 24 | 20161014-13:51:31: ====== iptables4: configured started vip=188.125.82.253 dscp=17 25 | 20161014-13:51:31: ====== Iptables End 26 | type state name ipaddr dscp loopback iptables 27 | ===== ======= ============== ============== ==== ======== ======== 28 | 20161014-13:51:31: ====== Checking configured DSR 188.125.67.68=28 29 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 30 | 20161014-13:51:31: ====== Checking configured DSR 188.125.82.38= 31 | l2dsr started 188.125.82.38 188.125.82.38 -- lo:2 -- 32 | 20161014-13:51:31: ====== Checking configured DSR 188.125.82.196=43 33 | l3dsr started 188.125.82.196 188.125.82.196 43 lo:3 up 34 | 20161014-13:51:31: ====== Checking configured DSR 188.125.82.253=17 35 | l3dsr started 188.125.82.253 188.125.82.253 17 lo:4 up 36 | -------------------------------------------------------------------------------- /linux/iptables-daddr/rpm/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makes the SRPM and RPM packages. 3 | # 4 | # Optionally takes: 5 | # TOPDIR top directory for rpmbuild 6 | # DIST %{dist} for rpmbuild or '""' for unsetting it 7 | # EXTRA_RPMBUILD_ARGS extra arguments to add to rpmbuild commands 8 | # 9 | # Also see rpmdefs.mk for rarely set optional macros. 10 | # 11 | 12 | include ../macros.mk ../package.mk rpmdefs.mk 13 | 14 | ifdef TOPDIR 15 | topdir = $(TOPDIR) 16 | else 17 | topdir := $(shell rpm -E '%{_topdir}') 18 | ifeq ($(topdir),%{_topdir}) 19 | $(error Cannot determine topdir) 20 | endif 21 | endif 22 | 23 | ifdef DIST 24 | ifeq ($(DIST),"") 25 | dist = %{nil} 26 | else 27 | dist = $(DIST) 28 | endif 29 | endif 30 | 31 | rpmpkgs := $(shell rpm -q $(build_defs) --specfile '$(specfile)' 2> /dev/null) 32 | 33 | pkgarches = $(foreach p,$(rpmpkgs),$(lastword $(subst ., ,$p))) 34 | rpmdirs = $(foreach a,$(pkgarches),$(topdir)/RPMS/$a/) 35 | rpms = $(addsuffix .rpm,$(join $(rpmdirs),$(rpmpkgs))) 36 | 37 | srpmpkg = $(patsubst %.$(firstword $(pkgarches)),%,$(firstword $(rpmpkgs))) 38 | srpm = $(topdir)/SRPMS/$(srpmpkg).src.rpm 39 | 40 | tardir = ../tar 41 | 42 | rpmbuild_defs = $(build_defs) \ 43 | $(if $(TOPDIR),--define '_topdir $(TOPDIR)') 44 | 45 | rpmbuild_args = $(rpmbuild_defs) \ 46 | $(EXTRA_RPMBUILD_ARGS) 47 | 48 | clean_files = $(rpms) $(srpm) $(zrpmtarfile) $(rpmtarfile) 49 | clobber_files = $(clean_files) $(TOPDIR) 50 | distclean_files = $(clobber_files) 51 | 52 | 53 | all: spkg pkgs 54 | 55 | spkg: $(srpm) 56 | 57 | pkgs: $(rpms) 58 | 59 | zrpmtar: $(zrpmtarfile) 60 | 61 | $(tardir)/$(zsrctarfile): 62 | $(MAKE) -C '$(@D)' '$(@F)' 63 | 64 | $(rpmtarfile): $(tardir)/$(zsrctarfile) $(extrasrcfiles) $(specfile) 65 | xz -cdk '$<' > '$@' 66 | tar -rf '$@' $(extrasrcfiles) '$(specfile)' 67 | 68 | $(zrpmtarfile): $(rpmtarfile) 69 | xz -czk '$<' > '$@' 70 | 71 | $(srpm): $(zrpmtarfile) 72 | rpmbuild -ts --target=noarch $(rpmbuild_args) '$<' 73 | 74 | $(rpms): $(zrpmtarfile) 75 | rpmbuild -tb $(rpmbuild_args) '$<' 76 | 77 | $(srpm) $(rpms): $(MAKEFILE_LIST) 78 | 79 | print_spkg: 80 | @echo '$(srpm)' 81 | 82 | print_pkgs: 83 | @echo '$(rpms)' 84 | 85 | clean clobber distclean: 86 | $(call scrub_files_call,$($@_files)) 87 | $(MAKE) -C '$(tardir)' $@ 88 | 89 | 90 | .PHONY: all spkg pkgs zrpmtar print_spkg print_pkgs clean clobber distclean 91 | .DELETE_ON_ERROR: 92 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.stop.2.template: -------------------------------------------------------------------------------- 1 | 20161014-13:52:06: ===== Iptables Table is TABLE (TABLE_CMT) 2 | 20161014-13:52:06: ===== Loading config file 20-vip.conf 3 | 20161014-13:52:06: ====== Config File Start 4 | 20161014-13:52:06: ====== Number of DSRs = 4 5 | 20161014-13:52:06: ====== dsr4: configured init vip=188.125.67.68 dscp=28 6 | 20161014-13:52:06: ====== dsr4: configured init vip=188.125.82.38 dscp= 7 | 20161014-13:52:06: ====== dsr4: configured init vip=188.125.82.196 dscp=43 8 | 20161014-13:52:06: ====== dsr4: configured init vip=188.125.82.253 dscp=17 9 | 20161014-13:52:06: ====== Config File End 10 | 20161014-13:52:06: +ip -o addr show lo 11 | 20161014-13:52:06: ====== Loopbacks Start 12 | 20161014-13:52:06: ====== Number of loopbacks = 4 13 | 20161014-13:52:06: ====== loopback4: configured started vip=188.125.67.68 1 14 | 20161014-13:52:06: ====== loopback4: configured started vip=188.125.82.38 2 15 | 20161014-13:52:06: ====== loopback4: configured started vip=188.125.82.196 3 16 | 20161014-13:52:06: ====== loopback4: configured started vip=188.125.82.253 4 17 | 20161014-13:52:06: ====== Loopbacks End 18 | 20161014-13:52:06: +iptables -L -t TABLE -n 19 | IPV6ONLY:20161014-13:52:06: +ip6tables -L -t TABLE -n 20 | 20161014-13:52:06: ====== Iptables Start 21 | 20161014-13:52:06: ====== Number of iptables rules = 3 22 | 20161014-13:52:06: ====== iptables4: configured started vip=188.125.67.68 dscp=28 23 | 20161014-13:52:06: ====== iptables4: configured started vip=188.125.82.196 dscp=43 24 | 20161014-13:52:06: ====== iptables4: configured started vip=188.125.82.253 dscp=17 25 | 20161014-13:52:06: ====== Iptables End 26 | 20161014-13:52:06: ====== Stopping DSR 188.125.82.253=17 27 | 20161014-13:52:06: +iptables -t TABLE -D PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=188.125.82.253 28 | 20161014-13:52:06: +ip addr del 188.125.82.253/32 dev lo label lo:4 29 | 20161014-13:52:06: ====== Stopping DSR 188.125.82.196=43 30 | 20161014-13:52:06: +iptables -t TABLE -D PREROUTING -m dscp --dscp 43 -j DADDR --set-daddr=188.125.82.196 31 | 20161014-13:52:06: +ip addr del 188.125.82.196/32 dev lo label lo:3 32 | 20161014-13:52:06: ====== Stopping DSR 188.125.82.38= 33 | 20161014-13:52:06: +ip addr del 188.125.82.38/32 dev lo label lo:2 34 | 20161014-13:52:06: ====== Stopping DSR 188.125.67.68=28 35 | 20161014-13:52:06: +iptables -t TABLE -D PREROUTING -m dscp --dscp 28 -j DADDR --set-daddr=188.125.67.68 36 | 20161014-13:52:06: +ip addr del 188.125.67.68/32 dev lo label lo:1 37 | 20161014-13:52:06: +modprobe -r xt_DADDR 38 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/trun: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | Tmplts=( expected.start.1 11 | expected.status.1 12 | expected.stop.1 13 | expected.start.2 14 | expected.status.2 15 | expected.stop.2 16 | expected.start.3 17 | expected.status.3 18 | expected.stop.3 19 | expected.status.4 20 | expected.status.5 21 | expected.start.6 22 | ) 23 | 24 | expand_templates Tmplts "$Table" 25 | 26 | # Run tests. 27 | typeset rv=0 28 | 29 | # Test for single -v. 30 | (( rv && ! ErrIgnore )) || docmd start "-v" n:20 1 || rv=1 31 | (( rv && ! ErrIgnore )) || docmd status "-v" n:20 1 || rv=1 32 | (( rv && ! ErrIgnore )) || docmd stop "-v -s1:0.25" n:20 1 || rv=1 33 | 34 | # Test the -i option by verifying that the -I iptables option is 35 | # used when adding iptables rules. 36 | (( rv && ! ErrIgnore )) || docmd start "-vi" n:20 6 || rv=1 37 | (( rv && ! ErrIgnore )) || docmd status "-vi" n:20 1 || rv=1 38 | (( rv && ! ErrIgnore )) || docmd stop "-vi -s1:0.25" n:20 1 || rv=1 39 | 40 | # Test for double -vv. 41 | (( rv && ! ErrIgnore )) || docmd start "-vv" n:20 2 || rv=1 42 | (( rv && ! ErrIgnore )) || docmd status "-vv" n:20 2 || rv=1 43 | (( rv && ! ErrIgnore )) || docmd stop "-vv -s1:0.25" n:20 2 || rv=1 44 | 45 | # Test for triple -vvv. 46 | (( rv && ! ErrIgnore )) || docmd start "-vvv" n:20 3 || rv=1 47 | (( rv && ! ErrIgnore )) || docmd status "-vvv" n:20 3 || rv=1 48 | (( rv && ! ErrIgnore )) || docmd stop "-vvv -s1:0.25" n:20 3 || rv=1 49 | 50 | # Test for triple -vvv. 51 | (( rv && ! ErrIgnore )) || docmd start "-vvv" n:20 3 || rv=1 52 | (( rv && ! ErrIgnore )) || docmd status "-vvv" n:20 3 || rv=1 53 | (( rv && ! ErrIgnore )) || docmd stop "-vvv -s1:0.25" n:20 3 || rv=1 54 | 55 | # Initialize loopbacks and iptables rules. 56 | (( rv && ! ErrIgnore )) || start_one_loopback 188.125.66.2 1 || rv=1 57 | (( rv && ! ErrIgnore )) || start_one_loopback 188.125.66.3 2 || rv=1 58 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.66.2 20 || rv=1 59 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.66.3 21 || rv=1 60 | 61 | (( rv && ! ErrIgnore )) || docmd status "-avvv" n:30 4 || rv=1 62 | (( rv && ! ErrIgnore )) || docmd status "-vvv" n:30 5 || rv=1 63 | 64 | dsrcleanup 65 | 66 | exit $rv 67 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | Tmplts=( expected.start.1 11 | expected.status.1 12 | expected.stop.1 13 | expected.start.2 14 | expected.status.2 15 | expected.stop.2 16 | expected.start.3 17 | expected.status.3 18 | expected.stop.3 19 | expected.status.4 20 | expected.status.5 21 | expected.start.6 22 | ) 23 | 24 | expand_templates Tmplts "$Table" 25 | 26 | # Run tests. 27 | typeset rv=0 28 | 29 | # Test for single -v. 30 | (( rv && ! ErrIgnore )) || docmd start "-v" n:20 1 || rv=1 31 | (( rv && ! ErrIgnore )) || docmd status "-v" n:20 1 || rv=1 32 | (( rv && ! ErrIgnore )) || docmd stop "-v -s1:0.25" n:20 1 || rv=1 33 | 34 | # Test the -i option by verifying that the -I iptables option is 35 | # used when adding iptables rules. 36 | (( rv && ! ErrIgnore )) || docmd start "-vi" n:20 6 || rv=1 37 | (( rv && ! ErrIgnore )) || docmd status "-vi" n:20 1 || rv=1 38 | (( rv && ! ErrIgnore )) || docmd stop "-vi -s1:0.25" n:20 1 || rv=1 39 | 40 | # Test for double -vv. 41 | (( rv && ! ErrIgnore )) || docmd start "-vv" n:20 2 || rv=1 42 | (( rv && ! ErrIgnore )) || docmd status "-vv" n:20 2 || rv=1 43 | (( rv && ! ErrIgnore )) || docmd stop "-vv -s1:0.25" n:20 2 || rv=1 44 | 45 | # Test for triple -vvv. 46 | (( rv && ! ErrIgnore )) || docmd start "-vvv" n:20 3 || rv=1 47 | (( rv && ! ErrIgnore )) || docmd status "-vvv" n:20 3 || rv=1 48 | (( rv && ! ErrIgnore )) || docmd stop "-vvv -s1:0.25" n:20 3 || rv=1 49 | 50 | # Test for triple -vvv. 51 | (( rv && ! ErrIgnore )) || docmd start "-vvv" n:20 3 || rv=1 52 | (( rv && ! ErrIgnore )) || docmd status "-vvv" n:20 3 || rv=1 53 | (( rv && ! ErrIgnore )) || docmd stop "-vvv -s1:0.25" n:20 3 || rv=1 54 | 55 | # Initialize loopbacks and iptables rules. 56 | (( rv && ! ErrIgnore )) || start_one_loopback 188.125.66.2 1 || rv=1 57 | (( rv && ! ErrIgnore )) || start_one_loopback 188.125.66.3 2 || rv=1 58 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.66.2 20 || rv=1 59 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.66.3 21 || rv=1 60 | 61 | (( rv && ! ErrIgnore )) || docmd status "-avvv" n:30 4 || rv=1 62 | (( rv && ! ErrIgnore )) || docmd status "-vvv" n:30 5 || rv=1 63 | 64 | dsrcleanup 65 | 66 | exit $rv 67 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.verbose.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | Tmplts=( expected.start.1 11 | expected.status.1 12 | expected.stop.1 13 | expected.start.2 14 | expected.status.2 15 | expected.stop.2 16 | expected.start.3 17 | expected.status.3 18 | expected.stop.3 19 | expected.status.4 20 | expected.status.5 21 | expected.start.6 22 | ) 23 | 24 | expand_templates Tmplts "$Table" 25 | 26 | # Run tests. 27 | typeset rv=0 28 | 29 | # Test for single -v. 30 | (( rv && ! ErrIgnore )) || docmd start "-v" n:20 1 || rv=1 31 | (( rv && ! ErrIgnore )) || docmd status "-v" n:20 1 || rv=1 32 | (( rv && ! ErrIgnore )) || docmd stop "-v -s1:0.25" n:20 1 || rv=1 33 | 34 | # Test the -i option by verifying that the -I iptables option is 35 | # used when adding iptables rules. 36 | (( rv && ! ErrIgnore )) || docmd start "-vi" n:20 6 || rv=1 37 | (( rv && ! ErrIgnore )) || docmd status "-vi" n:20 1 || rv=1 38 | (( rv && ! ErrIgnore )) || docmd stop "-vi -s1:0.25" n:20 1 || rv=1 39 | 40 | # Test for double -vv. 41 | (( rv && ! ErrIgnore )) || docmd start "-vv" n:20 2 || rv=1 42 | (( rv && ! ErrIgnore )) || docmd status "-vv" n:20 2 || rv=1 43 | (( rv && ! ErrIgnore )) || docmd stop "-vv -s1:0.25" n:20 2 || rv=1 44 | 45 | # Test for triple -vvv. 46 | (( rv && ! ErrIgnore )) || docmd start "-vvv" n:20 3 || rv=1 47 | (( rv && ! ErrIgnore )) || docmd status "-vvv" n:20 3 || rv=1 48 | (( rv && ! ErrIgnore )) || docmd stop "-vvv -s1:0.25" n:20 3 || rv=1 49 | 50 | # Test for triple -vvv. 51 | (( rv && ! ErrIgnore )) || docmd start "-vvv" n:20 3 || rv=1 52 | (( rv && ! ErrIgnore )) || docmd status "-vvv" n:20 3 || rv=1 53 | (( rv && ! ErrIgnore )) || docmd stop "-vvv -s1:0.25" n:20 3 || rv=1 54 | 55 | # Initialize loopbacks and iptables rules. 56 | (( rv && ! ErrIgnore )) || start_one_loopback 188.125.66.2 1 || rv=1 57 | (( rv && ! ErrIgnore )) || start_one_loopback 188.125.66.3 2 || rv=1 58 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.66.2 20 || rv=1 59 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.66.3 21 || rv=1 60 | 61 | (( rv && ! ErrIgnore )) || docmd status "-avvv" n:30 4 || rv=1 62 | (( rv && ! ErrIgnore )) || docmd status "-vvv" n:30 5 || rv=1 63 | 64 | dsrcleanup 65 | 66 | exit $rv 67 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.start.2.template: -------------------------------------------------------------------------------- 1 | 20161014-12:38:14: +modprobe xt_DADDR 2 | 20161014-12:38:14: ===== Iptables Table is TABLE (TABLE_CMT) 3 | 20161014-12:38:14: ===== Loading config file 20-vip.conf 4 | 20161014-12:38:14: ====== Config File Start 5 | 20161014-12:38:14: ====== Number of DSRs = 4 6 | 20161014-12:38:14: ====== dsr4: configured init vip=188.125.67.68 dscp=28 7 | 20161014-12:38:14: ====== dsr4: configured init vip=188.125.82.38 dscp= 8 | 20161014-12:38:14: ====== dsr4: configured init vip=188.125.82.196 dscp=43 9 | 20161014-12:38:14: ====== dsr4: configured init vip=188.125.82.253 dscp=17 10 | 20161014-12:38:14: ====== Config File End 11 | 20161014-12:38:14: +ip -o addr show lo 12 | 20161014-12:38:14: ====== Loopbacks Start 13 | 20161014-12:38:14: ====== Number of loopbacks = 4 14 | 20161014-12:38:14: ====== loopback4: configured stopped vip=188.125.67.68 15 | 20161014-12:38:14: ====== loopback4: configured stopped vip=188.125.82.38 16 | 20161014-12:38:14: ====== loopback4: configured stopped vip=188.125.82.196 17 | 20161014-12:38:14: ====== loopback4: configured stopped vip=188.125.82.253 18 | 20161014-12:38:14: ====== Loopbacks End 19 | 20161014-12:38:14: +iptables -L -t TABLE -n 20 | IPV6ONLY:20161014-12:38:14: +ip6tables -L -t TABLE -n 21 | 20161014-12:38:14: ====== Iptables Start 22 | 20161014-12:38:14: ====== Number of iptables rules = 3 23 | 20161014-12:38:14: ====== iptables4: configured stopped vip=188.125.67.68 dscp=28 24 | 20161014-12:38:14: ====== iptables4: configured stopped vip=188.125.82.196 dscp=43 25 | 20161014-12:38:14: ====== iptables4: configured stopped vip=188.125.82.253 dscp=17 26 | 20161014-12:38:14: ====== Iptables End 27 | 20161014-12:38:14: ====== Starting DSR 188.125.67.68=28 28 | 20161014-12:38:14: +iptables -t TABLE -A PREROUTING -m dscp --dscp 28 -j DADDR --set-daddr=188.125.67.68 29 | 20161014-12:38:14: +ip -o addr show lo 30 | 20161014-12:38:14: +ip addr add 188.125.67.68/32 dev lo label lo:1 31 | 20161014-12:38:14: ====== Starting DSR 188.125.82.38= 32 | 20161014-12:38:14: +ip -o addr show lo 33 | 20161014-12:38:14: +ip addr add 188.125.82.38/32 dev lo label lo:2 34 | 20161014-12:38:14: ====== Starting DSR 188.125.82.196=43 35 | 20161014-12:38:14: +iptables -t TABLE -A PREROUTING -m dscp --dscp 43 -j DADDR --set-daddr=188.125.82.196 36 | 20161014-12:38:14: +ip -o addr show lo 37 | 20161014-12:38:14: +ip addr add 188.125.82.196/32 dev lo label lo:3 38 | 20161014-12:38:14: ====== Starting DSR 188.125.82.253=17 39 | 20161014-12:38:14: +iptables -t TABLE -A PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=188.125.82.253 40 | 20161014-12:38:14: +ip -o addr show lo 41 | 20161014-12:38:14: +ip addr add 188.125.82.253/32 dev lo label lo:4 42 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.status.5.template: -------------------------------------------------------------------------------- 1 | 20161014-13:51:31: ===== Iptables Table is TABLE (TABLE_CMT) 2 | 20161014-13:51:31: ===== Loading config file 30-vip.conf 3 | 20161014-13:51:31: ====== Lexical analysis recognizes empty/comment line (# IPv4 L3DSRs) 4 | 20161014-13:51:31: ====== Lexical analysis recognizes empty/comment line () 5 | 20161014-13:51:31: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.1=10) 6 | 20161014-13:51:31: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.2=11) 7 | 20161014-13:51:31: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.3=12) 8 | 20161014-13:51:31: ====== Config File Start 9 | 20161014-13:51:31: ====== Number of DSRs = 3 10 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.67.1 dscp=10 11 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.67.2 dscp=11 12 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.67.3 dscp=12 13 | 20161014-13:51:31: ====== Config File End 14 | 20161014-13:51:31: +ip -o addr show lo 15 | 20161014-13:51:31: ====== Loopbacks Start 16 | 20161014-13:51:31: ====== Number of loopbacks = 5 17 | 20161014-13:51:31: ====== loopback4: configured stopped vip=188.125.67.1 18 | 20161014-13:51:31: ====== loopback4: configured stopped vip=188.125.67.2 19 | 20161014-13:51:31: ====== loopback4: configured stopped vip=188.125.67.3 20 | 20161014-13:51:31: ====== loopback4: discovered started vip=188.125.66.2 1 21 | 20161014-13:51:31: ====== loopback4: discovered started vip=188.125.66.3 2 22 | 20161014-13:51:31: ====== Loopbacks End 23 | 20161014-13:51:31: +iptables -L -t TABLE -n 24 | IPV6ONLY:20161014-13:51:31: +ip6tables -L -t TABLE -n 25 | 20161014-13:51:31: ====== Iptables Start 26 | 20161014-13:51:31: ====== Number of iptables rules = 5 27 | 20161014-13:51:31: ====== iptables4: configured stopped vip=188.125.67.1 dscp=10 28 | 20161014-13:51:31: ====== iptables4: configured stopped vip=188.125.67.2 dscp=11 29 | 20161014-13:51:31: ====== iptables4: configured stopped vip=188.125.67.3 dscp=12 30 | 20161014-13:51:31: ====== iptables4: discovered started vip=188.125.66.2 dscp=0x14 31 | 20161014-13:51:31: ====== iptables4: discovered started vip=188.125.66.3 dscp=0x15 32 | 20161014-13:51:31: ====== Iptables End 33 | type state name ipaddr dscp loopback iptables 34 | ===== ======= ============ ============ ==== ======== ======== 35 | 20161014-13:51:31: ====== Checking configured DSR 188.125.67.1=10 36 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 37 | 20161014-13:51:31: ====== Checking configured DSR 188.125.67.2=11 38 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- 39 | 20161014-13:51:31: ====== Checking configured DSR 188.125.67.3=12 40 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- 41 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.status.3.template: -------------------------------------------------------------------------------- 1 | 20161014-13:51:31: ===== Iptables Table is TABLE (TABLE_CMT) 2 | 20161014-13:51:31: ===== Loading config file 20-vip.conf 3 | 20161014-13:51:31: ====== Lexical analysis recognizes empty/comment line (# Mix of IPv4 L2DSR/L3DSR VIPs) 4 | 20161014-13:51:31: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.68=28) 5 | 20161014-13:51:31: ====== Lexical analysis recognizes L2DSR IPv4 (188.125.82.38) 6 | 20161014-13:51:31: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.82.196=43) 7 | 20161014-13:51:31: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.82.253=17) 8 | 20161014-13:51:31: ====== Config File Start 9 | 20161014-13:51:31: ====== Number of DSRs = 4 10 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.67.68 dscp=28 11 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.82.38 dscp= 12 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.82.196 dscp=43 13 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.82.253 dscp=17 14 | 20161014-13:51:31: ====== Config File End 15 | 20161014-13:51:31: +ip -o addr show lo 16 | 20161014-13:51:31: ====== Loopbacks Start 17 | 20161014-13:51:31: ====== Number of loopbacks = 4 18 | 20161014-13:51:31: ====== loopback4: configured started vip=188.125.67.68 1 19 | 20161014-13:51:31: ====== loopback4: configured started vip=188.125.82.38 2 20 | 20161014-13:51:31: ====== loopback4: configured started vip=188.125.82.196 3 21 | 20161014-13:51:31: ====== loopback4: configured started vip=188.125.82.253 4 22 | 20161014-13:51:31: ====== Loopbacks End 23 | 20161014-13:51:31: +iptables -L -t TABLE -n 24 | IPV6ONLY:20161014-13:51:31: +ip6tables -L -t TABLE -n 25 | 20161014-13:51:31: ====== Iptables Start 26 | 20161014-13:51:31: ====== Number of iptables rules = 3 27 | 20161014-13:51:31: ====== iptables4: configured started vip=188.125.67.68 dscp=28 28 | 20161014-13:51:31: ====== iptables4: configured started vip=188.125.82.196 dscp=43 29 | 20161014-13:51:31: ====== iptables4: configured started vip=188.125.82.253 dscp=17 30 | 20161014-13:51:31: ====== Iptables End 31 | type state name ipaddr dscp loopback iptables 32 | ===== ======= ============== ============== ==== ======== ======== 33 | 20161014-13:51:31: ====== Checking configured DSR 188.125.67.68=28 34 | l3dsr started 188.125.67.68 188.125.67.68 28 lo:1 up 35 | 20161014-13:51:31: ====== Checking configured DSR 188.125.82.38= 36 | l2dsr started 188.125.82.38 188.125.82.38 -- lo:2 -- 37 | 20161014-13:51:31: ====== Checking configured DSR 188.125.82.196=43 38 | l3dsr started 188.125.82.196 188.125.82.196 43 lo:3 up 39 | 20161014-13:51:31: ====== Checking configured DSR 188.125.82.253=17 40 | l3dsr started 188.125.82.253 188.125.82.253 17 lo:4 up 41 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.005.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | init "$@" 6 | 7 | unload_kmod 8 | load_kmod 9 | 10 | 11 | Tmplts=( expected.status.1 12 | expected.status.3 13 | ) 14 | 15 | expand_templates Tmplts "$Table" 16 | 17 | # Run tests. 18 | typeset rv=0 19 | 20 | 21 | 22 | # These are the same IPs as in 20-vip.conf. 23 | # The OUTPUT chain rules should not conflict with the VIP rules. 24 | # Note that I'm choosing to use the OUTPUT chain because it exists for both 25 | # the raw and mangle tables. 26 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables OUTPUT 188.125.67.1 10 || rv=1 27 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables OUTPUT 188.125.67.2 11 || rv=1 28 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables OUTPUT 188.125.67.3 12 || rv=1 29 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables OUTPUT 2a00:1288:110:021b::4002 32 || rv=1 30 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables OUTPUT 2a00:1288:110:021b::4002 35 || rv=1 31 | 32 | 33 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 1 || rv=1 34 | (( rv && ! ErrIgnore )) || docmd status "" n:20 2 || rv=1 35 | 36 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 37 | 38 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 3 || rv=1 39 | (( rv && ! ErrIgnore )) || docmd status "" n:20 4 || rv=1 40 | 41 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 42 | 43 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 1 || rv=1 44 | (( rv && ! ErrIgnore )) || docmd status "" n:20 2 || rv=1 45 | 46 | # Run the same tests, but use the -i option. The output 47 | # should remain the same. 48 | (( rv && ! ErrIgnore )) || docmd status "-ai" n:20 1 || rv=1 49 | (( rv && ! ErrIgnore )) || docmd status "-i" n:20 2 || rv=1 50 | 51 | (( rv && ! ErrIgnore )) || docmd start "-i" n:20 1 || rv=1 52 | 53 | (( rv && ! ErrIgnore )) || docmd status "-ai" n:20 3 || rv=1 54 | (( rv && ! ErrIgnore )) || docmd status "-i" n:20 4 || rv=1 55 | 56 | (( rv && ! ErrIgnore )) || docmd stop "-i" n:20 1 || rv=1 57 | 58 | (( rv && ! ErrIgnore )) || docmd status "-ai" n:20 1 || rv=1 59 | (( rv && ! ErrIgnore )) || docmd status "-i" n:20 2 || rv=1 60 | 61 | dsrcleanup 62 | 63 | # dsrcleanup (dsrctl -a stop) only touches PREROUTING rules, 64 | # so we need to clean up the OUTPUT rules we started here. 65 | stop_one_iptables_rule iptables OUTPUT 188.125.67.1 10 || true 66 | stop_one_iptables_rule iptables OUTPUT 188.125.67.2 11 || true 67 | stop_one_iptables_rule iptables OUTPUT 188.125.67.3 12 || true 68 | stop_one_iptables_rule ip6tables OUTPUT 2a00:1288:110:021b::4002 32 || true 69 | stop_one_iptables_rule ip6tables OUTPUT 2a00:1288:110:021b::4002 35 || true 70 | 71 | exit $rv 72 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.verbose.d/expected.status.5.template: -------------------------------------------------------------------------------- 1 | 20161014-13:51:31: ===== Iptables Table is TABLE (TABLE_CMT) 2 | 20161014-13:51:31: ===== Loading config file 30-vip.conf 3 | 20161014-13:51:31: ====== Lexical analysis recognizes empty/comment line (# IPv4 L3DSR with same DSCP followed by good L3DSR) 4 | 20161014-13:51:31: ====== Lexical analysis recognizes empty/comment line () 5 | 20161014-13:51:31: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.1=10) 6 | 20161014-13:51:31: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.2=11) 7 | 20161014-13:51:31: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.3=12) 8 | 20161014-13:51:31: ====== Config File Start 9 | 20161014-13:51:31: ====== Number of DSRs = 3 10 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.67.1 dscp=10 11 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.67.2 dscp=11 12 | 20161014-13:51:31: ====== dsr4: configured init vip=188.125.67.3 dscp=12 13 | 20161014-13:51:31: ====== Config File End 14 | 20161014-13:51:31: +ip -o addr show lo 15 | 20161014-13:51:31: ====== Loopbacks Start 16 | 20161014-13:51:31: ====== Number of loopbacks = 5 17 | 20161014-13:51:31: ====== loopback4: configured stopped vip=188.125.67.1 18 | 20161014-13:51:31: ====== loopback4: configured stopped vip=188.125.67.2 19 | 20161014-13:51:31: ====== loopback4: configured stopped vip=188.125.67.3 20 | 20161014-13:51:31: ====== loopback4: discovered started vip=188.125.66.2 1 21 | 20161014-13:51:31: ====== loopback4: discovered started vip=188.125.66.3 2 22 | 20161014-13:51:31: ====== Loopbacks End 23 | 20161014-13:51:31: +iptables -L -t TABLE -n 24 | 20161014-13:51:31: +ip6tables -L -t TABLE -n 25 | 20161014-13:51:31: ====== Iptables Start 26 | 20161014-13:51:31: ====== Number of iptables rules = 5 27 | 20161014-13:51:31: ====== iptables4: configured stopped vip=188.125.67.1 dscp=10 28 | 20161014-13:51:31: ====== iptables4: configured stopped vip=188.125.67.2 dscp=11 29 | 20161014-13:51:31: ====== iptables4: configured stopped vip=188.125.67.3 dscp=12 30 | 20161014-13:51:31: ====== iptables4: discovered started vip=188.125.66.2 dscp=0x14 31 | 20161014-13:51:31: ====== iptables4: discovered started vip=188.125.66.3 dscp=0x15 32 | 20161014-13:51:31: ====== Iptables End 33 | type state name ipaddr dscp loopback iptables 34 | ===== ======= ============ ============ ==== ======== ======== 35 | 20161014-13:51:31: ====== Checking configured DSR 188.125.67.1=10 36 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 37 | 20161014-13:51:31: ====== Checking configured DSR 188.125.67.2=11 38 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- 39 | 20161014-13:51:31: ====== Checking configured DSR 188.125.67.3=12 40 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- 41 | -------------------------------------------------------------------------------- /linux/dsrtools/src/dsr.conf.5.sed: -------------------------------------------------------------------------------- 1 | .TH DSR.CONF "5" "January 2019" "dsr.conf __VERSION__" "System Management Commands" 2 | .SH NAME 3 | dsr.conf \- configuration file for DSRs 4 | 5 | .SH DESCRIPTION 6 | 7 | The \fBdsrctl\fP command parses all files that end with \fI.conf\fP in 8 | \fB/etc/dsr.d\fP as DSR configuration files (unless specific configuration files 9 | are provided on the command line). The \fI.conf\fP files are parsed 10 | in a sorted order that is defined by the locale specified in the environment. 11 | 12 | \fBdsrctl\fP validates the input line looking for a VIP address and optionally 13 | a DSCP value for L3DSR VIPs. 14 | 15 | The basic format for an L3DSR line in a \fI.conf\fP file is 16 | .nf 17 | = 18 | .fi 19 | The basic format for an L2DSR line in a \fI.conf\fP file is 20 | .nf 21 | 22 | .fi 23 | 24 | This is an example L3DSR configuration. 25 | .nf 26 | # VIP=DSCP 27 | 98.139.235.245=28 # this is the best L3DSR ever 28 | 201F::0080:1d0:f8=29 # this is a good one, too 29 | .fi 30 | 31 | This is an example L2DSR configuration. 32 | .nf 33 | # VIP 34 | 98.139.235.245 # this is the best L2DSR ever 35 | 201F::0080:1d0:f8 # this is a good one, too 36 | .fi 37 | 38 | IPv4 VIPs may be entered in dotted decimal format (\fIe.g.\fP, 98.139.235.245) or 39 | as a FQDN (Fully Qualified Domain Name) (\fIe.g.\fP, host.colo.domain.com). 40 | Spaces are not allowed within the dotted decimal or FQDN VIP addresses. 41 | 42 | IPv6 VIPs are restricted to the standard hex groups, with colons separating 43 | the groups. Double colons are allowed once in the address. Upper and lower 44 | case hex letters are supported. Mixed IPv6/IPv4 addressing is not supported 45 | (\fIe.g.\fP, ::ffff:10.0.0.128). Similar to IPv4 addresses, spaces are not 46 | allowed within the colon-separated groups of the IPv6 address. 47 | 48 | The maximum DSCP value is 63. The DSCP value may be specified as a decimal 49 | (\fIe.g.\fP, 33), octal (\fIe.g.\fP, 041), or hex (\fIe.g.\fP, 0x21) value. 50 | \fBdsrctl\fP does not stop you from using a DSCP value of 0, but since this is 51 | the likely default value for the DSCP in most packets, it is a poor choice. 52 | 53 | Spaces/tabs are allowed anywhere (except within the VIP and DSCP values), but 54 | the VIP and DSCP must reside on the same line. Only one DSR configuration is 55 | allowed per line. 56 | 57 | Lines that begin with an octothorp (#) are considered comments and are 58 | ignored. Empty lines and lines containing only spaces and tabs are ignored. 59 | Comments are allowed after the VIP=DSCP on the VIP lines in the \fI.conf\fP 60 | file -- everything after the octothorp is ignored. 61 | 62 | 63 | .SH FILES 64 | .TP 65 | /etc/dsr.d 66 | This directory is the location where DSR configuration files are stored. Only 67 | files that end with \fI.conf\fP are considered configuration files and all 68 | others are ignored. 69 | 70 | .SH AUTHOR 71 | Wayne Badger, Verizon Media 72 | .SH "REPORTING BUGS" 73 | Report bugs to . 74 | .SH "SEE ALSO" 75 | .BR dsrctl (8) 76 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.stop.3.template: -------------------------------------------------------------------------------- 1 | 20161014-13:52:06: ===== Iptables Table is TABLE (TABLE_CMT) 2 | 20161014-13:52:06: ===== Loading config file 20-vip.conf 3 | 20161014-13:52:06: ====== Lexical analysis recognizes empty/comment line (# Mix of IPv4 L2DSR/L3DSR VIPs) 4 | 20161014-13:52:06: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.68=28) 5 | 20161014-13:52:06: ====== Lexical analysis recognizes L2DSR IPv4 (188.125.82.38) 6 | 20161014-13:52:06: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.82.196=43) 7 | 20161014-13:52:06: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.82.253=17) 8 | 20161014-13:52:06: ====== Config File Start 9 | 20161014-13:52:06: ====== Number of DSRs = 4 10 | 20161014-13:52:06: ====== dsr4: configured init vip=188.125.67.68 dscp=28 11 | 20161014-13:52:06: ====== dsr4: configured init vip=188.125.82.38 dscp= 12 | 20161014-13:52:06: ====== dsr4: configured init vip=188.125.82.196 dscp=43 13 | 20161014-13:52:06: ====== dsr4: configured init vip=188.125.82.253 dscp=17 14 | 20161014-13:52:06: ====== Config File End 15 | 20161014-13:52:06: +ip -o addr show lo 16 | 20161014-13:52:06: ====== Loopbacks Start 17 | 20161014-13:52:06: ====== Number of loopbacks = 4 18 | 20161014-13:52:06: ====== loopback4: configured started vip=188.125.67.68 1 19 | 20161014-13:52:06: ====== loopback4: configured started vip=188.125.82.38 2 20 | 20161014-13:52:06: ====== loopback4: configured started vip=188.125.82.196 3 21 | 20161014-13:52:06: ====== loopback4: configured started vip=188.125.82.253 4 22 | 20161014-13:52:06: ====== Loopbacks End 23 | 20161014-13:52:06: +iptables -L -t TABLE -n 24 | IPV6ONLY:20161014-13:52:06: +ip6tables -L -t TABLE -n 25 | 20161014-13:52:06: ====== Iptables Start 26 | 20161014-13:52:06: ====== Number of iptables rules = 3 27 | 20161014-13:52:06: ====== iptables4: configured started vip=188.125.67.68 dscp=28 28 | 20161014-13:52:06: ====== iptables4: configured started vip=188.125.82.196 dscp=43 29 | 20161014-13:52:06: ====== iptables4: configured started vip=188.125.82.253 dscp=17 30 | 20161014-13:52:06: ====== Iptables End 31 | 20161014-13:52:06: ====== Stopping DSR 188.125.82.253=17 32 | 20161014-13:52:06: +iptables -t TABLE -D PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=188.125.82.253 33 | 20161014-13:52:06: +ip addr del 188.125.82.253/32 dev lo label lo:4 34 | 20161014-13:52:06: ====== Stopping DSR 188.125.82.196=43 35 | 20161014-13:52:06: +iptables -t TABLE -D PREROUTING -m dscp --dscp 43 -j DADDR --set-daddr=188.125.82.196 36 | 20161014-13:52:06: +ip addr del 188.125.82.196/32 dev lo label lo:3 37 | 20161014-13:52:06: ====== Stopping DSR 188.125.82.38= 38 | 20161014-13:52:06: +ip addr del 188.125.82.38/32 dev lo label lo:2 39 | 20161014-13:52:06: ====== Stopping DSR 188.125.67.68=28 40 | 20161014-13:52:06: +iptables -t TABLE -D PREROUTING -m dscp --dscp 28 -j DADDR --set-daddr=188.125.67.68 41 | 20161014-13:52:06: +ip addr del 188.125.67.68/32 dev lo label lo:1 42 | 20161014-13:52:06: +modprobe -r xt_DADDR 43 | -------------------------------------------------------------------------------- /linux/dsrtools/mock/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makes the SRPM and RPM packages using mock. 3 | # 4 | # Optionally takes: 5 | # MOCK mock (can be useful to set to "sudo mock") 6 | # DIST %{dist} for rpmbuild or '""' for unsetting it 7 | # MOCK_SRPM_RESULTDIR --resultdir for building SRPM 8 | # MOCK_RPM_RESULTDIR --resultdir for building RPMs 9 | # EXTRA_MOCK_SRPM_ARGS extra mock arguments when building SRPM 10 | # EXTRA_MOCK_RPM_ARGS extra mock arguments when building RPMs 11 | # 12 | # Also see rpm/rpmdefs.mk for rarely set optional macros. 13 | # 14 | 15 | ifdef DIST 16 | ifeq ($(DIST),"") 17 | dist = %{nil} 18 | else 19 | dist = $(DIST) 20 | endif 21 | endif 22 | 23 | include ../macros.mk ../package.mk ../rpm/rpmdefs.mk 24 | 25 | MOCK ?= mock 26 | 27 | srpm_resultdir = $(or $(MOCK_SRPM_RESULTDIR),results_srpm) 28 | rpm_resultdir = $(or $(MOCK_RPM_RESULTDIR),results_rpm) 29 | 30 | mock_srpm_args = $(build_defs) \ 31 | --resultdir='$(srpm_resultdir)' \ 32 | $(EXTRA_MOCK_SRPM_ARGS) 33 | 34 | mock_rpm_args = $(build_defs) \ 35 | --resultdir='$(rpm_resultdir)' \ 36 | $(EXTRA_MOCK_RPM_ARGS) 37 | 38 | tardir = ../tar 39 | rpmdir = ../rpm 40 | 41 | rpmspecfile = $(rpmdir)/$(specfile) 42 | sources = SOURCES 43 | sourcesfiles = $(addprefix $(sources)/,$(extrasrcfiles)) 44 | 45 | rpmpkgs := $(shell \ 46 | $(MOCK) $(mock_srpm_args) --quiet \ 47 | --copyin '$(rpmspecfile)' . && \ 48 | $(MOCK) $(mock_srpm_args) --quiet \ 49 | --shell "rpm -q $(build_defs) --specfile '$(specfile)'") 50 | rpms = $(foreach p,$(rpmpkgs),$(rpm_resultdir)/$p.rpm) 51 | 52 | pkgarches = $(foreach p,$(rpmpkgs),$(lastword $(subst ., ,$p))) 53 | srpmpkg = $(patsubst %.$(firstword $(pkgarches)),%,$(firstword $(rpmpkgs))) 54 | srpm = $(srpm_resultdir)/$(srpmpkg).src.rpm 55 | 56 | clean_files = $(rpms) $(srpm) $(sourcesfiles) 57 | clobber_files = $(clean_files) $(sources) $(rpm_resultdir) $(srpm_resultdir) 58 | distclean_files = $(clobber_files) 59 | 60 | 61 | all: spkg pkgs 62 | 63 | spkg: $(srpm) 64 | 65 | pkgs: $(rpms) 66 | 67 | $(tardir)/$(zsrctarfile): 68 | $(MAKE) -C '$(@D)' '$(@F)' 69 | 70 | $(sources)/$(zsrctarfile): $(tardir)/$(zsrctarfile) | $(sources) 71 | cp -fp -- '$<' '$@' 72 | 73 | $(sources)/%: $(rpmdir)/% | $(sources) 74 | cp -fp -- '$<' '$@' 75 | 76 | $(srpm): $(sourcesfiles) $(sources)/$(zsrctarfile) $(rpmspecfile) 77 | $(MOCK) \ 78 | $(mock_srpm_args) \ 79 | --buildsrpm \ 80 | --sources '$(sources)' \ 81 | --spec '$(rpmspecfile)' 82 | 83 | $(rpms): $(srpm) 84 | $(MOCK) $(mock_rpm_args) --rebuild '$(srpm)' 85 | 86 | $(srpm) $(rpms): $(MAKEFILE_LIST) 87 | 88 | $(sources): 89 | mkdir -p -- '$@' 90 | 91 | print_spkg: 92 | @echo '$(addprefix $(CURDIR)/,$(srpm))' 93 | 94 | print_pkgs: 95 | @echo '$(addprefix $(CURDIR)/,$(rpms))' 96 | 97 | clean clobber distclean: 98 | $(call scrub_files_call,$($@_files)) 99 | $(MAKE) -C '$(rpmdir)' '$@' 100 | 101 | 102 | .PHONY: all spkg pkgs print_spkg print_pkgs clean clobber distclean 103 | .DELETE_ON_ERROR: 104 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.l3.003.d/trun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | . ../testfunctions.sh 4 | 5 | function start_iptables_rules 6 | { 7 | typeset rv=0 8 | 9 | # iptables rules for configured VIP 10 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.67.68 28 || rv=1 11 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.67.68 28 || rv=1 12 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.67.68 28 || rv=1 13 | 14 | # iptables rules for configured VIP 15 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.67.69 29 || rv=1 16 | 17 | # iptables rules for nonconfigured VIP 18 | (( rv && ! ErrIgnore )) || start_one_iptables_rule iptables PREROUTING 188.125.67.70 30 || rv=1 19 | 20 | # ip6tables rules for configured VIP 21 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2a00:1288:110:21b::4002 19 || rv=1 22 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2a00:1288:110:21b::4002 19 || rv=1 23 | 24 | # ip6tables rules for configured VIP 25 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2a00:1288:110:21b::4003 20 || rv=1 26 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2a00:1288:110:21b::4003 20 || rv=1 27 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2a00:1288:110:21b::4003 20 || rv=1 28 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2a00:1288:110:21b::4003 20 || rv=1 29 | 30 | # ip6tables rules for configured VIP 31 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2a00:1288:110:21b::4004 21 || rv=1 32 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2a00:1288:110:21b::4004 21 || rv=1 33 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2a00:1288:110:21b::4004 21 || rv=1 34 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2a00:1288:110:21b::4004 21 || rv=1 35 | (( rv && ! ErrIgnore )) || start_one_iptables_rule ip6tables PREROUTING 2a00:1288:110:21b::4004 21 || rv=1 36 | 37 | return $rv 38 | } 39 | 40 | init "$@" 41 | 42 | unload_kmod 43 | load_kmod 44 | 45 | Tmplts=( expected.status.2 46 | expected.status.4 47 | ) 48 | 49 | expand_templates Tmplts "$Table" 50 | 51 | # Run tests. 52 | typeset rv=0 53 | 54 | (( rv && ! ErrIgnore )) || docmd start "" n:20 1 || rv=1 55 | 56 | (( rv && ! ErrIgnore )) || start_iptables_rules || rv=$? 57 | 58 | (( rv && ! ErrIgnore )) || docmd status "" n:20 1 || rv=1 59 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 2 || rv=1 60 | 61 | (( rv && ! ErrIgnore )) || docmd stop "" n:20 1 || rv=1 62 | 63 | (( rv && ! ErrIgnore )) || docmd status "" n:20 3 || rv=1 64 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 4 || rv=1 65 | 66 | (( rv && ! ErrIgnore )) || docmd stop "-a" n:20 2 || rv=1 67 | 68 | (( rv && ! ErrIgnore )) || docmd status "" n:20 5 || rv=1 69 | (( rv && ! ErrIgnore )) || docmd status "-a" n:20 6 || rv=1 70 | 71 | dsrcleanup 72 | 73 | exit $rv 74 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.l3.005.d/expected.status.1: -------------------------------------------------------------------------------- 1 | Conflicting DSRs (IP=188.125.67.1, IP=188.125.67.2) found with DSCP 10. 2 | - Prev: L3DSR at "20-vip.conf", line 3. 3 | - Dup: L3DSR at "20-vip.conf", line 4. 4 | Conflicting DSRs (IP=188.125.67.3, IP=188.125.67.4) found with DSCP 013. 5 | - Prev: L3DSR at "20-vip.conf", line 6. 6 | - Dup: L3DSR at "20-vip.conf", line 7. 7 | Conflicting DSRs (IP=188.125.67.5, IP=188.125.67.6) found with DSCP 0Xc. 8 | - Prev: L3DSR at "20-vip.conf", line 9. 9 | - Dup: L3DSR at "20-vip.conf", line 10. 10 | Conflicting DSRs (IP=188.125.67.7, IP=188.125.67.8) found with DSCP 0Xd. 11 | - Prev: L3DSR at "20-vip.conf", line 12. 12 | - Dup: L3DSR at "20-vip.conf", line 13. 13 | Conflicting DSRs (IP=188.125.67.9, IP=188.125.67.10) found with DSCP 0xE. 14 | - Prev: L3DSR at "20-vip.conf", line 15. 15 | - Dup: L3DSR at "20-vip.conf", line 16. 16 | Conflicting DSRs (IP=188.125.67.11, IP=188.125.67.12) found with DSCP 0XF. 17 | - Prev: L3DSR at "20-vip.conf", line 18. 18 | - Dup: L3DSR at "20-vip.conf", line 19. 19 | Conflicting DSRs (IP=188.125.67.13, IP=188.125.67.14) found with DSCP 0x10. 20 | - Prev: L3DSR at "20-vip.conf", line 21. 21 | - Dup: L3DSR at "20-vip.conf", line 22. 22 | Conflicting DSRs (IP=188.125.67.15, IP=188.125.67.16) found with DSCP 0x11. 23 | - Prev: L3DSR at "20-vip.conf", line 24. 24 | - Dup: L3DSR at "20-vip.conf", line 25. 25 | Conflicting DSRs (IP=188.125.67.17, IP=188.125.67.18) found with DSCP 18. 26 | - Prev: L3DSR at "20-vip.conf", line 27. 27 | - Dup: L3DSR at "20-vip.conf", line 28. 28 | Conflicting DSRs (IP=188.125.67.19, IP=188.125.67.20) found with DSCP 023. 29 | - Prev: L3DSR at "20-vip.conf", line 30. 30 | - Dup: L3DSR at "20-vip.conf", line 31. 31 | Conflicting DSRs (IP=188.125.67.19, IP=188.125.67.20) found with DSCP 20. 32 | - Prev: L3DSR at "20-vip.conf", line 33. 33 | - Dup: L3DSR at "20-vip.conf", line 34. 34 | Conflicting DSRs (IP=188.125.67.21, IP=188.125.67.22) found with DSCP 025. 35 | - Prev: L3DSR at "20-vip.conf", line 36. 36 | - Dup: L3DSR at "20-vip.conf", line 37. 37 | Conflicting DSRs (IP=188.125.67.23, IP=188.125.67.24) found with DSCP 0x16. 38 | - Prev: L3DSR at "20-vip.conf", line 39. 39 | - Dup: L3DSR at "20-vip.conf", line 40. 40 | type state name ipaddr dscp loopback iptables 41 | ===== ======= ============= ============= ==== ======== ======== 42 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- 43 | l3dsr stopped 188.125.67.3 188.125.67.3 013 -- -- 44 | l3dsr stopped 188.125.67.5 188.125.67.5 0xc -- -- 45 | l3dsr stopped 188.125.67.7 188.125.67.7 0xD -- -- 46 | l3dsr stopped 188.125.67.9 188.125.67.9 0Xe -- -- 47 | l3dsr stopped 188.125.67.11 188.125.67.11 0XF -- -- 48 | l3dsr stopped 188.125.67.13 188.125.67.13 0x10 -- -- 49 | l3dsr stopped 188.125.67.15 188.125.67.15 17 -- -- 50 | l3dsr stopped 188.125.67.17 188.125.67.17 0x12 -- -- 51 | l3dsr stopped 188.125.67.19 188.125.67.19 19 -- -- 52 | l3dsr stopped 188.125.67.19 188.125.67.19 024 -- -- 53 | l3dsr stopped 188.125.67.21 188.125.67.21 0x15 -- -- 54 | l3dsr stopped 188.125.67.23 188.125.67.23 026 -- -- 55 | -------------------------------------------------------------------------------- /linux/dsrtools/src/Makefile: -------------------------------------------------------------------------------- 1 | $(call varchklist_call,\ 2 | INSTDIR \ 3 | PACKAGE \ 4 | RELEASE \ 5 | VERSION) 6 | 7 | rcfilebase = dsr 8 | rcfile = $(rcfilebase)rc 9 | cmdfile = dsrctl 10 | servicefile = dsr.service 11 | man5base = dsr.conf 12 | man5file = $(man5base).5 13 | man8base = dsrctl 14 | man8file = $(man8base).8 15 | confdir = dsr.d 16 | readme = README 17 | 18 | instrcfile = $(INSTDIR)/etc/rc.d/init.d/$(rcfilebase) 19 | instcmdfile = $(INSTDIR)/usr/sbin/$(cmdfile) 20 | instservicefile = $(INSTDIR)/usr/lib/systemd/system/$(servicefile) 21 | instman5file = $(INSTDIR)/usr/share/man/man5/$(man5file) 22 | instman8file = $(INSTDIR)/usr/share/man/man8/$(man8file) 23 | 24 | instrcd = $(INSTDIR)/etc/rc.d/init.d 25 | instconfd = $(INSTDIR)/etc/$(confdir) 26 | instcmdd = $(INSTDIR)/usr/sbin 27 | instserviced = $(INSTDIR)/usr/lib/systemd/system 28 | instman5d = $(INSTDIR)/usr/share/man/man5 29 | instman8d = $(INSTDIR)/usr/share/man/man8 30 | instreadme = $(INSTDIR)/etc/$(confdir)/$(readme) 31 | 32 | ifeq ($(WITHSYSTEMD),1) 33 | rcfile= 34 | instrcfile= 35 | instrcd= 36 | else 37 | servicefile= 38 | instservicefile= 39 | instserviced= 40 | endif 41 | 42 | 43 | all_targets = $(rcfile) \ 44 | $(cmdfile) \ 45 | $(servicefile) \ 46 | $(man5file) \ 47 | $(man8file) 48 | 49 | install_targets = $(instrcfile) \ 50 | $(instcmdfile) \ 51 | $(instservicefile) \ 52 | $(instman5file) \ 53 | $(instman8file) \ 54 | $(instrcd) \ 55 | $(instcmdd) \ 56 | $(instconfd) \ 57 | $(instreadme) 58 | 59 | instdirs = $(instrcd) \ 60 | $(instconfd) \ 61 | $(instcmdd) \ 62 | $(instserviced) \ 63 | $(instman5d) \ 64 | $(instman8d) 65 | 66 | clean_targets = $(all_targets) 67 | 68 | clobber_targets = $(clean_targets) $(topdir) 69 | 70 | distclean_targets = $(clobber_targets) 71 | 72 | all: $(all_targets) 73 | 74 | install: $(install_targets) 75 | 76 | $(instservicefile): $(servicefile) | $(instserviced) 77 | cp -fp -- '$<' '$@' 78 | 79 | $(instrcfile): $(rcfile) $(instrcd) 80 | cp -fp -- '$<' '$@' 81 | 82 | $(instcmdfile): $(cmdfile) | $(instcmdd) 83 | cp -fp -- '$<' '$@' 84 | 85 | $(instman5file): $(man5file) | $(instman5d) 86 | cp -fp -- '$<' '$@' 87 | 88 | $(instman8file): $(man8file) | $(instman8d) 89 | cp -fp -- '$<' '$@' 90 | 91 | $(instreadme): $(readme) | $(instconfd) 92 | cp -fp -- '$<' '$@' 93 | 94 | $(instdirs): 95 | mkdir -p -- '$@' 96 | 97 | clean clobber distclean: 98 | $(foreach file,\ 99 | $(filter $(wildcard $($(@)_targets)),$($(@)_targets)),\ 100 | rm -rf -- '$(file)'\ 101 | $(nl)\ 102 | ) 103 | 104 | %: %.sh 105 | cp -fp -- '$<' '$@' 106 | chmod -w+x -- '$@' 107 | 108 | %: %.txt 109 | cp -fp -- '$<' '$@' 110 | chmod -w -- '$@' 111 | 112 | %: %.sed 113 | rm -f -- '$@' 114 | @[ -d '$(@D)' ] || mkdir -p -- '$(@D)' 115 | sed \ 116 | -e 's/__VERSION__/$(VERSION)/g' \ 117 | '$<' > '$@' || rm -f -- '$@' 118 | chmod -w -- '$@' 119 | 120 | .PHONY: all install clean clobber distclean 121 | .DELETE_ON_ERROR: 122 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.start.3.template: -------------------------------------------------------------------------------- 1 | 20161014-12:38:14: +modprobe xt_DADDR 2 | 20161014-12:38:14: ===== Iptables Table is TABLE (TABLE_CMT) 3 | 20161014-12:38:14: ===== Loading config file 20-vip.conf 4 | 20161014-12:38:14: ====== Lexical analysis recognizes empty/comment line (# Mix of IPv4 L2DSR/L3DSR VIPs) 5 | 20161014-12:38:14: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.68=28) 6 | 20161014-12:38:14: ====== Lexical analysis recognizes L2DSR IPv4 (188.125.82.38) 7 | 20161014-12:38:14: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.82.196=43) 8 | 20161014-12:38:14: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.82.253=17) 9 | 20161014-12:38:14: ====== Config File Start 10 | 20161014-12:38:14: ====== Number of DSRs = 4 11 | 20161014-12:38:14: ====== dsr4: configured init vip=188.125.67.68 dscp=28 12 | 20161014-12:38:14: ====== dsr4: configured init vip=188.125.82.38 dscp= 13 | 20161014-12:38:14: ====== dsr4: configured init vip=188.125.82.196 dscp=43 14 | 20161014-12:38:14: ====== dsr4: configured init vip=188.125.82.253 dscp=17 15 | 20161014-12:38:14: ====== Config File End 16 | 20161014-12:38:14: +ip -o addr show lo 17 | 20161014-12:38:14: ====== Loopbacks Start 18 | 20161014-12:38:14: ====== Number of loopbacks = 4 19 | 20161014-12:38:14: ====== loopback4: configured stopped vip=188.125.67.68 20 | 20161014-12:38:14: ====== loopback4: configured stopped vip=188.125.82.38 21 | 20161014-12:38:14: ====== loopback4: configured stopped vip=188.125.82.196 22 | 20161014-12:38:14: ====== loopback4: configured stopped vip=188.125.82.253 23 | 20161014-12:38:14: ====== Loopbacks End 24 | 20161014-12:38:14: +iptables -L -t TABLE -n 25 | IPV6ONLY:20161014-12:38:14: +ip6tables -L -t TABLE -n 26 | 20161014-12:38:14: ====== Iptables Start 27 | 20161014-12:38:14: ====== Number of iptables rules = 3 28 | 20161014-12:38:14: ====== iptables4: configured stopped vip=188.125.67.68 dscp=28 29 | 20161014-12:38:14: ====== iptables4: configured stopped vip=188.125.82.196 dscp=43 30 | 20161014-12:38:14: ====== iptables4: configured stopped vip=188.125.82.253 dscp=17 31 | 20161014-12:38:14: ====== Iptables End 32 | 20161014-12:38:14: ====== Starting DSR 188.125.67.68=28 33 | 20161014-12:38:14: +iptables -t TABLE -A PREROUTING -m dscp --dscp 28 -j DADDR --set-daddr=188.125.67.68 34 | 20161014-12:38:14: +ip -o addr show lo 35 | 20161014-12:38:14: +ip addr add 188.125.67.68/32 dev lo label lo:1 36 | 20161014-12:38:14: ====== Starting DSR 188.125.82.38= 37 | 20161014-12:38:14: +ip -o addr show lo 38 | 20161014-12:38:14: +ip addr add 188.125.82.38/32 dev lo label lo:2 39 | 20161014-12:38:14: ====== Starting DSR 188.125.82.196=43 40 | 20161014-12:38:14: +iptables -t TABLE -A PREROUTING -m dscp --dscp 43 -j DADDR --set-daddr=188.125.82.196 41 | 20161014-12:38:14: +ip -o addr show lo 42 | 20161014-12:38:14: +ip addr add 188.125.82.196/32 dev lo label lo:3 43 | 20161014-12:38:14: ====== Starting DSR 188.125.82.253=17 44 | 20161014-12:38:14: +iptables -t TABLE -A PREROUTING -m dscp --dscp 17 -j DADDR --set-daddr=188.125.82.253 45 | 20161014-12:38:14: +ip -o addr show lo 46 | 20161014-12:38:14: +ip addr add 188.125.82.253/32 dev lo label lo:4 47 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip4.verbose.d/expected.status.4.template: -------------------------------------------------------------------------------- 1 | 20161014-16:44:44: ===== Iptables Table is TABLE (TABLE_CMT) 2 | 20161014-16:44:44: ===== Loading config file 30-vip.conf 3 | 20161014-16:44:44: ====== Lexical analysis recognizes empty/comment line (# IPv4 L3DSRs) 4 | 20161014-16:44:44: ====== Lexical analysis recognizes empty/comment line () 5 | 20161014-16:44:44: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.1=10) 6 | 20161014-16:44:44: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.2=11) 7 | 20161014-16:44:44: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.3=12) 8 | 20161014-16:44:44: ====== Config File Start 9 | 20161014-16:44:44: ====== Number of DSRs = 3 10 | 20161014-16:44:44: ====== dsr4: configured init vip=188.125.67.1 dscp=10 11 | 20161014-16:44:44: ====== dsr4: configured init vip=188.125.67.2 dscp=11 12 | 20161014-16:44:44: ====== dsr4: configured init vip=188.125.67.3 dscp=12 13 | 20161014-16:44:44: ====== Config File End 14 | 20161014-16:44:44: +ip -o addr show lo 15 | 20161014-16:44:44: ====== Loopbacks Start 16 | 20161014-16:44:44: ====== Number of loopbacks = 5 17 | 20161014-16:44:44: ====== loopback4: configured stopped vip=188.125.67.1 18 | 20161014-16:44:44: ====== loopback4: configured stopped vip=188.125.67.2 19 | 20161014-16:44:44: ====== loopback4: configured stopped vip=188.125.67.3 20 | 20161014-16:44:44: ====== loopback4: discovered started vip=188.125.66.2 1 21 | 20161014-16:44:44: ====== loopback4: discovered started vip=188.125.66.3 2 22 | 20161014-16:44:44: ====== Loopbacks End 23 | 20161014-16:44:44: +iptables -L -t TABLE -n 24 | IPV6ONLY:20161014-16:44:44: +ip6tables -L -t TABLE -n 25 | 20161014-16:44:44: ====== Iptables Start 26 | 20161014-16:44:44: ====== Number of iptables rules = 5 27 | 20161014-16:44:44: ====== iptables4: configured stopped vip=188.125.67.1 dscp=10 28 | 20161014-16:44:44: ====== iptables4: configured stopped vip=188.125.67.2 dscp=11 29 | 20161014-16:44:44: ====== iptables4: configured stopped vip=188.125.67.3 dscp=12 30 | 20161014-16:44:44: ====== iptables4: discovered started vip=188.125.66.2 dscp=0x14 31 | 20161014-16:44:44: ====== iptables4: discovered started vip=188.125.66.3 dscp=0x15 32 | 20161014-16:44:44: ====== Iptables End 33 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 34 | ===== ======= ============ ============ ==== ======== ======== IPTBL_HDR_EQUALS ==== 35 | 20161014-16:44:44: ====== Checking configured DSR 188.125.67.1=10 36 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- IPTBL_VAL conf 37 | 20161014-16:44:44: ====== Checking configured DSR 188.125.67.2=11 38 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- IPTBL_VAL conf 39 | 20161014-16:44:44: ====== Checking configured DSR 188.125.67.3=12 40 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- IPTBL_VAL conf 41 | 20161014-16:44:44: ====== Checking configured DSR 188.125.66.2=20 42 | l3dsr started 188.125.66.2 188.125.66.2 20 lo:1 up IPTBL_VAL disc 43 | 20161014-16:44:44: ====== Checking configured DSR 188.125.66.3=21 44 | l3dsr started 188.125.66.3 188.125.66.3 21 lo:2 up IPTBL_VAL disc 45 | -------------------------------------------------------------------------------- /linux/dsrtools/tests/ip46.verbose.d/expected.status.4.template: -------------------------------------------------------------------------------- 1 | 20161014-16:44:44: ===== Iptables Table is TABLE (TABLE_CMT) 2 | 20161014-16:44:44: ===== Loading config file 30-vip.conf 3 | 20161014-16:44:44: ====== Lexical analysis recognizes empty/comment line (# IPv4 L3DSR with same DSCP followed by good L3DSR) 4 | 20161014-16:44:44: ====== Lexical analysis recognizes empty/comment line () 5 | 20161014-16:44:44: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.1=10) 6 | 20161014-16:44:44: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.2=11) 7 | 20161014-16:44:44: ====== Lexical analysis recognizes L3DSR IPv4 (188.125.67.3=12) 8 | 20161014-16:44:44: ====== Config File Start 9 | 20161014-16:44:44: ====== Number of DSRs = 3 10 | 20161014-16:44:44: ====== dsr4: configured init vip=188.125.67.1 dscp=10 11 | 20161014-16:44:44: ====== dsr4: configured init vip=188.125.67.2 dscp=11 12 | 20161014-16:44:44: ====== dsr4: configured init vip=188.125.67.3 dscp=12 13 | 20161014-16:44:44: ====== Config File End 14 | 20161014-16:44:44: +ip -o addr show lo 15 | 20161014-16:44:44: ====== Loopbacks Start 16 | 20161014-16:44:44: ====== Number of loopbacks = 5 17 | 20161014-16:44:44: ====== loopback4: configured stopped vip=188.125.67.1 18 | 20161014-16:44:44: ====== loopback4: configured stopped vip=188.125.67.2 19 | 20161014-16:44:44: ====== loopback4: configured stopped vip=188.125.67.3 20 | 20161014-16:44:44: ====== loopback4: discovered started vip=188.125.66.2 1 21 | 20161014-16:44:44: ====== loopback4: discovered started vip=188.125.66.3 2 22 | 20161014-16:44:44: ====== Loopbacks End 23 | 20161014-16:44:44: +iptables -L -t TABLE -n 24 | 20161014-16:44:44: +ip6tables -L -t TABLE -n 25 | 20161014-16:44:44: ====== Iptables Start 26 | 20161014-16:44:44: ====== Number of iptables rules = 5 27 | 20161014-16:44:44: ====== iptables4: configured stopped vip=188.125.67.1 dscp=10 28 | 20161014-16:44:44: ====== iptables4: configured stopped vip=188.125.67.2 dscp=11 29 | 20161014-16:44:44: ====== iptables4: configured stopped vip=188.125.67.3 dscp=12 30 | 20161014-16:44:44: ====== iptables4: discovered started vip=188.125.66.2 dscp=0x14 31 | 20161014-16:44:44: ====== iptables4: discovered started vip=188.125.66.3 dscp=0x15 32 | 20161014-16:44:44: ====== Iptables End 33 | type state name ipaddr dscp loopback iptables IPTBL_HDR src 34 | ===== ======= ============ ============ ==== ======== ======== IPTBL_HDR_EQUALS ==== 35 | 20161014-16:44:44: ====== Checking configured DSR 188.125.67.1=10 36 | l3dsr stopped 188.125.67.1 188.125.67.1 10 -- -- IPTBL_VAL conf 37 | 20161014-16:44:44: ====== Checking configured DSR 188.125.67.2=11 38 | l3dsr stopped 188.125.67.2 188.125.67.2 11 -- -- IPTBL_VAL conf 39 | 20161014-16:44:44: ====== Checking configured DSR 188.125.67.3=12 40 | l3dsr stopped 188.125.67.3 188.125.67.3 12 -- -- IPTBL_VAL conf 41 | 20161014-16:44:44: ====== Checking configured DSR 188.125.66.2=20 42 | l3dsr started 188.125.66.2 188.125.66.2 20 lo:1 up IPTBL_VAL disc 43 | 20161014-16:44:44: ====== Checking configured DSR 188.125.66.3=21 44 | l3dsr started 188.125.66.3 188.125.66.3 21 lo:2 up IPTBL_VAL disc 45 | --------------------------------------------------------------------------------