Commit Graph

414 Commits

Author SHA1 Message Date
Donald Sharp
d476347d5d Merge remote-tracking branch 'origin/stable/3.0' 2017-05-04 13:35:25 -04:00
Renato Westphal
6cf3661ddf ospfd: fix small problem in the redistribute command
The use of {<>} is unnecessary and not correct.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-05-03 10:08:03 -03:00
Donald Sharp
05ba625af7 Merge remote-tracking branch 'origin/stable/3.0' 2017-05-02 15:52:09 -04:00
Donald Sharp
df581cd3e1 Merge remote-tracking branch 'origin/stable/2.0' 2017-05-02 15:11:46 -04:00
Donald Sharp
f4d78586df ospfd: Fix a variant of the ospf redistribute command
Fix 'redistribute (ospf|table) ....' command

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-02 13:56:41 -04:00
Hung-Weic Chiu
c604467a08 Fix the "Uninitialized argument value" of clang SA.
Signed-off-by: Hung-Weic Chiu <sppsorrg@gmail.com>
2017-04-29 15:35:32 +00:00
Hung-Weic Chiu
3a6570a1f1 Fix the "Dead assignment" of clang SA.
- Remove duplicated assignemt.
- Remove unused initialized.

Signed-off-by: Hung-Weic Chiu <sppsorrg@gmail.com>
2017-04-29 15:25:32 +00:00
Donald Sharp
6be4da3dfa ospfd: Fix the 'show ip ospf int ...' command
Fixed output:

robot.cumulusnetworks.com# show ip ospf int
enp0s3 is up
  ifindex 2, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  Internet Address 10.0.2.15/24, Broadcast 10.0.2.255, Area 0.0.0.0
  MTU mismatch detection:enabled
  Router ID 192.168.0.1, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State Waiting, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 9.611s
  Neighbor Count is 0, Adjacent neighbor count is 0
enp0s10 is up
  ifindex 7, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  Internet Address 192.168.201.146/24, Broadcast 192.168.201.255, Area 0.0.0.0
  MTU mismatch detection:enabled
  Router ID 192.168.0.1, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State Waiting, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 7.241s
  Neighbor Count is 0, Adjacent neighbor count is 0

robot.cumulusnetworks.com# show ip ospf int enp0s3
enp0s3 is up
  ifindex 2, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
  Internet Address 10.0.2.15/24, Broadcast 10.0.2.255, Area 0.0.0.0
  MTU mismatch detection:enabled
  Router ID 192.168.0.1, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State Waiting, Priority 1
  No backup designated router on this network
  Multicast group memberships: OSPFAllRouters
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in 2.915s
  Neighbor Count is 0, Adjacent neighbor count is 0

robot.cumulusnetworks.com# show ip ospf int enp0s10 json
{
  "enp0s10":{
    "ifUp":true,
    "ifIndex":7,
    "mtuBytes":1500,
    "bandwidthMbit":0,
    "ifFlags":"<UP,BROADCAST,RUNNING,MULTICAST>",
    "ospfEnabled":true,
    "ipAddress":"192.168.201.146",
    "ipAddressPrefixlen":24,
    "ospfIfType":"Broadcast",
    "localIfUsed":"192.168.201.255",
    "area":"0.0.0.0",
    "routerId":"192.168.0.1",
    "networkType":"BROADCAST",
    "cost":10,
    "transmitDelayMsecs":1000,
    "state":"Waiting",
    "priority":1,
    "mcastMemberOspfAllRouters":true,
    "timerMsecs":100,
    "timerDeadMsecs":25,
    "timerWaitMsecs":25,
    "timerRetransmit":200,
    "timerHelloInMsecs":2106,
    "nbrCount":0,
    "nbrAdjacentCount":0
  }
}
robot.cumulusnetworks.com#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-08 08:47:59 -04:00
David Lamparter
ffc37fa151 Merge pull request #330 from dwalton76/ospf-no-log-adjacency-changes-detail
ospfd: "no log-adjacency-changes detail" disables log-adjacency-changes
2017-04-04 21:45:14 +02:00
Daniel Walton
7994b01d26 ospfd: "no log-adjacency-changes detail" disables log-adjacency-changes
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-04 18:13:43 +00:00
David Lamparter
3e7c8d040c Merge branch 'stable/2.0'
Fixed minor conflicts from "defaults" change on stable.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-04-04 19:01:47 +02:00
Quentin Young
eaa1ae0db4 ospfd, ospf6d: fix distance commands
OSPF distance commands were broken in a variety of ways. Fix 'em.

* `distance ospf` and `distance ospf6` were accepted commands
* Inconsistent doc strings
* Make use of {keyword|tokens}
* Add ability to reset specific distance without specifying a value
  Ex: ~# no distance ospf6 intra

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-04-03 20:17:12 +00:00
David Lamparter
505e50567f *: apply DEFUN_NOSH for node-switch CLI commands
These have copies in vtysh that do the node-switch locally and are
listed in extract.pl's ignore list.  The ignore list however is
redundant since DEFUN_NOSH does the same thing...

ldpd is a bit hacky, but Renato is reworking this anyway.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-28 15:48:07 -04:00
David Lamparter
8efe88eacf *: track version & "defaults" in configs
[CF]: Move default name to autoconf and update tests

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-03-28 19:18:42 +02:00
Donald Sharp
baaea325e6 *: Refactor ifindex2ifname to be VRF aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-15 10:43:21 -04:00
Donald Sharp
92a57eb206 *: Refactor if_get_by_name to be VRF aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-15 10:36:38 -04:00
Donald Sharp
1306c09a1b *: Refactor if_lookup_by_name to be VRF aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-15 10:36:23 -04:00
Donald Sharp
7e2b760345 *: Remove non-vrf based ifindex lookup
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-15 10:26:53 -04:00
David Lamparter
4525281af1 *: get rid of zlog(*, LOG_LEVEL, ...)
Result of running the following Coccinelle patch + fixups:
<<EOF
/* long-forms: zlog(NULL, <level>, ...)
 *    =>       zlog_level(...)
 */

@@
expression list args;
@@
- zlog(NULL, LOG_DEBUG, args)
+ zlog_debug(args)

@@
expression list args;
@@
- zlog(NULL, LOG_NOTICE, args)
+ zlog_notice(args)

@@
expression list args;
@@
- zlog(NULL, LOG_INFO, args)
+ zlog_info(args)

@@
expression list args;
@@
- zlog(NULL, LOG_WARNING, args)
+ zlog_warn(args)

@@
expression list args;
@@
- zlog(NULL, LOG_ERR, args)
+ zlog_err(args)

/* long-forms: zlog(base->log, <level>, ...)
 *    =>       zlog_level(...)
 */

@@
expression base;
expression list args;
@@
- zlog(base->log, LOG_DEBUG, args)
+ zlog_debug(args)

@@
expression base;
expression list args;
@@
- zlog(base->log, LOG_NOTICE, args)
+ zlog_notice(args)

@@
expression base;
expression list args;
@@
- zlog(base->log, LOG_INFO, args)
+ zlog_info(args)

@@
expression base;
expression list args;
@@
- zlog(base->log, LOG_WARNING, args)
+ zlog_warn(args)

@@
expression base;
expression list args;
@@
- zlog(base->log, LOG_ERR, args)
+ zlog_err(args)

EOF

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08 00:15:39 +01:00
Donald Sharp
40d1cbfbb3 *: Fix redistribute issue
Somewhere in the past we switched from
using the auto-generated redistribute statements
to a non-generated version.  This caused us to
loose new protocols to redistribute as they are
added.  Put it back.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-27 15:52:12 -05:00
David Lamparter
cbf3e3eb3a ospfd: time: replace local helpers with monotime
This ditches tv_add, tv_sub, tv_cmp, etc. in favour of
monotime{,_since,_until}() which actually makes the code much more
readable in some locations.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-23 18:26:28 +01:00
Donald Sharp
efd64b137a Merge remote-tracking branch 'frr/master' into cli_cleanup 2017-01-15 18:56:01 -05:00
Donald Sharp
effe821e25 ospfd: Fix some more virtual-link crashes
This commit fixes 2 virtual link cli crashes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-15 18:45:09 -05:00
David Lamparter
b6f1faf045 Merge branch 'stable/2.0-for-merge'
Conflicts (CLI vs. atol()):
- bgpd/bgp_vty.c
- ospfd/ospf_vty.c
- zebra/zebra_vty.c

NB: pull req #65 (LabNConsulting/working/2.0/afi-safi-vty/c) was
excluded from this merge.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-13 15:24:25 +01:00
Quentin Young
b84aadae44 Merge branch 'master' into fix-proto_redistnum 2017-01-06 19:44:46 -05:00
Donald Sharp
3b14d86eed Merge remote-tracking branch 'origin/stable/2.0' 2017-01-06 09:58:21 -05:00
Donald Sharp
36da066554 ospfd: Stop attempt to read beyond end of argv
When unconfiguring certain commands in ospf, you can
run into situations where we attempt to read beyond
the end of a argv[] vector created.  On certain platforms
this will crash it.

Ticket: CM-14090
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-05 19:39:56 -05:00
David Lamparter
ab0181eed3 build: rename (2 of ?): route_types macros
All of the autogenerated macros in lib/route_types.pl are now called
FRR_* instead of QUAGGA_*.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-20 18:34:29 +01:00
Quentin Young
6d681bd874 all: use ->text when parsing protocol argument
and match on full protocol name in proto_redistnum()

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-16 05:39:44 +00:00
David Lamparter
5304ba7e56 *: kill useless if(...) after VTY_DECLVAR_CONTEXT
VTY_DECLVAR_CONTEXT already contains a NULL check, vty warning message
and return statement.  These are not needed.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-09 17:50:01 +01:00
David Lamparter
52c6b0e20a *: fix remaining vty->index & add coccinelle patch
Fix instances that the coccinelle patch didn't catch (or which
coccinelle couldn't parse), and add the patch file for future posterity
(and application to yet-unmerged branches).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-09 17:36:25 +01:00
David Lamparter
cdc2d76507 *: coccinelle-replace vty->index
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-09 17:36:25 +01:00
Quentin Young
6fd800be4a Merge remote-tracking branch 'osr/master' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	lib/command_match.c
2016-12-06 19:51:33 +00:00
David Lamparter
d7d73ffc8f *: fix up DEFUNs without install_element calls
These now generate warnings which will break the build with -Werror.

Note this may have enabled commands that should be disabled, or the
other way around...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-05 20:28:24 +01:00
David Lamparter
7ddcfca4fb Merge branch 'queue/osr/vtysh-generic'
WARNING: Merge contains nontrivial fixups in vrf_cmd handling.

Conflicts:
	lib/if.c
	zebra/interface.c
2016-12-05 20:04:08 +01:00
David Lamparter
53dc2b05c7 Merge branch 'stable/2.0'
Conflicts:
	bgpd/bgp_route.c
	lib/if.c
	ripd/rip_interface.c
	zebra/interface.c
	zebra/zebra_vty.c
2016-12-05 19:48:38 +01:00
Quentin Young
0b11464604 Merge remote-tracking branch 'osr_private_quagga/queue/osr/vtysh-generic' into vtysh-grammar 2016-12-02 19:02:06 +00:00
Donald Sharp
45d430e81d ospfd: Fix json Crash with inactive timer
When nbr->t_inactivity is not active, and
you do a show json over the neighbor it
will crash ospfd.  Fix the code so it
prints out -1 when the timer is inactive.

Ticket:CM-13835
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
(cherry picked from commit 78d8fcb9623ab4d9cebf6187a451448e056a84bf)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-02 16:59:02 +01:00
David Lamparter
0b84f29490 *: make DEFUN installations file-local
This moves all install_element calls into the file where the DEFUNs are
located.  This fixes several small related bugs:

- ospf6d wasn't installing a "no interface FOO" command
- zebra had a useless copy of "interface FOO"
- pimd's copy of "interface FOO" was not setting qobj_index, which means
  "description LINE" commands would fail with an error

The next commit will do the actual act of making "foo_cmd" static.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-01 17:25:56 +01:00
David Lamparter
0577b824e1 Merge branch 'stable/2.0' 2016-12-01 17:24:03 +01:00
Donald Sharp
0cad6e2653 ospfd: Fix memory leak when not using json
When doing a show command under ospf, if
not using json we would have a small memory
leak in show_ip_ospf_common.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 50750712b1ac8364e290c67782eaf371025dc59e)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-01 16:28:12 +01:00
Quentin Young
9973d18404 all: Replace "JavaScript Object Notation\n" with JSON_STR
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-29 23:26:03 +00:00
Quentin Young
3a2d747c2e all: Fix all underfull doc strings
Additionally:
* Add [ip] to a couple bgp show commands
* Quick refactor of a couple ISIS commands
* Quick refactor of a couple OSPF6 commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-29 23:07:11 +00:00
David Lamparter
030204c7b0 *: fix CLI copypasta mixups
Nice clang catch:  ospfd/ospf_vty.c:6710:1: error: all paths through
this function will call itself [-Werror,-Winfinite-recursion]

