[quagga-dev 14487] Re: CI Testresult: FAILED (Re: [quagga-dev, 14474, 3/3] lib, bgpd, tests: Refactor FILTER_X in zebra.h)

2016-01-08 Thread Martin Winter

Updated (fixed) report.
My Automated CI system didn’t handle error reporting from Package 
building correctly.


This is now fixed for future runs.
(Yes, I’m not handling all cases - I’m lazy and usually wait for new 
failures to implement that
part of the analysis. Far from perfect, but timesaving and makes my 
testing simpler by getting a

“free” test case)

Regards,
   Martin Winter


On 8 Jan 2016, at 16:43, cisys...@netdef.org wrote:


Continous Integration Result: FAILED

See below for issues.
This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter .

Patches applied :
Patchwork 1747: http://patchwork.quagga.net/patch/1747
[quagga-dev,14472,1/3] lib, bgpd: Remove 'struct fifo' 
from lib/zebra.h

Patchwork 1748: http://patchwork.quagga.net/patch/1748
[quagga-dev,14473,2/3] lib, bgpd: Fixup afi_t to be an enum and 
cleanup zebra.h

Patchwork 1749: http://patchwork.quagga.net/patch/1749
[quagga-dev,14474,3/3] lib, bgpd, tests: Refactor FILTER_X in 
zebra.h

Tested on top of Git : eae18d1 (as of 20151209.135437 UTC)
CI System Testrun URL: 
https://ci1.netdef.org/browse/QUAGGA-QPWORK-208/



Get source and apply patch from patchwork: Successful


Building Stage: Failed

NetBSD7 amd64 build: Successful
Openbsd58 amd64 build: Successful
NetBSD6 amd64 build: Successful
Ubuntu1404 amd64 build: Successful
FreeBSD9 amd64 build: Successful
OmniOS amd64 build: Successful
FreeBSD8 amd64 build: Successful
Debian8 amd64 build: Successful
FreeBSD10 amd64 build: Successful
Ubuntu1204 amd64 build: Successful

Package building failed for CentOS7 amd64 build:(see full log in 
attachment centos7_amd64_pkgbuild.log)

CC   bgp_snmp.o
In file included from bgp_snmp.c:34:0:
../bgpd/bgpd.h:235:11: error: 'FILTER_MAX' undeclared here (not in a 
function)

} dlist[FILTER_MAX];
^
make[3]: Leaving directory 
`/home/ci/cibuild.208/rpmbuild/BUILD/quagga-source/bgpd'

make[3]: *** [bgp_snmp.o] Error 1
make[2]: Leaving directory 
`/home/ci/cibuild.208/rpmbuild/BUILD/quagga-source'
make[1]: Leaving directory 
`/home/ci/cibuild.208/rpmbuild/BUILD/quagga-source'


Package building failed for CentOS6 amd64 build:(see full log in 
attachment centos6_amd64_pkgbuild.log)

CC bgp_snmp.o
In file included from bgp_snmp.c:34:
../bgpd/bgpd.h:235: error: 'FILTER_MAX' undeclared here (not in a 
function)
make[3]: Leaving directory 
`/home/ci/cibuild.208/rpmbuild/BUILD/quagga-source/bgpd'

make[3]: *** [bgp_snmp.o] Error 1
Making all in ripd
make[3]: Entering directory 
`/home/ci/cibuild.208/rpmbuild/BUILD/quagga-source/ripd'

CC ripd.o
CC rip_zebra.o



Regards,
NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education 
Foundation,

For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, 
mwin...@netdef.org


___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev

[quagga-dev 14486] CI Testresult: FAILED (Re: [quagga-dev, 14474, 3/3] lib, bgpd, tests: Refactor FILTER_X in zebra.h)

2016-01-08 Thread cisystem
Continous Integration Result: FAILED

See below for issues.
This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter .

Patches applied :
  Patchwork 1747: http://patchwork.quagga.net/patch/1747
   [quagga-dev,14472,1/3] lib, bgpd: Remove 'struct fifo' from 
lib/zebra.h
  Patchwork 1748: http://patchwork.quagga.net/patch/1748
   [quagga-dev,14473,2/3] lib, bgpd: Fixup afi_t to be an enum and cleanup 
zebra.h
  Patchwork 1749: http://patchwork.quagga.net/patch/1749
   [quagga-dev,14474,3/3] lib, bgpd, tests: Refactor FILTER_X in zebra.h
Tested on top of Git : eae18d1 (as of 20151209.135437 UTC)
CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-208/


Get source and apply patch from patchwork: Successful


Building Stage: Failed

NetBSD7 amd64 build: Successful
Openbsd58 amd64 build: Successful
NetBSD6 amd64 build: Successful
Ubuntu1404 amd64 build: Successful
FreeBSD9 amd64 build: Successful
OmniOS amd64 build: Successful
FreeBSD8 amd64 build: Successful
Debian8 amd64 build: Successful
FreeBSD10 amd64 build: Successful
Ubuntu1204 amd64 build: Successful

Package building failed for CentOS7 amd64 build:(see full log in attachment 
centos7_amd64_pkgbuild.log)
>   CC   bgp_snmp.o
> In file included from bgp_snmp.c:34:0:
> ../bgpd/bgpd.h:235:11: error: 'FILTER_MAX' undeclared here (not in a function)
>} dlist[FILTER_MAX];
>^
> make[3]: Leaving directory 
> `/home/ci/cibuild.208/rpmbuild/BUILD/quagga-source/bgpd'
> make[3]: *** [bgp_snmp.o] Error 1
> make[2]: Leaving directory `/home/ci/cibuild.208/rpmbuild/BUILD/quagga-source'
> make[1]: Leaving directory `/home/ci/cibuild.208/rpmbuild/BUILD/quagga-source'

Package building failed for CentOS6 amd64 build:(see full log in attachment 
centos6_amd64_pkgbuild.log)
>   CC bgp_snmp.o
> In file included from bgp_snmp.c:34:
> ../bgpd/bgpd.h:235: error: 'FILTER_MAX' undeclared here (not in a function)
> make[3]: Leaving directory 
> `/home/ci/cibuild.208/rpmbuild/BUILD/quagga-source/bgpd'
> make[3]: *** [bgp_snmp.o] Error 1
> Making all in ripd
> make[3]: Entering directory 
> `/home/ci/cibuild.208/rpmbuild/BUILD/quagga-source/ripd'
>   CC ripd.o
>   CC rip_zebra.o


Regards,
  NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education Foundation,
For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, 
mwin...@netdef.org



Building quagga-test-20160108.132007-git.eae18d1 RPM
-

#
# Fix up the SPEC File
/bin/sed -i 's/%_VERSION_%/20160108.132007/g' rpmbuild/SPECS/quagga-test.spec
/bin/sed -i 's/%_RELEASE_%/git.eae18d1/g' rpmbuild/SPECS/quagga-test.spec
/bin/sed -i 
's|%_SOURCEURL_%|https://ci1.netdef.org/browse/QUAGGA-QPWORK-CI005BUILD-208/artifact/shared/SourceCode/quagga-source.tar.gz|g'
 rpmbuild/SPECS/quagga-test.spec
/bin/sed -i 's/%_DATE_%/Fri Jan  8 2016/g' rpmbuild/SPECS/quagga-test.spec
/bin/sed -i 's/%_USER_%/RPM Makefile/g' rpmbuild/SPECS/quagga-test.spec
/bin/sed -i 's/%_EMAIL_%//g' rpmbuild/SPECS/quagga-test.spec
#
# Build the RPM
/usr/bin/rpmbuild --define "_topdir /home/ci/cibuild.208/rpmbuild" -ba --target 
x86_64 rpmbuild/SPECS/quagga-test.spec
Building target platforms: x86_64
Building for target x86_64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.eH7ErH
+ umask 022
+ cd /home/ci/cibuild.208/rpmbuild/BUILD
+ cd /home/ci/cibuild.208/rpmbuild/BUILD
+ rm -rf quagga-source
+ /usr/bin/tar -xf -
+ /usr/bin/gzip -dc /home/ci/cibuild.208/rpmbuild/SOURCES/quagga-source.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd quagga-source
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
Patch #0 (0001-systemd-change-the-WantedBy-target.patch):
+ echo 'Patch #0 (0001-systemd-change-the-WantedBy-target.patch):'
+ /usr/bin/cat 
/home/ci/cibuild.208/rpmbuild/SOURCES/0001-systemd-change-the-WantedBy-target.patch
+ /usr/bin/patch -p1 --fuzz=0
patching file redhat/bgpd.service
patching file redhat/isisd.service
patching file redhat/ospf6d.service
patching file redhat/ospfd.service
patching file redhat/ripd.service
patching file redhat/ripngd.service
patching file redhat/zebra.service
Patch #1 (quagga-pimd-init):
+ echo 'Patch #1 (quagga-pimd-init):'
+ /usr/bin/cat /home/ci/cibuild.208/rpmbuild/SOURCES/quagga-pimd-init
patching file redhat/Makefile.am
patching file redhat/pimd.init
patching file redhat/pimd.service
+ /usr/bin/patch -p1 --fuzz=0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.hBedIf
+ exit 0
+ umask 022
+ cd /home/ci/cibuild.208/rpmbuild/BUILD
+ cd quagga-source
+ ./bootstrap.sh
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtooliz

[quagga-dev 14485] Re: CI Testresult: FAILED (Re: [quagga-dev, 14460, 3/3] lib, bgpd, tests: Refactor FILTER_X in zebra.h)

2016-01-08 Thread Martin Winter
Corrected Report - my automated script didn’t analyze the dejagnu logs 
correctly.

This is now corrected and should work in the future…

Regards,
   Martin Winter

On 8 Jan 2016, at 16:07, cisys...@netdef.org wrote:


Continous Integration Result: FAILED

See below for issues.
This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter .

Patches applied :
Patchwork 1743: http://patchwork.quagga.net/patch/1743
[quagga-dev,14458,1/3] lib, bgpd: Remove 'struct fifo' 
from lib/zebra.h

Patchwork 1744: http://patchwork.quagga.net/patch/1744
[quagga-dev,14459,2/3] lib, bgpd: Fixup afi_t to be an enum and 
cleanup zebra.h

Patchwork 1745: http://patchwork.quagga.net/patch/1745
[quagga-dev,14460,3/3] lib, bgpd, tests: Refactor FILTER_X in 
zebra.h

