Commit Graph

26 Commits

Author SHA1 Message Date
Renato Westphal
1d75a89d85 ldpd: do not consume vty_conf when updating the configuration
David Lamparter gave the idea of keeping vty_conf as a permanent copy of
ldpd_conf in order to simplify the CLI code and facilitate the integration
with his cap'n proto framework in the future. Doing this demanded quite
some effort but it was worth it as the code looks much better now.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-31 13:51:53 -03:00
Renato Westphal
52b530fc64 ldpd: fix configuration of non-existing VPLS interfaces and pseudowires
If we don't know the ifindex, flags, etc of an interface at the time it's
configured, we should make sure that once this information is available
the appropriate structures are updated.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-31 12:57:37 -03:00
Renato Westphal
52bd4c2321 ldpd: remove a few unnecessary functions
The original ldpd(8) daemon in OpenBSD doesn't allow the user to put
non-existing interfaces in the configuration file. For this reason,
the l2vpn_if_find() and l2vpn_pw_find() functions take an ifindex as
an argument.  In FRR's ldpd we can put non-existing interfaces in the
configuration, and they are activated as soon as they are available. For
this reason, we can't lookup interfaces by their ifindex in this port.
The l2vpn_if_find_name() and l2vpn_pw_find_name() functions were
introduced to address this issue. However, since the "find-by-ifindex"
functions are not being used anymore, we can just remove them and rename
the *_find_name() functions removing the "_name" suffix.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-27 14:54:57 -03:00
Renato Westphal
1e7e440f5a ldpd: ignore the SIGHUP signal in the child processes
Only the parent process should handle the SIGHUP signal, but we need
to make sure that this signal is ignored in the child processes so a
command like "killall -SIGHUP ldpd" won't kill ldpd.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-27 14:54:57 -03:00
Donald Sharp
7bd48975b9 Merge pull request #286 from opensourcerouting/ldpd-tshoot
Ldpd tshoot
2017-03-24 07:17:06 -04:00
Renato Westphal
0f7b5df925 ldpd: provide more detailed information in some show commands
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-20 21:42:14 -03:00
Renato Westphal
bc0eb287fa ldpd: provide both a brief and a detailed version of some show commands
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-20 21:42:14 -03:00
Donald Sharp
61cd110086 ldpd: Move if_update to ldp_if_update
The if_update function should be owned
by lib/if.h.  Move the function out of the
way so we can rename lib/if.h if_update_vrf -> if_update

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-15 10:50:11 -04:00
Renato Westphal
236c69359e ldpd: remove unnecessary memcpy's
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-03 17:50:22 -03:00
Renato Westphal
26519d8c02 ldpd: send VPLS MAC withdrawals
RFC 4762 says that MAC address withdrawal messages can be used to
improve convergence time in VPLS networks. This patch makes ldpd send
MAC withdrawals whenever a non-pseudowire interface pertaining to a
VPLS goes down. The processing of received MAC withdrawals will be
implemented later.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-03 17:50:22 -03:00
Renato Westphal
05aac414e6 ldpd: minor tweaks
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-03 17:50:22 -03:00
Donald Sharp
1a35e2e565 Merge remote-tracking branch 'origin/stable/2.0' 2017-02-02 10:42:51 -05:00
Renato Westphal
45a8eba972 ldpd: introduce advanced filtering capabilities
This patch introduces several new configuration commands to ldpd. These
commands should allow the operator to define advanced filtering policies
for things like label advertisement, label allocation, etc.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-02-01 22:03:36 -02:00
Renato Westphal
28e8294caa ldpd: add synchronous IPC channels
By default all ldpd interprocess communication is asynchronous
(non-blocking socketpairs). Under some circumstances, however, we'll
need synchronous IPC as well. Examples:
* the lde child process requesting labels to zebra (through the parent
  process);
* apply an access-list on a given IP prefix (ACLs are only available in
  the parent process).

This patch only adds the necessary infrastructure to allow the child
processes to make synchronous requests to the parent process. Later
patches will make use of this new infrastructure.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-02-01 21:55:47 -02:00
Renato Westphal
372b8bd381 ldpd: add ctl_socket cli option to override the compiled-in location for the control socket
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-01-26 00:44:42 +07:00
Donald Sharp
aac93a83e3 Merge pull request #40 from opensourcerouting/ldpd-ordered-output
ldpd ordered output - fixes issue#18
2017-01-06 14:01:23 -05:00
Renato Westphal
057d48bd58 ldpd: use red-black trees to store 'adj' elements
Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-01-03 22:07:13 -02:00
Renato Westphal
20bacaeba2 ldpd: use red-black trees to store 'l2vpn_pw' elements
Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-01-03 22:07:13 -02:00
Renato Westphal
029c195854 ldpd: use red-black trees to store 'l2vpn_if' elements
Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-01-03 22:07:13 -02:00
Renato Westphal
90d7e7bd8b ldpd: use red-black trees to store 'l2vpn' elements
Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-01-03 22:07:13 -02:00
Renato Westphal
76c4abd19f ldpd: use red-black trees to store 'nbr_params' elements
Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-01-03 22:07:13 -02:00
Renato Westphal
7989cdba45 ldpd: use red-black trees to store 'tnbr' elements
Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-01-03 22:07:13 -02:00
Renato Westphal
7d3d7491a0 ldpd: use red-black trees to store 'iface' elements
Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-01-03 22:07:13 -02:00
David Lamparter
b2f361571b build: rename (1 of ?): configure.ac + preproc
This replaces Quagga -> FRR in most configure.ac settings as well as
a handful of preprocessor macros in the source code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-20 17:57:47 +01:00
Renato Westphal
eac6e3f027 ldpd: adapt the code for Quagga
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23 09:31:09 -04:00
Renato Westphal
8429abe0c2 ldpd: copy original sources from OpenBSD (14/09/2016)
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23 09:31:05 -04:00