(same in vtysh/vtysh.c)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-29 14:15:05 +01:00
Quentin Young
99a522c71b ospfd, ospf6d: Clean up and unify doc strings
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-17 20:19:27 +00:00
Quentin Young
47b91972ad ospfd: Fix typo in retransmit-interval arg parsing
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-17 20:18:34 +00:00
Quentin Young
537eae3f28 ospfd: Use sane cmd names and organize install_element's
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-16 08:09:32 +00:00
Quentin Young
0d829fa74c ospfd: Clean up ospf_vty.c
Refactor a bunch of commands.

* Make hidden configuration items consistent
* Remove duplicate code
* Make unconfig consistent with config

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-16 07:46:49 +00:00
Quentin Young
5c2fc921e5 ospfd: Fix and consolidate ospf cost commands
Also hide deprecated unconfiguration forms.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-16 01:05:39 +00:00
Quentin Young
fefa0d8214 ospfd: Fix bad index for ospf message-digest-key
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-15 01:45:58 +00:00
Quentin Young
bc7d452fe6 ospfd: Update ospf area vlink interval commands
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-06 07:17:54 +00:00
Quentin Young
16cedbb01f all: Fix underfull doc strings, part 1
Add missing docstrings and separating \n.
Also eat some low-hanging refactoring fruit.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-04 23:03:03 +00:00
Quentin Young
e9e190f245 Merge branch 'cmaster-next' into vtysh-grammar
Conflicts:
	vtysh/vtysh.c
	zebra/zebra_vty.c
2016-10-25 19:38:04 +00:00
Donald Sharp
882261e18b Merge remote-tracking branch 'origin/cmaster' into cmaster-next 2016-10-21 16:05:03 -04:00
Quentin Young
39e92c066f Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	bgpd/bgp_encap.c
	bgpd/bgp_route.c
	lib/command.c
	lib/command.h
	ospf6d/ospf6d.c
	vtysh/vtysh.c
2016-10-21 19:27:49 +00:00
Christian Franke
c8cdf5c774 ospfd: fix double assignment in ospf_vl_set_timers
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-20 20:28:26 -04:00
Quentin Young
e52702f29d Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	bgpd/bgp_route.c
	bgpd/bgp_routemap.c
	bgpd/bgp_vty.c
	isisd/isis_redist.c
	isisd/isis_routemap.c
	isisd/isis_vty.c
	isisd/isisd.c
	lib/command.c
	lib/distribute.c
	lib/if.c
	lib/keychain.c
	lib/routemap.c
	lib/routemap.h
	ospf6d/ospf6_asbr.c
	ospf6d/ospf6_interface.c
	ospf6d/ospf6_neighbor.c
	ospf6d/ospf6_top.c
	ospf6d/ospf6_zebra.c
	ospf6d/ospf6d.c
	ospfd/ospf_routemap.c
	ospfd/ospf_vty.c
	ripd/rip_routemap.c
	ripngd/ripng_routemap.c
	vtysh/extract.pl.in
	vtysh/vtysh.c
	zebra/interface.c
	zebra/irdp_interface.c
	zebra/rt_netlink.c
	zebra/rtadv.c
	zebra/test_main.c
	zebra/zebra_routemap.c
	zebra/zebra_vty.c
2016-10-17 23:36:21 +00:00
Donald Sharp
0b1442e37b *: Consolidate all double VIEW_NODE and ENABLE_NODE's
If a command is put into the VIEW_NODE, it is going into the
ENABLE_NODE as well.  This is especially true for show commands.
As such if a command is in both consolidate it down to VIEW_NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07 21:05:06 -04:00
Christian Franke
dc9ffce878 *: Consistently support 32-bit route tags
This patch improves zebra,ripd,ripngd,ospfd and bgpd so that they can
make use of 32-bit route tags in the case of zebra,ospf,bgp or 16-bit
route-tags in the case of ripd,ripngd.

It is based on the following patch:

    commit d25764028829a3a30cdbabe85f32408a63cccadf
    Author: Paul Jakma <paul.jakma@hpe.com>
    Date:   Fri Jul 1 14:23:45 2016 +0100

    *: Widen width of Zserv routing tag field.

But also contains the changes which make this actually useful for all
the daemons.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-10-07 21:05:05 -04:00
Don Slice
a452df33aa ospfd: Display all ospf peers with show ip ospf neighbor detail all
Problem reported that no peers are displayed when the command "show
ip ospf neighbor detail all" is entered.  Determined that the problem
was actually that the function only displayed NBMA peers, and since
we rarely (if ever) define NBMA peers, nothing is normally displayed.
Changed the code to display both NBMA and non-NBMA peers, in both the
up and down state.  Manual testing attached to the jira ticket.

Ticket: CM-5878
Signed-off-by: Don Slice
Reviewed-by: Daniel Walton
2016-10-06 13:50:36 -04:00
Quentin Young
12dcf78e0b all: Fix various syntax errors
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-04 19:21:45 +00:00
Quentin Young
ccb8e0c7fb ospfd, ospf6d, ripd: Fix miscellaneous syntax errors
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-04 01:13:44 +00:00
Quentin Young
e83a94147f all: fix sundry syntax errors
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-01 04:20:30 +00:00
Daniel Walton
22b27e9530 ospfd: added some missing <>s
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-30 16:05:55 +00:00
root
7a7be51923 ospfd: resolve argc CHECK MEs in ospf_vty.c
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2016-09-30 11:18:14 -04:00
Daniel Walton
2aac576795 use JSON_C_TO_STRING_PRETTY for json_object_to_json_string
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-28 04:52:36 +00:00
Daniel Walton
a636c635ae bgpd: collaps show ip bgp, show ip bgp x.x.x.x, etc calls
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-26 18:08:45 +00:00
Daniel Walton
199d90a10e Expand #defines in command strings
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-25 16:49:39 +00:00
Daniel Walton
9ccf14f739 Expand #defines in command strings
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-25 14:10:48 +00:00
Daniel Walton
8d769265c4 ospfd: add 'int idx_foo' argv index variables
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 20:01:26 +00:00
Daniel Walton
6147e2c694 convert <1-255> to (1-255), ()s to <>s, etc
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 13:47:20 +00:00
Daniel Walton
b162fa7858 Change {json} to [json]
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 11:39:50 +00:00
Daniel Walton
f412b39a33 ALIAS removal for bgp, ospf, pim, isis, rip, ripng, lib and zebra
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 03:55:26 +00:00
Daniel Walton
bf2bfafd7e ospfd: argv update for all but ospf_vty.c
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-22 19:15:24 +00:00
Donald Sharp
87aea55d34 ospfd: Fix crash with usage of incorrect command
Entering 'show ip ospf interface json' causes ospf
to crash.

Entering 'show ip ospf interface <intf> json' causes
ospf to crash if intf has no neighbors on the otherside

Modify the code to not crash in these cases.

Ticket: CM-12776
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-13 14:12:41 -04:00
Donald Sharp
b8dfa54478 ospfd: Fix crash with usage of incorrect command
Entering 'show ip ospf interface json' causes ospf
to crash.

Entering 'show ip ospf interface <intf> json' causes
ospf to crash if intf has no neighbors on the otherside

Modify the code to not crash in these cases.

Ticket: CM-12776
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-09 14:53:24 -04:00
Olivier Dugeon
16f1b9ee29 Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches.  Since this
series builds together I am doing this. -DBS

This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering

* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>

Add support for IEEE 754 format

* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
  safely convert between big-endian IEEE-754 single and double binary
  format, as used in IETF RFCs, and C99.  Implementation depends on host
  using __STDC_IEC_559__, which should be everything we care about.  Should
  correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>

Add link parameters support to Zebra

* zebra/interface.c:
   - Add new link-params CLI commands
   - Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>

Add support of new link-params CLI to vtysh

In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>

Update Traffic Engineering support for OSPFD

These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).

* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>

tmp
2016-09-03 11:05:50 -04:00
Joakim Tjernlund
953cde65c5 ospfd: Impl. per interface 'ip ospf area' command
Use with interface command:
 interface ppp0
 ip ospf area 0.0.0.0
This will enable OSPF on ppp0 with area 0.0.0.0

Remove with "no ip ospf area"

* ospf_vty.c: add "ip ospf area (A.B.C.D|<0-4294967295>)" interface command

* ospfd.c: (ospf_interface_{un,}set) new helper function to enable/disable
  OSPF on a specific interface.
  (ospf_if_update) 2 possible paths now to deal with interface updates.

Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[DL: this restores the tree to deccaf9...]
2016-08-18 07:35:39 -04:00
David Lamparter
2c494df3fa Revert "per-interface ospf enable and area set command."
This reverts commit e723861da1.

The code is from Joakim Tjernlund; this is just to fix the history (and
attribution) of it.  The last commit will restore the exact same tree
state.

THIS COMMIT WILL PROBABLY NOT COMPILE.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-08-18 07:35:38 -04:00
Donald Sharp
cd66cd4ce1 ospfd: Remove HAVE_OPAQUE_LSA
HAVE_OPAQUE_LSA is used by default and you have to actively turn it off
except that OPAQUE_LSA is an industry standard and used pretty much
everywhere.  There is no need to have special #defines for this anymore.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 36fef5708d074a3ef41f34d324c309c45bae119b)
2016-08-16 12:43:05 -04:00
Sid Khot
e018c7cc9a bgpd: Reverting fix for CM-5040: BGP and OSPF should accept "router-id use-loopback"
ospfd: Reverting fix for CM-5040: BGP and OSPF should accept "router-id use-loopback"

This reverts commit cdb805bc9e.

Conflicts:
	bgpd/bgp_vty.c
2016-08-12 17:09:27 -07:00
Sid Khot
cdb805bc9e bgpd: BGP should accept "router-id IFNAME"
ospfd: OSPF should accept "router-id IFNAME"

Added commands in BGP and OSPF where user can specify interface for router-id.

Ticket: CM-5040
Reviewed By: CCR-4908
Testing Done: Manual
2016-07-01 17:25:30 -07:00
Don Slice
70bd3c4369 ospfd/ospf6d/zebra: Change interface bandwidth range and auto-cost range to 100G
Prior to this change, interface bandwidth could not be defined above 10G. With
the use of higher speed interfaces, the ability to effectively define the path
links was highly impacted. Additionally, the default auto-cost reference-bandwidth
for ospf and ospfv3 was set to 100M, which relects a much earlier time.  Changed both
the range of interface bandwidth definitions and reference bandwidths to be up to
100G.  Set the default interface bandwidth (if not defined) to 10G to make the ratio
continue to cause a cost of 10 as before.  Manual testing as well as ospf-min and
ospf-smoke passed successfully.

Ticket: CM-10756
Signed-of-by: Don Slice
Reviewed-by: Donald Sharp
2016-06-13 09:06:45 -04:00
Paul Jakma
801e0e1492 ospfd: Remove the blocking of opaque LSAs origination & flooding 'optimisation'
* Opaque support contains some kind of hack/optimisation to
  origination/flooding to suppress some origins/floods until an opaque LS
  Acks are received.  Previous versions of the code have already been shown
  to have bugs in them (see e16fd8a5, e.g.). It seems over-complex and fragile,
  plus its conceptually the wrong place to try implement flooding hacks that,
  AFAICT, do not depend particularly on the semantics of opaque LSA.

  Nuke.

Tested-by: Olivier Dugeon <olivier.dugeon@orange.com>
2016-06-08 14:41:16 -04:00
Paul Jakma
d3a9c76878 ospfd: Some small tweaks to the SPF execution reason patch
* ospf_spf.h: use an enum for the reason, and have it as a new argument to
  ospf_spf_calculate_schedule, no need for additional call, and let compiler
  do the checking.
* ospf_spf.c: format changes - Quagga coding style places function names
  at the start of a new line, for easy grepping for definition.
  (ospf_spf_calculate_timer) Change the log format of SPF execution time to
  avoid ginormous line, and make logging conditional, as is the norm.

(cherry picked from commit b6eef003e1a79471addea0b01853b08aed812cc8)

Conflicts:
	ospfd/ospf_spf.c
2016-05-26 20:46:24 +00:00
Paul Jakma
f842f16640 ospfd: Make ospf_passive_interface_update calls friendly to static analysis
* ospf_vty.c: ({no_}ospf_passive_interface_addr_cmd) To a static analyser,
  the call to ospf_passive_interface_update can look like uninitialised memory
  in addr might be read from. It won't be, as ospf_passive_interface_update
  only reads addr if params != IF_DEF_PARAMS, but not clear. Split up the
  helper into the two cases to make it clear.

(cherry picked from commit e1bcd4741c24ff990a9413ead9a9e37b80153046)
2016-05-26 15:33:30 +00:00
Donald Sharp
cb2af5d07a ospfd: Fix compiler warnings
Two issues:

1) nbr->oi->ifp->name is an array it would
always evaluate to true.

2) There exist a code path where addr
would be used without initialization.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-05-20 09:34:32 -04:00
Daniel Walton
535c84b16b OSPF LSA may not be refreshed within 1800s, ANVL OSPF test 12.4 fails
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-10948

The previous formula for calculating delay was:

    delay = OSPF_LS_REFRESH_TIME - LS_AGE (lsa) - OSPF_LS_REFRESH_JITTER
              + (random () % (2*OSPF_LS_REFRESH_JITTER));