Tested on top of Git : eae18d1 (as of 20151209.135437 UTC)
CI System Testrun URL: 
https://ci1.netdef.org/browse/QUAGGA-QPWORK-206/



Get source and apply patch from patchwork: Successful


Building Stage: Failed

OmniOS amd64 build: Successful

DejaGNU Unittests (make check) failed for Ubuntu1204 amd64 build:
(see full log in attachment ubuntu1204_amd64_dejagnu.log)

Running ./bgpd.tests/ecommtest.exp ...
Running ./bgpd.tests/testbgpcap.exp ...
FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
Running ./bgpd.tests/testbgpmpath.exp ...
Running ./bgpd.tests/testbgpmpattr.exp ...
=== bgpd Summary ===
# of expected passes180
# of unexpected failures2


DejaGNU Unittests (make check) failed for CentOS7 amd64 build:(see 
full log in attachment centos7_amd64_dejagnu.log)

Running ./bgpd.tests/ecommtest.exp ...
Running ./bgpd.tests/testbgpcap.exp ...
FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
Running ./bgpd.tests/testbgpmpath.exp ...
Running ./bgpd.tests/testbgpmpattr.exp ...
=== bgpd Summary ===
# of expected passes180
# of unexpected failures2


DejaGNU Unittests (make check) failed for Openbsd58 amd64 build:
(see full log in attachment openbsd58_amd64_dejagnu.log)

Running ./bgpd.tests/ecommtest.exp ...
Running ./bgpd.tests/testbgpcap.exp ...
FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
Running ./bgpd.tests/testbgpmpath.exp ...
Running ./bgpd.tests/testbgpmpattr.exp ...
=== bgpd Summary ===
# of expected passes180
# of unexpected failures2


DejaGNU Unittests (make check) failed for NetBSD6 amd64 build:(see 
full log in attachment netbsd6_amd64_dejagnu.log)

Running ./bgpd.tests/ecommtest.exp ...
Running ./bgpd.tests/testbgpcap.exp ...
FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
Running ./bgpd.tests/testbgpmpath.exp ...
Running ./bgpd.tests/testbgpmpattr.exp ...
=== bgpd Summary ===
# of expected passes180
# of unexpected failures2


DejaGNU Unittests (make check) failed for FreeBSD9 amd64 build:
(see full log in attachment freebsd9_amd64_dejagnu.log)

Running ./bgpd.tests/ecommtest.exp ...
Running ./bgpd.tests/testbgpcap.exp ...
FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
Running ./bgpd.tests/testbgpmpath.exp ...
Running ./bgpd.tests/testbgpmpattr.exp ...
=== bgpd Summary ===
# of expected passes180
# of unexpected failures2


DejaGNU Unittests (make check) failed for CentOS6 amd64 build:(see 
full log in attachment centos6_amd64_dejagnu.log)

Running ./bgpd.tests/ecommtest.exp ...
Running ./bgpd.tests/testbgpcap.exp ...
FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
Running ./bgpd.tests/testbgpmpath.exp ...
Running ./bgpd.tests/testbgpmpattr.exp ...
=== bgpd Summary ===
# of expected passes180
# of unexpected failures2


DejaGNU Unittests (make check) failed for Debian8 amd64 build:(see 
full log in attachment debian8_amd64_dejagnu.log)

Running ./bgpd.tests/ecommtest.exp ...
Running ./bgpd.tests/testbgpcap.exp ...
FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
Running ./bgpd.tests/testbgpmpath.exp ...
Running ./bgpd.tests/testbgpmpattr.exp ...
=== bgpd Summary ===
# of expected passes180
# of unexpected failures2


DejaGNU Unittests (make check) failed for Ubuntu1404 amd64 build:
(see full log in attachment ubuntu1404_amd64_dejagnu.log)

Running ./bgpd.tests/ecommtest.exp ...
Running ./bgpd.tests/testbgpcap.exp ...

[quagga-dev 14484] CI Testresult: FAILED (Re: [quagga-dev, 14460, 3/3] lib, bgpd, tests: Refactor FILTER_X in zebra.h)

2016-01-08 Thread cisystem
Continous Integration Result: FAILED

See below for issues.
This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter .

Patches applied :
  Patchwork 1743: http://patchwork.quagga.net/patch/1743
   [quagga-dev,14458,1/3] lib, bgpd: Remove 'struct fifo' from 
lib/zebra.h
  Patchwork 1744: http://patchwork.quagga.net/patch/1744
   [quagga-dev,14459,2/3] lib, bgpd: Fixup afi_t to be an enum and cleanup 
zebra.h
  Patchwork 1745: http://patchwork.quagga.net/patch/1745
   [quagga-dev,14460,3/3] lib, bgpd, tests: Refactor FILTER_X in zebra.h
Tested on top of Git : eae18d1 (as of 20151209.135437 UTC)
CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-206/


Get source and apply patch from patchwork: Successful


Building Stage: Failed

OmniOS amd64 build: Successful

DejaGNU Unittests (make check) failed for Ubuntu1204 amd64 build:(see full 
log in attachment ubuntu1204_amd64_dejagnu.log)
> Running ./bgpd.tests/ecommtest.exp ...
> Running ./bgpd.tests/testbgpcap.exp ...
> FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
> FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
> Running ./bgpd.tests/testbgpmpath.exp ...
> Running ./bgpd.tests/testbgpmpattr.exp ...
>   === bgpd Summary ===
> # of expected passes  180
> # of unexpected failures  2

DejaGNU Unittests (make check) failed for CentOS7 amd64 build:(see full log 
in attachment centos7_amd64_dejagnu.log)
> Running ./bgpd.tests/ecommtest.exp ...
> Running ./bgpd.tests/testbgpcap.exp ...
> FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
> FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
> Running ./bgpd.tests/testbgpmpath.exp ...
> Running ./bgpd.tests/testbgpmpattr.exp ...
>   === bgpd Summary ===
> # of expected passes  180
> # of unexpected failures  2

DejaGNU Unittests (make check) failed for Openbsd58 amd64 build:(see full 
log in attachment openbsd58_amd64_dejagnu.log)
> Running ./bgpd.tests/ecommtest.exp ...
> Running ./bgpd.tests/testbgpcap.exp ...
> FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
> FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
> Running ./bgpd.tests/testbgpmpath.exp ...
> Running ./bgpd.tests/testbgpmpattr.exp ...
>   === bgpd Summary ===
> # of expected passes  180
> # of unexpected failures  2

DejaGNU Unittests (make check) failed for NetBSD6 amd64 build:(see full log 
in attachment netbsd6_amd64_dejagnu.log)
> Running ./bgpd.tests/ecommtest.exp ...
> Running ./bgpd.tests/testbgpcap.exp ...
> FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
> FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
> Running ./bgpd.tests/testbgpmpath.exp ...
> Running ./bgpd.tests/testbgpmpattr.exp ...
>   === bgpd Summary ===
> # of expected passes  180
> # of unexpected failures  2

DejaGNU Unittests (make check) failed for FreeBSD9 amd64 build:(see full 
log in attachment freebsd9_amd64_dejagnu.log)
> Running ./bgpd.tests/ecommtest.exp ...
> Running ./bgpd.tests/testbgpcap.exp ...
> FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
> FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
> Running ./bgpd.tests/testbgpmpath.exp ...
> Running ./bgpd.tests/testbgpmpattr.exp ...
>   === bgpd Summary ===
> # of expected passes  180
> # of unexpected failures  2

DejaGNU Unittests (make check) failed for CentOS6 amd64 build:(see full log 
in attachment centos6_amd64_dejagnu.log)
> Running ./bgpd.tests/ecommtest.exp ...
> Running ./bgpd.tests/testbgpcap.exp ...
> FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
> FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
> Running ./bgpd.tests/testbgpmpath.exp ...
> Running ./bgpd.tests/testbgpmpattr.exp ...
>   === bgpd Summary ===
> # of expected passes  180
> # of unexpected failures  2

DejaGNU Unittests (make check) failed for Debian8 amd64 build:(see full log 
in attachment debian8_amd64_dejagnu.log)
> Running ./bgpd.tests/ecommtest.exp ...
> Running ./bgpd.tests/testbgpcap.exp ...
> FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
> FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
> Running ./bgpd.tests/testbgpmpath.exp ...
> Running ./bgpd.tests/testbgpmpattr.exp ...
>   === bgpd Summary ===
> # of expected passes  180
> # of unexpected failures  2

DejaGNU Unittests (make check) failed for Ubuntu1404 amd64 build:(see full 
log in attachment ubuntu1404_amd64_dejagnu.log)
> Running ./bgpd.tests/ecommtest.exp ...
> Running ./bgpd.tests/testbgpcap.exp ...
> FAIL: testbgpcap ORF: ORF, simple, single entry, single tuple
> FAIL: testbgpcap AS4real2: AS4 capability, in series of capabilities
> 

[quagga-dev 14483] Re: CI Testresult: FAILED (Re: [quagga-dev,14449] Re: Patch: Perfect command " table" )

2016-01-08 Thread Martin Winter
It seems my test system didn’t save the complete error log from the 
failed patch.
The patch failed to apply to the quagga master, but the relevant error 
was cut off by the reporting on my automated system


The full log is:

Applying Patchwork patch 1742

patching file lib/table.h
patching file zebra/rib.h
Hunk #1 succeeded at 630 (offset 53 lines).
patching file zebra/rt_netlink.c
patch:  malformed patch at line 91: nlmsghdr *h)


This is now corrected in my CI system and should report correctly in the 
future.


Regards,
   Martin Winter
   mwin...@opensourcerouting.org


On 7 Jan 2016, at 5:40, cisys...@netdef.org wrote:


Continous Integration Result: FAILED

See below for issues.
This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter .

Patches applied :
Patchwork 1742: http://patchwork.quagga.net/patch/1742
[quagga-dev,14449] Re: Patch: Perfect command "table"
Tested on top of Git : eae18d1 (as of 20151209.135437 UTC)
CI System Testrun URL: 
https://ci1.netdef.org/browse/QUAGGA-QPWORK-205/



Get source and apply patch from patchwork: Failed


Applying Patchwork patch 1742

patching file lib/table.h
patching file zebra/rib.h
Hunk #1 succeeded at 630 (offset 53 lines).
patching file zebra/rt_netlink.c


Regards,
NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education 
Foundation,

For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, 
mwin...@netdef.org


___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev

[quagga-dev 14482] Re: [PATCH 0/3] Refactor some lib/zebra.h code

