ospfd: add some debug messages for router lsa-generation

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
ospfd: run DR election prior to LSA regeneration

The results from DR election are used when constructing router-LSAs.
E.g. they are used to determine whether a broadcast interface should
be added with a link type of stub interface or transit interface.

Therefore, we should run DR election prior before regenerating LSAs.

Before commit c363d3861b5384a31465a72ddc3b0f6ff007a95a the DR election
was called synchronously prior to router-LSA regeneration which was run
asynchronously.

This fixes bug #761 on the Quagga bugzilla.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
ospfd: don't allow to set network type on loopback interfaces

OSPFd only allocates some stub information for loopback interfaces.
This causes a crash when the interface state machine is started on
that interface by configuring a different network type.

It doesn't make much sense to configure the network type of a loopback
interface, therefore, just forbid it.

See also bugzilla #670.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
bgpd,ospfd,zebra: fix some DEFUN definitions

Fixup some DEFUNS with incorrect command strings or mixed up helpstrings.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
tests: add a test program for lib/command.c

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
lib/command.c: rewrite command matching/parsing

Add support for keyword commands.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
ospfd/ospf_vty.c: use keyword cmd style

Use the new keyword command style for:

  - default-information originate
  - distance ospf
  - redistribute

Signed-off-by: Christian Franke <chris@opensourcerouting.org>