If LS_AGE() is 0 we get:

  delay = 1800 - 0 - 60 + (random() % 2*60)

So delay will be 1740 + 0..120, so we could easily pick a delay that is
greater than OSPF_LS_REFRESH_TIME (1800).  For the normal case where
we hit this else the LS_AGE will be > 0 so that reduces the chances of
delay being greater than 1800.
2016-05-18 13:36:38 +00:00
Daniel Walton
54b7214fb9 OSPF refreshTimerMsecs in json output is off
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-10960

The timer is in seconds and was being divided by 1000 instead of
multiplying by 1000 when converting to ms.
2016-05-13 18:19:56 +00:00
Donald Sharp
b2d7c082a2 quagga: Remove iflist global variable
The file if.c has a iflist that had the list of interfaces
in the default vrf.  Remove this variable and replace
with a vrf_iflist lookup on the default vrf where it
was used.

Additionally, modify ptm code to iterate over all vrf's
when enabling ptm.

Ticket: CM-10338
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Radhika Mahankali <radhika@cumulusnetworks.com>
2016-04-08 13:15:59 -04:00
Don Slice
84361d615d quagga: delete interface from default table when moved to vrf
All daemons changed to flag an interface that has been moved to a vrf as DELETED instead of INTERNAL.
When they were flagged as IFINDEX_INTERNAL, ospf, rip, and isis would re-install them in the default
assuming that they were being "pre-defined" before the kernel definitions.

Ticket: CM-9265
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
2016-03-18 19:53:15 +00:00
Donald Sharp
d8f70b86d7 ospfd: Fix Dereference of Null Pointer during config
This construct:

struct ospf *ospf = vty->index;
if (!ospf)
  return CMD_SUCCESS;

Is present throughout the entire ospfd code base.  The command:
distance ospf external 255

Is not protected by this construct. I added this construct
to the command and in addition did a quick search to find
any others not protected and to protect them.

Ticket: CM-9725
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
2016-03-17 17:26:46 -04:00
Daniel Walton
747e489cd8 Make duplicate ospf commands hidden
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2016-03-02 19:56:28 +00:00
Donald Sharp
a1afa410da ospfd: Fix some missing 'no XXX' commands
A recent modification accidently removed the 'no XXXX'
form of some commands that cl-ospf depended on.

Tickets: CM-9481
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-02-24 07:43:22 -05:00
Daniel Walton
12fde75be5 OSPFv2 has both "router-id x.x.x.x" and "ospf router-id x.x.x.x"
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Don Slice <dslice@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-9285
2016-02-19 13:36:06 +00:00
Daniel Walton
2b053042aa OSPF distance command does not accept "external <1-255>"
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2016-02-10 21:02:23 +00:00
Daniel Walton
813d4307f9 Should be able to "no" the full text of any config line
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-5816
2015-11-23 18:05:03 +00:00
Donald Sharp
db7c85284f Quagga: Fixup cli and json keyword
The json keyword was being read incorrectly.
Basically some commands read a variable # of arguments
and in ospf the command values were being placed into
argc and argv.  With a variable # of arguments their
existed a possibility that less arguments would be read
from the cli than were being tested for in the command function
handler.  This caused core dumps in some situations.

All code to read to decide to use the json keyword has
been centralized through a function and all code
converted to use it, irrelevant if it exhibited the bug

Ticket: CM-8278
Reviewed by: CCR-3830
Testing: OSPF no longer crashes and all other test suites still run

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-11-18 15:36:04 -08:00
Daniel Walton
c3150466c8 OSPF: remove deprecated commands
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-8142
2015-11-13 02:38:42 +00:00
Daniel Walton
692c795432 Enable OSPF "log-adjacency-changes" by default
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-7941
2015-11-03 10:48:30 -08:00
Vipin Kumar
73b9f7037b Print an error when user tries to change a previously configured area.
Ticket: CM-5673
Reviewed By: Donald
Testing Done:  Cherry picking from 2.5.4, no testing in 3.0 yet.
2015-10-20 15:06:25 -07:00
radhika
68fe91d6c7 Support of BFD status in Quagga
Ticket:CM-6802, CM-6952
Reviewed By: Donald, Kanna
Testing Done:

Double commit of b76943235e09472ec174edcf7204fc82d27fe966 from br2.5. But, manually resolved all the compilation errors. Also, modified the shows to support the json format which was not supported in br2.5.

CM-6802 – Currently, BFD session status can be monitored only through ptmctl. There is no way to check the BFD status of a peer/neighbor through Quagga. Debugging becomes easier if BFD status is shown in Quagga too. BFD status is relevant when it is shown against the BGP peer/OSPF neighbor. For, this following code changes have been done:
   - Only down messages from PTM were being propagated from Zebra daemon to clients (bgpd, ospfd and ospf6d). Now, both up and down messages are redistributed to the clients from zebra. BFD status field has been added to the messaging. Handling of BFD session up messages has been added to the client code. BGP/OSPF neighbor is brought down only if the old BFD session status is ‘Up’ to handle extra/initial down messages.
   - BFD status and last update timestamp fields have been added to the common BFD info structure. Also, common show functions for showing BFD information have been added to BFD lib.
   - Modified the BGP neighbor show functions to call common BFD lib functions.
   - For ospf and ospf6, BFD information was maintained only at interface level. To show BFD status per neighbor, BFD information has been added at neighbor level too. “show ip ospf interface”, “show ip ospf neighbor detail”, “show ipv6 ospf6 interface” and “show ipv6 ospf6 neighbor detail” output have been modified to show BFD information.

CM-6952 - IBGP peers were always assumed to be multi-hop since there was no easy way to determine whether an IBGP peer was single hop or multihop unlike EBGP. But, this is causing problem with IBGP link local peers since BFD doesn't allow multihop BFD session with link local IP addresses. Link local peers were discovered when the interface peering was enabled. Interface peering is always singlehop. So, added checks to treat all interface based peers as single hop irrespective of whether the peer is IBGP or EBGP.
2015-08-31 14:56:11 -07:00
Morgan Stewart
3ac237f89a Added json formating support to several show-...-detail ospf commands.
Ticket: CM-6520
Reviewed By: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed By: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-By: Morgan Stewart <morgan@cumulusnetworks.com>
Testing Done: Manual testing and smoketested

Whenever some sort of output is encountered, added a json version with
proper logic as well.
2015-08-07 11:16:18 -07:00
Michael Rossberg
ac7424f9de configuration options for faster OSPF convergence
Allow configuration of faster OSPF convergence via the
min_ls_interval and min_ls_arrival timer lengths.

This patch was originated by Michael, and cross-ported
to Cumulus's Quagga.

Signed-off-by: Michael Rossberg <michael.rossberg@tu-ilmenau.de>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-07-31 06:29:35 -07:00
Donald Sharp
b07c4cb33e arm compilation failures.
Ticket: Trivial
Reviewed by: Trivial
Testing: arm/powerpc/amd64 targets now build

Apparently we have a arm build.  Who knew?  This fixes the compile warnings/errors
produced when you compile a arm build with -Werror.
2015-07-29 16:02:26 -07:00
Donald Sharp
88177fe3ed Fixup of warnings in the code
Ticket: None
Reviewed by: Trivial
Testing:

A bunch of warnings have crept in to the code base.  This
fixes the issue
2015-07-25 15:55:47 -07:00
Donald Sharp
7f342629a9 This patch changes ospfd from only listening mode for BFD status updates to interactive mode of dynamically registering/deregistering neighbors discovered on BFD enabled interfaces with PTM/BFD through zebra. Neighbor is registered with BFD when 2-way adjacency is established and deregistered when adjacency goes down if the BFD is enabled on the interface through which the neighbor was discovered.
OSPF BFD command enhancement to configure BFD parameters (detect multiplier, min rx and min tx).
interface <if-name>
  ip ospf bfd <detect mult> <min rx> <min tx>

This patch also adds BFD support for IPv6 OSPF. ospf6d  will dynamically register/deregister IPv6 neighbors with BFD for monitoring the connectivity of the neighbor. Neighbor is registered with BFD when 2-way adjacency is established and deregistered when adjacency goes down if the BFD is enabled on the interface through which the neighbor was discovered.

OSPF6 BFD command added to configure BFD and parameters (detect multiplier, min rx and min tx).
interface <if-name>
  ipv6 ospf6 bfd <detect mult> <min rx> <min tx>

Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Kanna Rajagopal <kanna@cumulusnetworks.com>
2015-07-22 12:35:37 -07:00
Donald Sharp
91756b38b1 Add optional json capability to the "show ip ospf neighbor", "show ip ospf neighbor all", and "show ip ospf neighbor IFNAME" commands and whatever functions that they call. 2015-07-22 12:35:36 -07:00
Donald Sharp
7ec4159b23 Add json capability to the "show ip ospf interface [INTERFACE]" and "show ip ospf <1-65535> interface [INTERFACE]" commands and whatever functions that they call. Option shows up as {json}. 2015-07-22 12:35:36 -07:00
Donald Sharp
ca08c43dc9 Add json capability to the ospf commands: "show ip ospf" and "show ip ospf <1-65535>". Optional argument will be {json} and will output a json object with all applicable information. 2015-07-22 12:35:35 -07:00
Donald Sharp
2d627ff50c zebra, bgpd, ospfd: 'redistribute table' to 'redistribute table <table-id>'
Table-id argument support wasnt complete, used the [proto, instance]
combination changes that were done for OSPF multi-instance. In this case
its 'table <table-id>' just like it was 'ospf <instance-id>'
2015-06-11 09:11:13 -07:00
Donald Sharp
b4a039bf22 ospfd: ospf_cli_fixes
ospf: Fix cli issues with timers throttle spf and no ip ospf authentication...
When entering no timers throttle spf there was no way to specify the delay, hold
time and max hold time so the command was rejected.  This is useful for automated
processes that take currently entered cli to remove the cli.
When entering no ip ospf authentication most forms of the command were being
ignored, this fixes that as well.

Signed-off-by: Donald Sharp <sharpd at cumulusnetworks.com>
Reviewed-by:
2015-05-19 18:04:15 -07:00
Donald Sharp
b69278752c Command to adjust min-arrival value in Milliseconds.
timers lsa min-arrival <1-60000>

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2015-05-19 18:04:07 -07:00
Donald Sharp
2c19a6ec62 Changing router-id inline isnt handled correctly in the current implementation.
At the minimum, the OSPF_LSA_SELF logic isnt foolproof, and it may hit assert
in ospf_refresh_unregister_lsa on a router-id change.

Once OSPF has created and flooded LSAs, its not a good idea to change
router-id inline. Tying it to restart has at least two benefits:

- Implementation can remain sane by not having to re-adjust neighbors and LSAs,
  based on the new router-id.
- Works as a deterrent for the user to not meddle with the router-id unless
  really needed.
2015-05-19 18:04:07 -07:00
Donald Sharp
804fb5c1e5 If on-shutdown is configured to a large value and 'service quagga restart'
is executed, then the init.d/quagga script doesnt wait more than 120 seconds
for the daemon do stop, worse, it goes ahead and starts the new daemon
regardless. This can result into two ospfd processes running on the same config.
Which leads to many issues including but not limited to high cpu usage.
Thats because the two processes are mixing packets on adjancencies thus
causing churn on the box and network.

As long as OSPF is able to reliably send the max-metric router-lsa before
exiting thats mostly good enough for this purpose anyways.

As a solution to this situation, bringing the maximum configurable value of
the on-shutdown timer below the maximum retry to stop a daemon in init.d/quagga

Notes: This may not be an upstreamable patch, still we needed to find
a solution for init.d/quagga and this command this co-exist.
2015-05-19 18:03:59 -07:00
Donald Sharp
490578f385 The column headers for displaying OSPF neighbors are not aligned 2015-05-19 18:03:57 -07:00
Donald Sharp
0bad48516f Add a running flag in ospf instance.
set/reset it on 'router ospf [<instance>]'/'no router ospf [<instance>]'
2015-05-19 18:03:54 -07:00
Donald Sharp
f9dfba8dcb OSPF silently ignores 'no ip ospf hello-interval X' and 'no ip ospf hello-interval X'
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-19 18:03:48 -07:00
Donald Sharp
7c8ff89e93 Multi-Instance OSPF Summary
——————————————-------------

- etc/init.d/quagga is modified to support creating separate ospf daemon
  process for each instance. Each individual instance is monitored by
  watchquagga just like any protocol daemons.(requires initd-mi.patch).

- Vtysh is modified to able to connect to multiple daemons of the same
  protocol (supported for OSPF only for now).

- ospfd is modified to remember the Instance-ID that its invoked with. For
  the entire life of the process it caters to any command request that
  matches that instance-ID (unless its a non instance specific command).
  Routes/messages to zebra are tagged with instance-ID.

- zebra route/redistribute mechanisms are modified to work with
  [protocol type + instance-id]

- bgpd now has ability to have multiple instance specific redistribution
  for a protocol (OSPF only supported/tested for now).

- zlog ability to display instance-id besides the protocol/daemon name.