2016-01-08 Thread Vincent JARDIN

On 07/01/2016 17:19, Donald Sharp wrote:

lib/zebra.h has a hodge-podge of different api's in it.
Start the refactoring.

Donald Sharp (3):
   lib, bgpd: Remove 'struct fifo' from lib/zebra.h
   lib, bgpd: Fixup afi_t to be an enum and cleanup zebra.h
   lib, bgpd, tests: Refactor FILTER_X in zebra.h


this patch serie looks.

reviewed-by: vincent.jar...@6wind.com

___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev


[quagga-dev 14481] Re: [PATCH 16/25] bgpd: general MP/SAFI improvements

2016-01-08 Thread Lou Berger
Vivek,

On 1/8/2016 11:34 AM, Vivek Venkatraman wrote:
>
> On Thu, Jan 7, 2016 at 8:39 AM, Lou Berger  > wrote:
>
>
>
> On 1/7/2016 11:12 AM, Vivek Venkatraman wrote:
> >
> > On Thu, Jan 7, 2016 at 7:36 AM, Lou Berger  
> > >> wrote:
> >
> >
> > ...
> > do you think default originate apply to other safi's such as
> > ENCAP, VPN,
> > EVPN and whatever comes next?  I'm leaning towards no...
> >
> >
> > I feel the same way. The default_originate command need not be
> > installed for those AFI/SAFI. But I believe they make sense for the
> > multicast AFs and others like labeled-unicast (1/4 or 2/4).
> >
> VPN = 4
>
>
> I meant the real (IANA) value, that should be in the protocol packets.
> VPN is 128 (1/128 or 2/128) while labeled-unicast is 4. 
>

> As mentioned in one of my other mails, we have a patch that clearly
> demarcates IANA and internal values and maps between them. It is done
> as part of our BGP-LU implementation, but I can see if it is useful to
> remove the LU part of the code and post it.
>
> Of course, since SAFI_ENCAP is only a small value (7), it does not
> immediately matter (there are only 2 unused slots - 5 and 6 - in the
> definitions).

Yup, lots (maybe too many) ways to refer to the same thing.  Also, FYI
the code being discussed has other issues when dealing with normal
network announcements, so need to spend some time coming up with the
'right answer'.  Will let you know what I/we end up with.

Thanks,
Lou
>  
>
> Lou
> >
> >
>
>
>



___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev


[quagga-dev 14480] Re: Testing Progress Update

2016-01-08 Thread Donald Sharp
Olivier -

We do have a solution, but it's wrapped up in a bunch of other code later
in our patch tree.  I'll talk internally to see if we can work something
out to get something done sooner rather than later.

thanks

donald

On Fri, Jan 8, 2016 at 11:33 AM,  wrote:

