Commit Graph

221 Commits

Author SHA1 Message Date
David Lamparter
f4b8291fcb *: move CLI node names to cmd_node->name
And again for the name.  Why on earth would we centralize this, just so
people can forget to update it?

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:59 +02:00
David Lamparter
243895805a *: move CLI parent data to cmd_node->parent_node
Same as before, instead of shoving this into a big central list we can
just put the parent node in cmd_node.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
612c2c15d8 *: remove second parameter on install_node()
There is really no reason to not put this in the cmd_node.

And while we're add it, rename from pointless ".func" to ".config_write".

[v2: fix forgotten ldpd config_write]

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
249a771b63 *: remove cmd_node->vtysh
The only nodes that have this as 0 don't have a "->func" anyway, so the
entire thing is really just pointless.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
62b346eefa *: clean up cmd_node initializers
... and use named assignments everywhere (so I can change the struct.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
4c1458b595 bgpd, ospfd, ospf6d: long is not bool :(
... Oops ...

(for context, the defaults code originally didn't have a dedicated
"bool" variant and just used long for bools...  I derp'd this when
adding bool as a separate case :( )

Reported-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-02 21:16:04 +02:00
Donatas Abraitis
15569c58f8 *: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__
Just keep the code cool.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-05 20:23:23 +02:00
David Lamparter
c572fbfe2d ospfd: use new defaults mechanism (v2)
Some preprocessor constants converted to enums to make the names usable
in the preprocessor.

v2: better isolation between core and vty code to make future northbound
conversion easier.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06 15:13:32 +01:00
Donald Sharp
cf319495a4 ospf6: Add vrf_id to the ospf6 data structure
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-10 10:10:22 -04:00
Donald Sharp
a36898e755
Revert "Ospf missing interface handling 2" 2019-06-23 19:46:39 -04:00
Philippe Guibert
f11e98eca3 *: change if_lookup_by_name() api with vrf
the vrf_id parameter is replaced by struct vrf * parameter.
this impacts most of the daemons that look for an interface based on the
name and the vrf identifier.
Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was
ignored until now.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 08:37:54 +02:00
Philippe Guibert
4c634658a6 ospf, ospf6d, zebra, lib: change if_get_by_name prototype with vrf
vrf pointer is used as reference when calling if_get_by_name() function.
this will permit to create interfaces with an unknown vrf_id, since it
is only necessary to get the vrf structure to store the interfaces.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-11 17:10:47 +02:00
Renato Westphal
8f90d89ba9 lib: retrofit interface commands to the new northbound model
The frr-interface YANG module models interfaces using a YANG list keyed
by the interface name and the interface VRF. Interfaces can't be keyed
only by their name since interface names might not be globally unique
when the netns VRF backend is in use. When using the VRF-Lite backend,
however, interface names *must* be globally unique. In this case, we need
to validate the uniqueness of interface names inside the appropriate
northbound callback since this constraint can't be expressed in the
YANG language. We must also ensure that only inactive interfaces can be
removed, among other things we need to validate in the northbound layer.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-27 16:16:12 -02:00
David Lamparter
6a154c8812 *: list_delete_and_null() -> list_delete()
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02 11:40:52 +02:00
Donald Sharp
d0b6f68174 ospf6d: Remove deprecated code after 1 year
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-30 14:29:04 -04:00
Lou Berger
66f99ce592 ospf6d: remove VERSION_TYPE_DEV from CONFDATE checks
Signed-off-by: Lou Berger <lberger@labn.net>
2018-07-10 16:20:18 -04:00
Chirag Shah
99ab28cb02 ospf6d: fix area border router duplicate
Avoid duplicate ABR brouter entry and
its nexthops.
The route lookup results in first element of the
route/redix node. In case of Intra and inter area
brouter, the first element always intra brouter.
the first element comparison results in always addition
of new element for inter area brouter in brouter table.
Now, iterate all elements of the route node and compare
for brouter origin, if it is same simply update its
nexthops to FIB.

brouter and brouter route nexthops should be merge to avoid
duplicate nexthops for the inter area routes.

Ticket:CM-20807

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-05-08 11:53:21 -07:00
Lou Berger
e24be24183 *: Only test CONFDATE when VERSION_TYPE_DEV defined
Signed-off-by: Lou Berger <lberger@labn.net>
2018-04-03 13:47:50 -04:00
Quentin Young
d7c0a89a3a
*: use C99 standard fixed-width integer types
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t

Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-27 15:13:34 -04:00
Jafar Al-Gharaibeh
e28a328600
Merge pull request #1814 from chiragshah6/mdev
ospf6d: assign zebra router-id to ospf6 instance
2018-03-08 18:05:32 -06:00
Lou Berger
996c93142d *: conform with COMMUNITY.md formatting rules, via 'make indent'
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:04:32 -05:00
Chirag Shah
78c6ba61db ospf6d: assign zebra router-id to ospf6 instance
Store zebra router-id in global structure.
Before router ospf6 instance created,
zebra router-id callback called.

During ospf6 main execution zebra init happens,
but default instance does not execute until
cli replay 'router ospf6'.
Call ospf6_router_id_change during 'router ospf6'
to assign zebra router id to ospf6 instance.

Ticket:CM-19937
Testing Done:
Assign Loopback /32 (6.6.6.6/32) address,
restart frr with (router ospf6 in frr.conf).
ospf6 default instance assigned 6.6.6.6 router-id.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-03-01 14:19:15 -08:00
Chirag Shah
07b37f93a7 ospf6d: ECMP for external routes
The route being added check its origin matches,
with any of the existing path (list of paths).
Remove the existing path, add if its cost is
eqaual or less than any of the existing path.

For a given route and of existing path cost is lower
(better) than one being added, discard new route update.

The existing path cost is higher (lower) than one being
added, ospf6_route_add replaces existing with new route
info.

Compare cost between delete request and with existing
route.

Ticket:CM-16139

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-03-01 07:47:17 -08:00
Jafar Al-Gharaibeh
e9847d4a5b
Merge pull request #1754 from chiragshah6/ospfv3_dev
ospf6d: Router-ID change notify to restart ospf6d
2018-02-15 14:39:09 -06:00
Jafar Al-Gharaibeh
89080977e3
Merge pull request #1742 from chiragshah6/mdev
ospf(6)d: Fix distance option command
2018-02-15 14:30:06 -06:00
Chirag Shah
d6927cf390 ospf6d: router-id change notify to restart ospf6d
Notify user to store config and restart ospf6d
as part of router-id change cli if any of
the area active.
Store zebra router-id under ospf6, when static
router-id removed restore zebra router-id, ask
to restart ospf6d.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-02-15 09:57:05 -08:00
Chirag Shah
76249532fa ospf6d: Handle Premature Aging of LSAs
RFC 2328 (14.1) Premature aging of LSAs from
routing domain :
When ospf6d is going away (router going down),
send MAXAGEd self originated LSAs to all
neighbors in routing domain to trigger
Premature aging to remove from resepective LSDBs.

Neighbor Router Reboot:
Upon receiving Self-originate MAXAGEd LSA, simply
discard, Current copy could be non maxaged latest.

For neighbor advertised LSA's (current copy in LSDB)
is set to MAXAGE but received new LSA with Non-MAXAGE
(with current age), discard the current MAXAGE LSA,
Send latest copy of LSA to neighbors and update the
LSDB with new LSA.

When a neighbor transition to FULL, trigger AS-External
LSAs update from external LSDB to new neighbor.

Testing:
R1 ---- DUT --- R5
| \
R2 R3
|
R4

Area 1: R5 and DUT
Area 0: DUT, R1, R2, R3
Area 2: R2 R4

Add IPv6 static routes at R5
Redistribute kernel routes at R5,
Validate routes at R4, redistributed via backbone
to area 2.
Stop n start frr.service at R5 and validated
MAXAGE LSAs then recent age LSAs in Database at DUT-R4.
Validated external routes installed DUT to R4.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-02-14 17:37:34 -08:00
Chirag Shah
f89a449b5f ospf6d: Fix distance command
Reset prevoiusly configured distance command options
if user enters new (different) parameters.

Ticket:CM-19635
Reviewed By:
Testing Done:

R1(config-ospf6)# distance ospf6 intra-area 55 external 55
R1#show running-config ospf6d
router ospf6
 distance ospf6 intra-area 55 external 55

R1(config-ospf6)# distance ospf6 inter-area 55
R1#show running-config ospf6d
router ospf6
 distance ospf6 inter-area 55

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-02-11 21:00:29 -08:00
Chirag Shah
856ae1eb2e ospf6d: Fix redist w/ route-map during restart
Add hook for route-map update event.
Add a delay one shot timer to accomodate route-map
update and reset redist with zebra to process
all redistribute routes with route-map info.

Cleanup route-map, prefix cached date during ospf6 exit.

Ticket:CM-13800
Testing Done:
configure redistribute connected with route-map to define
type-2 routes. Restart frr.service and validated
route-map add,update event, thread is scheduled,
once timer is done redist reset with zebra.
Upon redist add notification, all route map info is cached
in ospf6 and processed as type-2 route and send ASE E2 LSA.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-01-26 09:53:37 -08:00
Chirag Shah
064d4355ca ospf6d: Fix External routes ECMP
Handle RFC 2328 16.4 Calculating AS external routes with ECMP

For ASBR route, if it is learnt via new LSA and contains
different nexthop list. First lookup route in ospf6 route table
if it exists, merge nexthop list to existing and call the callback
to install into FIB (zebra). Delete created new route as it is
identical to existing entry in route table.

Ticket:CM-16139
Testing Done:
Run two ASBR with 2 ECMP paths from each
DUT neighbor receievs 4 ECMP path to a external route.
ospf6 installs all 4 ECMP path to FIB/RIB

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-01-02 10:00:38 -08:00
Renato Westphal
bcc245799b lib: nuke the if_*_by_name_len() functions
Make use of strnlen() and strlcpy() so we can get rid of these
convoluted if_*_by_name_len() functions.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-10 09:01:24 -03:00
Donald Sharp
affe9e9983 *: Convert list_delete(struct list *) to ** to allow nulling
Convert the list_delete(struct list *) function to use
struct list **.  This is to allow the list pointer to be nulled.

I keep running into uses of this list_delete function where we
forget to set the returned pointer to NULL and attempt to use
it and then experience a crash, usually after the developer
has long since left the building.

Let's make the api explicit in it setting the list pointer
to null.

Cynical Prediction:  This code will expose a attempt
to use the NULL'ed list pointer in some obscure bit
of code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:53:13 -04:00
Donald Sharp
ab0f1135b5 ospf6d: Note when we calculated spf
Fixes: #1181
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-14 16:03:26 -04:00
Quentin Young
60466a63f2
*: fix style
Fixes style nits introduced by recent pull requests.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-30 11:27:11 -04:00
Quentin Young
5d1a2ee87b
ospf6d, ospfd: add no ospf6 router-id ...
* Deprecate `router-id A.B.C.D` for ospf6d
* Add `ospf6 router-id A.B.C.D`
* Add `no ospf6 router-id [A.B.C.D]`
* Add deprecation notices for previously deprecated ospf commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-28 13:50:21 -04:00
whitespace / reindent
d62a17aede *: reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17 14:04:07 +02:00
David Lamparter
625e016d14 *: remove VTYNL, part 6 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:03 +02:00
David Lamparter
55f70b671f *: remove VTYNL, part 4 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:03 +02:00
David Lamparter
26a429fe8e *: remove VTYNL, part 2 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
David Lamparter
6d3c2ed4ed *: remove VTYNL, part 1 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
David Lamparter
6b18e3b2e0 ospf6d: VNL -> VTYNL
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
David Lamparter
5c7571d43f *: ditch vty_outln(), part 1 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13 20:29:22 +02:00
Quentin Young
7111c1a0cd
*: fix excess docstring
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-05 15:33:00 -04:00
Quentin Young
e31b6333f4 *: vty_outln (vty, "") --> vty_out (vty, VTYNL)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:34:56 +00:00
Quentin Young
96ade3ed77 *: use vty_outln
Saves 400 lines

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:31:28 +00:00
Quentin Young
facfee22f5 *: remove VTY_GET_*
CLI validates input tokens, so there's no need to do it in handler
functions anymore.

spatch follows
----------------

@getull@
expression v;
expression str;
@@
<...
- VTY_GET_ULL(..., v, str)
+ v = strtoull (str, NULL, 10)
...>

@getul@
expression v;
expression str;
@@
<...
- VTY_GET_ULONG(..., v, str)
+ v = strtoul (str, NULL, 10)
...>

@getintrange@
expression name;
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER_RANGE(name, v, str, ...)
+ v = strtoul (str, NULL, 10)
...>

@getint@
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER(..., v, str)
+ v = strtoul (str, NULL, 10)
...>

@getv4@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_ADDRESS(..., v, str)
+ inet_aton (str, &v)
...>

@getv4pfx@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_PREFIX(..., v, str)
+ str2prefix_ipv4 (str, &v)
...>

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-27 19:04:41 +00:00
Quentin Young
79c3f4f491 ospf6d: remember format for ospf6 area id
If the user enters a decimal, display a decimal.
If the user enters a dotted quad, display a dotted quad.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-19 16:51:23 +00:00
David Lamparter
896014f4bc *: make consistent & update GPLv2 file headers
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header.  (The style with * at the beginning won out with
580 to 141 in existing files.)

Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15 16:37:41 +02:00
Quentin Young
66e78ae64b *: update thread_add_* calls
Pass pointer to pointer instead of assigning by return value. See
previous commit message.

To ensure that the behavior stays functionally correct, any assignments
with the result of a thread_add* function have been transformed to set
the pointer to null before passing it. These can be removed wherever the
pointer is known to already be null.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-09 20:44:22 +00:00
Quentin Young
ffa2c8986d *: remove THREAD_ON macros, add nullity check
The way thread.c is written, a caller who wishes to be able to cancel a
thread or avoid scheduling it twice must keep a reference to the thread.
Typically this is done with a long lived pointer whose value is checked
for null in order to know if the thread is currently scheduled.  The
check-and-schedule idiom is so common that several wrapper macros in
thread.h existed solely to provide it.

This patch removes those macros and adds a new parameter to all
thread_add_* functions which is a pointer to the struct thread * to
store the result of a scheduling call. If the value passed is non-null,
the thread will only be scheduled if the value is null. This helps with
consistency.

A Coccinelle spatch has been used to transform code of the form:

  if (t == NULL)
    t = thread_add_* (...)

to the form

  thread_add_* (..., &t)

The THREAD_ON macros have also been transformed to the underlying
thread.c calls.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-09 20:44:19 +00:00
Renato Westphal
34288970c4 ospf6d: fix "no router ospf6"
The "no router ospf6" command wasn't working.

Regression introduced by commit 16cedbb.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-04-22 17:51:14 -03: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
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
David Lamparter
cf672a8654 *: use monotime()
This is largely a bulk-replace made with coccinelle.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-23 18:26:32 +01: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
cdc2d76507 *: coccinelle-replace vty->index
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-09 17:36:25 +01:00
David Lamparter
ae19c24047 ospfd, ospf6d: add qobj registrations
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
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
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
34d5ef4591 vtysh: fix some macro breakage
vtysh's extract.pl script doesn't cope with install_element(var, ) where
"var" is not one of the FOO_NODE constants.  Also, the future defun_lex
tool doesn't deal well with preprocessor expansions in the same regard.

This tries simplifying out some of these.  lib/distribute.c needs
further thinking.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-23 08:32:30 +01: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
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
Maitane Zotes
baff583e8b ospf6d: implement admin distance
Until today the admin distance cannot be configured for any IPv6
routing protocol. This patch implements it for ospf6.

Signed-off-by: Maitane Zotes <maz@open.ch>
Signed-off-by: Roman Hoog Antink <rha@open.ch>
2016-10-19 22:28:45 -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
Renato Westphal
b2d4d0393a *: rename all instances of OSPFv6 to OSPF6 or OSPFv3
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-10-13 00:59:19 +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
Daniel Walton
6de69f8305 all: added some missing <>s within []s
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-30 15:31:48 +00:00
Daniel Walton
1d68dbfe66 ospf6d: scrubbed some argc CHECK MEs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-30 01:27:05 +00:00
Daniel Walton
67656e9b65 all: added CHECK ME for DEFUNs that look at argc
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-29 17:48:57 +00:00
Daniel Walton
51c2641415 ospf6d: add 'int idx_foo' argv index variables
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 19:56:31 +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
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
cc9de1ba25 ospf6d: argv update
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 00:45:56 +00: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
David Lamparter
8f2c16aab0 *: use long long to print time_t
Since we can't assume time_t to be long, int, or even long long, this
consistently uses %lld/long long (or %llu/unsigned long long in a few
cases) to print time_t/susecond_t values.  This should fix a bunch of
warnings, on NetBSD in particular.

(Unfortunately, there seems to be no "PRId64" style printing macro for
time_t...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit ef008d2f8dc8f7160d8a3d24a15f2fad79ef3242)
2016-05-29 21:08:04 -04: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
Donald Sharp
ed2eb093c7 ospfd: ospfd-warnings.patch
Remove compile warnings for the ospfd/ospf6d directory
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:
2015-05-19 18:29:14 -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
b52a8a52c1 ospf6d: ospfv3-show-cmds-instance-check-fix.patch
SYMPTOM:

If some of the ospfv3 commands like 'show ipv6 ospf6 route' are executed
with ospf6d daemon running but before having any ospfv3 configuration, then
ospf6d crash is seen.

ISSUE:

There are a few show commands, which are (unlike others) not checking if
ospf6 instance is initialized already.

FIX:

Add the missing checks, by using OSPF6_CMD_CHECK_RUNNING() in the commands
where its needed and not yet used.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com>
             Dinesh Dutt <ddutt@cumulusnetworks.com>
2015-05-19 18:03:41 -07:00
Donald Sharp
c3c0ac8395 ospf6d: ospfv3-abr-ecmp-support.patch
OSPFv3: Add ABR support and make ECMP > 4.

Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com>
Signed-off-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>
2015-05-19 18:03:39 -07:00
Vincent Bernat
fd5006896f ospf6d: add "auto-cost reference-bandwidth" command
This command allows the user to change to default reference bandwidth
for cost calculations. The default value is 100 Mbps. With a default
bandwidth of 10 MBps, the default cost becomes 10. Those values are
consistent with OSPFv2.

[DL: resolved conflicts in vty command additions & docs]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-03-21 06:28:48 +01:00
Christian Franke
d9628728e0 ospf6d: improve ordered shutdown
Improve the _disable/_enable infrastructure so it gets into
a more usable shape and make 'no router ospf6' actually work.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-03-18 08:44:05 +01:00
Dinesh Dutt
a0edf6740e ospf6d: add SPF logs, statistics, and display of SPF parameters
Signed-off-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com>
[DL: adapted to rebase / readded randomly lost line]
[DL: killed timeval_subtract]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2013-11-07 18:15:43 -08:00
Dinesh Dutt
3d35ca482b ospf6d: add 'log-adjacency-changes [detail]'
Similar to OSPFv2, add support for 'log-adjacency-changes [detail]' to log
changes in adjacency state of ospfv3 neighbors.

Signed-off-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt at cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm at cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2013-11-07 18:15:43 -08:00
Dinesh Dutt
f41b4a0216 ospf6d: add overload support
OSPFv3: Support setting/clearing overload bit on router

It is sometimes necessary for a router to gracefully remove itself from
the SPF tree i.e. it cannot act as a transit router. It does this by
setting the overload bit in the router LSA. This patch adds support for
enabling/disabling the overload bit.

Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com>
Reviewed-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>
[DL: patch applied with fuzz]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2013-11-07 18:15:43 -08:00
Dinesh Dutt
2449fcd64a ospf6d: reinvoke MaxAge remover thread if not all MaxAge LSAs were flushed.
MaxAge LSAs are being flushed out only on an event, unlike OSPFv2 where they're flushed out
periodically. This causes certain LSAs to hang around forever, never getting flushed out.
This patch makes flushing out MaxAge LSAs periodic, retriggered after a certain period if
not all MaxAge LSAs were flushed out.

Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2013-11-07 18:15:42 -08:00
Dinesh Dutt
3810e06eeb ospf6d: schedule SPF to run on events rather than directly on each event.
OSPV3 SPF triggers on every SPF-able event instead of using timers the way
OSPFv2 does. This patch makes SPF be triggered/throttled similar to OSPFv2.
It adds a command to quagga identical to the OSPFv2 equivalent to configure
these timers.
Summary:

Signed-off-by: Dinesh Dutt <ddutt at cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com>
[DL: removed reference to oa->ts_spf for rebase]
[DL: killed timeval_subtract]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2013-11-07 18:15:30 -08:00
Denis Ovsienko
ea4021984f ospf6d: spelling 2011-09-27 21:36:54 +04:00
Tom Goff
ae2254aa7f ospf6d: Have ospf6d cleanup when it terminates normally
A clean exit makes it easier to use memory debuggers.

* ospf6_asbr.c: (ospf6_asbr_terminate) Add a function to do route map
  cleanup.
* ospf6_lsa.c: (ospf6_lsa_terminate) Add a function to cleanup the lsa
  handler vector.
* ospf6_main.c: (ospf6_exit) Add an function that causes ospf6d to
  gracefully exit.
* ospf6_message.c: (ospf6_message_terminate) Add a function that frees
  the send and receive buffers.
* ospf6_top.c: (ospf6_delete) Enable the ospf6_delete() function.
  Disable ospf6 before freeing everything.
2011-03-21 13:31:16 +00:00
Stephen Hemminger
e580216e1b ospf6d: remove dead code
* ospf6d/ospf6_interface.c
  * loopind(): sayonara
* ospf6d/ospf6_top.c
  * ospf6_delete(): comment out, it might be useful if real shutdown is
    added
2009-12-10 16:18:41 +03:00
Takashi Sogabe
86f72dcba3 Convert ospf6d over to quagga_gettime() wrappers. 2009-06-22 12:21:22 +01:00
Stephen Hemminger
66a11e76d4 [ospf6d] Remove 'no router' from OSPF6_NODE
Don't need command twice.
2009-06-18 20:18:27 +01:00
Jon
56abbb886f [ospf6d] Fix ospf6d crash if removing interface with no area
ospf6d will crash if attempting to remove interface when no areas have been
defined Check if any areas have been defined.  Should prevent use of empty
pointer.
2009-06-18 20:18:26 +01:00
Jon
6c19d26a01 [ospf6] Add no router ospf6
Suggestion: Makes no sense to me that the statement to remove ospf6
configuration is located in OSPF6D_NODE.
Moved to CONFIG_NODE next to matching define command.
2009-06-18 20:18:26 +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
Stephen Hemminger
393deb9bd6 [cleanup] Convert XMALLOC/memset to XCALLOC
Simple conversion of XMALLOC/memset to XCALLOC
2009-06-12 17:07:49 +01:00
Paul Jakma
6ac29a5107 [trivia] finish off static'ification of ospf6d and ripngd
2008-08-15 Paul Jakma <paul.jakma@sun.com>

	* {ospf6d,ripngd}/*: Finish job of marking functions as static, or
	  exporting declarations for them, to quell warning noise with
	  Quagga's GCC default high-level of warning flags. Thus allowing
	  remaining, more useful warnings to be more easily seen.
2008-08-22 19:52:58 +01:00
Paul Jakma
cf1ce250d2 [ospf6d] GNU Zebra #3562: ABR Crash fix, memory fixes, route table debugs
2006-02-22  Yasuhiro Ohara  <yasu@sfc.wide.ad.jp>

	* valgrind check and memory fix
	* route table identification string added
	* ospf6d.h: version 0.9.7q
2006-05-15 10:46:07 +00:00
Paul Jakma
cb4b88452e [ospf6d] Import GNU Zebra CVSps#3559: Fix inter-area as-ext bug, cleanup debug
2005-10-06  Yasuhiro Ohara  <yasu@sfc.wide.ad.jp>

	* ospf6_asbr.c: fix bug of calculating AS-External routes
	  in other areas. Add debugging function for border-router
	  calculation.
	* ospf6d.h: version 0.9.7p
2006-05-15 10:39:30 +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
hasso
c8a440eca0 Better common router-id handling. 2004-10-11 17:02:40 +00:00
paul
0c083ee9d8 2004-10-10 Paul Jakma <paul@dishone.st>
* ospf6_route.c: Add const qualifier to various char arrays of
          constants. signed/unsigned fixes.
          (ospf6_linkstate_table_show) argv is const
        * ospf6_snmp.c: listnode typedef is dead.
          (ospf6_snmp_init) Take struct thread_master arg, needed for
          smux_init.
        * ospf6_snmp.h: update ospf6_snmp_init declaration.
        * ospf6d.c: (ospf6_init) add const qualifier to sargv, pass master
          to ospf_snmp6_init.
	* ospf6_asbr.c: const char update.
	* ospf6_interface.c: ditto, plus signed/unsigned fixes.
	  (ipv6_ospf6_cost) Check whether cost fits in u_int32_t and use
          strtoul.
	* ospf6_intra.c: const char update. Parenthesise expression.
	* ospf6_lsa.c: signed/unsigned and const char updates.
	* ospf6_proto.c: ditto.
	* ospf6_message.c: ditto.
	* ospf6_lsdb.c: signed/unsigned update.
	* ospf6_main.c: const char update.
	* ospf6_neighbor.c: ditto.
	* ospf6_spf.c: ditto.
	* ospf6_top.c: ditto.
2004-10-10 12:54:58 +00:00
hasso
52dc7ee65f Remove usage of evil list and listnode typedefs. 2004-09-23 19:18:23 +00:00
hasso
4846ef64ba Merge svn revision 981 from Zebra cvs. 2004-09-03 06:04:00 +00:00
hasso
1e05838a4d Merge svn revision 975 from Zebra repository. 2004-09-01 21:36:14 +00:00
hasso
69b4a810cd Make ospf6d configuration appear in vtysh as well. Report sent to Yasuhiro
Ohara.
2004-08-26 18:10:36 +00:00
hasso
ccb59b1104 SVN revisions 935-940 merge from Zebra CVS. 2004-08-25 09:10:37 +00:00
hasso
3b68735fc3 Merge svn revisions 924 and 925 from Zebra CVS. Also remove useless
ospf6_lsdb prototype declaration from ospf6_lsa.h. Report sent to Yasuhiro
Ohara as well.
2004-08-19 06:56:53 +00:00
hasso
6452df092b SVN revisions 916-920 from Zebra. ABR support is almost done. 2004-08-15 05:52:07 +00:00
hasso
049207c31d SVN revision 907 from Zebra cvs repository. 2004-08-04 20:02:13 +00:00
hasso
508e53e2ee Ospf6d merge from Zebra repository with added privs stuff and merged
zclient changes.
2004-05-18 18:57:06 +00:00
hasso
e26bbebadd ospf6d part of 6Wind patch. 2003-05-25 21:39:29 +00:00
paul
718e374419 Initial revision 2002-12-13 20:15:29 +00:00