- Changes in other daemons are to because of the needed integration with
  some of the modified APIs/routines. (Didn’t prefer replicating too many
  separate instance specific APIs.)

- config/show/debug commands are modified to take instance-id argument
  as appropriate.

Guidelines to start using multi-instance ospf
---------------------------------------------

The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.

To enable multiple instances, do the following:

     1. service quagga stop
     2. Modify /etc/quagga/daemons to add instance-ids of each desired
        instance in the following format:
        ospfd=“yes"
        ospfd_instances="1,2,3"
	assuming you want to enable 3 instances with those instance ids.
     3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
        and ospfd-3.conf.
     4. service quagga start/restart
     5. Verify that the deamons are started as expected. You should see
        ospfd started with -n <instance-id> option.
     	ps –ef | grep quagga
     	With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
	ospfd-<instance-id>/vty to each instance.
     6. vtysh to work with instances as you would with any other deamons.
     7. Overall most quagga semantics are the same working with the instance
     	deamon, like it is for any other daemon.

NOTE:
     To safeguard against errors leading to too many processes getting invoked,
     a hard limit on number of instance-ids is in place, currently its 5.
     Allowed instance-id range is <1-65535>
     Once daemons are up, show running from vtysh should show the instance-id
     of  each daemon as 'router ospf <instance-id>’  (without needing explicit
     configuration)
     Instance-id can not be changed via vtysh, other router ospf configuration
     is allowed as before.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-19 18:03:42 -07:00
Donald Sharp
e723861da1 per-interface ospf enable and area set command. 2015-05-19 17:58:14 -07:00
Donald Sharp
525c183906 Unnumbered interface support. 2015-05-19 17:58:13 -07:00
Donald Sharp
09f35f8cef Support for 'clear ip ospf interface [IFNAME]' 2015-05-19 17:58:13 -07:00
Donald Sharp
d5a5c8f05b This patch adds support for a new BFD session down message from zebra to
protocols. BGP and OSPF are integrated to respond this BFD session down message
originated in Zebra via ptmd.

BGP and OSPF now have a bfd command, which tells OSPF/BGP to respond to the
BFD session down message.

OSPF:

interface <>
 ip ospf bfd

BGP:

router bgp <>
  neighbor <> bfd

Please note that these commands don't enable BFD as a protocol. BFD configuration
and paramter tuning are via BFD applicable UI.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
2015-05-19 17:47:23 -07:00
Donald Sharp
e8f45e82d4 Modified the number of writes to service at most
20 interfaces.

Signed-off-by: Ayan Banerjee <ayan@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-19 17:24:43 -07:00
Donald Sharp
2f8f370e35 In the "write" direction added a command to ensure that Quagga
is able to send out K (=3 by default) packets per thread-write.

Signed-off-by: Ayan Banerjee <ayan@cumulusnetworks.com>
Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com>
2015-05-19 17:24:42 -07:00
Donald Sharp
cf744958ba ospfd-spf-stats.patch
Compute and display SPF execution statistics

Detailed SPF statistics, all around time spent executing various pieces of SPF
such as the SPF algorithm itself, installing routes, pruning unreachable networks
etc.

Reason codes for firing up SPF are:
R - Router LSA, N - Network LSA, S - Summary LSA, ABR - ABR status change,
ASBR - ASBR Status Change, AS - ASBR Summary, M - MaxAge

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Reviewed-by: Ayan Banerjee <ayan@cumulusnetworks.com>
2015-05-19 16:36:05 -07:00
David Lamparter
6b0655a251 *: nuke ^L (page feed)
Quagga sources have inherited a slew of Page Feed (^L, \xC) characters
from ancient history.  Among other things, these break patchwork's
XML-RPC API because \xC is not a valid character in XML documents.

Nuke them from high orbit.

Patches can be adapted simply by:
	sed -e 's%^L%%' -i filename.patch
(you can type page feeds in some environments with Ctrl-V Ctrl-L)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-06-04 06:58:02 +02:00
Christian Franke
4b4bda9bb1 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>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-05-14 16:46:22 +02:00
Christian Franke
6f2a67031c 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>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-04-01 20:21:42 +02:00
Christian Franke
2b00515a9b 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>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-04-01 17:32:49 +02:00
Andrew Certain
0798cee34f ospfd: compile warning cleanups
A set of patches to clarify some comments as well as cleanup code that was
causing warnings.  After these patches, the code can be compiled with

-Wall -Wsign-compare -Wpointer-arith -Wbad-function-cast -Wwrite-strings
-Wmissing-prototypes -Wmissing-declarations -Wchar-subscripts -Wcast-qual
-Wextra -Wno-unused-parameter -Wno-missing-field-initializers

(what is current in trunk plus -Wextra -Wno-unused-parameter
-Wno-missing-field-initializers).

Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
2013-01-07 09:59:59 -08:00
Andrew Certain
1a61ad1011 ospfd: Fixed typo bug in ospf_vty.h:ospf_neighbor
Typo bug. ospf_nbr_nbma_poll_interval_set() was being sent priority instead
of interval.

Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
2013-01-07 09:59:49 -08:00
Christian Franke
bda3c326a3 ospfd: fix argument parsing for distribute-list
Use the correct argument for the protocol lookup in
ospf distribute-list commands.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
2013-01-07 09:59:48 -08:00
Dinesh Dutt
91e6a0e5ca ospf: Convert MAX_AGE LSA list to tree
Store the MaxAge LSA list in a tree instead of a linked list for efficient access.
Walking the list can be quite inefficient in some large systems and under certain tests.

ospfd maintains the list of LSA's that have been MaxAge'd out in a separate
linked list for removal by a remover/walker thread. When a new LSA is to be
installed, the old LSA is ejected and when it is ejected, the MaxAge LSA list
is traversed to ensure that the old LSA is also removed from this list if it
exists on this list.

When a large number (> 5K) MaxAge LSAs are bombarding the system, walking this
list takes a significant time causing timers to fire and actions to be taken
such as expiring neighbors due to expiry of DeadInterval (especially when timer
is really low, <= 12s), creating a spiral of instability.

By making this MaxAge LSA list be a tree, this problem is mitigated.

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Ayan Banerjee <ayan@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
2013-01-07 09:59:43 -08:00
Ayan Banerjee
4ba4fc8576 ospf: forward ref. of areas for "max-metric router-lsa administrative" cmd
In the event areas are created at a later point of time with respect
to the playback of the "max-metric router-lsa administrative" command,
those areas do not get into indefinite max-metric mode. This patch is
inteneded to store the configuration and apply it to all future areas
that may be created.

In the process, some other bugs that were there with respect to restart
etc are fixed up.

Tested locally to see that the fix works across multiple
areas and across multiple restarts.

Signed-off-by: Ayan Banerjee <ayan@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com>
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
2013-01-07 09:59:41 -08:00
Ulrich Weber
664711c1f4 lib: fix some strtoul() use cases
...otherwise 4294967295 is not a valid value on 32bit systems
2012-01-02 19:13:28 +04:00
David Lamparter
e0ca5fde7b lib: put route_types.txt to real use
this replaces most occurences of routing protocol lists by preprocessor
defines from route_types.h. the latter is autogenerated from
route_types.txt by a perl script (previously awk). adding a routing
protocol now is mostly a matter of changing route_types.txt and log.c.

Conflicts:

	lib/route_types.awk
2011-12-13 19:13:17 +04:00
Stephen Hemminger
075e12f57d ospfd: remove unused code
The code for nssa_range and other bits that were written but
never used.
2011-12-07 01:23:32 +04:00
Denis Ovsienko
171c9a996d ospfd: use existing macro for consistency 2011-09-27 21:42:52 +04:00
Paul Jakma
c363d3861b ospfd: Unify router and network LSA refresh logic with general refresher
* (general) Get rid of the router and network LSA specific refresh timers
  and make the general refresher do this instead. Get rid of the twiddling
  of timers for router/network LSA that was spread across the code.

  This lays the foundations for future, general LSA refresh improvements,
  such as making sequence rollover work, and having generic LSA delays.

* ospfd.h: (struct ospf) Bye bye to the router-lsa update timer thread
  pointer.
  (struct ospf_area) and to the router-lsa refresh timer.
* ospf_interface.h: Remove the network_lsa_self timer thread pointer
* ospf_lsa.h: (struct ospf_lsa) oi field should always be there, for benefit
  of type-2/network LSA processing.
  (ospf_{router,network}_lsa_{update_timer,timer_add}) no timers for these
  more
  (ospf_{router,network}_lsa_update) more generic functions to indicate that some
  router/network LSAs need updating
  (ospf_router_lsa_update_area) update router lsa in a particular area alone.
  (ospf_{summary,summary_asbr,network}_lsa_refresh) replaced by the general
  ospf_lsa_refresh function.
  (ospf_lsa_refresh) general LSA refresh function
2010-12-08 17:13:19 +00:00
Paul Jakma
7eb5b47e54 ospfd: Remember network LSA sequence numbers across up/downs of an interface
* ospf_interface.h: (struct ospf_if_params) add field for saved network LSA
  seqnum
* ospf_interfa.c: (ospf_new_if_params) init network_lsa_seqnum field to
  initial seqnum - doesnt matter though.
* ospf_lsa.c: (ospf_network_lsa_new) check for any saved sequence number,
  and use if it exists.  Save the result back. This should help avoid needless
  round of LSUpdate/LSRequests when a neighbour has to tell the originator
  "uhm, i have something newer than that already".
* ospf_vty.c: (show_ip_ospf_interface_sub) Show the saved network LSA seqnum
2010-12-08 17:13:14 +00:00
Stephen Hemminger
8b6a15b282 ospfd: VTY strings cleanup
Several bits of text can be local or are unused.
2009-12-03 19:25:04 +03:00
Denis Ovsienko
827341b797 [ospfd] enable more OSPF cost command aliases
The following syntax forms were not historically supported
by Quagga, although IOS accepted them w/o a problem:

no ip ospf cost <1-65535>
no ospf cost <1-65535>
no ip ospf cost <1-65535> A.B.C.D
no ospf cost <1-65535> A.B.C.D

From now on Quagga also supports these variants.
2009-09-28 19:34:59 +04:00
Joakim Tjernlund
a8ba847ff9 ospfd: Change struct ospf_path *oi to ifindex.
* global: In struct ospf_path, change struct ospf_interface *oi to int
  ifindex.  It is unsafe to reference *oi as an ospf interface can be
  deleted under your feet. Use a weak reference instead.
2009-08-03 16:52:30 +01:00
Stephen Hemminger
7fc626de5f [cleanup] Make command nodes static
The cmd_nodes used to configure vty, can mostly be static so
(basic data hiding 101).
2009-06-12 17:10:29 +01:00
Francesco Dolcini
04d23314dd [ospfd] fix vty ospfd no ospf abr-type standard
"no ospf abr-type standard" was broken
2009-06-02 18:20:09 +01:00
Denis Ovsienko
9eff36b378 Justified OSPF cost function names and added support for:
ospf cost <1-65535> A.B.C.D
 no ospf cost <1-65535>