> Hello Donald,
>
> We face same issue here when implementing BGP-LS (Traffic Engineering AFI
> is 16388). We circumvent the problem by shifting (i.e. clear bit 14) AFI to
> internal value equal to 4. But, it is not safe (AFI = 4 is already assigned
> to HDLC). So, a safe and secure way to handle AFI with large value without
> create large table will be useful. I don't know if an indirect array or a
> hash table could be used. But, in any case, we need to look carefully at
> values already assigned by IANA.
>
> my 2 cents,
>
> Olivier
>
> Le 08/01/2016 15:07, Donald Sharp a écrit :
>
> Just wanted to capture a discussion Paul and I had off list.  The afi_t
> change in this patch breaks assumptions about data structures in
> bgpd/bgp_open.c and the handling of capability codes.  I've fixed those in
> http://patchwork.quagga.net/patch/1748/ when I was looking at some zebra
> refactoring.  I plan to merge this patch with Paul's afi_t typedef and it's
> fix of the clang issues with my bgp_open.c changes.  I'll send something
> along here shortly.
>
> This still leaves the change of the safi_t.  Switching over to an enum for
> it doesn't work that well because bgp defines SAFI_MPLS_LABELED_VPN as
> 128.  We would need to include this in the enum.  The problem is that both
> bgp and zebra( maybe more ) create multidimensional arrays based upon
> SAFI_MAX and AFI_MAX.  This mixing of indices and sizes causes issues.  We
> need a generic methodology to map afi/safi to an indice to create one
> dimensional arrays that are appropriately sized.  At this point that's a
> decent amount of work that would need some major testing to get right.  I'm
> going to hold off on that at the moment, unless someone wants to tackle
> this issue separately
>
> donald
>
> On Tue, Dec 15, 2015 at 11:22 AM, Paul Jakma  wrote:
>
>> On Tue, 15 Dec 2015, Donald Sharp wrote:
>>
>> Martin -
>>>
>>> As discussed in the meeting today here is an example of a bogus issue:
>>>
>>>
>>> https://ci1.netdef.org/artifact/QUAGGA-QMASTER/shared/build-82/static_analysis/report-8a9e85.html#EndPath
>>>
>>> Basically the error message boils down to this code construct:
>>>
>>> struct prefix p;
>>> if (afi == v4)
>>>   set p appropriately
>>> else if (afi == v6)
>>>   set p appropriately
>>>
>>> if (p.prefixlen)   <--- If afi is not v4 or v6 then prefix length is
>>> not going to be set.
>>>
>>> I spent a few minutes looking at clang and saw no good way to mark the
>>> code
>>> in plist.c as ok.
>>>
>>
>> To be fair, the compiler is technically correct - the best kind of
>> correct. :)
>>
>> It'd be nice if setting afi_t to an enum with just those 2 values was
>> sufficient, but it seems clang still does:
>>
>> if (afi == v4)
>> /* take false */
>> if (afi == v6)
>> /* take false */
>>
>> However, enum + a switch with just those 2 values and clang shuts up. See
>> below.
>>
>> A more compact diff would just be:
>>
>> if (!(afi == AFI_IP || afi == AFI_IP6))
>>   return CMD_WARNING;
>>
>> at the top of that func, but the enum could help compilers.
>>
>> diff --git a/lib/plist.c b/lib/plist.c
>> index f9e626d..6e00869 100644
>> --- a/lib/plist.c
>> +++ b/lib/plist.c
>> @@ -698,44 +698,45 @@ vty_prefix_list_install (struct vty *vty, afi_t
>> afi, const char *name,
>>  }
>>
>>/* "any" is special token for matching any IPv4 addresses.  */
>> -  if (afi == AFI_IP)
>> -{
>> -  if (strncmp ("any", prefix, strlen (prefix)) == 0)
>> -   {
>> - ret = str2prefix_ipv4 ("0.0.0.0/0", (struct prefix_ipv4 *) &p);
>> - genum = 0;
>> - lenum = IPV4_MAX_BITLEN;
>> - any = 1;
>> -   }
>> -  else
>> -   ret = str2prefix_ipv4 (prefix, (struct prefix_ipv4 *) &p);
>> -
>> -  if (ret <= 0)
>> -   {
>> - vty_out (vty, "%% Malformed IPv4 prefix%s", VTY_NEWLINE);
>> - return CMD_WARNING;
>> -   }
>> -}
>> -#ifdef HAVE_IPV6
>> -  else if (afi == AFI_IP6)
>> +  switch (afi)
>>  {
>> -  if (strncmp ("any", prefix, strlen (prefix)) == 0)
>> -   {
>> - ret = str2prefix_ipv6 ("::/0", (struct prefix_ipv6 *) &p);
>> - genum = 0;
>> - lenum = IPV6_MAX_BITLEN;
>> - any = 1;
>> -   }
>> -  else
>> -   ret = str2prefix_ipv6 (prefix, (struct prefix_ipv6 *) &p);
>> -
>> -  if (ret <= 0)
>> -   {
>> - vty_out (vty, "%% Malformed IPv6 prefix%s", VTY_NEWLINE);
>> - return CMD_WARNING;
>> -   }
>> +  case AFI_IP:
>> +{
>> +  if (strncmp ("any", prefix, strlen (prefix)) == 0)
>> +{
>> +  ret = str2prefix_ipv4 ("0.0.0.0/0", (struct prefix_ipv4
>> *) &p);
>> +  genum = 0;
>> +  lenum = IPV4_MAX_B

[quagga-dev 14478] Re: Testing Progress Update

2016-01-08 Thread olivier.dugeon

Hello Donald,

We face same issue here when implementing BGP-LS (Traffic Engineering 
AFI is 16388). We circumvent the problem by shifting (i.e. clear bit 14) 
AFI to internal value equal to 4. But, it is not safe (AFI = 4 is 
already assigned to HDLC). So, a safe and secure way to handle AFI with 
large value without create large table will be useful. I don't know if 
an indirect array or a hash table could be used. But, in any case, we 
need to look carefully at values already assigned by IANA.


my 2 cents,

Olivier

Le 08/01/2016 15:07, Donald Sharp a écrit :
Just wanted to capture a discussion Paul and I had off list.  The 
afi_t change in this patch breaks assumptions about data structures in 
bgpd/bgp_open.c and the handling of capability codes.  I've fixed 
those in http://patchwork.quagga.net/patch/1748/ when I was looking at 
some zebra refactoring.  I plan to merge this patch with Paul's afi_t 
typedef and it's fix of the clang issues with my bgp_open.c changes.  
I'll send something along here shortly.


This still leaves the change of the safi_t.  Switching over to an enum 
for it doesn't work that well because bgp defines 
SAFI_MPLS_LABELED_VPN as 128.  We would need to include this in the 
enum.  The problem is that both bgp and zebra( maybe more ) create 
multidimensional arrays based upon SAFI_MAX and AFI_MAX.  This mixing 
of indices and sizes causes issues.  We need a generic methodology to 
map afi/safi to an indice to create one dimensional arrays that are 
appropriately sized. At this point that's a decent amount of work that 
would need some major testing to get right.  I'm going to hold off on 
that at the moment, unless someone wants to tackle this issue separately


donald

On Tue, Dec 15, 2015 at 11:22 AM, Paul Jakma > wrote:


On Tue, 15 Dec 2015, Donald Sharp wrote:

Martin -

As discussed in the meeting today here is an example of a
bogus issue:


https://ci1.netdef.org/artifact/QUAGGA-QMASTER/shared/build-82/static_analysis/report-8a9e85.html#EndPath

Basically the error message boils down to this code construct:

struct prefix p;
if (afi == v4)
  set p appropriately
else if (afi == v6)
  set p appropriately

if (p.prefixlen)   <--- If afi is not v4 or v6 then prefix
length is
not going to be set.

I spent a few minutes looking at clang and saw no good way to
mark the code
in plist.c as ok.


To be fair, the compiler is technically correct - the best kind of
correct. :)

It'd be nice if setting afi_t to an enum with just those 2 values
was sufficient, but it seems clang still does:

if (afi == v4)
/* take false */
if (afi == v6)
/* take false */

However, enum + a switch with just those 2 values and clang shuts
up. See below.

A more compact diff would just be:

if (!(afi == AFI_IP || afi == AFI_IP6))
  return CMD_WARNING;

at the top of that func, but the enum could help compilers.

diff --git a/lib/plist.c b/lib/plist.c
index f9e626d..6e00869 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -698,44 +698,45 @@ vty_prefix_list_install (struct vty *vty,
afi_t afi, const char *name,
 }

   /* "any" is special token for matching any IPv4 addresses.  */
-  if (afi == AFI_IP)
-{
-  if (strncmp ("any", prefix, strlen (prefix)) == 0)
-   {
- ret = str2prefix_ipv4 ("0.0.0.0/0 ",
(struct prefix_ipv4 *) &p);
- genum = 0;
- lenum = IPV4_MAX_BITLEN;
- any = 1;
-   }
-  else
-   ret = str2prefix_ipv4 (prefix, (struct prefix_ipv4 *) &p);
-
-  if (ret <= 0)
-   {
- vty_out (vty, "%% Malformed IPv4 prefix%s", VTY_NEWLINE);
- return CMD_WARNING;
-   }
-}
-#ifdef HAVE_IPV6
-  else if (afi == AFI_IP6)
+  switch (afi)
 {
-  if (strncmp ("any", prefix, strlen (prefix)) == 0)
-   {
- ret = str2prefix_ipv6 ("::/0", (struct prefix_ipv6 *) &p);
- genum = 0;
- lenum = IPV6_MAX_BITLEN;
- any = 1;
-   }
-  else
-   ret = str2prefix_ipv6 (prefix, (struct prefix_ipv6 *) &p);
-
-  if (ret <= 0)
-   {
- vty_out (vty, "%% Malformed IPv6 prefix%s", VTY_NEWLINE);
- return CMD_WARNING;
-   }
+  case AFI_IP:
+{
+  if (strncmp ("any", prefix, strlen (prefix)) == 0)
+{
+  ret = str2prefix_ipv4 ("0.0.0.0/0
", (struct prefix_ipv4 *) &p);
+  genum = 0;
+  lenum = IPV4_MAX_BITLEN;
+  any = 1;
+}
+  else
+ret = str2prefix_ipv4 (prefix, (struct prefix_ipv4 *)
&p

[quagga-dev 14479] Re: [PATCH 16/25] bgpd: general MP/SAFI improvements

2016-01-08 Thread Vivek Venkatraman
On Thu, Jan 7, 2016 at 8:39 AM, Lou Berger  wrote:

>
>
> On 1/7/2016 11:12 AM, Vivek Venkatraman wrote:
> >
> > On Thu, Jan 7, 2016 at 7:36 AM, Lou Berger  > > wrote:
> >
> >
> > ...
> > do you think default originate apply to other safi's such as
> > ENCAP, VPN,
> > EVPN and whatever comes next?  I'm leaning towards no...
> >
> >
> > I feel the same way. The default_originate command need not be
> > installed for those AFI/SAFI. But I believe they make sense for the
> > multicast AFs and others like labeled-unicast (1/4 or 2/4).
> >
> VPN = 4
>
>
I meant the real (IANA) value, that should be in the protocol packets. VPN
is 128 (1/128 or 2/128) while labeled-unicast is 4.

As mentioned in one of my other mails, we have a patch that clearly
demarcates IANA and internal values and maps between them. It is done as
part of our BGP-LU implementation, but I can see if it is useful to remove
the LU part of the code and post it.

Of course, since SAFI_ENCAP is only a small value (7), it does not
immediately matter (there are only 2 unused slots - 5 and 6 - in the
definitions).


> Lou
> >
> >
>
>
>
___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev

[quagga-dev 14477] Re: Testing Progress Update

2016-01-08 Thread Donald Sharp
Just wanted to capture a discussion Paul and I had off list.  The afi_t
change in this patch breaks assumptions about data structures in
bgpd/bgp_open.c and the handling of capability codes.  I've fixed those in
http://patchwork.quagga.net/patch/1748/ when I was looking at some zebra
refactoring.  I plan to merge this patch with Paul's afi_t typedef and it's
fix of the clang issues with my bgp_open.c changes.  I'll send something
along here shortly.

This still leaves the change of the safi_t.  Switching over to an enum for
it doesn't work that well because bgp defines SAFI_MPLS_LABELED_VPN as
128.  We would need to include this in the enum.  The problem is that both
bgp and zebra( maybe more ) create multidimensional arrays based upon
SAFI_MAX and AFI_MAX.  This mixing of indices and sizes causes issues.  We
need a generic methodology to map afi/safi to an indice to create one
dimensional arrays that are appropriately sized.  At this point that's a
decent amount of work that would need some major testing to get right.  I'm
going to hold off on that at the moment, unless someone wants to tackle
this issue separately

donald

On Tue, Dec 15, 2015 at 11:22 AM, Paul Jakma  wrote:

> On Tue, 15 Dec 2015, Donald Sharp wrote:
>
> Martin -
>>
>> As discussed in the meeting today here is an example of a bogus issue:
>>
>>
>> https://ci1.netdef.org/artifact/QUAGGA-QMASTER/shared/build-82/static_analysis/report-8a9e85.html#EndPath
>>
>> Basically the error message boils down to this code construct:
>>
>> struct prefix p;
>> if (afi == v4)
>>   set p appropriately
>> else if (afi == v6)
>>   set p appropriately
>>
>> if (p.prefixlen)   <--- If afi is not v4 or v6 then prefix length is
>> not going to be set.
>>
>> I spent a few minutes looking at clang and saw no good way to mark the
>> code
>> in plist.c as ok.
>>
>
> To be fair, the compiler is technically correct - the best kind of
> correct. :)
>
> It'd be nice if setting afi_t to an enum with just those 2 values was
> sufficient, but it seems clang still does:
>
> if (afi == v4)
> /* take false */
> if (afi == v6)
> /* take false */
>
> However, enum + a switch with just those 2 values and clang shuts up. See
> below.
>
> A more compact diff would just be:
>
> if (!(afi == AFI_IP || afi == AFI_IP6))
>   return CMD_WARNING;
>
> at the top of that func, but the enum could help compilers.
>
> diff --git a/lib/plist.c b/lib/plist.c
> index f9e626d..6e00869 100644
> --- a/lib/plist.c
> +++ b/lib/plist.c
> @@ -698,44 +698,45 @@ vty_prefix_list_install (struct vty *vty, afi_t afi,
> const char *name,
>  }
>
>/* "any" is special token for matching any IPv4 addresses.  */
> -  if (afi == AFI_IP)
> -{
> -  if (strncmp ("any", prefix, strlen (prefix)) == 0)
> -   {
> - ret = str2prefix_ipv4 ("0.0.0.0/0", (struct prefix_ipv4 *) &p);
> - genum = 0;
> - lenum = IPV4_MAX_BITLEN;
> - any = 1;
> -   }
> -  else
> -   ret = str2prefix_ipv4 (prefix, (struct prefix_ipv4 *) &p);
> -
> -  if (ret <= 0)
> -   {
> - vty_out (vty, "%% Malformed IPv4 prefix%s", VTY_NEWLINE);
> - return CMD_WARNING;
> -   }
> -}
> -#ifdef HAVE_IPV6
> -  else if (afi == AFI_IP6)
> +  switch (afi)
>  {
> -  if (strncmp ("any", prefix, strlen (prefix)) == 0)
> -   {
> - ret = str2prefix_ipv6 ("::/0", (struct prefix_ipv6 *) &p);
> - genum = 0;
> - lenum = IPV6_MAX_BITLEN;
> - any = 1;
> -   }
> -  else
> -   ret = str2prefix_ipv6 (prefix, (struct prefix_ipv6 *) &p);
> -
> -  if (ret <= 0)
> -   {
> - vty_out (vty, "%% Malformed IPv6 prefix%s", VTY_NEWLINE);
> - return CMD_WARNING;
> -   }
> +  case AFI_IP:
> +{
> +  if (strncmp ("any", prefix, strlen (prefix)) == 0)
> +{
> +  ret = str2prefix_ipv4 ("0.0.0.0/0", (struct prefix_ipv4 *)
> &p);
> +  genum = 0;
> +  lenum = IPV4_MAX_BITLEN;
> +  any = 1;
> +}
> +  else
> +ret = str2prefix_ipv4 (prefix, (struct prefix_ipv4 *) &p);
> +
> +  if (ret <= 0)
> +{
> +  vty_out (vty, "%% Malformed IPv4 prefix%s", VTY_NEWLINE);
> +  return CMD_WARNING;
> +}
> +} break;
> +  case AFI_IP6:
> +{
> +  if (strncmp ("any", prefix, strlen (prefix)) == 0)
> +{
> +  ret = str2prefix_ipv6 ("::/0", (struct prefix_ipv6 *) &p);
> +  genum = 0;
> +  lenum = IPV6_MAX_BITLEN;
> +  any = 1;
> +}
> +  else
> +ret = str2prefix_ipv6 (prefix, (struct prefix_ipv6 *) &p);
> +
> +  if (ret <= 0)
> +{
> +  vty_out (vty, "%% Malformed IPv6 prefix%s", VTY_NEWLINE);
> +  return CMD_WARNING;
> +}
> +} break;
>  }
> -#endif /* HAVE_IPV6 */
>
>/* ge and le check. */
>  

[quagga-dev 14476] CI Testresult: FAILED (Re: [quagga-dev, 14474, 3/3] lib, bgpd, tests: Refactor FILTER_X in zebra.h)

2016-01-08 Thread cisystem
Continous Integration Result: FAILED

See below for issues.
This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter .

Patches applied :
  Patchwork 1747: http://patchwork.quagga.net/patch/1747
   [quagga-dev,14472,1/3] lib, bgpd: Remove 'struct fifo' from 
lib/zebra.h
  Patchwork 1748: http://patchwork.quagga.net/patch/1748
   [quagga-dev,14473,2/3] lib, bgpd: Fixup afi_t to be an enum and cleanup 
zebra.h
  Patchwork 1749: http://patchwork.quagga.net/patch/1749
   [quagga-dev,14474,3/3] lib, bgpd, tests: Refactor FILTER_X in zebra.h
Tested on top of Git : eae18d1 (as of 20151209.135437 UTC)
CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-208/


Get source and apply patch from patchwork: Successful


Building Stage: Failed

NetBSD6 amd64 build: Successful
Openbsd58 amd64 build: Successful
NetBSD7 amd64 build: Successful
Ubuntu1404 amd64 build: Successful
FreeBSD9 amd64 build: Successful
OmniOS amd64 build: Successful
Debian8 amd64 build: Successful
FreeBSD8 amd64 build: Successful
Ubuntu1204 amd64 build: Successful
FreeBSD10 amd64 build: Successful

CentOS7 amd64 build: Unknown Log 
URL: 
https://ci1.netdef.org/browse/QUAGGA-QPWORK-208/artifact/CI005BUILD/ErrorLog/log_package_build.txt
CentOS7 amd64 build: No useful log found
CentOS6 amd64 build: Unknown Log 
URL: 
https://ci1.netdef.org/browse/QUAGGA-QPWORK-208/artifact/CI006BUILD/ErrorLog/log_package_build.txt
CentOS6 amd64 build: No useful log found

Regards,
  NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education Foundation,
For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, 
mwin...@netdef.org

___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev


[quagga-dev 14475] Re: Project update: VRF-device integration and BGP multi-instance as VRFs

2016-01-08 Thread Vincent JARDIN
Someone needs to add the freebsd jail's support. The VRF framework allows
it.
Le 8 janv. 2016 13:31, "Donald Sharp"  a écrit :

> Vincent -
>
> Vipin and I are working on breaking the patch up now to get the data
> structures in place upstream.  Hopefully in the next week or so.
>
> Sami -
>
> The code will just work if there is no kernel vrf support, ie everything
> will just be in the default vrf.  I'm not aware of any work being done in
> this regards on freebsd, but that doesn't mean anything because I'm not
> plugged into that community.  The process should be the same, though from
> Quagga's perspective
>
> donald
>
>
>
> On Fri, Jan 8, 2016 at 7:27 AM, Sami Halabi  wrote:
>
>> hi,
>> great work.
>> is this work supported in freebsd? i noticed you mentioned netlink wixh
>> is linux soecific.
>>
>> Sami
>> בתאריך 8 בינו׳ 2016 11:04 AM,‏ "Vincent JARDIN" 
>> כתב:
>>
>> It looks good. Which patch serie to check?
>>> Le 8 janv. 2016 07:09, "Vipin Kumar"  a
>>> écrit :
>>>
 Significant progress has been made on this project. I had sent a few
 emails to quagga-dev outlining the approach for this project -- to leverage
 current VRF lib and BGP multi-instance support. We had a fruitful
 discussion about that and the config model as well.

 Will be sending the changes(with explanations) to the data-structures
 like vrf, zebra_vrf and interface soon. And also some of the new
 trees/lists that were needed to keep vrf (devices) within a name-space,
 take care of forward-referencing of VRFs, and deal with challenges
 associated with address notifications via netlink, etc.

 Created a new data-structure zebra_ns, so that name-space and vrf
 device models don't just co-exist, but also work in hierarchical way to
 possibly scale the number of vrfs/instances further.

 All the configuration/show/clear is  by vrf-device name, implementation
 however internally still uses the vrf-id for efficiency reasons. vrf-device
 index generated by the kernel is used as the vrf-id.

 We will also release/submit patches with descriptions in incremental
 (logical) batches as testing/sanities progress and clears.

 For now, here are some actual outputs based on the current
 implementation of this project.

 *1. Sample Running config*

 bgp multiple-instance
 !
 !
 interface swp1 vrf boo
  link-detect
 !
 interface swp2 vrf foo
  link-detect
 !
 interface swp3 vrf zoo
  link-detect
 !
 vrf boo
 !
 vrf foo
 !
 vrf zoo
 !
 router bgp 65001 vrf boo
  neighbor 11.0.0.2 remote-as 65001
  address-family ipv4 unicast
   redistribute static
   neighbor 11.0.0.2 activate
  exit-address-family
 !
 router bgp 65001 vrf foo
  neighbor 11.0.1.2 remote-as 65001
  address-family ipv4 unicast
   redistribute static
   neighbor 11.0.1.2 activate
  exit-address-family
 !
 router bgp 65001 vrf zoo
  neighbor 11.0.2.2 remote-as 65001
  address-family ipv4 unicast
   redistribute static
   neighbor 11.0.2.2 activate
  exit-address-family
 !
 ip route 10.10.10.10/32 Null0 vrf boo
 ip route 11.11.11.11/32 Null0 vrf foo
 ip route 12.12.12.12/32 Null0 vrf zoo
 !



 *2. New config modes*

 * Global VRF*

 r1(config)#?
   ..
   vrf  Select a VRF to configure
   ..
 r1(config)# vrf
   NAME  VRF's name
 r1(config)# vrf foo
   
 r1(config)# vrf foo
 r1(config-vrf)#

 Note: This mode works just the way it is for interfaces, i.e. quagga
 can hold the config and (in future) commands within it, VRF becomes active
 (usable by protocols BGP, static, ..) only after its been created in kernel
 and learnt by quagga via netlink interface.


 * Interface VRF*


 r1(config)# interface swp2
   
   vrf   Specify the VRF
 r1(config)# interface swp2 vrf
   NAME  The VRF name
 r1(config)# interface swp2 vrf foo
   
 r1(config)# interface swp2 vrf foo
 r1(config-if)#


 * BGP VRF*

 r1(config)# router bgp 65001
   
   view  BGP view
   vrf   BGP VRF
 r1(config)# router bgp 65001 vrf
   WORD  View/VRF name
 r1(config)# router bgp 65001 vrf foo
 r1(config-router)#


Note: BGP VRF instances (struct bgp) have some state of
 their own now.Which comes  handy as and when VRF creation/deletion
 is learnt by BGP via zebra api.
  bgp_create() -> bgp_instance_up() ->
 bgp_instance_down() ->bgp_delete ()

 When BGP instance is configured as view, it will
 act in view mode just like it used to.
 Introduced instance type - view or vrf, so
 implementation can differentiat

[quagga-dev 14473] [PATCH 2/3] lib, bgpd: Fixup afi_t to be an enum and cleanup zebra.h

2016-01-08 Thread Donald Sharp
This code change does two things:

1) Removes ZEBRA_AFI_XXX #defines since they were redundant information
2) Switches afi_t to an enumerated type so that the compiler
can do a bit more compile time checking.

Signed-off-by: Donald Sharp 
---
 bgpd/bgp_open.c |   44 +++-
 bgpd/bgp_open.h |1 +
 bgpd/bgp_routemap.c |   14 ++
 lib/zebra.h |   19 ---
 4 files changed, 38 insertions(+), 40 deletions(-)

diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index b9d6e93..a4c84d2 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -126,23 +126,25 @@ bgp_afi_safi_valid_indices (afi_t afi, safi_t *safi)
 {
   switch (afi)
 {
-  case AFI_IP:
-#ifdef HAVE_IPV6
-  case AFI_IP6:
-#endif
-switch (*safi)
-  {
-/* BGP MPLS-labeled VPN SAFI isn't contigious with others, remap */
-case SAFI_MPLS_LABELED_VPN:
-  *safi = SAFI_MPLS_VPN;
-case SAFI_UNICAST:
-case SAFI_MULTICAST:
-case SAFI_MPLS_VPN:
-  return 1;
-  }
+case AFI_IP:
+case AFI_IP6:
+  switch (*safi)
+   {
+ /* BGP MPLS-labeled VPN SAFI isn't contigious with others, remap */
+   case SAFI_MPLS_LABELED_VPN:
+ *safi = SAFI_MPLS_VPN;
+   case SAFI_UNICAST:
+   case SAFI_MULTICAST:
+   case SAFI_MPLS_VPN:
+ return 1;
+   }
+  break;
+case AFI_MAX:
+  zlog_debug ("unknown afi/safi (%u/%u)", afi, *safi);
+  return 0;
+  break;
 }
-  zlog_debug ("unknown afi/safi (%u/%u)", afi, *safi);
-  
+
   return 0;
 }
 
@@ -230,7 +232,7 @@ bgp_capability_orf_entry (struct peer *peer, struct 
capability_header *hdr)
 }
   
   /* validate number field */
-  if (sizeof (struct capability_orf_entry) + (entry.num * 2) > hdr->length)
+  if (CAPABILITY_CODE_ORF_LEN + (entry.num * 2) > hdr->length)
 {
   zlog_info ("%s ORF Capability entry length error,"
  " Cap length %u, num %u",
@@ -432,14 +434,14 @@ static const int capcode_str_max = 
array_size(capcode_str);
 /* Minimum sizes for length field of each cap (so not inc. the header) */
 static const size_t cap_minsizes[] = 
 {
-  [CAPABILITY_CODE_MP] = sizeof (struct capability_mp_data),
+  [CAPABILITY_CODE_MP] = CAPABILITY_CODE_MP_LEN,
   [CAPABILITY_CODE_REFRESH]= CAPABILITY_CODE_REFRESH_LEN,
-  [CAPABILITY_CODE_ORF]= sizeof (struct capability_orf_entry),
-  [CAPABILITY_CODE_RESTART]= sizeof (struct capability_gr),
+  [CAPABILITY_CODE_ORF]= CAPABILITY_CODE_ORF_LEN,
+  [CAPABILITY_CODE_RESTART]= 6,
   [CAPABILITY_CODE_AS4]= CAPABILITY_CODE_AS4_LEN,
   [CAPABILITY_CODE_DYNAMIC]= CAPABILITY_CODE_DYNAMIC_LEN,
   [CAPABILITY_CODE_REFRESH_OLD]= CAPABILITY_CODE_REFRESH_LEN,
-  [CAPABILITY_CODE_ORF_OLD]= sizeof (struct capability_orf_entry),
+  [CAPABILITY_CODE_ORF_OLD]= CAPABILITY_CODE_ORF_LEN,
 };
 
 /**
diff --git a/bgpd/bgp_open.h b/bgpd/bgp_open.h
index 2b1382d..6233375 100644
--- a/bgpd/bgp_open.h
+++ b/bgpd/bgp_open.h
@@ -82,6 +82,7 @@ struct capability_gr
 #define CAPABILITY_CODE_DYNAMIC_LEN 0
 #define CAPABILITY_CODE_RESTART_LEN 2 /* Receiving only case */
 #define CAPABILITY_CODE_AS4_LEN 4
+#define CAPABILITY_CODE_ORF_LEN 5
 
 /* Cooperative Route Filtering Capability.  */
 
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 20bf2eb..7555ca7 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -2383,14 +2383,12 @@ bgp_route_map_update (const char *unused)
 {
   for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
{
- if (bgp->rmap[ZEBRA_FAMILY_IPV4][i].name)
-   bgp->rmap[ZEBRA_FAMILY_IPV4][i].map = 
- route_map_lookup_by_name (bgp->rmap[ZEBRA_FAMILY_IPV4][i].name);
-#ifdef HAVE_IPV6
- if (bgp->rmap[ZEBRA_FAMILY_IPV6][i].name)
-   bgp->rmap[ZEBRA_FAMILY_IPV6][i].map =
- route_map_lookup_by_name (bgp->rmap[ZEBRA_FAMILY_IPV6][i].name);
-#endif /* HAVE_IPV6 */
+ if (bgp->rmap[AFI_IP][i].name)
+   bgp->rmap[AFI_IP][i].map =
+ route_map_lookup_by_name (bgp->rmap[AFI_IP][i].name);
+ if (bgp->rmap[AFI_IP6][i].name)
+   bgp->rmap[AFI_IP6][i].map =
+ route_map_lookup_by_name (bgp->rmap[AFI_IP][i].name);
}
 }
 }
diff --git a/lib/zebra.h b/lib/zebra.h
index a283f14..c5b767d 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -445,11 +445,6 @@ extern int proto_redistnum(int afi, const char *s);
 
 extern const char *zserv_command_string (unsigned int command);
 
-/* Zebra's family types. */
-#define ZEBRA_FAMILY_IPV41
-#define ZEBRA_FAMILY_IPV62
-#define ZEBRA_FAMILY_MAX 3
-
 /* Error codes of zebra. */
 #define ZEBRA_ERR_NOERROR0
 #define ZEBRA_ERR_RTEXIST   -1
@@ -482,11 +477,6 @@ extern const char *zserv_co

[quagga-dev 14472] [PATCH 1/3] lib, bgpd: Remove 'struct fifo' from lib/zebra.h

2016-01-08 Thread Donald Sharp
The 'struct fifo' and it's accompanying #defines do not
belong in lib/zebra.h.  Move them into their own header.

Signed-off-by: Donald Sharp 
---
 bgpd/bgp_advertise.h |2 ++
 lib/fifo.h   |   62 ++
 lib/zebra.h  |   39 ---
 3 files changed, 64 insertions(+), 39 deletions(-)
 create mode 100644 lib/fifo.h

diff --git a/bgpd/bgp_advertise.h b/bgpd/bgp_advertise.h
index adbbe30..51ba626 100644
--- a/bgpd/bgp_advertise.h
+++ b/bgpd/bgp_advertise.h
@@ -21,6 +21,8 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA
 #ifndef _QUAGGA_BGP_ADVERTISE_H
 #define _QUAGGA_BGP_ADVERTISE_H
 
+#include 
+
 /* BGP advertise attribute.  */
 struct bgp_advertise_attr
 {
diff --git a/lib/fifo.h b/lib/fifo.h
new file mode 100644
index 000..6be75b7
--- /dev/null
+++ b/lib/fifo.h
@@ -0,0 +1,62 @@
+/* FIFO common header.
+   Copyright (C) 2015 Kunihiro Ishiguro
+
+This file is part of Quagga.
+
+Quagga is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+Quagga is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Zebra; see the file COPYING.  If not, write to the Free
+Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.  */
+#ifndef __LIB_FIFO_H__
+#define __LIB_FIFO_H__
+
+/* FIFO -- first in first out structure and macros.  */
+struct fifo
+{
+  struct fifo *next;
+  struct fifo *prev;
+};
+
+#define FIFO_INIT(F)  \
+  do {\
+struct fifo *Xfifo = (struct fifo *)(F);  \
+Xfifo->next = Xfifo->prev = Xfifo;\
+  } while (0)
+
+#define FIFO_ADD(F,N) \
+  do {\
+struct fifo *Xfifo = (struct fifo *)(F);  \
+struct fifo *Xnode = (struct fifo *)(N);  \
+Xnode->next = Xfifo;  \
+Xnode->prev = Xfifo->prev;\
+Xfifo->prev = Xfifo->prev->next = Xnode;  \
+  } while (0)
+
+#define FIFO_DEL(N)   \
+  do {\
+struct fifo *Xnode = (struct fifo *)(N);  \
+Xnode->prev->next = Xnode->next;  \
+Xnode->next->prev = Xnode->prev;  \
+  } while (0)
+
+#define FIFO_HEAD(F)  \
+  struct fifo *)(F))->next == (struct fifo *)(F)) \
+  ? NULL : (F)->next)
+
+#define FIFO_EMPTY(F) \
+  (((struct fifo *)(F))->next == (struct fifo *)(F))
+
+#define FIFO_TOP(F)   \
+  (FIFO_EMPTY(F) ? NULL : ((struct fifo *)(F))->next)
+
+#endif /* __LIB_FIFO_H__ */
diff --git a/lib/zebra.h b/lib/zebra.h
index a607437..a283f14 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -527,43 +527,4 @@ typedef u_int16_t zebra_command_t;
 /* VRF ID type. */
 typedef u_int16_t vrf_id_t;
 
-/* FIFO -- first in first out structure and macros.  */
-struct fifo
-{
-  struct fifo *next;
-  struct fifo *prev;
-};
-
-#define FIFO_INIT(F)  \
-  do {\
-struct fifo *Xfifo = (struct fifo *)(F);  \
-Xfifo->next = Xfifo->prev = Xfifo;\
-  } while (0)
-
-#define FIFO_ADD(F,N) \
-  do {\
-struct fifo *Xfifo = (struct fifo *)(F);  \
-struct fifo *Xnode = (struct fifo *)(N);  \
-Xnode->next = Xfifo;  \
-Xnode->prev = Xfifo->prev;\
-Xfifo->prev = Xfifo->prev->next = Xnode;  \
-  } while (0)
-
-#define FIFO_DEL(N)   \
-  do {\
-struct fifo *Xnode = (struct fifo *)(N);  \
-Xnode->prev->next = Xnode->next;  \
-Xnode->next->prev = Xnode->prev;  \
-  } while (0)
-
-#define FIFO_HEAD(F)  \
-  struct fifo *)(F))->next == (struct fifo *)(F)) \
-  ? NULL : (F)->next)
-
-#define FIFO_EMPTY(F) \
-  (((struct fifo *)(F))->next == (struct fifo *)(F))
-
-#define FIFO_TOP(F)   \
-  (FIFO_EMPTY(F) ? NULL : ((struct fifo *)(F))->next)
-
 #endif /* _ZEBRA_H */