2009-04-10 18:51:24 +04:00
Joakim Tjernlund
35f891404a Fix SEGV in ip ospf neighbor all
Dont use vty->index in show_ip_ospf_neighbor_all_cmd(),
It is invalid, use ospf_lookup() instead.
2008-08-25 09:44:18 +02:00
Paul Jakma
30a2231a48 [warnings] Fix various SOS warnings
2008-08-15 Paul Jakma <paul.jakma@sun.com>

	* */*: Fix various problems flagged by Sun Studio compiler.
	  - '<qualifier> <storage>' obsolescent in declarations
	  - empty statements (';' after ALIAS definitions)
	  - implicit declarations (e.g printstack in lib/log.c)
	  - "\%" in printf string instead of "%%"
	  - loops that return on the first iteration (legitimately, but
 	    compiler can't really know), e.g. bgp_routemap.c
 	  - internal declarations which mask prototypes.
2008-08-22 19:52:59 +01:00
Paul Jakma
5dcf71df96 [ospfd] Fix address qualified 'ip ospf auth' commands
2007-05-09 Milan Kocian <milon@wq.cz>

	* ospf_vty.c: Fix commands: 'ip ospf authentication A.B.C.D',
	  'no ip ospf authentication A.B.C.D', 'no ip ospf
	  authentication-key A.B.C.D'. Simply fix argv's indexes and
          argc check in DEFUN functions.
2007-05-10 03:00:09 +00:00
Andrew J. Schorr
e4529636b7 [PtP over ethernet] New peer flag allows much more addressing flexibility
2006-12-12 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* if.h: (struct connected) Add new ZEBRA_IFA_PEER flag indicating
	  whether a peer address has been configured.  Comment now shows
	  the new interpretation of the destination addr: if ZEBRA_IFA_PEER
	  is set, then it must contain the destination address, otherwise
	  it may contain the broadcast address or be NULL.
	  (CONNECTED_DEST_HOST,CONNECTED_POINTOPOINT_HOST) Remove obsolete
	  macros that were specific to IPv4 and not fully general.
	  (CONNECTED_PEER) New macro to check ZEBRA_IFA_PEER flag.
	  (CONNECTED_PREFIX) New macro giving the prefix to insert into
	  the RIB: if CONNECTED_PEER, then use the destination (peer) address,
	  else use the address field.
	  (CONNECTED_ID) New macro to come up with an identifying address
	  for the struct connected.
	* if.c: (if_lookup_address, connected_lookup_address) Streamline
	  logic with new CONNECTED_PREFIX macro.
	* prefix.h: (PREFIX_COPY_IPV4, PREFIX_COPY_IPV6) New macros
	  for better performance than the general prefix_copy function.
	* zclient.c: (zebra_interface_address_read) For non-null destination
	  addresses, set prefixlen to equal the address prefixlen.  This
	  is needed to get the new CONNECTED_PREFIX macro to work properly.
	* connected.c: (connected_up_ipv4, connected_down_ipv4,
	  connected_up_ipv6, connected_down_ipv6) Simplify logic using the
	  new CONNECTED_PREFIX macro.
	  (connected_add_ipv4) Set prefixlen in destination addresses (required
	  by the CONNECTED_PREFIX macro).  Use CONNECTED_PEER macro instead
	  of testing for IFF_POINTOPOINT.  Delete invalid warning message.
	  Warn about cases where the ZEBRA_IFA_PEER is set but no
	  destination address has been supplied (and turn off the flag).
	  (connected_add_ipv6) Add new flags argument so callers may set
	  the ZEBRA_IFA_PEER flag.  If peer/broadcast address satisfies
	  IN6_IS_ADDR_UNSPECIFIED, then reject it with a warning.
	  Set prefixlen in destination address so CONNECTED_PREFIX will work.
	* connected.h: (connected_add_ipv6) Add new flags argument so
	  callers may set the ZEBRA_IFA_PEER flag.
	* interface.c: (connected_dump_vty) Use CONNECTED_PEER macro
	  to decide whether the destination address is a peer or broadcast
	  address (instead of checking IFF_BROADCAST and IFF_POINTOPOINT).
	* if_ioctl.c: (if_getaddrs) Instead of setting a peer address
	  only when the IFF_POINTOPOINT is set, we now accept a peer
	  address whenever it is available and not the same as the local
	  address.  Otherwise (no peer address assigned), we check
	  for a broadcast address (regardless of the IFF_BROADCAST flag).
	  And must now pass a flags value of ZEBRA_IFA_PEER to
	  connected_add_ipv4 when a peer address is assigned.
	  The same new logic is used with the IPv6 code as well (and we
	  pass the new flags argument to connected_add_ipv6).
	  (if_get_addr) Do not bother to check IFF_POINTOPOINT: just
	  issue the SIOCGIFDSTADDR ioctl and see if we get back
	  a peer address not matching the local address (and set
	  the ZEBRA_IFA_PEER in that case).  If there's no peer address,
	  try to grab SIOCGIFBRDADDR regardless of whether IFF_BROADCAST is set.
	* if_ioctl_solaris.c: (if_get_addr) Just try the SIOCGLIFDSTADDR ioctl
	  without bothering to check the IFF_POINTOPOINT flag.  And if
	  no peer address was found, just try the SIOCGLIFBRDADDR ioctl
	  without checking the IFF_BROADCAST flag.  Call connected_add_ipv4
	  and connected_add_ipv6 with appropriate flags.
	* if_proc.c: (ifaddr_proc_ipv6) Must pass new flags argument to
	  connected_add_ipv6.
	* kernel_socket.c: (ifam_read) Must pass new flags argument to
	  connected_add_ipv6.
	* rt_netlink.c: (netlink_interface_addr) Copy logic from iproute2
	  to determine local and possible peer address (so there's no longer
	  a test for IFF_POINTOPOINT).  Set ZEBRA_IFA_PEER flag appropriately.
	  Pass new flags argument to connected_add_ipv6.
	  (netlink_address) Test !CONNECTED_PEER instead of if_is_broadcast
	  to determine whether the connected destination address is a
	  broadcast address.
	* bgp_nexthop.c: (bgp_connected_add, bgp_connected_delete)
	  Simplify logic by using new CONNECTED_PREFIX macro.
	* ospf_interface.c: (ospf_if_is_configured, ospf_if_lookup_by_prefix,
	  ospf_if_lookup_recv_if) Simplify logic using new CONNECTED_PREFIX
	  macro.
	* ospf_lsa.c: (lsa_link_ptop_set) Using the new CONNECTED_PREFIX
	  macro, both options collapse into the same code.
	* ospf_snmp.c: (ospf_snmp_if_update) Simplify logic using new
	  CONNECTED_ID macro.
	  (ospf_snmp_is_if_have_addr) Simplify logic using new CONNECTED_PREFIX
	  macro.
	* ospf_vty.c: (show_ip_ospf_interface_sub) Use new CONNECTED_PEER macro
	  instead of testing the IFF_POINTOPOINT flag.
	* ospfd.c: (ospf_network_match_iface) Use new CONNECTED_PEER macro
	  instead of testing with if_is_pointopoint.  And add commented-out
	  code to implement alternative (in my opinion) more elegant behavior
	  that has no special-case treatment for PtP addresses.
	  (ospf_network_run) Use new CONNECTED_ID macro to simplify logic.
	* rip_interface.c: (rip_interface_multicast_set) Use new CONNECTED_ID
	  macro to simplify logic.
	  (rip_request_interface_send) Fix minor bug: ipv4_broadcast_addr does
	  not give a useful result if prefixlen is 32 (we require a peer
	  address in such cases).
	* ripd.c: (rip_update_interface) Fix same bug as above.
2006-12-12 19:18:21 +00:00
Andrew J. Schorr
4354088661 [ospfd] Fix bug in passive-interface default commands.
2006-11-28 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_vty.c: (ospf_passive_interface_default) Take additional
	  'newval' arg so we can update ospf->passive_interface_default inside
	  this function.  More importantly, we now call ospf_if_set_multicast
	  on all ospf_interfaces.
	  (ospf_passive_interface, no_ospf_passive_interface) Fix bug:
	  for 'default' case, argv[0] is undefined, so we must test for
	  (argc == 0) before using argv[0].  And since
	  ospf_passive_interface_default now calls ospf_if_set_multicast as
	  needed, we can just return after calling
	  ospf_passive_interface_default.
2006-11-28 16:36:39 +00:00
Paul Jakma
7ffa8fa232 [ospfd] Add passive-interface default support
2006-10-22 Yar Tikhiy <yar@comp.chem.msu.su>

	* (general) Add support for passive-interface default (with
	  minor edits by Paul Jakma).
	* ospf_interface.h: Add OSPF_IF_PASSIVE_STATUS macro, looking
	  at configured value, or the global 'default' value, as
	  required.
	* ospf_interface.c: (ospf_if_new_hook) Leave passive
	  unconfigured per default, allowing global 'default' to
	  take effect for unconfigured interfaces.
	* ospf_packet.c: (various) use OSPF_IF_PASSIVE_STATUS
	* ospf_vty.c: (ospf_passive_interface_default) new function,
	  unset passive from all interfaces if default is enabled, as
	  the per-iface settings become redundant.
	  (ospf_passive_interface_update) new func, update passive
	  setting taking global default into account.
	  ({no,}ospf_passive_interface_addr_cmd) Add support for
	  'default' variant of command.
	  (show_ip_ospf_interface_sub) Update to take global
	  default into account when printing passive status.
	  (ospf_config_write) ditto.
	* ospfd.c: (ospf_new) set global passive-interface default.
	* ospfd.h: (struct ospf) Add field for global
          passive-interface.
2006-10-22 20:07:53 +00:00
Paul Jakma
2518efd15b [ospfd] Bug #134, ospfd should be more robust to backward time change
2006-08-25 Paul Jakma <paul.jakma@sun.com>

	* (general) Bug #134. Be more robust to backward time changes,
	  use the newly added libzebra time functions.
	  In most cases: recent_time -> recent_relative_time()
	  gettimeofday -> quagga_gettime (QUAGGA_CLK_MONOTONIC, ..)
	  time -> quagga_time.
	  (ospf_make_md5_digest) time() call deliberately not changed.
	  (ospf_external_lsa_refresh) remove useless gettimeofday, LSA
	  tv_orig time was already set in ospf_lsa_new, called via
	  ospf_external_lsa_new.
2006-08-27 06:49:29 +00:00
Paul Jakma
3fed4160cd [ospfd] Additional NSM neighbour state change stats/information
2006-07-25 Paul Jakma <paul.jakma@sun.com>

	* ospf_neigbor.h: (struct ospf_neighbor) Add some additional
	  neighbour state statistics fields, timestamps for progressive
	  and regressive state changes, and pointer to event string
	  for the latter state change.
	* ospf_nsm.c: (nsm_notice_state_change) Update new state changs
	  history as required.
	* ospf_vty.c: (show_ip_ospf_neighbor_detail_sub) Print out above
	  new per-neighbour state change stats.
2006-07-25 20:44:12 +00:00
Paul Jakma
90c33177f5 [ospfd] record timestamp and event of last NSM state change for neighbour
2006-07-10 Paul Jakma <paul.jakma@sun.com>

	* ospf_nsm.c: (ospf_nsm_event) Record state change timestamp
	  and event in nbr struct.
	* ospf_neighbor.h: (struct ospf_neighbor) Add fields to record
	  timestamp of last NSM change and event.
	* ospf_vty.c: (show_ip_ospf_neighbor_detail_sub) Print
	  last state change timestamp and event, if available.
2006-07-11 17:57:25 +00:00
Andrew J. Schorr
1c066bfe62 [ospfd] Fix "show ip ospf neighbor A.B.C.D" to show all matches
2006-06-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_vty.c: (show_ip_ospf_neighbor_id) Should show all instances
	  of that neighbor (since it may appear on multiple interfaces)
	  instead of bailing out after showing the first match.
2006-06-30 16:53:47 +00:00
Andrew J. Schorr
d7e60dd7a9 [ospfd] Implement new ospf router subcommand "log-adjacency-changes [detail]"
2006-06-28 Erik Muller <erikm@internap.com>

	* ospfd.h: Define 2 new struct ospf config flags:
	  OSPF_LOG_ADJACENCY_CHANGES and OSPF_LOG_ADJACENCY_DETAIL
	* ospf_nsm.c (nsm_change_state): Log adjacency changes if
	  requested.
	* ospf_vty.c (ospf_log_adjacency_changes): New command function
	  to implement ospf subcommand "log-adjacency-changes [detail]".
	  (no_ospf_log_adjacency_changes) Turn off log-adjacency-changes.
	  (show_ip_ospf) Show whether adjacency changes are logged.
	  (ospf_config_write) Add "log-adjacency-changes [detail]" to config.
	  (ospf_vty_init) Add ospf_log_adjacency_changes and
	  no_ospf_log_adjacency_changes.
	* ospfd.texi: Document new ospf router subcommand
	  "log-adjacency-changes [detail]".
2006-06-29 20:20:52 +00:00
Paul Jakma
d1c65c211c [ospfd] Replace redistribution strings with new route_types.h defines.
2006-05-23 Paul Jakma <paul.jakma@sun.com>

	* ospf_vty.c: (general) Replace in-place route redistribution
	  command and help strings with the new auto-generated defines
	  from lib/route_types.h
2006-06-27 08:01:43 +00:00
Andrew J. Schorr
6e72cb6a09 [ospfd] Fix ospf passive-interface subcommand to create interface if necessary
2006-06-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_vty.c: ({no_,}ospf_passive_interface) Replace if_lookup_by_name
	  with a call to if_get_by_name -- if the interface does not exist
	  already, it should be created.  And remove the obsolete warning
	  message.
2006-06-18 00:45:48 +00:00
Paul Jakma
429ac78cc6 [ospfd] Fix multicast membership drop bug
2006-06-15 Paul Jakma <paul.jakma@sun.com>

	* Reported by Milan Koci
	* ospf_interface.h: (struct ospf_if_info) Add reference counts
	  for multicast group memberships. Add various macros to help
	  manipulate/check membership state.
	* ospf_interface.c: (ospf_if_set_multicast) Maintain the
	  ospf_if_info reference counts, and only actually drop
	  memberships if it hits 0, to avoid losing membership when
	  OSPF is disabled on an interface with multiple active OSPF
	  interfaces.
	* ospf_packet.c: (ospf_{hello,read}) Use the new macros to
	  check/set
	  multicast membership.
	* ospf_vty.c: (show_ip_ospf_interface_sub) ditto.
2006-06-15 18:40:49 +00:00
Paul Jakma
1a8ec2b9a3 [ospfd] Check NULL result from ospf_area_lookup_by_area_id, CID #69
2006-05-11 Paul Jakma <paul.jakma@sun.com>

	* ospf_vty.c: (no_ospf_area_filter_list) Check NULL result from
	  ospf_area_lookup_by_area_id, fixes Coverity CID #69
2006-05-11 13:34:08 +00:00
Paul Jakma
cac3b5c435 [ospfd] Fix missing check for ospf_lookup NULL return, CID #70
2006-05-11 Paul Jakma <paul.jakma@sun.com>

	* ospf_vty.c: (general) Audit ospf_lookup calls in commands,
	  ensure check for NULL result, make vty messages consistent.
	  (show_ip_ospf_interface) Missing NULL check on ospf_lookup
	  result, fixes Coverity CID #70.
2006-05-11 13:31:11 +00:00
Paul Jakma
9c27ef9b9c [ospfd] Fix SPF of virtual-links
2006-04-24 Paul Jakma <paul.jakma@sun.com>

	* (general) More Virtual-link fixes, again with much help in
	  testing / debug from Juergen Kammer. Primarily in SPF.
	* ospf_spf.h: Add guard. ospf_interface.h will include this
	  header.
	* ospf_interface.h: Modify ospf_vl_lookup definition to take
	  struct ospf as argument, so as to allow for NULL area
	  argument.
	  (struct ospf_vl_data) Remove out_oi, instead add a struct
	  vertex_nexthop, to use as initial nexthop for backbone paths
	  through a vlink.
	* ospf_interface.c: (ospf_vl_lookup) Modified to allow
	  NULL area to be passed to indicate "any" (first) area.
	  Add extra debug.
	  (ospf_vl_set_params) vl_oi -> nexthop. Add extra debug.
	  (ospf_vl_up_check) Fix debug, inet_ntoa returns a static
	  buffer..
	* ospf_route.c: (ospf_intra_add_router) Vlinks dont go through
	  backbone, don't bother checking.
	* ospf_spf.c: (static struct list vertex_list) Record vertices
	  that will need to be freed.
	  (cmp) Order network before router vertices, as required,
	  wasn't implemented.
	  (vertex_nexthop_free) Mild additional robustness check.
	  (vertex_parent_free) Take void argument, as this function
	  is passed as list deconstructor for vertex parent list.
	  (ospf_vertex_new) More debug. Set deconstructor for parent
	  list. Track allocated vertices on the vertex_list.
	  (ospf_vertex_free) Get rid of the tricky recursive cleanup of
	  vertices. Now frees only the given vertex.
	  (ospf_vertex_add_parent) Fix assert.
	  (ospf_nexthop_calculation) Fix calculation of nexthop for
	  VLink vertices, lookup the vl_data and use its previously
	  recorded nexthop information.
	  (ospf_spf_calculate) Vertices are freed simply by deleting
	  vertex_list nodes and letting ospf_vertex_free as deconstructor
	  work per-node.
	  (ospf_spf_calculate_timer) Trivial optimisation, leave
	  backbone SPF calculation till last to reduce SPF churn on
	  VLink updates.
	* ospf_vty.c: (ospf_find_vl_data) update call to ospf_vl_lookup
	  (no_ospf_area_vlink_cmd) ditto.
	  (show_ip_ospf_interface_sub) For Vlinks, the peer address is
	  more interesting than the output interface.
2006-05-04 07:32:57 +00:00
paul
e8e1946edf [compiler] miscellaneous trivial compiler warning fixes
2006-01-19 Paul Jakma <paul.jakma@sun.com>

        * (general) various miscellaneous compiler warning fixes.
          Remove redundant break statements from switch clauses
          which return.
          return from main, not exit, cause it annoys SOS.
          Remove stray semi-colons which cause empty-statement
          warnings.
	* zebra/main.c: (sighup) remove private declaration of external
	  function.
2006-01-19 20:16:55 +00:00
paul
c42c177de3 [ospfd] trim redundant strings
2006-01-10 Paul Jakma <paul.jakma@sun.com>

	* ospf_vty.c: (config_write_ospf_distribute) trim down
	  redundant strings.
2006-01-10 20:36:49 +00:00
paul
c9c93d50cc [ospfd] rename graceful to deferred, fix a tiny compile warning.
2005-11-26 Paul Jakma <paul.jakma@sun.com>

	* (general) s/graceful/deferred/ in all files, the former term
	   is confusing wrt OSPF Graceful-Restart.
	* ospfd.c: (ospf_deferred_shutdown_check) dont return
	  a function which returns void. SOS complains about this.
	  (ospf_finish)
2005-11-26 13:31:11 +00:00
paul
b29800a676 2005-11-20 Paul Jakma <paul.jakma@sun.com>
* ospfd.h: remove the OSPF_ROUTER_ID_UPDATE_DELAY define
          (struct ospf) remove the router_id timer thread.
          remove export of ospf_router_id_update_timer.
        * ospfd.c: (ospf_router_id_update) call ospf_if_update to
          poke interfaces into action after ID has been configured.
          (ospf_router_id_update_timer) removed.
          (ospf_finish_final) t_router_id_update timer is gone.
          (ospf_network_run) router-id update timer gone.
          call ospf_router_id_update directly if ID not configured.
          In the per-iface loop, don't ospf_if_up interfaces if
          ID is still not configured. The update function will call
          ospf_if_update anyway.
          (ospf_if_update) ID update timer is gone. Just return if no
          ID is set.
        * ospf_vty.c: (ospf_router_id) call ospf_router_id_update, no
          timer needed.
        * ospf_zebra.c: (ospf_router_id_update_zebra) call
          ospf_router_id_update directly, not via timer.
2005-11-20 14:50:45 +00:00
ajs
649654aba2 [ospfd] Standardize buffer sizes used for displaying timers.
2005-11-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_dump.h: Define OSPF_TIME_DUMP_SIZE as appropriate buffer size
	  for use with ospf_timer_dump and ospf_timeval_dump.
	* ospf_vty.c: Change all buffer sizes used with ospf_timer_dump and
	  ospf_timeval_dump to have size OSPF_TIME_DUMP_SIZE.
	  (show_ip_ospf_interface_sub) Fix possible buffer overflow in
	  call to ospf_timer_dump.
2005-11-16 20:17:52 +00:00
paul
c8c1521a7d 2005-11-04 Paul Jakma <paul.jakma@sun.com>
* ospf_{dump,spf,vty}.c: Oops, use the internal tv_sub
	  function rather than unportable timersub.
2005-11-04 12:31:39 +00:00
paul
88d6cf37f6 2005-10-29 Paul Jakma <paul.jakma@sun.com>
* (general) RFC3137 stub-router support
	* ospfd.h: Add OSPF_OUTPUT_COST_INFINITE define.
	  (struct ospf_master) Add a OSPF_MASTER_SHUTDOWN flag for
	  options, to allow shutdown to distinguish between complete
	  shutdown and shutdown of a subset of ospf instances.
	  (struct ospf)
	  Add stub_router_{startup,shutdown_}time, configuration of startup
	  and shutdown time for stub-router.
	  Add t_graceful_shutdown struct thread, timer for graceful
	  shutdown, if needed.
	  (struct ospf_area) Add stub_router_state - run time state of
	  stub-router for an area. Add flags for ADMIN, IS and WAS
	  states.
	  Add t_stub_router, timer thread to resend router-lsa for an
	  area.
	* ospf_lsa.c: (ospf_link_cost) new simple function to spit out
	  either the given lnks cost or infinite cost if stub-router is
	  in effect.
	  (lsa_link_{ptop,broadcast,virtuallink,ptomp}_set) use
	  previous function for transit-links.
	  (ospf_stub_router_timer) timer thread for end of startup stub
	  router. Change state as required for the area and setup
	  re-origination of router-lsa.
	  (ospf_stub_router_check) Check/do whether stub-router should be
	  enabled, and whether it requires timer to be setup.
	  (ospf_router_lsa_new) call previous function at top.
	  (ospf_router_lsa_originate) no external callers, made static.
	* ospf_lsa.h: (ospf_router_lsa_originate) removed.
	* ospf_main.c: (sigint) make static.
	  remove call to exit, as ospf_terminate now deals with
	  exiting.
	* ospf_route.c: (ospf_terminate) removed, now in ospfd.c.
	* ospf_vty.c: (show_ip_ospf_area) print out state of
	  stub-router, if active.
	  (show_ip_ospf) print out configuration of stub-router
	  support, and details of graceful-shutdown if the timer is
	  active.
	  ((no)?ospf_max_metric_router_lsa_{admin,startup,shutdown}) new
	  commands to (de-)?configure stub-router support.
	  (config_write_stub_router) write out config of stub-router.
	  (ospf_config_write) call previous.
	  (ospf_vty_init) install the new stub-router commands.
	* ospfd.c: various functions made static.
	  (ospf_new) Set defaults for stub-router. Graceful shutdown
	  is made to default on, just to be adventerous.
	  (ospf_graceful_shutdown_finish) new function, final part of
	  shutdown.
	  (ospf_graceful_shutdown_timer) timer thread wrapper for
	  graceful-shutdown.
	  (ospf_graceful_shutdown_check) check whether to setup timer
	  for shutdown or proceed directly to final shutdown.
	  (ospf_terminate) moved here from ospf_route.c, call
	  ospf_finish for each instance.
	  (ospf_finish) renamed to ospf_finish_final and made static.
	  (ospf_finish) new function, exported wrapper around
	  ospf_graceful_shutdown_check.
	  (ospf_finish_final) complete shutdown of an instance.
	  Add missing TIMER_OFF's of two timer threads.
	  (ospf_area_free) opaque self lsa timer should be turned off.
2005-10-29 12:50:09 +00:00
paul
b8ad39d47a 2005-10-23 Paul Jakma <paul.jakma@sun.com>
* ospf_vty.c: (show_ip_ospf) fix display of SPF timer if it
	  has not yet been run.
2005-10-23 15:23:05 +00:00
paul
ea4ffc9009 2005-10-21 Paul Jakma <paul.jakma@sun.com>
* ospf_dump.c: (ospf_timeval_dump) fix ms adjustment, thanks to
	  Andrew Schorr.
	* ospf_vty.c: (ospf_config_write) fix write out of spf timers
	  configuration.
2005-10-21 20:04:41 +00:00
paul
d24f6e2a34 2005-10-21 Paul Jakma <paul.jakma@sun.com>
* (general) SPF millisecond resolution timer with adaptive,
	  linear back-off holdtime. Prettification of ospf_timer_dump.
	* ospf_dump.c: (ospf_timeval_dump) new function. The guts of
	  ospf_timer_dump, but made to be more dynamic in printing out
	  the relative timeval, sliding the precision printed out
	  according to the value.
	  (ospf_timer_dump) guts moved to ospf_timeval_dump.
	* ospf_dump.h: export ospf_timeval_dump.
	* ospf_flood.c: (ospf_flood) remove gettimeofday, use
	  the libzebra exported recent_time instead, as it's not
	  terribly critical to have time exactly right - the dropped
	  LSA will be retransmited to us if we don't ACK it.
	* ospf_packet.c: (ospf_ls_upd_timer) Ditto, but here we're
	  not transmitting, just putting LSA back on update transmit list.
	* ospfd.h: delay and holdtimes should be unsigned.
	  Add spf_max_holdtime and spf_hold_multiplier.
	  Update default defines for delay and hold time to be in msec.
	  (struct ospf) change the SPF timestamp to a struct timeval.
	  Remove ospf_timers_spf_(un)?set.
	* ospfd.c: (ospf_timers_spf_{set,unset}) removed.
	  (ospf_new) initialise spf_max_holdtime and spf_hold_multiplier
	* ospf_spf.c: (ospf_spf_calculate) SPF timestamp is a timeval
	  now, update with gettimeofday.
	  (ospf_spf_calculate_schedule) Change SPF timers to millisecond
	  resolution.
	  Make the holdtime be adaptive, with a linear increase in
	  holdtime ever consecutive SPF run which occurs within holdtime
	  of previous SPF, bounded by spf_max_holdtime.
	* ospf_vty.c: Update spf timers commands.
	  (ospf_timers_spf_set) trivial helper.
	  (ospf_timers_throttle_spf_cmd) new command to set SPF delay,
	  initial hold and max hold times with millisecond resolution.
	  (ospf_timers_spf_cmd) Deprecated. Accept the old values,
	  convert to msec, truncate to new limits.
	  (no_ospf_timers_throttle_spf_cmd) set timers to defaults.
	  (no_ospf_timers_spf_cmd) deprecated form, same as previous.
	  (show_ip_ospf_cmd) Display SPF parameters and times.
	  (show_ip_ospf_neighbour_header) Centralise the 'sh ip os ne'
	  header.
	  (show_ip_ospf_neighbor_sub) Fix the field widths. Get rid of
	  the multiple spaces which were making the lines even longer.
	  (show_ip_ospf_neighbor_cmd) Use show_ip_ospf_neighbour_header
	  (show_ip_ospf_neighbor_all_cmd) ditto and fix the field
	  widths for NBMA neighbours.
	  (show_ip_ospf_neighbor_int) Use header function.
	  (show_ip_ospf_nbr_nbma_detail_sub) use sizeof for timebuf,
	  local array - safer.
	  (show_ip_ospf_neighbor_detail_sub) ditto
	  (ospf_vty_init) install the new SPF throttle timer commands.
2005-10-21 09:23:12 +00:00
paul
f9ad937f53 2005-10-21 Paul Jakma <paul.jakma@sun.com>
* (general) OSPF fast, sub-second hello and 1s dead-interval
	  support. A warning fix. Millisec support for ospf_timer_dump.
	  Change auto-cost ref-bandwidth to add a comment to write out
	  of config, rather than printing annoying messages to vty on
	  startup.
	* ospf_dump.c: (ospf_timer_dump) Print out milliseconds too.
	  Callers typically specify a length of 9, so most see
	  millisecs unless they specify the additional length.
	* ospf_interface.h: (struct ospf_interface) new interface param,
	  fast_hello.
	* ospf_interface.c: (ospf_if_table_lookup) add brackets,
	  gcc warning fix.
	  (ospf_new_if_params) Initialise fast_hello param.
	  (ospf_free_if_params) Check whether fast_hello is configured.
	  (ospf_if_new_hook) set fast_hello to default.
	* ospf_ism.h: Wrap OSPF_ISM_TIMER_ON inside do {} while (0) to
	  prevent funny side-effects from its if statement when this
	  macro is used conditionally by other macros.
	  (OSPF_ISM_TIMER_MSEC_ON) new macro, set in milliseconds.
	  (OSPF_HELLO_TIMER_ON) new macro to set hello timer according
	  to whether fast_hello is set.
	* ospf_ism.c: Update all setting of the hello timer to use
	  either OSPF_ISM_TIMER_MSEC_ON or OSPF_HELLO_TIMER_ON. The
	  former is used when hello is to be sent immediately.
	* ospf_nsm.c: ditto
	* ospf_packet.c: (ospf_hello) hello-interval is not checked
	  for mismatch if fast_hello is set.
	  (ospf_read) Annoying nit, fix "no ospf_interface" to be debug
	  rather than a warning, as it can be perfectly normal to
	  receive packets when logical subnets are used.
	  (ospf_make_hello) Set hello-interval to 0 if fast-hellos are
	  configured.
	* ospf_vty.c: (ospf_auto_cost_reference_bandwidth) annoying
	  nit, don't vty_out if this command is given, it gets tired
	  quick.
	  (show_ip_ospf_interface_sub) Print the hello-interval
	  according to whether fast-hello is set or not.
	  Print the extra 5 millisec characters from (ospf_timer_dump)
	  if fast-hello is configured.
	  (ospf_vty_dead_interval_set) new function, common to all
	  forms of dead-interval command, to set dead-interval and
	  fast-hello correctly. If a dead-interval is given, unset
	  fast-hello, else if a hello-multiplier is set, set
          dead-interval to 1 and fast-hello to given multiplier.
	  (ip_ospf_dead_interval_addr_cmd) use
	  ospf_vty_dead_interval_set().
	  (ip_ospf_dead_interval_minimal_addr_cmd) ditto.
	  (no_ip_ospf_dead_interval) Unset fast-hello.
	  (no_ip_ospf_hello_interval) Bug-fix, unset of hello-interval
	  should set it to OSPF_HELLO_INTERVAL_DEFAULT, not
	  OSPF_ROUTER_DEAD_INTERVAL_DEFAULT.
	  (config_write_interface) Write out fast-hello.
	  (ospf_config_write) Write a comment about
	  "auto-cost reference-bandwidth" having to be equal on all
	  routers. Hopefully just as noticeable as old practice of
	  writing to vty, but less annoying.
	  (ospf_vty_if_init) install the two new dead-interval
	  commands.
	* ospfd.h: Add defines for OSPF_ROUTER_DEAD_INTERVAL_MINIMAL
	  and OSPF_FAST_HELLO_DEFAULT.
2005-10-21 00:45:17 +00:00
ajs
f52d13cb2e 2005-10-01 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* zebra.h: Declare new functions zebra_route_string() and
	  zebra_route_char().
	* log.c: (zroute_lookup,zebra_route_string,zebra_route_char) New
	  functions to map zebra route numbers to strings.
	* zebra_vty.c: (route_type_str) Remove obsolete function: use new
	  library function zebra_route_string() instead.  Note that there
	  are a few differences: for IPv6 routes, we now get "ripng" and
	  "ospf6" instead of the old behavior ("rip" and "ospf").
	  (route_type_char) Remove obsolete function: ues new library function
	  zebra_route_char() instead.  Note that there is one difference:
	  the old function returned 'S' for a ZEBRA_ROUTE_SYSTEM route,
	  whereas the new one returns 'X'.
	  (vty_show_ip_route_detail,vty_show_ipv6_route_detail) Replace
	  route_type_str() with zebra_route_string().
	  (vty_show_ip_route,vty_show_ipv6_route) Replace route_type_char()
	  with zebra_route_char().
	* bgp_vty.c: (bgp_config_write_redistribute) Use new library function
	  zebra_route_string instead of a local hard-coded table.
	* ospf6_asbr.c: Remove local hard-coded tables zroute_name and
	  zroute_abname. Change the ZROUTE_NAME macro to use new library
	  function zebra_route_string().  Remove the ZROUTE_ABNAME macro.
	  (ospf6_asbr_external_route_show): Replace ZROUTE_ABNAME() with
	  a call to zebra_route_char(), and be sure to fix the format string,
	  since we now have a char instead of a char *.
	* ospf6_zebra.c: Remove local hard-coded tables zebra_route_name and
	  zebra_route_abname.  Note that the zebra_route_name[] table
	  contained mixed-case strings, whereas the zebra_route_string()
	  function returns lower-case strings.
	  (ospf6_zebra_read_ipv6): Change debug message to use new library
	  function zebra_route_string() instead of zebra_route_name[].
	  (show_zebra): Use new library function zebra_route_string() instead
	  of zebra_route_name[].
	* ospf_dump.c: Remove local hard-coded table ospf_redistributed_proto.
	  (ospf_redist_string) New function implemented using new library
	  function zebra_route_string().  Note that there are a few differences
	  in the output that will result: the new function returns strings
	  that are lower-case, whereas the old table was mixed case.  Also,
	  the old table mapped ZEBRA_ROUTE_OSPF6 to "OSPFv3", whereas the
	  new function returns "ospf6".
	* ospfd.h: Remove extern struct message ospf_redistributed_proto[],
	  and add extern const char *ospf_redist_string(u_int route_type)
	  instead.
	* ospf_asbr.c: (ospf_external_info_add) In two messages, use
	  ospf_redist_string instead of LOOKUP(ospf_redistributed_proto).
	* ospf_vty.c: Remove local hard-coded table distribute_str.
	  (config_write_ospf_redistribute,config_write_ospf_distribute): Use
	  new library function zebra_route_string() instead of distribute_str[].
	* ospf_zebra.c: (ospf_redistribute_set,ospf_redistribute_unset,
	  ospf_redistribute_default_set,ospf_redistribute_check)
	  In debug messages, use ospf_redist_string() instead of
	  LOOKUP(ospf_redistributed_proto).
	* rip_zebra.c: (config_write_rip_redistribute): Remove local hard-coded
	  table str[]. Replace str[] with calls to new library function
	  zebra_route_string().
	* ripd.c: Remove local hard-coded table route_info[].
	  (show_ip_rip) Replace uses of str[] with calls to new library
	  functions zebra_route_char and zebra_route_string.
	* ripng_zebra.c: (ripng_redistribute_write) Remove local hard-coded
	  table str[].  Replace str[i] with new library function
	  zebra_route_string(i).
	* ripngd.c: Remove local hard-coded table route_info[].
	  (show_ipv6_ripng) Use new library function zebra_route_char() instead
	  of table route_info[].
2005-10-01 17:38:06 +00:00
vincent
ba68253771 2005-09-29 Alain Ritoux <alain.ritoux@6wind.com>
* ospfd/ospf_vty.c: forece default route LSA to be re_issued whenever
      cost is changed ( [no] ip ospf area XXX default-cost YYY)
      Support ignore-mtu option
    * ospfd/ospfd.h: define OSPF_MTU_IGNORE_DEFAULT
    * ospfd/ospf_packet.c: support ignore-mtu option
    * ospfd/ospf_interface.h: field added for skipping MTU check
    * ospfd/ospf_interface.c: fix memory leak in ospf_crypt_key_delete()
      Set mtu_ignore field to default value
    * ospfd/ospf_abr.[ch]: export ospf_abr_announce_network_to_area()
    * ospfd/ospf_ism.h: add MACRO to convert internal ISM status into SNMP
      correct values
    * ospfd/ospf_snmp.c: add sanity check on LSA type in lsdb_lookup_next()
      convert OSPFIFSTATE internal status into SNMP values
2005-09-29 13:52:57 +00:00
ajs
5339cfdb7c 2005-09-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospf_lsa.h: (ospf_external_lsa_flush) Comment out the 5th argument
	  (nexthop) since it is not used in the function (except inside
	  some commented-out code).
	* ospf_lsa.c: (ospf_external_lsa_flush,ospf_external_lsa_refresh)
	  Comment out the 5th argument to ospf_external_lsa_flush.
	* ospf_asbr.c: (ospf_redistribute_withdraw) Comment out 5th arg
	  to ospf_external_lsa_flush.
	* ospf_vty.c: (no_ospf_default_information_originate) Eliminate 5th
	  uninitialized nexthop arg to ospf_external_lsa_flush.
	* ospf_zebra.c: (ospf_zebra_read_ipv4) Comment out 5th arg
	  to ospf_external_lsa_flush.
	* ospfd.c: (ospf_network_set) Comment out 5th arg
	  to ospf_external_lsa_flush.
2005-09-19 13:28:05 +00:00
hasso
bb5b7552cc * ospf_vty.c: Make "show ip ospf neighbor xxx" commands work.
Interface should be specified by name now.

	[backport candidate]
2005-08-21 20:01:15 +00:00
hasso
54bedb55d9 * ospf_vty.c: Check carefully if interface exists before trying to
print info about it.

	Fixes bugzilla #213. [backport candidate]
2005-08-17 13:31:47 +00:00
paul
d57834f6e5 2005-07-12 Paul Jakma <paul.jakma@sun.com>
* ospfd.h: add OSPF_ABR_DEFAULT for convenience, make
	  OSPF_ABR_CISCO be the default ABR type.
	* ospfd.c: (ospf_new) initialise abr_type to OSPF_ABR_DEFAULT
	* ospf_vty.c: (no_ospf_abr_type_cmd) add standard as a negatable
	  abr_type. default abr_type should be OSPF_ABR_DEFAULT.
	  (ospf_config_write) test whether default abr_type against
	  OSPF_ABR_DEFAULT, rather than any specific ABR_TYPE.
2005-07-12 20:04:22 +00:00
paul
4dadc291e5 2005-05-06 Paul Jakma <paul.jakma@sun.com>
* (general) extern and static qualifiers added.
          unspecified arguments in definitions fixed, typically they should
          be 'void'.
          function casts added for callbacks.
          Guards added to headers which lacked them.
          Proper headers included rather than relying on incomplete
          definitions.
          gcc noreturn function attribute where appropriate.
        * ospf_opaque.c: remove the private definition of ospf_lsa's
          ospf_lsa_refresh_delay.
        * ospf_lsa.h: export ospf_lsa_refresh_delay
        * ospf_packet.c: (ospf_make_md5_digest) make *auth_key const,
          correct thing to do - removes need for the casts later.
        * ospf_vty.c: Use vty.h's VTY_GET_INTEGER rather than ospf_vty's
          home-brewed versions, shuts up several warnings.
        * ospf_vty.h: remove VTY_GET_UINT32. VTY_GET_IPV4_ADDRESS and
          VTY_GET_IPV4_PREFIX moved to lib/vty.h.
        * ospf_zebra.c: (ospf_distribute_list_update_timer) hacky
          overloading of the THREAD_ARG pointer should at least use
          uintptr_t.
2005-05-06 21:37:42 +00:00
paul
1eb8ef2584 2005-04-07 Paul Jakma <paul.jakma@sun.com>
* (global): Fix up list loops to match changes in lib/linklist,
	  and some basic auditing of usage.
	* configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES
	* HACKING: Add notes about deprecating interfaces and commands.
	* lib/linklist.h: Add usage comments.
	  Rename getdata macro to listgetdata.
	  Rename nextnode to listnextnode and fix its odd behaviour to be
	  less dangerous.
	  Make listgetdata macro assert node is not null, NULL list entries
          should be bug condition.
          ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use
          with for loop, Suggested by Jim Carlson of Sun.
          Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the
          "safety" of previous macro.
	  LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to
	  distinguish from the similarly named functions, and reflect their
	  effect better.
	  Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section
	  with the old defines which were modified above,
	  for backwards compatibility - guarded to prevent Quagga using it..
	* lib/linklist.c: fix up for linklist.h changes.
	* ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single
	  scan of the area list, rather than scanning all areas first for
	  INTER_ROUTER and then again for INTER_NETWORK. According to
	  16.2, the scan should be area specific anyway, and further
	  ospf6d does not seem to implement 16.3 anyway.
2005-04-07 07:30:20 +00:00
ajs
d2fc88962a 2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
Fix problems when netlink interfaces are renamed (same ifindex used
	for a new interface).  Start cleaning up some problems with the way
	interface names are handled.
	* interface.c: (if_new_intern_ifindex) Remove obsolete function.
	  (if_delete_update) After distributing the interface deletion message,
	  set ifp->ifindex to IFINDEX_INTERNAL.
	  (if_dump_vty) Detect pseudo interface by checking if ifp->ifindex is
	  IFINDEX_INTERNAL.
	  (zebra_interface) Check return code from interface_cmd.func.
	  Do not set internal ifindex values to if_new_intern_ifindex(),
	  since we now use IFINDEX_INTERNAL for all pseudo interfaces.
	* kernel_socket.c: (ifm_read) Fix code and comments to reflect that
	  all internal interfaces now have ifp->ifindex set to IFINDEX_INTERNAL.
        * rt_netlink.c: (set_ifindex) New function used to update ifp->ifindex.
	  Detects interface rename events by checking if that ifindex is already
	  being used.  If it is, delete the old interface before assigning
	  the ifindex to the new interface.
	  (netlink_interface, netlink_link_change) Call set_ifindex to update
	  the ifindex.
	* if.h: Remove define for IFINDEX_INTERNBASE and add define
	  IFINDEX_INTERNAL 0, since all internal (i.e. non-kernel) pseudo-
	  interfaces should have ifindex set to 0.
	  (if_new) Remove function.
	  (if_delete_retain) New function to delete an interface without
	  removing from iflist and freeing the structure.
	  (ifname2ifindex) New function.
	* if.c: (if_new) Remove function (absorb into if_create).
	  (if_create) Replace function if_new with call to calloc.
	  Set ifp->ifindex to IFINDEX_INTERNAL.  Fix off-by-one error
	  in assert to check length of interface name.  Add error message
	  if interface with this name already exists.
	  (if_delete_retain) New function to delete an interface without
	  removing from iflist and freeing the structure.
	  (if_delete) Implement with help of if_delete_retain.
	  (ifindex2ifname) Reimplement using if_lookup_by_index.
	  (ifname2ifindex) New function to complement ifindex2ifname.
	  (interface) The interface command should check the name length
	  and fail with a warning message if it is too long.
	  (no_interface) Fix spelling in warning message.
	  (if_nametoindex) Reimplement using if_lookup_by_name.
	  (if_indextoname, ifaddr_ipv4_lookup) Reimplement using
	  if_lookup_by_index.
	* bgp_zebra.c: (bgp_interface_delete) After deleting, set ifp->ifindex
	  to IFINDEX_INTERNAL.
	* isis_zebra.c: (isis_zebra_if_del) Call if_delete_retain instead
	  of if_delete, since it is generally not safe to remove interface
	  structures.  After deleting, set ifp->ifindex to IFINDEX_INTERNAL.
	  (zebra_interface_if_lookup) Tighten up code.
	* ospf6_zebra.c: (ospf6_zebra_if_del) Previously, this whole function
	  was commented out.  But this is not safe: we should at least update
	  the ifindex when the interface is deleted.  So the new version
	  updates the interface status and sets ifp->ifindex to
	  IFINDEX_INTERNAL.
	  (ospf6_zebra_route_update) Use if_indextoname properly.
	* ospf_vty.c: (show_ip_ospf_interface_sub) Show ifindex and interface
	  flags to help with debugging.
	* ospf_zebra.c: (ospf_interface_delete) After deleting, set ifp->ifindex
	  to IFINDEX_INTERNAL.
	  (zebra_interface_if_lookup) Make function static.  Tighten up code.
	* rip_interface.c: (rip_interface_delete) After deleting, set
	  ifp->ifindex to IFINDEX_INTERNAL.
	* ripng_interface.c: (ripng_interface_delete) After deleting, set
	  ifp->ifindex to IFINDEX_INTERNAL.
2005-04-02 18:38:43 +00:00
ajs
fd651fa6d5 2005-03-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospf_vty.c (show_ip_ospf_interface_sub): Display interface MTU and
	bandwidth; this is useful for debugging problems.  Also, the function
	should be static.
2005-03-29 16:08:16 +00:00
ajs
ba6454ec1f 2005-02-08 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospf_interface.h: Improve passive_interface comment.  Add new
	  multicast_memberships bitmask to struct ospf_interface to track
	  active multicast subscriptions.  Declare new function
	  ospf_if_set_multicast.
	* ospf_interface.c: (ospf_if_set_multicast) New function to configure
	  multicast memberships properly based on the current
	  multicast_memberships status and the current values of the
	  ospf_interface state, type, and passive_interface status.
	  (ospf_if_up) Remove call to ospf_if_add_allspfrouters (this is
	  now handled by ism_change_state's call to ospf_if_set_multicast).
	  (ospf_if_down) Remove call to ospf_if_drop_allspfrouters (now
	  handled by ism_change_state).
	* ospf_ism.c: (ospf_dr_election) Remove logic to join or leave
	  the DRouters multicast group (now handled by ism_change_state's call
	  to ospf_if_set_multicast).
	  (ism_change_state) Add call to ospf_if_set_multicast to change
	  multicast memberships as necessary to reflect the new interface state.
	* ospf_packet.c: (ospf_hello) When a Hello packet is received on a
	  passive interface: 1. Increase the severity of the error message
	  from LOG_INFO to LOG_WARNING; 2. Add more information to the error
	  message (packet destination address and interface address);
	  and 3. If the packet was sent to ospf-all-routers, then try
	  to fix the multicast group memberships.
	  (ospf_read) When a packet is received on an interface whose state
	  is ISM_Down, enhance the warning message to show the packet
	  destination address, and try to update/fix the multicast group
	  memberships if the packet was sent to a multicast address.
	  When a packet is received for ospf-designated-routers, but the
	  current interface state is not DR or BDR, then increase the
	  severity level of the error message from LOG_INFO to LOG_WARNING,
	  and try to fix the multicast group memberships.
	* ospf_vty.c: (ospf_passive_interface) Call ospf_if_set_multicast for
	  any ospf interface that may have changed from active to passive.
	  (no_ospf_passive_interface) Call ospf_if_set_multicast for
	  any ospf interface that may have changed from passive to active.
	  (show_ip_ospf_interface_sub) Show multicast group memberships.
2005-02-08 15:37:30 +00:00
hasso
fe71a97da2 Show sums of checksums in "show ip ospf" output. Okayed by Paul and James
R. Leu (author of original idea).
2004-12-22 16:16:02 +00:00
hasso
c6b8781957 Fix "show ip ospf" output. If router is configured as "translate-never", we
say so - we can never be translator.
2004-12-22 13:09:59 +00:00
ajs
bc18d616ad 2004-12-15 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospf_interface.h: Declare new function ospf_default_iftype.
	* ospf_interface.c: (ospf_default_iftype) New function to centralize
	  this logic in one place.
	* ospf_zebra.c: (ospf_interface_add) Use new function
	  ospf_default_iftype.
	* ospf_vty.c: (no_ip_ospf_network,config_write_interface) Fix logic
	  by using new function ospf_default_iftype.
2004-12-15 15:07:19 +00:00
ajs
2a42e285ed 2004-12-08 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* *.c: Change level of debug messages to LOG_DEBUG.
2004-12-08 18:43:03 +00:00
hasso
3fb9cd6ef4 OK. Here it is - PtP patch from Andrew J. Schorr. No problems with ospfd,
ripd might need some more testing though.
2004-10-19 19:44:43 +00:00
paul
6c83567192 2004-10-11 Paul Jakma <paul@dishone.st>
* (global) Const char update and signed/unsigned fixes.
	* (various headers) size defines should be unsigned.
	* ospf_interface.h: remove duplicated defines, include the
	  authoritative header - though, these defines should probably
          be moved to a dedicated header, or ospfd.h.
	* ospf_lsa.h: (struct lsa) ls_seqnum should be unsigned.
	* ospf_packet.c: (ospf_write) cast result of shift to unsigned.
2004-10-11 11:00:30 +00:00
hasso
eb1ce6059a Compiler warnings fixes round 1. 2004-10-08 08:17:22 +00:00
hasso
c9e52be3f4 Compiler warnings fixes. 2004-09-26 16:09:34 +00:00
hasso
52dc7ee65f Remove usage of evil list and listnode typedefs. 2004-09-23 19:18:23 +00:00
hasso
7b90143f14 Fix for Bugzilla #108. 2004-08-31 13:37:42 +00:00
hasso
beebba7516 Remove ifdef's HAVE_NSSA. NSSA support is stable enough. 2004-06-20 21:00:27 +00:00
hasso
5293076627 Ooops. Check if area-id format is valid. 2004-04-19 18:26:53 +00:00
hasso
c266ac78ee ****! What else I will discover while documenting this code? Remove useless
warnings and update documentation.
2004-04-19 17:31:00 +00:00
hasso
42ed9da7b6 Fix segfault in ospfd - [quagga-dev 980]. 2004-03-20 18:59:59 +00:00
paul
96735eeafe 2003-08-10 amir <amir@datacore.ch>
* Add missing 'i' to getopts, short form of --pid_file.
	  see http://bugzilla.quagga.net/show_bug.cgi?id=25
2003-08-10 02:51:22 +00:00
paul
5fdc1e5257 2003-08-06 Anders K. Pedersen <mailnews+router-quagga-dev@news.cohaesio.com>
* ospfd/ospf_vty.c: (ospf_config_write) fix output of
	passive-interface when IP has been specified - we still need to
	print the interface.
2003-08-06 22:41:29 +00:00
paul
9d5260374a 2003-06-30 Paul Jakma <paul@dishone.st>
* (show_ip_ospf_database_header) Fix unconditional NSSA-dependent
          printf.
2003-06-30 22:46:14 +00:00
paul
4957f4946d 2003-06-27 Paul Jakma <paul@dishone.st>
* ospf_vty.c: (global) add, unused, description array for lsa flags.
	  (show_ip_ospf_database_header): pretty print options, printf hex
          numbers as 0x, print lsa flags and note if it is a translated LSA.
          (show_lsa_detail_proc): print out OSPF_LSA_LOCAL_XLT LSAs.
	* ospf_packet.c: (ospf_write) print out destination IP in debug info
          if write fails.
2003-06-27 01:28:45 +00:00
paul
b0a053be42 2003-06-19 Paul Jakma <paul@dishone.st>
* ospf_vty.c (ospf_area_stub_no_summary): fix typo.
	  (ospf_area_nssa_cmd_handler): new function to handle the
	  area.*nssa commands.
	  (ospf_area_nssa_cmd): changed to call ospf_area_nssa_cmd_handler
	  (ospf_area_nssa_translate_cmd) ditto
	  (ospf_area_nssa_translate_cmd): changed from ALIAS to defun, call
	  ospf_area_nssa_cmd_handler
	  (ospf_area_nssa_translate_no_summary_cmd): ditto
	  (no_ospf_area_nssa_cmd): call ospf_schedule_abr_task()
	  (show_ip_ospf_area): Formatting cleanups. Properly print out NSSA
          area configuration.
	  show_router_lsa_detail: Add missing newline
	  (show_network_lsa_detail): ditto
	  (show_summary_lsa_detail): ditto
	  (show_summary_asbr_lsa_detail): ditto
	  (show_ip_ospf_route_router): fix spacing
	  (config_write_ospf_area): actually write out proper state for NSSA
	  area.
2003-06-22 09:04:47 +00:00
paul
32d2463ca2 From: Hasso Tepper <hasso@estpak.ee>
Add the 'no interface' command to all the daemons and vtysh. now it's
possible to delete interface from routeing daemons as well only if it
doesn't exist in os.

http://hasso.linux.ee/zebra/ht-no_interface_fix.patch
2003-05-23 09:25:20 +00:00
paul
7515cffe5e Undo Hasso last patch, about to apply a slightly updated patch. 2003-05-23 09:21:46 +00:00
paul
68f43848fa From: Hasso Tepper <hasso@estpak.ee>
http://hasso.linux.ee/zebra/ht-no_interface-23052003.patch

Add the 'no interface' command to all the daemons and vtysh.
2003-05-23 06:58:44 +00:00
paul
551a897925 From: Hasso Tepper <hasso@estpak.ee>
Subject: [zebra 19093] [PATCH] Two more fixes

Show NSSA LSA route info in "show ip ospf database" output
2003-05-18 15:22:55 +00:00
paul
a2c6283126 From: Hasso Tepper
This one fixes "router xxx" node commands in vtysh. Don't get "unknown
command" error when entering "passive-interface eth0" command while
ospfd and ospf6d running etc.
2003-04-23 17:01:31 +00:00
paul
020709f993 2003-04-04 Paul Jakma <paul@dishone.st>
* Sync to Zebra CVS
        * Fix lib/thread.h leak
        * Fix small Opaque LSA leak
        * Do not configure OSPF interfaces for secondary addresses
        * vtysh fixes from Hasso
        * Dave Watson's missing ntohs fix
2003-04-04 02:44:16 +00:00
paul
6898008484 2003-03-25 Paul Jakma <paul@dishone.st>
* sync to latest zebra CVS
	* spec file: updated and added define for ospf-api/client

NB: OSPF-API has been broken by the zebra.org changes, which
has added struct ospf * as a new arg to many functions
2003-03-25 05:07:42 +00:00
paul
2e3b2e474e zebra link state detection support 2002-12-13 21:03:13 +00:00
paul
718e374419 Initial revision 2002-12-13 20:15:29 +00:00