-- 
1.7.10.4


___
Quagga-dev mailing list
Qua

[quagga-dev 14474] [PATCH 3/3] lib, bgpd, tests: Refactor FILTER_X in zebra.h

2016-01-08 Thread Donald Sharp
lib/zebra.h has FILTER_X #define's.  These do not belong there.
Put them in lib/filter.h where they belong.

Signed-off-by: Donald Sharp 
---
 bgpd/bgp_advertise.c|1 +
 bgpd/bgp_aspath.c   |1 +
 bgpd/bgp_attr.c |1 +
 bgpd/bgp_btoa.c |1 +
 bgpd/bgp_clist.c|1 +
 bgpd/bgp_damp.c |1 +
 bgpd/bgp_debug.c|1 +
 bgpd/bgp_dump.c |3 ++-
 bgpd/bgp_ecommunity.c   |1 +
 bgpd/bgp_filter.c   |9 ++---
 bgpd/bgp_fsm.c  |1 +
 bgpd/bgp_mpath.c|1 +
 bgpd/bgp_mplsvpn.c  |1 +
 bgpd/bgp_network.c  |1 +
 bgpd/bgp_nexthop.c  |1 +
 bgpd/bgp_open.c |1 +
 bgpd/bgp_packet.c   |1 +
 bgpd/bgp_regex.c|1 +
 bgpd/bgp_table.c|1 +
 bgpd/bgp_vty.c  |1 +
 bgpd/bgp_zebra.c|1 +
 lib/filter.h|5 +
 lib/zebra.h |5 -
 tests/aspath_test.c |1 +
 tests/bgp_capability_test.c |1 +
 tests/bgp_mp_attr_test.c|1 +
 tests/bgp_mpath_test.c  |1 +
 tests/ecommunity_test.c |1 +
 28 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c
index be9b480..ecf531f 100644
--- a/bgpd/bgp_advertise.c
+++ b/bgpd/bgp_advertise.c
@@ -25,6 +25,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA
 #include "prefix.h"
 #include "hash.h"
 #include "thread.h"
+#include "filter.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_table.h"
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index 9d49f34..6ab2937 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -29,6 +29,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA
 #include "log.h"
 #include "stream.h"
 #include "jhash.h"
+#include "filter.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_aspath.h"
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index ef19bc4..ce8f8a0 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -29,6 +29,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA
 #include "log.h"
 #include "hash.h"
 #include "jhash.h"
+#include "filter.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_attr.h"
diff --git a/bgpd/bgp_btoa.c b/bgpd/bgp_btoa.c
index b9ff67c..284b280 100644
--- a/bgpd/bgp_btoa.c
+++ b/bgpd/bgp_btoa.c
@@ -27,6 +27,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA
 #include "command.h"
 #include "memory.h"
 #include "privs.h"
+#include "filter.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_dump.h"
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c
index db2cfa4..bb06028 100644
--- a/bgpd/bgp_clist.c
+++ b/bgpd/bgp_clist.c
@@ -23,6 +23,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA
 #include "command.h"
 #include "prefix.h"
 #include "memory.h"
+#include "filter.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_community.h"
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
index 359fce3..ac64723 100644
--- a/bgpd/bgp_damp.c
+++ b/bgpd/bgp_damp.c
@@ -26,6 +26,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA
 #include "command.h"
 #include "log.h"
 #include "thread.h"
+#include "filter.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_damp.h"
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 1d09769..e3e5ca4 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -28,6 +28,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA
 #include "str.h"
 #include "log.h"
 #include "sockunion.h"
+#include "filter.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_aspath.h"
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c
index 227fc7a..1fa0e65 100644
--- a/bgpd/bgp_dump.c
+++ b/bgpd/bgp_dump.c
@@ -27,8 +27,9 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA
 #include "prefix.h"
 #include "thread.h"
 #include "linklist.h"
-#include "bgpd/bgp_table.h"
+#include "filter.h"
 
+#include "bgpd/bgp_table.h"
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_route.h"
 #include "bgpd/bgp_attr.h"
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c
index 04957d4..c76f01e 100644
--- a/bgpd/bgp_ecommunity.c
+++ b/bgpd/bgp_ecommunity.c
@@ -24,6 +24,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA
 #include "memory.h"
 #include "prefix.h"
 #include "command.h"
+#include "filter.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_ecommunity.h"
diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c
index fd8ece6..26819fc 100644
--- a/bgpd/bgp_filter.c
+++ b/bgpd/bgp_filter.c
@@ -24,6 +24,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA
 #include "log.h"
 #include "memory.h"
 #include "buffer.h"
+#include "filter.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_aspath.h"
@@ -65,18 +66,12 @@ struct as_filter
   char *reg_str;
 };
 
-enum as_list_type
-{
-  ACCESS_TYPE_STRING,
-  ACCES

[quagga-dev 14471] [PATCH v2 0/3] Refactor some lib/zebra.h code

2016-01-08 Thread Donald Sharp
lib/zebra.h has a hodge-podge of different api's in it.
Start the refactoring.

Donald Sharp (3):
  lib, bgpd: Remove 'struct fifo' from lib/zebra.h
  lib, bgpd: Fixup afi_t to be an enum and cleanup zebra.h
  lib, bgpd, tests: Refactor FILTER_X in zebra.h

 bgpd/bgp_advertise.c|1 +
 bgpd/bgp_advertise.h|2 ++
 bgpd/bgp_aspath.c   |1 +
 bgpd/bgp_attr.c |1 +
 bgpd/bgp_btoa.c |1 +
 bgpd/bgp_clist.c|1 +
 bgpd/bgp_damp.c |1 +
 bgpd/bgp_debug.c|1 +
 bgpd/bgp_dump.c |3 ++-
 bgpd/bgp_ecommunity.c   |1 +
 bgpd/bgp_filter.c   |9 ++-
 bgpd/bgp_fsm.c  |1 +
 bgpd/bgp_mpath.c|1 +
 bgpd/bgp_mplsvpn.c  |1 +
 bgpd/bgp_network.c  |1 +
 bgpd/bgp_nexthop.c  |1 +
 bgpd/bgp_open.c |   45 ---
 bgpd/bgp_open.h |1 +
 bgpd/bgp_packet.c   |1 +
 bgpd/bgp_regex.c|1 +
 bgpd/bgp_routemap.c |   14 +-
 bgpd/bgp_table.c|1 +
 bgpd/bgp_vty.c  |1 +
 bgpd/bgp_zebra.c|1 +
 lib/fifo.h  |   62 ++
 lib/filter.h|5 
 lib/zebra.h |   63 ++-
 tests/aspath_test.c |1 +
 tests/bgp_capability_test.c |1 +
 tests/bgp_mp_attr_test.c|1 +
 tests/bgp_mpath_test.c  |1 +
 tests/ecommunity_test.c |1 +
 32 files changed, 135 insertions(+), 92 deletions(-)
 create mode 100644 lib/fifo.h

-- 
1.7.10.4


___
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev


[quagga-dev 14470] Re: Project update: VRF-device integration and BGP multi-instance as VRFs

2016-01-08 Thread Donald Sharp
Vincent -

Vipin and I are working on breaking the patch up now to get the data
structures in place upstream.  Hopefully in the next week or so.

Sami -

The code will just work if there is no kernel vrf support, ie everything
will just be in the default vrf.  I'm not aware of any work being done in
this regards on freebsd, but that doesn't mean anything because I'm not
plugged into that community.  The process should be the same, though from
Quagga's perspective

donald



On Fri, Jan 8, 2016 at 7:27 AM, Sami Halabi  wrote:

> hi,
> great work.
> is this work supported in freebsd? i noticed you mentioned netlink wixh is
> linux soecific.
>
> Sami
> בתאריך 8 בינו׳ 2016 11:04 AM,‏ "Vincent JARDIN" 
> כתב:
>
> It looks good. Which patch serie to check?
>> Le 8 janv. 2016 07:09, "Vipin Kumar"  a
>> écrit :
>>
>>> Significant progress has been made on this project. I had sent a few
>>> emails to quagga-dev outlining the approach for this project -- to leverage
>>> current VRF lib and BGP multi-instance support. We had a fruitful
>>> discussion about that and the config model as well.
>>>
>>> Will be sending the changes(with explanations) to the data-structures
>>> like vrf, zebra_vrf and interface soon. And also some of the new
>>> trees/lists that were needed to keep vrf (devices) within a name-space,
>>> take care of forward-referencing of VRFs, and deal with challenges
>>> associated with address notifications via netlink, etc.
>>>
>>> Created a new data-structure zebra_ns, so that name-space and vrf device
>>> models don't just co-exist, but also work in hierarchical way to possibly
>>> scale the number of vrfs/instances further.
>>>
>>> All the configuration/show/clear is  by vrf-device name, implementation
>>> however internally still uses the vrf-id for efficiency reasons. vrf-device
>>> index generated by the kernel is used as the vrf-id.
>>>
>>> We will also release/submit patches with descriptions in incremental
>>> (logical) batches as testing/sanities progress and clears.
>>>
>>> For now, here are some actual outputs based on the current
>>> implementation of this project.
>>>
>>> *1. Sample Running config*
>>>
>>> bgp multiple-instance
>>> !
>>> !
>>> interface swp1 vrf boo
>>>  link-detect
>>> !
>>> interface swp2 vrf foo
>>>  link-detect
>>> !
>>> interface swp3 vrf zoo
>>>  link-detect
>>> !
>>> vrf boo
>>> !
>>> vrf foo
>>> !
>>> vrf zoo
>>> !
>>> router bgp 65001 vrf boo
>>>  neighbor 11.0.0.2 remote-as 65001
>>>  address-family ipv4 unicast
>>>   redistribute static
>>>   neighbor 11.0.0.2 activate
>>>  exit-address-family
>>> !
>>> router bgp 65001 vrf foo
>>>  neighbor 11.0.1.2 remote-as 65001
>>>  address-family ipv4 unicast
>>>   redistribute static
>>>   neighbor 11.0.1.2 activate
>>>  exit-address-family
>>> !
>>> router bgp 65001 vrf zoo
>>>  neighbor 11.0.2.2 remote-as 65001
>>>  address-family ipv4 unicast
>>>   redistribute static
>>>   neighbor 11.0.2.2 activate
>>>  exit-address-family
>>> !
>>> ip route 10.10.10.10/32 Null0 vrf boo
>>> ip route 11.11.11.11/32 Null0 vrf foo
>>> ip route 12.12.12.12/32 Null0 vrf zoo
>>> !
>>>
>>>
>>>
>>> *2. New config modes*
>>>
>>> * Global VRF*
>>>
>>> r1(config)#?
>>>   ..
>>>   vrf  Select a VRF to configure
>>>   ..
>>> r1(config)# vrf
>>>   NAME  VRF's name
>>> r1(config)# vrf foo
>>>   
>>> r1(config)# vrf foo
>>> r1(config-vrf)#
>>>
>>> Note: This mode works just the way it is for interfaces, i.e. quagga can
>>> hold the config and (in future) commands within it, VRF becomes active
>>> (usable by protocols BGP, static, ..) only after its been created in kernel
>>> and learnt by quagga via netlink interface.
>>>
>>>
>>> * Interface VRF*
>>>
>>>
>>> r1(config)# interface swp2
>>>   
>>>   vrf   Specify the VRF
>>> r1(config)# interface swp2 vrf
>>>   NAME  The VRF name
>>> r1(config)# interface swp2 vrf foo
>>>   
>>> r1(config)# interface swp2 vrf foo
>>> r1(config-if)#
>>>
>>>
>>> * BGP VRF*
>>>
>>> r1(config)# router bgp 65001
>>>   
>>>   view  BGP view
>>>   vrf   BGP VRF
>>> r1(config)# router bgp 65001 vrf
>>>   WORD  View/VRF name
>>> r1(config)# router bgp 65001 vrf foo
>>> r1(config-router)#
>>>
>>>
>>>Note: BGP VRF instances (struct bgp) have some state of their
>>> own now.Which comes  handy as and when VRF creation/deletion is
>>> learnt by BGP via zebra api.
>>>  bgp_create() -> bgp_instance_up() ->
>>> bgp_instance_down() ->bgp_delete ()
>>>
>>> When BGP instance is configured as view, it will act
>>> in view mode just like it used to.
>>> Introduced instance type - view or vrf, so
>>> implementation can differentiate as needed.
>>>
>>> *3. Sample (of a few) show commands*
>>>
>>> *r1# show vrf*
>>> vrf boo id 7 table 10
>>> vrf foo id 8 table 11
>>> vrf zoo id 9 table 12
>>> r1#
>>>
>>> *r1# show interface vrf foo*
>>> Interface swp2 is up, line protocol is up
>>>   PTM status: disabled
>>>   vrf: 8
>>>   Descr

[quagga-dev 14469] Re: Project update: VRF-device integration and BGP multi-instance as VRFs

2016-01-08 Thread Sami Halabi
hi,
great work.
is this work supported in freebsd? i noticed you mentioned netlink wixh is
linux soecific.

Sami
בתאריך 8 בינו׳ 2016 11:04 AM,‏ "Vincent JARDIN" 
כתב:

> It looks good. Which patch serie to check?
> Le 8 janv. 2016 07:09, "Vipin Kumar"  a écrit :
>
>> Significant progress has been made on this project. I had sent a few
>> emails to quagga-dev outlining the approach for this project -- to leverage
>> current VRF lib and BGP multi-instance support. We had a fruitful
>> discussion about that and the config model as well.
>>
>> Will be sending the changes(with explanations) to the data-structures
>> like vrf, zebra_vrf and interface soon. And also some of the new
>> trees/lists that were needed to keep vrf (devices) within a name-space,
>> take care of forward-referencing of VRFs, and deal with challenges
>> associated with address notifications via netlink, etc.
>>
>> Created a new data-structure zebra_ns, so that name-space and vrf device
>> models don't just co-exist, but also work in hierarchical way to possibly
>> scale the number of vrfs/instances further.
>>
>> All the configuration/show/clear is  by vrf-device name, implementation
>> however internally still uses the vrf-id for efficiency reasons. vrf-device
>> index generated by the kernel is used as the vrf-id.
>>
>> We will also release/submit patches with descriptions in incremental
>> (logical) batches as testing/sanities progress and clears.
>>
>> For now, here are some actual outputs based on the current implementation
>> of this project.
>>
>> *1. Sample Running config*
>>
>> bgp multiple-instance
>> !
>> !
>> interface swp1 vrf boo
>>  link-detect
>> !
>> interface swp2 vrf foo
>>  link-detect
>> !
>> interface swp3 vrf zoo
>>  link-detect
>> !
>> vrf boo
>> !
>> vrf foo
>> !
>> vrf zoo
>> !
>> router bgp 65001 vrf boo
>>  neighbor 11.0.0.2 remote-as 65001
>>  address-family ipv4 unicast
>>   redistribute static
>>   neighbor 11.0.0.2 activate
>>  exit-address-family
>> !
>> router bgp 65001 vrf foo
>>  neighbor 11.0.1.2 remote-as 65001
>>  address-family ipv4 unicast
>>   redistribute static
>>   neighbor 11.0.1.2 activate
>>  exit-address-family
>> !
>> router bgp 65001 vrf zoo
>>  neighbor 11.0.2.2 remote-as 65001
>>  address-family ipv4 unicast
>>   redistribute static
>>   neighbor 11.0.2.2 activate
>>  exit-address-family
>> !
>> ip route 10.10.10.10/32 Null0 vrf boo
>> ip route 11.11.11.11/32 Null0 vrf foo
>> ip route 12.12.12.12/32 Null0 vrf zoo
>> !
>>
>>
>>
>> *2. New config modes*
>>
>> * Global VRF*
>>
>> r1(config)#?
>>   ..
>>   vrf  Select a VRF to configure
>>   ..
>> r1(config)# vrf
>>   NAME  VRF's name
>> r1(config)# vrf foo
>>   
>> r1(config)# vrf foo
>> r1(config-vrf)#
>>
>> Note: This mode works just the way it is for interfaces, i.e. quagga can
>> hold the config and (in future) commands within it, VRF becomes active
>> (usable by protocols BGP, static, ..) only after its been created in kernel
>> and learnt by quagga via netlink interface.
>>
>>
>> * Interface VRF*
>>
>>
>> r1(config)# interface swp2
>>   
>>   vrf   Specify the VRF
>> r1(config)# interface swp2 vrf
>>   NAME  The VRF name
>> r1(config)# interface swp2 vrf foo
>>   
>> r1(config)# interface swp2 vrf foo
>> r1(config-if)#
>>
>>
>> * BGP VRF*
>>
>> r1(config)# router bgp 65001
>>   
>>   view  BGP view
>>   vrf   BGP VRF
>> r1(config)# router bgp 65001 vrf
>>   WORD  View/VRF name
>> r1(config)# router bgp 65001 vrf foo
>> r1(config-router)#
>>
>>
>>Note: BGP VRF instances (struct bgp) have some state of their
>> own now.Which comes  handy as and when VRF creation/deletion is
>> learnt by BGP via zebra api.
>>  bgp_create() -> bgp_instance_up() ->
>> bgp_instance_down() ->bgp_delete ()
>>
>> When BGP instance is configured as view, it will act
>> in view mode just like it used to.
>> Introduced instance type - view or vrf, so
>> implementation can differentiate as needed.
>>
>> *3. Sample (of a few) show commands*
>>
>> *r1# show vrf*
>> vrf boo id 7 table 10
>> vrf foo id 8 table 11
>> vrf zoo id 9 table 12
>> r1#
>>
>> *r1# show interface vrf foo*
>> Interface swp2 is up, line protocol is up
>>   PTM status: disabled
>>   vrf: 8
>>   Description: r3
>>   index 4 metric 0 mtu 1500
>>   flags: 
>>   HWaddr: 00:02:00:00:00:0a
>>   inet 11.0.1.1/24
>>   inet6 fe80::202:ff:fe00:a/64
>>   ND advertised reachable time is 0 milliseconds
>>   ND advertised retransmit interval is 0 milliseconds
>>   ND router advertisements are sent every 600 seconds
>>   ND router advertisements lifetime tracks ra-interval
>>   ND router advertisement default router preference is medium
>>   Hosts use stateless autoconfig for addresses.
>>
>>
>> *r1# show  ip bgp vrf foo summary*
>> BGP router identifier 11.0.1.1, local AS number 65001 vrf-id 8
>> BGP table version 5
>> RIB entries 9, using 1080 bytes of memory
>> Peers 1, using 16 KiB of memory
>>

[quagga-dev 14468] Re: Project update: VRF-device integration and BGP multi-instance as VRFs

2016-01-08 Thread Vincent JARDIN
It looks good. Which patch serie to check?
Le 8 janv. 2016 07:09, "Vipin Kumar"  a écrit :

> Significant progress has been made on this project. I had sent a few
> emails to quagga-dev outlining the approach for this project -- to leverage
> current VRF lib and BGP multi-instance support. We had a fruitful
> discussion about that and the config model as well.
>
> Will be sending the changes(with explanations) to the data-structures like
> vrf, zebra_vrf and interface soon. And also some of the new trees/lists
> that were needed to keep vrf (devices) within a name-space, take care of
> forward-referencing of VRFs, and deal with challenges associated with
> address notifications via netlink, etc.
>
> Created a new data-structure zebra_ns, so that name-space and vrf device
> models don't just co-exist, but also work in hierarchical way to possibly
> scale the number of vrfs/instances further.
>
> All the configuration/show/clear is  by vrf-device name, implementation
> however internally still uses the vrf-id for efficiency reasons. vrf-device
> index generated by the kernel is used as the vrf-id.
>
> We will also release/submit patches with descriptions in incremental
> (logical) batches as testing/sanities progress and clears.
>
> For now, here are some actual outputs based on the current implementation
> of this project.
>
> *1. Sample Running config*
>
> bgp multiple-instance
> !
> !
> interface swp1 vrf boo
>  link-detect
> !
> interface swp2 vrf foo
>  link-detect
> !
> interface swp3 vrf zoo
>  link-detect
> !
> vrf boo
> !
> vrf foo
> !
> vrf zoo
> !
> router bgp 65001 vrf boo
>  neighbor 11.0.0.2 remote-as 65001
>  address-family ipv4 unicast
>   redistribute static
>   neighbor 11.0.0.2 activate
>  exit-address-family
> !
> router bgp 65001 vrf foo
>  neighbor 11.0.1.2 remote-as 65001
>  address-family ipv4 unicast
>   redistribute static
>   neighbor 11.0.1.2 activate
>  exit-address-family
> !
> router bgp 65001 vrf zoo
>  neighbor 11.0.2.2 remote-as 65001
>  address-family ipv4 unicast
>   redistribute static
>   neighbor 11.0.2.2 activate
>  exit-address-family
> !
> ip route 10.10.10.10/32 Null0 vrf boo
> ip route 11.11.11.11/32 Null0 vrf foo
> ip route 12.12.12.12/32 Null0 vrf zoo
> !
>
>
>
> *2. New config modes*
>
> * Global VRF*
>
> r1(config)#?
>   ..
>   vrf  Select a VRF to configure
>   ..
> r1(config)# vrf
>   NAME  VRF's name
> r1(config)# vrf foo
>   
> r1(config)# vrf foo
> r1(config-vrf)#
>
> Note: This mode works just the way it is for interfaces, i.e. quagga can
> hold the config and (in future) commands within it, VRF becomes active
> (usable by protocols BGP, static, ..) only after its been created in kernel
> and learnt by quagga via netlink interface.
>
>
> * Interface VRF*
>
>
> r1(config)# interface swp2
>   
>   vrf   Specify the VRF
> r1(config)# interface swp2 vrf
>   NAME  The VRF name
> r1(config)# interface swp2 vrf foo
>   
> r1(config)# interface swp2 vrf foo
> r1(config-if)#
>
>
> * BGP VRF*
>
> r1(config)# router bgp 65001
>   
>   view  BGP view
>   vrf   BGP VRF
> r1(config)# router bgp 65001 vrf
>   WORD  View/VRF name
> r1(config)# router bgp 65001 vrf foo
> r1(config-router)#
>
>
>Note: BGP VRF instances (struct bgp) have some state of their
> own now.Which comes  handy as and when VRF creation/deletion is
> learnt by BGP via zebra api.
>  bgp_create() -> bgp_instance_up() ->
> bgp_instance_down() ->bgp_delete ()
>
> When BGP instance is configured as view, it will act
> in view mode just like it used to.
> Introduced instance type - view or vrf, so
> implementation can differentiate as needed.
>
> *3. Sample (of a few) show commands*
>
> *r1# show vrf*
> vrf boo id 7 table 10
> vrf foo id 8 table 11
> vrf zoo id 9 table 12
> r1#
>
> *r1# show interface vrf foo*
> Interface swp2 is up, line protocol is up
>   PTM status: disabled
>   vrf: 8
>   Description: r3
>   index 4 metric 0 mtu 1500
>   flags: 
>   HWaddr: 00:02:00:00:00:0a
>   inet 11.0.1.1/24
>   inet6 fe80::202:ff:fe00:a/64
>   ND advertised reachable time is 0 milliseconds
>   ND advertised retransmit interval is 0 milliseconds
>   ND router advertisements are sent every 600 seconds
>   ND router advertisements lifetime tracks ra-interval
>   ND router advertisement default router preference is medium
>   Hosts use stateless autoconfig for addresses.
>
>
> *r1# show  ip bgp vrf foo summary*
> BGP router identifier 11.0.1.1, local AS number 65001 vrf-id 8
> BGP table version 5
> RIB entries 9, using 1080 bytes of memory
> Peers 1, using 16 KiB of memory
>
> NeighborVAS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down
>  State/PfxRcd
> r3(11.0.1.2)4 65001 134 135000 00:06:37
>  4
>
> Total number of neighbors 1
> r1#
>
> *r1# show ip bgp vrf foo*
> BGP table version is 5, local router ID is 11.0.1.1
> Status codes: s suppressed, d damped, h history, *