0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-20 04:15:19 +00:00
Commit Graph

944 Commits

Author SHA1 Message Date
Ondrej Zajicek
f8fefde318 Refactoring of OSPF messages. 2014-10-24 11:07:38 +02:00
Ondrej Zajicek
78342404ff Merge remote-tracking branch 'origin/master' into soft-int 2014-10-14 17:23:34 +02:00
Ondrej Zajicek
7aa809016e Implements show route noexport option.
Shows routes that would be exported to the protocol but are rejected by
the export filter.
2014-10-02 12:52:50 +02:00
Ondrej Zajicek
1123e70740 Implements token bucket filter for rate limiting. 2014-10-02 12:52:50 +02:00
Ondrej Zajicek
0479b44373 Fixes some warnings. 2014-10-02 12:52:50 +02:00
Ondrej Zajicek
a7a7372aa7 Temporary integrated OSPF commit. 2014-07-18 18:24:12 +02:00
Ondrej Zajicek
9eceab33f9 String constants could be used for string option values.
Thanks to Frederik Kriewitz for the patch.
2014-05-29 23:05:03 +02:00
Ondrej Zajicek
1149aa977d Fixes a problem with undoing of deconfiguring of protocol.
Thanks to Sergey Popovich for the original patch.
2014-05-05 11:05:12 +02:00
Ondrej Zajicek
c865cae3eb Fixes 'show route export' w.r.t. protocols with different RA_* types. 2014-04-28 17:31:03 +02:00
Ondrej Zajicek
984d734944 Fixes limit verification during reconfiguration. 2014-04-27 00:46:32 +02:00
Ondrej Zajicek
1cb0f83d29 Fixes some asserts. 2014-04-07 11:48:25 +02:00
Ondrej Zajicek
d7c0628591 Check validity of interface definitions.
Thanks to Aleksey Berezin for the bugreport.
2014-03-31 01:52:28 +02:00
Ondrej Zajicek
227af309e5 Fixes some minor issues in graceful restart. 2014-03-24 12:32:12 +01:00
Ondrej Zajicek
6eda3f135f Documentation (and minor fixes) for BGP graceful restart. 2014-03-23 01:35:33 +01:00
Ondrej Zajicek
0c791f873a BGP graceful restart support.
Also significant core protocol state changes needed for that,
global graceful restart recovery state and kernel proto support
for recovery.
2014-03-20 14:07:12 +01:00
Ondrej Zajicek
5c200e0a4d Merge branch 'add-path' 2014-02-06 20:15:05 +01:00
Ondrej Zajicek
6601a14831 Merge branch 'add-path' 2013-12-10 22:30:46 +01:00
Ondrej Zajicek
2d0b7e24a5 Fixes problem with source address selection in BGP and BFD. 2013-12-02 11:54:32 +01:00
Ondrej Zajicek
e7d2ac4401 Finishes add-path.
Fixes some bugs and uses generic hash implementation.
2013-12-01 13:49:42 +01:00
Ondrej Zajicek
283c7dfada Merge branch 'master' into add-path 2013-11-25 18:42:47 +01:00
Ondrej Zajicek
5ebc92935c Last state change should track protocol state change.
And not core state change, which is not much relevant
(e.g. refeed in BGP).
2013-11-24 22:22:24 +01:00
Ondrej Zajicek
e4d179f2c2 Minor changes to default router ID calculation. 2013-11-24 12:50:53 +01:00
Ondrej Zajicek
736e143fa5 Merge branch 'master' into add-path
Conflicts:

	filter/filter.c
	nest/proto.c
	nest/rt-table.c
	proto/bgp/bgp.h
	proto/bgp/config.Y
2013-11-23 11:50:34 +01:00
Ondrej Zajicek
0aeac9cb7f Merge commit 'origin/bfd' 2013-11-22 02:48:44 +01:00
Ondrej Zajicek
548c329cde Adds rate limiting to some log messages. 2013-11-22 01:21:15 +01:00
Ondrej Zajicek
7c9930f9c8 Adds a missing file.
I forgot to add that to the previous commit.
2013-11-21 11:36:49 +01:00
Ondrej Zajicek
1ec522538f BFD protocol, ready for release.
Supports OSPF and BGP and also statically configured sessions.
2013-11-19 22:33:48 +01:00
Ondrej Zajicek
a15dab76f9 Implements 'allow local as' option.
Similar to allowas-in option on other routers.
2013-10-21 14:59:35 +02:00
Ondrej Zajicek
0e175f9f0f Fixes some BFD bugs and makes logging thread-safe. 2013-10-05 20:12:28 +02:00
Ondrej Zajicek
7ccb36d330 Implements C.len operator for clist and eclist types.
Thanks to Sergey Popovich for the original patch.
2013-10-02 14:57:29 +02:00
Ondrej Zajicek
28a10f84cb Some fixes in filter code.
Thanks to Sergey Popovich for original patches.
2013-10-02 14:41:37 +02:00
Ondrej Filip
ec57bbf67f Recheck export/import/receive limits during reconfiguration. 2013-09-30 14:07:34 +02:00
Ondrej Zajicek
4df2019ebf Fixes build issues without BGP.
Thanks to Sergey Popovich for the patch.
2013-09-26 17:36:30 +02:00
Ondrej Zajicek
f83ce94d5e Fixes missing unregister of kernel table handling code.
And some minor fixes.

Thanks to Sergey Popovich for the patch.
2013-09-26 17:33:00 +02:00
Ondrej Zajicek
6a8d3f1c1f BFD work in progress.
Now it compiles and mostly works.
2013-09-16 23:57:40 +02:00
Ondrej Zajicek
92f8878cbf Fixes a bug related to multiple IPs and direct protocol.
Multiple IPs in the same IP prefix confuse the direct
protocol and could cause withdrawal of a valid prefix.

Thanks to Dan Rimal for a bugreport.
2013-09-10 13:03:58 +02:00
Ondrej Zajicek
bff9ce5130 Extends delete/filter operators to work no bgp_paths. 2013-08-15 01:06:47 +02:00
Ondrej Zajicek
508d936078 Implements eval command and minor CLI cleanups.
Implemented eval command can be used to evaluate expressions.

The patch also documents echo command and allows to use log classes
instead of integer as a mask for echo.
2013-07-25 13:15:32 +02:00
Ondrej Zajicek
9135c1f0ca Fixes bug in protocol flushing and rtable pruning.
When route was propagated to another rtable through a pipe and then the
pipe was reconfigured softly in such a way that any subsequent route
updates are filtered, then the source protocol shutdown didn't clean up
the route in the second rtable which caused stale routes and potential
crashes.
2013-07-24 14:11:12 +02:00
Ondrej Zajicek
cc31b75a8f Implements 'bgppath ~ int set' filter op. 2013-07-09 23:27:10 +02:00
Ondrej Zajicek
ef4a50be10 Better packet priority and traffic class handling.
Implements support for IPv6 traffic class, sets higher priority for OSPF
and RIP outgoing packets by default and allows to configure ToS/DS/TClass
IP header field and the local priority of outgoing packets.
2013-06-24 16:37:30 +02:00
Ondrej Zajicek
fad04c750c Fixes problems with kernel routes multiple routing tables.
Temporary dummy routes created by a kernel protocol during routing table
scan get mixed with real routes propagated from another kernel protocol
through a pipe.
2013-06-13 11:27:14 +02:00
Ondrej Zajicek
cd3b02d198 Allows IP of loopback to be used in automatic router ID selection.
Thanks to Alexander V. Chernikov for the patch.
2013-04-16 17:53:22 +02:00
Ondrej Filip
e667622a35 Default rounting table for 'show route export/preexport/protocol' is the one related to a respective protocol. 2013-02-25 10:39:46 +01:00
Ondrej Filip
9d969be5f2 I still believe that 0 == NULL, however this patch will make Santiago happy. :-) 2013-02-14 23:35:51 +01:00
Ondrej Filip
0bc3542ab6 Route limits can be disabled - this makes sense for protocol templates 2013-02-10 19:06:56 +01:00
Ondrej Zajicek
36da2857bc Implements router advertisements activated by received routes.
The RAdv protocol could be configured to change its behavior based on
availability of routes, e.g., do not announce router lifetime when a
default route is not available.
2013-02-08 23:58:27 +01:00
Ondrej Zajicek
b662290f40 Separate import and receive limits.
They have different behavior w.r.t. filtered routes that are kept.
2013-01-10 13:07:33 +01:00
Ondrej Zajicek
79b4e12e60 Implements interface masks for choosing router id.
Router ID could be automatically determined based of subset of
ifaces/addresses specified by 'router id from' option. The patch also
does some minor changes related to router ID reconfiguration.

Thanks to Alexander V. Chernikov for most of the work.
2012-12-27 12:56:23 +01:00
Ondrej Zajicek
a92cf57dd6 Implements undo command and optional timeout for configuration
Several new configure command variants:

configure undo - undo last reconfiguration
configure timeout - configure with scheduled undo if not confirmed in timeout
configure confirm - confirm last configuration
configure check - just parse and validate config file
2012-12-26 12:40:48 +01:00
Ondrej Zajicek
7057752924 Fixes route tracing w.r.t. kept filtered routes. 2012-11-16 13:29:16 +01:00
Ondrej Zajicek
1555095795 Changes 'rejected' to 'filtered' in one of the last patches. 2012-11-15 01:29:01 +01:00
Ondrej Zajicek
cf98be7b67 Allows rejected routes to be kept and examined.
When 'import keep rejected' protocol option is activated, routes
rejected by the import filter are kept in the routing table, but they
are hidden and not propagated to other protocols. It is possible to
examine them using 'show route rejected'.
2012-11-10 14:26:13 +01:00
Ondrej Zajicek
8ecbaf9c70 Fixes a bug with neighbor cache and overlapping IP prefixes.
When there are overlapping IP prefixes and one disappears,
neighbors associated with it was removed even if there
is another covering IP prefix.
2012-08-16 13:09:26 +02:00
Ondrej Zajicek
094d2bdb79 Implements ADD-PATH extension for BGP.
Allows to send and receive multiple routes for one network by one BGP
session. Also contains necessary core changes to support this (routing
tables accepting several routes for one network from one protocol).
It needs some more cleanup before merging to the master branch.
2012-08-14 16:46:43 +02:00
Ondrej Zajicek
5400c0e7f9 Fixes BGP subcode during global shutdown. 2012-08-06 02:42:24 +02:00
Ondrej Zajicek
36415e4b1d Allows to redefine master table. 2012-07-20 19:56:57 +02:00
Ondrej Zajicek
4be266a983 Implements wildcard matching in config file include.
Also fixes some minor bugs in include.

Thanks Kelly Cochran for suggestion and draft patch.
2012-07-18 19:29:33 +02:00
Ondrej Zajicek
abced4a914 Merge branch 'rt-accepted'
Conflicts:

	nest/config.Y
	nest/rt-table.c
	proto/bgp/bgp.c
2012-07-16 14:44:45 +02:00
Ondrej Zajicek
26822d8fe1 Finalize RA_ACCEPTED handling. 2012-07-16 01:33:02 +02:00
Ondrej Zajicek
47c447c42e Minor cleanups. 2012-05-11 12:10:21 +02:00
Ondrej Zajicek
b7f3df7905 Fixes a bug in RA_ACCEPTED handling. 2012-05-11 12:01:27 +02:00
Ondrej Zajicek
f1aceff59b Cleanup in sysdep KRT code, part 2.
Remove support for historic Linux kernels,
merge krt-iface, krt-set and krt-scan stub headers.
2012-04-30 22:25:24 +02:00
Ondrej Zajicek
bf42207332 Changes keyword 'exceed' to 'action'. 2012-04-28 13:18:39 +02:00
Ondrej Zajicek
ab758e4fb2 Some fixes in route export limits. 2012-04-28 12:59:40 +02:00
Ondrej Zajicek
d494df63ac Some minor fixes. 2012-04-27 00:04:51 +02:00
Ondrej Zajicek
d9b77cc281 Implements generalized export limits.
And also fixes some minor bugs in limits.
2012-04-24 23:39:57 +02:00
Ondrej Zajicek
7d0a31deed Fixes in generalized import limits. 2012-04-21 21:05:36 +02:00
Ondrej Zajicek
ebecb6f6a1 Implements generalized import hooks.
Thanks to Alexander V. Chernikov for the original patch.
2012-04-15 15:28:29 +02:00
Ondrej Zajicek
00a09f3c36 Implement RA_ACCEPTED mode of route propagation. 2012-04-15 15:07:58 +02:00
Ondrej Zajicek
bf2abe2f51 Merge branch 'soon'
Conflicts:

	nest/proto.c
	nest/rt-table.c
2012-03-30 11:04:12 +02:00
Ondrej Zajicek
fb829de690 Fixes responsiveness for protocol shutdown.
When a protocol went down, all its routes were flushed in one step, that
may block BIRD for too much time. The patch fixes that by limiting
maximum number of routes flushed in one step.
2012-03-28 18:40:04 +02:00
Ondrej Zajicek
c47d037ecb Some minor changes to CLI. 2012-03-22 12:13:26 +01:00
Ondrej Zajicek
af582c4811 Route Origin Authorization basics.
- ROA tables, which are used as a basic part for RPKI.
 - Commands for examining and modifying ROA tables.
 - Filter operators based on ROA tables consistent with RFC 6483.
2012-03-18 17:32:30 +01:00
Ondrej Zajicek
0f808c066f Adds filtering to 'show symbols' command.
Thanks Alexander V. Chernikov for the original patch.
2012-03-16 12:47:12 +01:00
Ondrej Zajicek
0888a737b0 Extends set operations in filters.
Allows add/filter/delete clist on clist (set algebra on clists).

Allows number ~ bgppath match.
2012-03-15 21:07:58 +01:00
Ondrej Zajicek
c0adf7e9fc Better support for multitable protocols.
The nest-protocol interaction is changed to better handle multitable
protocols. Multitable protocols now declare that by 'multitable' field,
which tells nest that a protocol handles things related to proto-rtable
interaction (table locking, announce hook adding, reconfiguration of
filters) itself.

Filters and stats are moved to announce hooks, a protocol could have
different filters and stats to different tables.

The patch is based on one from Alexander V. Chernikov, thanks.
2012-03-15 12:13:04 +01:00
Ondrej Zajicek
39c028e9e9 Assign default protocol preference via proto_config_new().
The patch from Alexander V. Chernikov.
2012-01-24 11:31:00 +01:00
Ondrej Zajicek
09686693d3 Implements handling of BSD iface arrival/departure notifications.
Thanks to Alexander V. Chernikov for original patch.
2012-01-23 03:15:12 +01:00
Ondrej Zajicek
732a0a257d Fixes problems with creating/removing/renaming ifaces on BSD. 2012-01-23 01:26:40 +01:00
Ondrej Zajicek
bc09257117 Fixes another minor bug in iface scan.
Iface flags are not updated in some cases.
2012-01-21 22:56:16 +01:00
Ondrej Zajicek
69a8259c5e Allows sticky link-local neighbors.
Allows using NEF_STICKY neighbors with link-local addresses. This is
used for static route nexthops, they can be specified like fe80::1%eth0
.
2012-01-01 12:14:42 +01:00
Ondrej Zajicek
be4cd99a36 Implements deterministic MED handling.
Thanks to Alexander V. Chernikov for many suggestions.
2011-12-22 13:20:29 +01:00
Ondrej Zajicek
cf7f064531 Fixes problem with sticky neighbors and iface address changes.
Thanks Matthias Schiffer for the bugreport and the original patch.
2011-12-12 00:24:15 +01:00
Ondrej Zajicek
a7f23f581f Implements protocol templates.
Based on the patch from Alexander V. Chernikov.
Extended to support almost all protocols.
Uses 'protocol bgp NAME from TEMPLATE { ... }' syntax.
2011-11-07 00:31:23 +01:00
Ondrej Zajicek
9b7fdfc84a Fixes for include. 2011-10-10 01:41:08 +02:00
Ondrej Zajicek
32f95476a8 Signal problems with route installation to kernel tables. 2011-10-06 22:48:49 +02:00
Ondrej Zajicek
bf6d91dc4e Use undefined scope for undefined IPv6 addresses. 2011-09-24 11:06:42 +02:00
Ondrej Filip
48ec367aab Configuration can include other files. 2011-09-11 21:21:47 +02:00
Ondrej Zajicek
a52d52fa91 Fixes some missing tabs.
They unintentionally disappeared in 1.3.2.
2011-08-15 20:54:58 +02:00
Ondrej Zajicek
42a0c05408 BGP Extended communities. 2011-08-14 13:55:02 +02:00
Ondrej Zajicek
fdf16eb658 Prints full community lists during 'show route all'. 2011-07-03 19:43:30 +02:00
Ondrej Zajicek
6370d6f61b Fix route types in rta_show(). 2011-06-26 22:32:05 +02:00
Ondrej Zajicek
23fd464447 Fixes a bug related to protocol enabling and reconfigure.
When a protocol was enabled interactively (but disabled in the config
file), then reconfigure in some cases forgets to disable it.
2011-06-20 20:35:59 +02:00
Ondrej Zajicek
5e9bdac28e Fixes a bug with setting preference during show route cmd.
If show route cmd was used with a filter that changed preference,
BIRD crashed.
2011-05-21 22:48:08 +02:00
Ondrej Filip
b7c4898106 Compilation was failing without OSPF or RIP protocol - FIXED. 2011-05-05 14:14:20 +02:00
Ondrej Zajicek
a506476acd There may be more IP address records with the same IP. 2011-05-01 18:42:32 +02:00
Ondrej Zajicek
71ca77169d Adds support for several Linux kernel route attributes. 2011-04-13 12:32:27 +02:00
Ondrej Zajicek
489c308a75 Minor fixes. 2011-04-05 11:41:18 +02:00
Ondrej Zajicek
4ef0950603 Fixes a problem with BGP protocols and implicit router IDs. 2011-04-01 13:55:52 +02:00
Ondrej Zajicek
ab16497189 Fixes a nasty bug in OSPF.
Sending malformed network prefixes in LSAs causes OSPF to crash
just after the LSA is propagated to the other routers.
2011-03-29 01:41:46 +02:00
Ondrej Zajicek
52a43ae3b7 Minor changes in addresses.
Mainly changes IA_UNNUMBERED to IA_PEER and adds IA_HOST. Also do not
show broadcast addr in show interfaces. Nobody cares for that.
2011-03-28 22:46:18 +02:00
Ondrej Zajicek
93e868c730 Implements Router Advertisement protocol. 2011-03-13 11:33:50 +01:00
Ondrej Zajicek
9d67ffb0b4 Fixes scope for sticky neighbors. 2011-01-08 19:34:12 +01:00
Ondrej Zajicek
8cab377d92 Remove unnecessary check. 2010-12-22 23:33:40 +01:00
Ondrej Zajicek
7e95c05d88 Core multipath support. 2010-12-07 23:33:55 +01:00
Ondrej Zajicek
01427d3f2b Remove some runaway debug messages and typos. 2010-11-19 18:03:27 +01:00
Ondrej Zajicek
fe181e7c63 Adds support for iface link check to static protocol. 2010-11-11 12:24:27 +01:00
Ondrej Zajicek
f25cb0ef9f Implements link state detection.
Also changes some symbol names (IFF_ADMIN_DOWN -> IFF_SHUTDOWN,
IFF_LINK_UP -> IFF_ADMIN_UP).
2010-11-11 10:03:02 +01:00
Ondrej Zajicek
fcf5a4f4b3 Change default for BGP IPv6 socket to V6ONLY.
Also add a new option 'dual' for the old behavior.
2010-11-03 10:02:24 +01:00
Ondrej Zajicek
4ca93a5067 Fixes a one byte buffer overflow. 2010-09-08 12:08:38 +02:00
Ondrej Zajicek
2c9033afd5 Do not allow interdependent recursive routes. 2010-08-03 08:26:47 +02:00
Ondrej Zajicek
ba5e5940aa Adds igp_metric attribute. 2010-08-02 13:11:53 +02:00
Ondrej Zajicek
d1e146f2f8 Implements IGP metric comparison for BGP routes. 2010-07-31 01:04:32 +02:00
Ondrej Zajicek
1b180121a9 Use link-local addresses in recursive next hops for IPv6 BGP. 2010-07-28 11:45:35 +02:00
Ondrej Zajicek
c477f48916 Hostcache should use trie to filter relevant route changes. 2010-07-27 18:20:12 +02:00
Ondrej Zajicek
f2b76f2c45 For hostentry cache, replace FIB with a hash table using (IP, dep table) as a key. 2010-07-26 16:39:27 +02:00
Ondrej Zajicek
852b7062e3 Fixes a buffer overflow in TX code of IPv6 BGP. 2010-07-22 15:09:35 +02:00
Ondrej Zajicek
cfe34a316e Implements hostcache and recursive next hops.
Hostcache is a structure for monitoring changes in a routing table that
is used for routes with dynamic/recursive next hops. This is needed for
proper iBGP next hop handling.
2010-07-05 17:50:19 +02:00
Ondrej Zajicek
acb60628f5 Implements command that shows memory usage. 2010-06-02 22:20:40 +02:00
Ondrej Zajicek
0267f49fb2 Do not add community if it is already in clist. 2010-05-14 15:24:53 +02:00
Ondrej Zajicek
ba32170657 Better support for /31 networks. 2010-04-28 00:39:57 +02:00
Ondrej Filip
ba13017254 Avoid warning if not compiled with pipes. 2010-04-27 11:27:54 +02:00
Ondrej Zajicek
b8113a5e92 Implements BGP 'show protocols' info details. 2010-04-07 00:19:23 +02:00
Ondrej Zajicek
c429d4a4ba Restrict export of device routes to the kernel protocol.
In usual configuration, such export is already restricted
with the aid of the direct protocol but there are some
races that can circumvent it. This makes it harder to
break kernel device routes. Also adds an option to
disable this restriction.
2010-04-04 15:41:31 +02:00
Ondrej Zajicek
eb0f129fce Merge branch 'socket2' into new 2010-03-26 18:53:31 +01:00
Ondrej Zajicek
4d9a0d1f02 Update lastmod in 'ignored' case only for RIP routes. 2010-03-24 10:42:25 +01:00
Ondrej Zajicek
5d53b80770 Allow iface pattern matching code to match peer address on ptp links. 2010-03-19 18:46:56 +01:00
Ondrej Zajicek
1528d30aeb Fixes unterminated string for atomic_aggr attribute formatting. 2010-03-17 23:17:55 +01:00
Ondrej Zajicek
0aad2b9292 Temporary OSPF commit - sockets. 2010-03-14 16:36:59 +01:00
Ondrej Zajicek
54305181f6 Merge branch 'new' into socket2 2010-03-11 18:55:59 +01:00
Ondrej Zajicek
e7b76b9760 Temoporary OSPF commit - socket changes. 2010-03-11 18:07:24 +01:00
Ondrej Zajicek
53434e44a9 Better flushing of interfaces.
When device protocol goes down, interfaces should be flushed
asynchronously (in the same way like routes from protocols are flushed),
when protocol goes to DOWN/HUNGRY.

This fixes the problem with static routes staying in kernel routing
table after BIRD shutdown.
2010-02-27 16:00:07 +01:00
Ondrej Zajicek
212ff33582 Fixes signedness in format route attributes. 2010-02-26 13:55:22 +01:00
Ondrej Zajicek
ff2857b03d Many changes in (mainly) kernel syncers.
- BSD kernel syncer is now self-conscious and can learn alien routes
- important bugfix in BSD kernel syncer (crash after protocol restart)
- many minor changes and bugfixes in kernel syncers and neighbor cache
- direct protocol does not generate host and link local routes
- min_scope check is removed, all routes have SCOPE_UNIVERSE by default
- also fixes some remaining compiler warnings
2010-02-26 10:55:58 +01:00
Ondrej Zajicek
e81b440f68 Fix configure to enable warnings and fix most of them. 2010-02-21 14:34:53 +01:00
Ondrej Zajicek
e0a45fb421 Restricted read-only CLI.
Also adds support for executing commands using birdc <cmd>.
2010-02-21 09:57:26 +01:00
Ondrej Zajicek
e304fd4bcf Implements pattern match for 'show protocols' command.
And generally consolidates protocol commands.
2010-02-20 00:08:07 +01:00
Ondrej Zajicek
dca75fd7c2 Removes phantom protocol from the pipe design.
It seems that by adding one pipe-specific exception to route
announcement code and by adding one argument to rt_notify() callback i
could completely eliminate the need for the phantom protocol instance
and therefore make the code more straightforward. It will also fix some
minor bugs (like ignoring debug flag changes from the command line).
2010-02-13 12:26:26 +01:00
Ondrej Zajicek
9db74169be Fixes protocol statistics for pipes. 2010-02-13 10:44:46 +01:00
Ondrej Zajicek
c83876265e Fixes a tricky bug in the pipe protocol.
When uncofiguring the pipe and the peer table, the peer table was
unlocked when pipe protocol state changed to down/flushing and not to
down/hungry. This leads to the removal of the peer table before
the routes from the pipe were flushed.

The fix leads to adding some pipe-specific hacks to the nest,
but this seems inevitable.
2010-02-11 22:27:06 +01:00
Ondrej Zajicek
353729f513 Temporary OSPF commit - socket changes. 2010-02-11 10:23:35 +01:00
Ondrej Zajicek
c27b2449d1 Shows source (Router ID) for OSPF routes and adds such attribute.
A sad thing is that we does not have a 'router_id' filter type,
so it must be given as decimal number in filters.
2010-02-08 16:01:03 +01:00
Ondrej Zajicek
5a56f27cd0 Adds asterisk to the primary route in 'show route' cmd.
And also fixes a minor bug.
2010-02-08 12:42:09 +01:00
Ondrej Zajicek
76b53a4e20 Adds some log messages related to configure.
Also fixes a bug in the previous patch.
2010-02-06 22:57:51 +01:00
Ondrej Zajicek
ebae4770c9 Modifies configure to just reload protocols when filters change.
Before this change, protocols were restarted in that case.
2010-02-06 19:19:09 +01:00
Ondrej Zajicek
c37e78510f Makes date/time formats configurable. 2010-02-03 00:19:24 +01:00
Ondrej Zajicek
0c75411bec NEWS, version and documentation update. 2010-01-06 16:57:20 +01:00
Ondrej Zajicek
cf31112f0d Implements MRTdump feature. 2010-01-03 12:17:52 +01:00
Ondrej Zajicek
43c1ceccb9 Remove bgp_as4_support variable. 2009-12-14 23:31:25 +01:00
Ondrej Zajicek
63542845df Merge branch 'dev' into ospf3
Conflicts:

	proto/ospf/lsreq.c
	proto/ospf/lsupd.c
	proto/ospf/rt.c
2009-12-14 20:37:32 +01:00
Ondrej Zajicek
8a7fb8858f Finishes 'route reload' feature. 2009-12-14 01:32:37 +01:00
Ondrej Zajicek
a421ec33cb Fixes silly bug. 2009-12-02 22:22:40 +01:00
Ondrej Zajicek
11361a1015 Implements route re-feed.
This can be used to re-feed routes to protocol after soft change in
export filters.
2009-12-02 22:19:47 +01:00
Ondrej Zajicek
11787b8473 Fixes some problems in pipes.
For transparent pipes, loop detection works correctly now.
Pipes are now more symmetric - in both directions filtering
is done in do_rte_announce().
2009-12-02 17:26:16 +01:00
Ondrej Zajicek
e8b29bdc8d Fixes one missing log message. 2009-12-02 14:33:34 +01:00
Ondrej Zajicek
bf47fe4b2e Implements BGP route refresh. 2009-11-26 20:47:59 +01:00
Ondrej Zajicek
069bfcb53c Fixes serious bug in core related to route filtering.
If protocol announces a route, route is accepted by import filter to
routing table, and later it announces replacement of that route that is
rejected by import filter, old route remains in routing table.
2009-11-24 17:15:20 +01:00
Ondrej Zajicek
3f9b7bfe9f Implements option that controls IPv6 BGP next hops when lladdr is missing. 2009-11-18 20:32:36 +01:00
Ondrej Zajicek
e04555c045 Implement description field of protocol. 2009-11-17 15:45:05 +01:00
Ondrej Zajicek
3f22fa9e74 Merge branch 'dev' into ospf3 2009-11-09 22:54:39 +01:00
Ondrej Zajicek
4cdd078453 Implements protocol-specific router id and updates documentation. 2009-10-12 23:31:42 +02:00
Ondrej Zajicek
52b9b2a178 Rename as_path_get_last/as_path_get_first to be consistent. 2009-10-12 20:44:58 +02:00
Ondrej Zajicek
d82fc18d75 Implement proper LSA ID generation. 2009-10-07 21:10:29 +01:00
Ondrej Zajicek
46eb80d5d5 Fixes headers for uintptr_t (and build on NetBSD). 2009-09-17 17:52:36 +02:00
Ondrej Zajicek
f4c6ca8c9c Fixes preference bounds. 2009-09-17 13:35:37 +02:00
Ondrej Zajicek
be86240662 Temporary OSPFv3 development commit.
Finally, it is working.
2009-09-08 13:45:02 +02:00
Ondrej Zajicek
d2ceaf4ec8 Temporary OSPFv3 development commit 2009-08-28 13:45:43 +02:00
Ondrej Zajicek
05198c12f4 Some cleanups. 2009-08-27 19:01:04 +02:00
Ondrej Zajicek
061ab802a6 Temporary OSPFv3 development commit 2009-08-27 18:25:46 +02:00
Ondrej Zajicek
949bd34e81 Fixes bug related to AS2->AS4 conversion. 2009-08-25 19:01:37 +02:00
Ondrej Zajicek
b49e6f5a65 Temporary OSPFv3 development commit 2009-08-25 16:42:14 +02:00
Ondrej Zajicek
2ef58837dc Merge commit 'origin/master' into dev 2009-08-21 09:46:49 +02:00
Ondrej Zajicek
fee78355b4 Fixes bug in eattr binary search. 2009-08-21 09:31:35 +02:00
Ondrej Zajicek
c3226991a0 Temporary OSPFv3 development commit 2009-08-21 09:27:52 +02:00
Ondrej Filip
87d7fd9725 Bugfix - each protocol can be compiled separately. 2009-08-16 22:36:41 +02:00
Ondrej Zajicek
c0973621bc Fixes another bug in rte_recalculate().
Previous bugfix revealed another hidden bug here.
2009-08-11 15:49:56 +02:00
Ondrej Zajicek
ac07aacd2c Replace assert with log.
Although it is true unless there is a bug in BIRD,  this assert is not
needed (code below does not require that assumption), so we should not
crash.
2009-08-11 11:03:37 +02:00
Ondrej Zajicek
024e633c16 Fixes bug that caused losing of some routes.
When update changes preferred route in such a way that
it ceased to be preferred, the new route was linked
to wrong place and lost.
2009-08-11 10:54:50 +02:00
Ondrej Zajicek
2f6483cd31 Adds %R printf directive for Router ID. 2009-07-23 16:06:25 +02:00
Ondrej Zajicek
6baef17ecf Fixes bug in CLI TX buffer management. 2009-07-14 14:18:54 +02:00
Ondrej Zajicek
d72cdff411 Replace 'bind' option with 'listen' option.
To be consistent with other daemons.
2009-06-23 11:08:30 +02:00
Ondrej Zajicek
bf1aec970e Adds support for soft reconfiguration. 2009-06-19 23:49:34 +02:00
Ondrej Zajicek
789772ed45 Implements option that changes BGP listening socket parametres. 2009-06-18 19:20:07 +02:00
Ondrej Zajicek
925fe2d3de Implements route statistics and fixes some minor bugs. 2009-06-04 01:22:56 +02:00
Ondrej Zajicek
c07c65d6d0 Escaped debbuging message removed. 2009-06-01 23:18:45 +02:00
Ondrej Zajicek
92a72a4cbd Adds support for dynamic pair and bgp mask expressions. 2009-06-01 19:32:41 +02:00
Ondrej Zajicek
f98e291579 The pipe cleanup. 2009-06-01 14:07:13 +02:00
Ondrej Zajicek
23ac9e9a9e Changes pipes to transfer all routes between routing table, not just optimal routes. 2009-05-31 15:24:27 +02:00
Ondrej Zajicek
874b868544 Implements primary address selection base on 'primary' option. 2009-05-29 22:49:30 +02:00
Ondrej Zajicek
ea2ae6dd0a Change import/preimport to export/preexport to be consistent with filters. 2009-05-22 17:12:15 +02:00
Ondrej Zajicek
d72a0ac239 Fixes serious bug in route attribute handing.
ea_same() sometimes returns true for different route attributes,
which caused that hash table in BGP does not work correctly and
some routes were sent with different attributes.
2009-05-22 15:16:53 +02:00
Ondrej Zajicek
6c84554b67 Merge branch 'master' into dev 2009-05-21 09:26:59 +02:00
Ondrej Filip
4d176e1450 'show route protocol <p>' added to CLI. 2009-05-11 02:01:11 +02:00
Ondrej Filip
dd8d2acd3c Fixed bug in cli help. 2009-05-10 19:23:05 +02:00
Ondrej Zajicek
20e94fb85b A change in OSPF and RIP interface patterns.
Allows to add more interface patterns to one common 'options'
section like:

interface "eth3", "eth4" { options common to eth3 and eth4 };

Also removes undocumented and unnecessary ability to specify
more interface patterns with different 'options' sections:

interface "eth3" { options ... }, "eth4" { options ... };
2009-05-06 22:02:45 +02:00
Ondrej Zajicek
c8a6b9a3d1 Rewrite of buggy AS path matching.
Old AS path maching supposes thath AS number appears
only once in AS path, but that is not true. It also
contains some bugs related to AS path sets.

New code does not use any assumptions about semantic
structure of AS path. It is asymptotically slower than
the old code, but on real paths it is not significant.

It also allows '?' for matching one arbitrary AS number.
2009-04-17 01:48:36 +02:00
Ondrej Zajicek
024c310b53 Fixes broken cryptographic authentication in OSPF
Cryptographic authentication in OSPF is defective by
design - there might be several packets independently
sent to the network (for example HELLO, LSUPD and LSACK)
where they might be reordered and that causes crypt.
sequence number error.

That can be workarounded by not incresing sequence number
too often. Now we update it only when last packet was sent
before at least one second. This can constitute a risk of
replay attacks, but RFC supposes something similar (like time
in seconds used as CSN).
2009-04-08 20:15:01 +02:00
Ondrej Zajicek
40b65f947a Fixes bug in pipe route filtering.
Routes comming through pipe from primary to secondary table were
filtered by both EXPORT and IMPORT filters, but they should be
only filtered by EXPORT filters.
2009-03-25 19:05:52 +01:00
Ondrej Zajicek
48d79d521c Better handling of AS4 optional attribute errors
AS4 optional attribute errors were handled by session
drop (according to BGP RFC). This patch implements
error handling according to new BGP AS4 draft (*)
 - ignoring invalid AS4 optional attributes.

(*) http://www.ietf.org/internet-drafts/draft-chen-rfc4893bis-02.txt
2009-03-18 20:30:21 +01:00
Ondrej Zajicek
25cb9f1d01 Fix bug in empty bgp mask handling 2009-02-21 16:20:45 +01:00
Ondrej Zajicek
b807ef9a15 Fixes bug in protocol state machine
Scheduling flush must be done before resource pool freeing as it
frees some allocated list nodes from a global list.
2009-02-12 13:43:06 +01:00
Ondrej Zajicek
d6a836f8d6 Fixes core state machine.
The core state machine was broken - it didn't free resources
in START -> DOWN transition and might freed resources after
UP -> STOP transition before protocol turned down. It leads
to deadlock on olock acquisition when lock was not freed
during previous stop.

The current behavior is that resources, allocated during
DOWN -> * transition, are freed in * -> DOWN transition,
and flushing (scheduled in UP -> *) just counteract
feeding (scheduled in * -> UP). Protocol fell down
when both flushing is done (if needed) and protocol
reports DOWN.

BTW, is thera a reason why neighbour cache item acquired
by protocol is not tracked by resource mechanism?
2008-12-08 12:24:55 +01:00
Ondrej Zajicek
fbde6c3908 Fixes race condition leading to memory corruption and crash.
When protocol started, feeding was scheduled. If protocol
got down before feeding was executed, then function
responsible for connecting protocol to kernel routing
tables was called after the function responsible for
disconnecting, then resource pool of protocol was freed,
but freed linked list structures remains in the list.
2008-11-22 01:12:22 +01:00
Ondrej Zajicek
ebacaf6f7b Fix bug in AS path matching 2008-11-16 11:35:30 +01:00
Ondrej Zajicek
258d0ad4ca Fixes feeding of new protocol, only preferred routes are announced. 2008-11-14 23:03:15 +01:00
Ondrej Zajicek
aebe06b40c Proper format functions for ORIGINATOR_ID, CLUSTER_LIST 2008-11-08 23:33:22 +01:00
Ondrej Zajicek
b21f68b4cd Fix bugs in OSPF MD5 authentication. First bug is that default
values for MD5 password ID changed during reconfigure, Second
bug is that BIRD chooses password in first-fit manner, but RFC
says that it should use the one with the latest generate-from.

It also modifies the syntax for multiple passwords.
Now it is possible to just add more 'password' statements
to the interface section and it is not needed to use
'passwords' section. Old syntax can be used too.
2008-11-08 17:24:23 +01:00
Ondrej Zajicek
fd91ae3325 Fix problem with local time changes. 2008-11-05 22:36:49 +01:00
Ondrej Zajicek
b6bf284a90 Bugfixes in MULIT_EXIT_DISC attribute handling.
- Old MED handling was completely different from behavior
   specified in RFCs - for example they havn't been propagated
   to neighboring areas.

 - Update tie-breaking according to RFC 4271.

 - Change default value for 'default bgp_med' configuration
   option according to RFC 4271.
2008-10-26 22:59:21 +01:00
Ondrej Zajicek
4847a894bf Implementation of route reflection for BGP 2008-10-26 22:45:09 +01:00
Ondrej Zajicek
11cb620266 Implementation of 4B ASN support for BGP 2008-10-26 22:36:08 +01:00
Ondrej Filip
030d3b387e Small changed to reduce the number of warnings. 2005-02-14 11:58:46 +00:00
Ondrej Filip
bc956fcab6 MD5 authentication in OSPF works. :-) 2004-07-13 14:46:14 +00:00
Ondrej Filip
32d3228d86 Bugfix in simple authentification. 2004-07-13 13:52:54 +00:00
Ondrej Filip
02ad2737fd Password WALK_LIST bugfix. 2004-07-01 15:01:26 +00:00
Ondrej Filip
5236fb03af Password management redesigned (untested). 2004-06-26 20:11:14 +00:00
Ondrej Filip
98ac61766d A lot of changes:
- metric is 3 byte long now
	- summary lsa originating
	- more OSPF areas possible
	- virtual links
	- better E1/E2 routes handling
	- some bug fixes..

I have to do:
	- md5 auth (last mandatory item from rfc2328)
	- !!!!DEBUG!!!!! (mainly virtual link system has probably a lot of bugs)
	- 2328 appendig E
2004-06-25 16:39:53 +00:00
Ondrej Filip
8bf684eca2 RTS_OSPF_BONDARY is nonsense, RTS_OSPF_IA must have smaller id than RTS_OSPF_EXT 2004-06-11 09:05:06 +00:00
Ondrej Filip
c90ac711bc Cleanup in show route import <p>. 2004-06-07 10:42:24 +00:00
Martin Mares
7c103b1ee1 Marked unused parameters in core code as such. 2004-06-05 09:10:56 +00:00
Martin Mares
277a34eff1 Small correction to va_start/va_end in cli_printf (va_end was missing).
(Andreas)
2004-05-31 18:08:50 +00:00
Ondrej Filip
10af3676ea Grrr, committing too fast.
#include "alloca.h" -> #include "lib/alloca.h"
2004-05-31 17:16:47 +00:00
Ondrej Filip
0e6eef620d Use #include "alloca.h" 2004-05-31 17:07:05 +00:00
Ondrej Filip
a60277b999 Added RTD_NONE /* Just for internal use */ 2004-05-31 13:35:06 +00:00
Ondrej Filip
0c745adc80 #ifdef ALLOCA_H 2004-05-31 13:34:20 +00:00
Martin Mares
13b75bacf7 protocol->import_control() could potentially call rte_cow() as well.
AFAIK it doesn't happen in any of our protocol, but better be sure.
2003-08-13 20:04:39 +00:00
Martin Mares
2adab6ae9c This was a potential memory leak, but not the one Feela observed.
This one could happen when an import filter of some protocol modified
the rte (so that it would be rte_cow()ed) and later rejected it.
2003-08-13 19:31:22 +00:00
Martin Mares
7b7a7b43a6 There can be multiple primary addresses with different scopes
and only the highest scope one has IA_PRIMARY set, so report
the remaining ones as "Unselected".
2003-02-22 22:39:06 +00:00
Martin Mares
7d875e094b Added missing includes. 2002-11-13 08:47:06 +00:00
Martin Mares
de10a974f2 Added missing semicolons. 2002-11-13 08:46:12 +00:00
Martin Mares
e43ae6330e Fix %<something>I format strings. 2001-08-19 11:15:24 +00:00
Martin Mares
8c6ce98b9d Fixed infinite recursion in password_same.
Pavel, please check.
2001-01-08 11:13:01 +00:00
Ondrej Filip
a5096a1bde Yet another nasty bugfix of iface_patts_equal(). 2000-11-08 22:46:54 +00:00
Ondrej Filip
0639f7263a Bugfix in iface_patts_equal.
When both patterns were NULL strcmp it sigfaulted.
2000-11-08 17:06:35 +00:00
Pavel Machek
ad3907559c RIP bugfix 2000-06-21 19:40:46 +00:00
Martin Mares
725270cb1d Fixes for the programmer's manual. 2000-06-08 12:37:21 +00:00
Martin Mares
49569a8b53 Oops! Configuration compiles now. 2000-06-08 10:48:35 +00:00
Pavel Machek
ca77641d07 Use switch' for disabled'. 2000-06-08 10:25:56 +00:00
Martin Mares
ec423cc725 Updated CLI helps. 2000-06-08 10:25:02 +00:00
Martin Mares
58f7d004fd Fixes to the progdoc. 2000-06-07 13:25:53 +00:00
Martin Mares
2e9b24211a Spelling fixes to progdoc. 2000-06-07 12:29:08 +00:00
Ondrej Filip
41ad16e2d5 Added IP protocols. 2000-06-06 11:50:48 +00:00
Martin Mares
5c18880e35 Avoid sentence containing a colon to start new doc subsection. 2000-06-05 21:26:11 +00:00
Martin Mares
525fa2c1f0 Documented sockets, events and timers. 2000-06-05 12:19:12 +00:00
Martin Mares
9238b06a2c Spelling. 2000-06-05 10:01:09 +00:00
Martin Mares
42b3daa09c Description of protocol module moved to where it belongs. If documentation
of standard modules is stored in their source, such auxilliary files
should be as well.
2000-06-05 09:51:24 +00:00
Martin Mares
47f8e0c216 Document. 2000-06-04 16:16:08 +00:00
Martin Mares
cdb898cfd4 Minor changes to the progdocs. 2000-06-03 18:23:27 +00:00
Martin Mares
3d675cdbe7 More documentation. 2000-06-03 14:40:39 +00:00
Martin Mares
ddbcb927f2 Documented protocol hooks. 2000-06-02 17:24:11 +00:00
Martin Mares
3c6269b8fe Added documentation on protocols.
Protocol hooks deserve an extra chapter (to come soon).
2000-06-02 13:42:36 +00:00
Martin Mares
9a8f20fc0f Better description of the route distribution process. 2000-06-02 12:41:25 +00:00
Martin Mares
3ce8c61000 Documentation on routing tables and route attributes. 2000-06-02 12:29:55 +00:00
Martin Mares
566a0eede7 Removed rta_find() since nobody uses it and it's more convenient
to use ea_find() directly.
2000-06-02 12:29:24 +00:00
Martin Mares
58740ed4c5 Documentation. 2000-06-01 17:12:19 +00:00
Martin Mares
cf318e3cd3 Removed comments about workings of the old neighbor cache which are
(1) obsolete and (2) replaced by the progdoc.
2000-06-01 16:17:29 +00:00
Martin Mares
1f495723c3 Documented. 2000-06-01 16:16:49 +00:00
Martin Mares
ce4aca093a FIB documentation.
I've changed the init callback type to a typedef to work around a bug
in kernel-doc I'm too lazy to hunt now.
2000-06-01 16:16:18 +00:00
Martin Mares
a9aa4c1ebb Inactive sticky neighbors have no scope. 2000-06-01 13:13:49 +00:00
Martin Mares
0f32f2a65a Modified the neighbor cache to remember local addresses as well.
neighbor->scope now contains proper address scope which is zero (SCOPE_HOST)
for local addresses, higher (SCOPE_LINK, ..., SCOPE_UNIVERSE) for remote ones.
2000-06-01 12:58:04 +00:00
Martin Mares
5919c66e8f Route attributes for OSPF. 2000-05-30 21:25:32 +00:00
Martin Mares
2f71123158 Killed bug in merging of dynamic attributes. 2000-05-30 21:24:15 +00:00
Martin Mares
caab3bb374 Better formatting of protocol status. 2000-05-30 21:23:49 +00:00
Pavel Machek
26c09e1d25 Added read-only access to all required fields in rta. 2000-05-30 10:42:39 +00:00
Ondrej Filip
73232f6b18 Better rt dumping. 2000-05-30 10:36:57 +00:00
Martin Mares
4761efdb43 Tracing of CLI connections/commands can be now controlled
by `debug commands <level>' in the configuration. Level 0 means
no tracing, 1 means connections only, 2 includes all commands.
2000-05-29 22:10:18 +00:00
Ondrej Filip
cdc25e8db7 To find out a type of route (external, inter/intra area) 2000-05-28 19:07:39 +00:00
Martin Mares
2eca3b3a9c Routing table garbage collector gets really called. 2000-05-19 19:49:33 +00:00
Martin Mares
0ba8a6147d Fixed a very nasty bug in FIB iterators. 2000-05-19 19:40:12 +00:00
Martin Mares
3ced9b349d Fixed freeing of non-embedded extended attributes. 2000-05-19 18:05:01 +00:00
Martin Mares
075898dea7 No more problems when protocols gets disabled during feeding. 2000-05-19 18:03:53 +00:00
Martin Mares
f49528a3df Added as_path_get_first(). 2000-05-19 11:01:06 +00:00
Martin Mares
76dfda9e74 Fixed a buglet in asynchronous feeding and increased maximum number
of routes allowed per feeding phase.
2000-05-19 10:59:47 +00:00
Martin Mares
ac5d801217 Asynchronous feeding of protocols. 2000-05-19 10:46:26 +00:00
Martin Mares
e79671a72c Fixed incorrect error message about router ID syntax. 2000-05-16 15:08:43 +00:00
Pavel Machek
d6796e7b54 Don't segfault when someone adds passwords. 2000-05-16 15:02:27 +00:00
Pavel Machek
2f2663bdb7 Password same now actually works 2000-05-16 15:00:15 +00:00
Martin Mares
df9f0fb30a Don't log state changes if nothing user-visible has changed. 2000-05-16 13:43:26 +00:00
Martin Mares
e3f2d5fce3 Cleanup of configuration.
o  Use `expr' instead of `NUM' and `ipa' instead of `IPA',
   so that defined symbols work everywhere.
o  `define' now accepts both numbers and IP addresses.
o  Renamed `ipa' in filters to `fipa'.

Pavel, please update filters to accept define'd symbols as well.
2000-05-15 11:48:23 +00:00
Martin Mares
9449c91ab2 Added `show route for <prefix-or-ipa>' which looks up route leading to
given network.
2000-05-13 11:42:42 +00:00
Martin Mares
56d6c530eb Added fib_route() which does (although very slow) lookup of longest-match
routing in a FIB.
2000-05-13 11:42:06 +00:00
Martin Mares
758458be05 Unified parsing of prefixes.
Had to rename `prefix' in filters to `fprefix'.
2000-05-13 11:17:49 +00:00
Martin Mares
08f0290a1e Changed semantics of the rt_update hook. The attribute list we pass now
contains all attributes, not just the temporary ones. This avoids having
to merge the lists inside protocols or doing searches on both of them.

Also, do filtering of routes properly. (I'd like to avoid it, but it's
needed at least in the krt protocol.)
2000-05-13 11:00:37 +00:00
Pavel Machek
ec21aecfdd Fixed nasty segfault in rip. 2000-05-11 10:33:18 +00:00
Pavel Machek
45a48e2de2 password_same utility function 2000-05-10 13:42:46 +00:00
Pavel Machek
c0100454cf Added more convient interface for ea_find.
What is special about int default;? Compiler chokes on that!
2000-05-10 06:54:40 +00:00
Martin Mares
0521e4f684 rt_prune: Don't kill routes from protocols in FS_FEEDING state. If debugging,
call fib_check() on the table's fib.
2000-05-08 22:33:02 +00:00
Martin Mares
8abbde02d4 Several simplifications of the fib iterators. 2000-05-08 19:11:49 +00:00
Martin Mares
33a368ad59 Implemented show route count' which is show route stats' with
exception that it doesn't print the routes themselves.
2000-05-08 14:58:00 +00:00
Martin Mares
e48dae3ed7 Stop feeding the protocol if it suddenly shuts down. 2000-05-08 14:51:26 +00:00
Martin Mares
5d86aefb6c Really free attributes. 2000-05-08 13:12:14 +00:00
Martin Mares
d0126f0bf0 bugs_in_attr_cache_hashing--; 2000-05-08 11:40:30 +00:00
Martin Mares
916c8c0aba Use preferences properly. 2000-05-08 10:40:00 +00:00
Martin Mares
0117d00494 Fixed `show route primary'. 2000-05-08 10:37:45 +00:00
Martin Mares
18c031fae8 Debugged printing and pruning of neighbor cache entries. 2000-05-08 10:13:59 +00:00
Martin Mares
0d3070824d Don't count networks with no routes (they are not displayed at all and
will be removed during the next garbage collection pass).
2000-05-07 11:32:34 +00:00
Martin Mares
23693958aa Implemented `show route <...> stats'. 2000-05-07 11:28:59 +00:00
Martin Mares
6998bb9ee3 Squashed one bug in fib_rehash(). No more routes disappearing as if struct
by a lightning :)
2000-05-07 11:28:34 +00:00
Martin Mares
891cec854f Killed one more reference to RTS_RIP_EXT. 2000-05-07 11:27:23 +00:00
Martin Mares
ce1da96ee7 Added commands show route protocol <p>' and show route import <p>' which
show the routing table as exported to the protocol given resp. as returned
from its import control hook.

To get handling of filtered extended attributes right (even in the old
`show route where <filter>' command), the get_route_info hook gets an
attribute list and all protocol specific rte attributes are contained
there as temporary ones. Updated RIP to do that.

Added ea_append() which joins two ea_list's.
2000-05-06 22:57:39 +00:00
Martin Mares
498c33395f Cosmetic fixes. 2000-05-06 21:42:19 +00:00
Martin Mares
0b7610985c Fixed silly bug in previous commit. 2000-05-06 21:31:41 +00:00
Martin Mares
67be5b23cd When rte_update is called for an identical route, don't announce anything.
Please implement the rte_same hook in your protocols. It should just
compare your metrics stored directly in rte, the rest is done by the core.
2000-05-06 21:21:19 +00:00
Martin Mares
ab1129c1bd Added skeleton Doc files for the whole developer's documentation. 2000-05-05 17:17:42 +00:00
Martin Mares
beaf86e13c Removed RTS_RIP_EXT. 2000-05-04 21:23:10 +00:00
Martin Mares
9a220cabbc #ifdef out lots of debugging information.
The long resource/routing table dump printed upon startup is gone now
and if you wish to see it, just send bird SIGUSR1 or use the `debug'
commands.
2000-05-04 20:52:28 +00:00
Martin Mares
93a786cb03 Removed a lot of unused variables.
Please try compiling your code with --enable-warnings to see them. (The
unused parameter warnings are usually bogus, the unused variable ones
are very useful, but gcc is unable to control them separately.)
2000-05-04 20:30:36 +00:00
Martin Mares
1d9622e10d Switched off LOCAL_DEBUG. 2000-05-04 09:08:28 +00:00
Martin Mares
85a291ff30 IPv6 address classification fixes. 2000-05-02 15:21:51 +00:00
Martin Mares
2edb31b097 Split CF_HDR section to CF_HDR (only includes) and CF_DEFINES (defines,
C declarations etc.).
2000-04-28 15:11:10 +00:00
Martin Mares
f75e3bbc01 Fixed a couple of nasty CLI bugs which were triggered on long or multi-part
outputs. It took a whole evening to hunt them down, but now the CLI seems
to work fine.

Now I run three BGP connections with several thousand routes!
2000-04-27 22:35:08 +00:00
Martin Mares
8f6accb5bb Event handlers no longer return re-queue flag. Instead of using it, just
call ev_schedule() on the same handler which should work perfectly now.
2000-04-27 22:28:49 +00:00
Martin Mares
987de54578 Fixed stupid bug in as_path_format(). 2000-04-27 19:44:27 +00:00
Martin Mares
dbf3939a53 Better formatting of router ID's. 2000-04-26 12:32:07 +00:00
Martin Mares
ebd3720f83 Fixed several bugs in protocol state machine. Reconfigurations and
restarts of BGP seem to work now.
2000-04-26 12:30:41 +00:00
Pavel Machek
9834765946 Whitespace changes. 2000-04-26 09:37:07 +00:00
Martin Mares
41b26cfb55 Don't forget to set filter pointers in struct proto when reconfiguring. 2000-04-25 21:56:46 +00:00
Martin Mares
56a2bed46b Don't import/export MED and LOCAL_PREF on external links.
Added real comparison of BGP routes (inspired by the Cisco one).
Default local preference and default MED are now settable.
Defined filter keywords for all BGP attributes we know.
2000-04-17 12:46:07 +00:00
Martin Mares
700bbe60fb The previous fix for spacing was (a) totally out of context, (b) wrong.
Please *read* the code when trying to change it.

Also killed a couple of type clashes.
2000-04-17 11:49:41 +00:00
Pavel Machek
5a2455886d Put space between entries so they are separated.
FIXME: should use format as in filters.
2000-04-17 11:42:34 +00:00
Pavel Machek
9c400ec9dd Int sets moved to core. It is now possible to have variable of type clist. 2000-04-17 11:34:38 +00:00
Martin Mares
51a183af78 Define EAF_ORIGINATED and propagate it properly when merging attribute lists. 2000-04-17 11:23:05 +00:00
Martin Mares
4b03f64b34 Aesthetical tweaks (asterisk spells `asterisk' etc.) 2000-04-17 11:22:24 +00:00
Pavel Machek
2a40efa5e6 as_path_match moved to a-path.c 2000-04-17 11:11:33 +00:00
Pavel Machek
684c6f5a0e Path_getlen moved to nest and length was made callable from filters. 2000-04-17 11:06:39 +00:00
Martin Mares
c6add07fa6 Printing of AS paths and community sets. 2000-04-17 10:18:55 +00:00
Martin Mares
c0668f3696 Created nest/a-path.c and a-set.c which should contain general operations
on AS paths and community sets.

Moved as_path_prepend() there.

Pavel, please move the other functions as well.
2000-04-17 07:53:29 +00:00
Martin Mares
b475c543b4 Fix comments. 2000-04-10 22:08:32 +00:00
Pavel Machek
73e03bce66 As usuall, most important info was missing. 2000-04-10 14:45:00 +00:00
Martin Mares
6f57dcc07c Export ea_same() and ea_hash(). 2000-04-10 12:39:29 +00:00
Martin Mares
287111fed1 Fix stupid bug in neighbor cache. 2000-04-10 10:40:00 +00:00
Martin Mares
d3feceff10 BGP doesn't need any inline attributes. 2000-04-09 22:04:12 +00:00
Martin Mares
3991d84e8f Changed initialization of protocol list -- now we call proto_build() instead
of calling the protocols manually.

Implemented printing of dynamic attributes in `show route all'.

Each protocol can now register its own attribute class (protocol->attr_class,
set to EAP_xxx) and also a callback for naming and formatting of attributes.
The callback can return one of the following results:

	GA_UNKNOWN	Attribute not recognized.
	GA_NAME		Attribute name recognized and put to the buffer,
			generic code should format the value.
	GA_FULL		Both attribute name and value put to the buffer.

Please update protocols generating dynamic attributes to provide
the attr_class and formatting hook.
2000-04-01 10:19:47 +00:00
Martin Mares
f880924990 BGP now handles incoming routes (IPv4 only). 2000-04-01 09:17:33 +00:00
Martin Mares
8581061399 When tracing, always print incoming part of the trace before the outgoing one.
Avoid buffer overflows in `show routes' command.
2000-04-01 09:16:42 +00:00
Martin Mares
ac4b4683ae Removal of useless includes continues... 2000-03-31 23:40:00 +00:00
Martin Mares
221135d6bf Include "lib/string.h" instead of <string.h>. It should give us bzero()
and other non-portable functions on all systems.
2000-03-31 23:30:21 +00:00
Martin Mares
08732b7178 Fixed bug in processing of dynamic attributes. 2000-03-31 23:21:19 +00:00
Martin Mares
3a6337ecb2 Use FF_FORCE_TMPATTR where appropriate. 2000-03-30 08:50:46 +00:00
Pavel Machek
0a06a9b8b3 f_run gets one more parameter to distinguish between in and out modes. 2000-03-29 09:02:00 +00:00
Martin Mares
200accf396 if_connected() is again private.
Introduced neigh_connected_to() to serve the same purpose efficiently.
2000-03-27 12:16:37 +00:00
Pavel Machek
6480dd0880 I broke compilation. Sorry. 2000-03-26 21:31:57 +00:00
Pavel Machek
697711be2c if_connected is usefull outside of neighbour cache. 2000-03-26 18:00:45 +00:00
Martin Mares
267a2c0ebd Added missing newline in debug output. 2000-03-20 20:52:18 +00:00
Martin Mares
ca97b489de Define new data types for BGP. 2000-03-20 18:45:03 +00:00
Martin Mares
2638249d34 Bare skeleton of the BGP. 2000-03-19 22:09:07 +00:00
Martin Mares
349e21bb0b Protocol tracing: Don't dump core on filtered out routes. 2000-03-19 21:59:24 +00:00
Martin Mares
f098e072be Fixed a bunch of FIXME's by removing them :) 2000-03-12 22:53:05 +00:00
Martin Mares
4327090276 Made `show status' show uptime and time of last reconfiguration. 2000-03-12 22:44:54 +00:00
Martin Mares
6b9fa32080 Great cleanup of debug messages. LOCAL_DEBUG turned off in most modules,
several debug() calls converted to DBG().
2000-03-12 21:01:38 +00:00
Martin Mares
6a9f28b0b9 Added tracing of interface events. 2000-03-12 20:50:35 +00:00
Martin Mares
b0a47440e3 Oops, got <' and >' markers in trace output reversed. 2000-03-12 20:49:08 +00:00
Martin Mares
cfd46ee4c5 Added debugging of communication between protocols and routing tables.
Just ask for "debug routes" if you want to see the routes and "debug filters"
if you want even the rejected ones.
2000-03-12 20:30:53 +00:00
Martin Mares
839380d7ec Added debugging of protocol state transitions. 2000-03-07 21:50:21 +00:00
Martin Mares
f30b86f9d5 Added configuration of default protocol debugging flags. 2000-03-07 21:50:03 +00:00
Martin Mares
96d8e3bff2 Added protocol debugging flags (protocol.h: D_xxx), parsing of them
in configuration files and commands for manipulating them.

Current debug message policy:

   o  D_STATES, D_ROUTES and D_FILTERS are handled in generic code.
   o  Other debug flags should be handled in the protocols and whenever
      the flag is set, the corresponding messages should be printed
      using calls to log(L_TRACE, ...), each message prefixed with
      the name of the protocol instance. These messages should cover
      the whole normal operation of the protocol and should be useful
      for an administrator trying to understand what does the protocol
      behave on his network or who is attempting to diagnose network
      problems. If your messages don't fit to the categories I've defined,
      feel free to add your own ones (by adding them to protocol.h
      and on two places in nest/config.Y), but please try to keep the
      categories as general as possible (i.e., not tied to your protocol).
   o  Internal debug messages not interesting even to an experienced
      user should be printed by calling DBG() which is either void or
      a call to debug() depending on setting of the LOCAL_DEBUG symbol
      at the top of your source.
   o  Dump functions (proto->dump etc.) should call debug() to print
      their messages.
   o  If you are doing any internal consistency checks, use ASSERT
      or bug().
   o  Nobody shall ever call printf() or any other stdio functions.

Also please try to log any protocol errors you encounter and tag them
with the appropriate message category (usually L_REMOTE or L_AUTH). Always
carefully check contents of any message field you receive and verify all
IP addresses you work with (by calling ipa_classify() or by using the
neighbour cache if you want to check direct connectedness as well).
2000-03-07 20:49:48 +00:00
Martin Mares
9f4929e749 Renamed EAF_INLINE to EAF_TEMP to make the name reflect the real meaning. 2000-03-04 22:30:44 +00:00
Martin Mares
b9626ec6ea Garbage collector events and counters are now per table and one day
they can be made configurable if it turns out to be useful.
2000-03-04 22:21:06 +00:00
Martin Mares
c7814f01fc Enabled short continuations. 2000-03-04 21:26:19 +00:00
Martin Mares
ee76a92a80 Implemented real attribute cache. 2000-03-04 21:09:14 +00:00
Martin Mares
c8518ae136 Removed RTF_EXTERIOR and RTF_TAGGED (unused). 2000-03-01 15:05:43 +00:00
Martin Mares
85053fce04 Reimplemented neighbor cache. Now uses real hashing. 2000-03-01 14:51:47 +00:00
Martin Mares
7293c5dd81 Added proto->hash_key which contains randomly generated hash key used
for calculation of hash functions depending on proto.
2000-03-01 14:49:07 +00:00
Martin Mares
4c1b4e1a58 If the user has specified identical preferences for instances of different
protocols, break the tie by comparing addresses, so we keep the ordering
unambiguous.
2000-03-01 11:48:11 +00:00
Martin Mares
6a636392d3 Rewrote interface type detection logic. The `unnumbered' flag is now per
address, not per interface (hence it's ifa->flags & IA_UNNUMBERED) and
should be set reliably. IF_MULTIACCESS should be fixed now, but it isn't
wise to rely on it on interfaces configured with /30 prefix.
2000-02-29 23:19:52 +00:00
Martin Mares
fae0396ea4 Completion works. Unfortunately, we have to access a couple of internal
symbols of libreadline :-(
2000-02-17 23:37:16 +00:00
Martin Mares
4b87e256eb Split off general commands to cmds.c.
Added `show symbols' command which dumps whole symbol table together
with symbol types etc.
2000-01-19 12:30:19 +00:00
Martin Mares
f5ad9f87a3 Killed a couple of bugs in the neighbor cache.
Manual disable/enable/restart/shutdown/reconfiguration of protocols
no longer hangs on loops in neighbor lists :)
2000-01-19 11:52:32 +00:00
Martin Mares
3ea1ba632b Killed protocol->priority. Protocol startup should be clean and hack-free now.
It seems everything still works (except for disable/enable/restart which hangs
sometimes, but it's another story).
2000-01-18 11:01:03 +00:00
Martin Mares
54aaa89ada protocol->startup_counter no longer exists. 2000-01-18 10:42:45 +00:00
Martin Mares
471cc0be65 Moved initlialization of protocol lists to global init. Argh. 2000-01-17 12:38:07 +00:00
Martin Mares
d272fe22dd Separated `official protocol names' used in status dumps from name templates
used for automatic generation of instance names.

	protocol->name is the official name
	protocol->template is the name template (usually "name%d"),
		should be all lowercase.

Updated all protocols to define the templates, checked that their configuration
grammar includes proto_name which generates the name and interns it in the
symbol table.
2000-01-17 11:52:50 +00:00
Martin Mares
88dc89f991 Device protocol supports reconfiguration. 2000-01-17 00:20:17 +00:00
Martin Mares
26368f656c Don't forget changing proto->name to point to name in new configuration
(to avoid the name being freed with the old config).

Also remember to add proto_pipe to protocol_list.
2000-01-17 00:19:58 +00:00
Martin Mares
f14a4becbe Reworked proto lists -- each proto is now in two lists: the global one
(proto_list) and per-type one (original lists). A lot of things simplified.

Implemented `disable', `enable' and `restart' CLI commands.
2000-01-16 23:30:06 +00:00
Martin Mares
30a6108ccc Added filter_same() for comparision of two filters.
Pavel, please implement this as soon as possible.
2000-01-16 17:49:32 +00:00
Martin Mares
bf8558bc9c Converted shutdown to a kind of reconfiguration, it's no more handled
as a exception in protocol state machines. Introduced a `shutdown'
CLI command. Killed few reconfiguration bugs.
2000-01-16 17:40:26 +00:00
Martin Mares
50fe90edf3 First attempt on dynamic reconfiguration. There are still lots of bugs
and problems to solve, but the hardest part works.
2000-01-16 16:44:50 +00:00
Martin Mares
394aec8fdd Don't forget to set proto->min_scope = SCOPE_HOST. 2000-01-16 16:40:57 +00:00
Martin Mares
476e108425 Minor cleanups. 1999-12-16 13:51:43 +00:00
Martin Mares
ccdc339756 Avoid touching F_MODIFY, it no longer exists. 1999-12-16 12:59:09 +00:00
Martin Mares
f545d38707 Added universal locking mechanism which will solve problems
with protocols wanting to use the same port on the same interface
during reconfiguration time.

How to use locks: In the if_notify hook, just order locks for the
interfaces you want to work with and do the real socket opening after the
lock hook function gets called. When you stop using the socket, close
it and rfree() the lock.

Please update your protocols to use the new locking mechanism.
1999-12-09 18:54:20 +00:00
Martin Mares
0da472d7e8 Except for special protocols (nowadays only the kernel syncer), don't
export host and link scope routes.
1999-12-08 14:16:13 +00:00
Martin Mares
7c0cc76ed7 Moved initialization of protocol list to proto.c.
Added sysdep configuration hooks.
1999-12-06 13:44:45 +00:00
Martin Mares
34350a5270 Implemented echoing of log messages to CLI connections. Just try `echo all'. 1999-12-06 12:34:45 +00:00
Martin Mares
f3792601df Don't forget to send an OK reply after dumping debug information. 1999-12-04 23:28:56 +00:00
Martin Mares
305a01f57b Added DEBUG commands.
Removed CLI tests, real commands now serve as much better examples.
1999-12-04 23:17:29 +00:00
Martin Mares
02c1fbddd4 Added proto_get_named() to be used in CLI commands to get protocol instance
of a given protocol with optionally given name. See `show static' for an
example.
1999-12-03 11:40:45 +00:00
Martin Mares
28e01f85c6 Renamed SHOW PROTOCOLS VERBOSE to SHOW PROTOCOLS ALL to be consistent
with the other commands.
1999-12-03 11:10:50 +00:00
Martin Mares
430da60fa2 Implemented `show route where <condition>' command.
Pavel, please check my addition to filter/config.Y.
1999-12-02 14:04:44 +00:00
Martin Mares
730f2e2c8c Added dumping of routing tables (`show route'). This includes filtering. 1999-12-01 15:10:21 +00:00
Martin Mares
04a60c689a Added get_route_info and show_route_data hooks to struct protocol.
Please implement them.
1999-12-01 15:08:32 +00:00
Martin Mares
f611f0ee82 Reset temporary parser data before parsing, not afterwards. This enables
deferred CLI command handlers to store their temporary data in the CLI
parsing pool.
1999-12-01 15:07:56 +00:00
Martin Mares
9685deb910 `show protocols' now shows time of last state change and protocol-dependent
status information (obtained via newly introduced hook protocol->get_status).
1999-12-01 12:00:15 +00:00
Martin Mares
5954dcfab7 Introduced new protocol-dependent integer field `aux' to struct neighbor. 1999-12-01 11:59:24 +00:00
Martin Mares
1d2664a4d4 Remember protocol instance in proto_config and use that for
`show protocols <name>'.
1999-11-30 14:04:09 +00:00
Martin Mares
f0474f2070 Use TIME_INFINITY for initialization of password entries instead
of 2000000000 (BTW who wrote that???)
1999-11-30 14:02:27 +00:00
Martin Mares
0d3e6bceee show interfaces' and show protocols' works. 1999-11-30 12:57:14 +00:00
Martin Mares
10b5baaef3 Don't use continuation shortcuts until real client is written. 1999-11-30 12:56:52 +00:00
Martin Mares
ae97b946e9 Added few basic commands: show status, show interfaces [summary],
show protocols (incomplete).
1999-11-25 15:35:30 +00:00
Martin Mares
3579376927 cli_msg() moved to cli.h, so that it can be used outside the parser. 1999-11-25 15:34:51 +00:00
Pavel Machek
774f149959 Fix timeouts. Triggered updates are not done, yet. 1999-11-25 12:01:45 +00:00
Martin Mares
8d24b6899d Allow EA type to be set to 'undefined' which overrides all further definitons
of that EA in the same list and causes ea_find() to fail unless you add
EA_ALLOW_UNDEF to the second argument.

ea_sort (resp. ea_do_prune()) removes all undef'd attributes from the list.

I hope this works :)
1999-11-18 14:41:29 +00:00
Martin Mares
da40b6f753 DEF_PREF_UKR and DEF_PREF_SINK removed. 1999-11-18 13:42:51 +00:00
Martin Mares
62a4639548 Added some temporary examples of how to define CLI commands (search for CF_CLI).
To define a new command, just add a new rule to the gramar:
  CF_CLI(COMMAND NAME, arguments, help-args, help-text) {
	what-should-the-command-do
	} ;
where <arguments> are appended to the RHS of the rule, <help-args> is the
argument list as shown in the help and <help-text> is description of the
command for the help.

<what-should-the-command-do> is a C code snippet to be executed. It should
not take too much time to execute. If you want to print out a lot of
information, you can schedule a routine to be called after the current
buffer is flushed by making cli->cont point to the routine (see the
TEST LONG command definition for an example); if the connection is closed
in the meantime, cli->cleanup gets called.

You can access `struct cli' belonging to the connection you're currently
servicing as this_cli, but only during parse time, not from routines scheduled
for deferred execution.

Functions to call inside command handlers:
  cli_printf(cli, code, printf-args) -- print text to CLI connection,
	<code> is message code as assigned in doc/reply_codes or a negative
	one if it's a continuation line.
  cli_msg(code, printf-args) -- the same for this_cli.

Use 'sock -x bird.ctl' for connecting to the CLI until a client is written.
1999-11-17 12:14:44 +00:00
Martin Mares
ffb59d243a Command line interface now works. 1999-11-17 12:00:21 +00:00
Martin Mares
7d509304b5 An example of how to define enums. 1999-11-15 11:36:22 +00:00
Martin Mares
2727bb7c5b Renamed attr->attrs to attr->eattrs. 1999-11-04 13:29:43 +00:00
Martin Mares
bc2fb68098 Parse CLI commands. We use the same parser as for configuration files (because
we want to allow filter and similar complex constructs to be used in commands
and we should avoid code duplication), only with CLI_MARKER token prepended
before the whole input.

Defined macro CF_CLI(cmd, args, help) for defining CLI commands in .Y files.
The first argument specifies the command itself, the remaining two arguments
are copied to the help file (er, will be copied after the help file starts
to exist). This macro automatically creates a skeleton rule for the command,
you only need to append arguments as in:

	CF_CLI(STEAL MONEY, <$>, [[Steal <$> US dollars or equivalent in any other currency]]): NUM {
		cli_msg(0, "%d$ stolen", $3);
	} ;

Also don't forget to reset lexer state between inputs.
1999-10-31 17:47:47 +00:00
Martin Mares
b9672a845f The CLI I/O functions work as desired. 1999-10-31 15:43:44 +00:00
Martin Mares
7d3aab1c16 First steps of the Command Line Interface: I/O routines. 1999-10-29 12:10:10 +00:00
Martin Mares
0d70292d88 Events now return a value. If it's non-zero, the event is re-queued
for processing in next event cycle. This can be used to prevent background
actions (hint: user commands) from hogging the CPU for too long time.
1999-10-29 12:08:49 +00:00
Pavel Machek
ac40c888c2 Obvious bugs in authentication fixed. 1999-10-02 10:44:48 +00:00
Martin Mares
d7975d261f Ouch, how could I write this? 1999-08-03 19:38:48 +00:00
Martin Mares
dce267832a Basic support for IPv6. The system-dependent part doesn't work yet,
but the core routines are there and seem to be working.

   o  lib/ipv6.[ch] written
   o  Lexical analyser recognizes IPv6 addresses and when in IPv6
      mode, treats pure IPv4 addresses as router IDs.
   o  Router ID must be configured manually on IPv6 systems.
   o  Added SCOPE_ORGANIZATION for org-scoped IPv6 multicasts.
   o  Fixed few places where ipa_(hton|ntoh) was called as a function
      returning converted address.
1999-08-03 19:36:06 +00:00
Martin Mares
9c11ec9efc Implemented a Table-to-Table protocol a.k.a The Pipe. 1999-08-03 19:34:26 +00:00
Martin Mares
8c943173ce Allow announces of rte's to protocols in FS_FEEDING state.
Else, we would get chicken-egg problems in the table-to-table protocol.
1999-08-03 19:33:45 +00:00
Martin Mares
7de45ba4a0 Kernel route syncer supports multiple tables.
The changes are just too extensive for lazy me to list them
there, but see the comment at the top of sysdep/unix/krt.c.
The code got a bit more ifdeffy than I'd like, though.

Also fixed a bunch of FIXME's and added a couple of others. :)
1999-08-03 19:33:22 +00:00
Martin Mares
9d8856897f Protocol engine bug fixes:
o  Make proto_config->table always point to the right
      table even if it should be the default one.
   o  When shutting down, kill protocol in reverse order
      of their priority.
   o  When stopping a protocol down, disconnect it from
      routing tables immediately instead of waiting
      for the delayed protocol flush event.

Also added a protocol instance counter (used by KRT code
in very magic ways).
1999-08-03 19:31:54 +00:00
Martin Mares
8edf2361f9 Cleaned up handling of interface patterns:
o  Parsing of interface patterns moved to generic code,
      introduced this_ipatt which works similarly to this_iface.
   o  Interface patterns now support selection by both interface
      names and primary IP addresses.
   o  Proto `direct' updated.
   o  RIP updated as well, it also seems the memory corruption
      bug there is gone.
1999-08-03 19:30:49 +00:00
Pavel Machek
2e6197d634 Added password_strncpy() which pads destination with zeros. 1999-05-31 19:15:52 +00:00
Pavel Machek
9c9e49ac39 Added extended attributes for rip. 1999-05-31 19:15:32 +00:00
Martin Mares
bb027be1e2 Added extra argument to rt_update hook which contains a pointer to the
temporary attribute list.
1999-05-31 18:55:35 +00:00
Pavel Machek
900d5470ae Added PASSIVE option to paswwords. 1999-05-31 17:12:00 +00:00
Pavel Machek
858a717796 Change format of passwords (less ;'s) and fix password.h to allow
multiple inclusions.
1999-05-26 14:37:07 +00:00
Pavel Machek
1a2ded450e Skeleton for password handling, currently I only build structures and
do nothing more advanced for them
1999-05-26 14:24:57 +00:00
Martin Mares
4f1a6d27b9 Kill remaining master_table relics in KRT code.
Make all protocols pass routing table to rte_update and rte_discard.
1999-05-17 20:16:53 +00:00
Martin Mares
0e02abfd57 From now we support multiple tables. The master_table variable is
definitely gone. Both rte_update() and rte_discard() have an additional
argument telling which table should they modify.

Also, rte_update() no longer walks the whole protocol list -- each table
has a list of all protocols connected to this table and having the
rt_notify hook set. Each protocol can also freely decide (by calling
proto_add_announce_hook) to connect to any other table, but it will
be probably used only by the table-to-table protocol.

The default debugging dumps now include all routing tables and also
all their connections.
1999-05-17 20:14:52 +00:00
Martin Mares
a2697f02ac Netlink support for secondary interface addresses. 1999-05-07 13:46:16 +00:00
Martin Mares
9a158361da I rewrote the interface handling code, so that it supports multiple
addresses per interface (needed for example for IPv6 support).

Visible changes:

o  struct iface now contains a list of all interface addresses (represented
   by struct ifa), iface->addr points to the primary address (if any).
o  Interface has IF_UP set iff it's up and it has a primary address.
o  IF_UP is now independent on IF_IGNORED (i.e., you need to test IF_IGNORED
   in the protocols; I've added this, but please check).
o  The if_notify_change hook has been simplified (only one interface pointer
   etc.).
o  Introduced a ifa_notify_change hook. (For now, only the Direct protocol
   does use it -- it's wise to just listen to device routes in all other
   protocols.)
o  Removed IF_CHANGE_FLAGS notifier flag (it was meaningless anyway).
o  Updated all the code except netlink (I'll look at it tomorrow) to match
   the new semantics (please look at your code to ensure I did it right).

Things to fix:

o  Netlink.
o  Make krt-iface interpret "eth0:1"-type aliases as secondary addresses.
1999-05-06 21:38:11 +00:00
Martin Mares
08e2d6259a Removed TOS support. This simplifies many things a lot. 1999-04-12 18:01:07 +00:00
Martin Mares
e2dc2f30ef Routing table core changes to support full route filtering:
o  Introduced rte_cow() which should be used for copying on write the
   rte's in filters. Each rte now carries a flag saying whether it's
   a real route (possessing table linkage and other insignia) or a local
   copy. This function can be expected to be fast since its fast-path
   is inlined.
o  Introduced rte_update_pool which is a linear memory pool used for
   all temporary data during rte_update. You should not reference it directly
   -- instead use a pool pointer passed to all related functions.
o  Split rte_update to three functions:

	rte_update	The front end: handles all checking, inbound
			filtering and calls rte_recalculate() for the
			final version of the route.
	rte_recalculate	Update the table according to already filtered route.
	rte_announce	Announce routing table changes to all protocols,
			passing them through export filters and so on.

   The interface has _not_ changed -- still call rte_update() and it will
   do the rest for you automagically.
o  Use new filtering semantics to be explained in a separate mail.
1999-04-05 20:25:03 +00:00
Martin Mares
9e0e485e50 Added some new protocol hooks (look at the comments for better explanation):
make_tmp_attrs		Convert inline attributes to ea_list
	store_tmp_attrs		Convert ea_list to inline attributes
	import_control		Pre-import decisions
1999-04-05 20:17:59 +00:00
Martin Mares
5056c559c4 Changed syntax of attaching filters to protocols to hopefully the final
version:

	EXPORT <filter-spec>	for outbound routes (i.e., those announced
				by BIRD to the rest of the world).
	IMPORT <filter-spec>	for inbound routes (i.e., those imported
				by BIRD from the rest of the world).

where <filter-spec> is one of:

	ALL			pass all routes
	NONE			drop all routes
	FILTER <name>		use named filter
	FILTER { <filter> }	use explicitly defined filter

For all protocols, the default is IMPORT ALL, EXPORT NONE. This includes
the kernel protocol, so that you need to add EXPORT ALL to get the previous
configuration of kernel syncer (as usually, see doc/bird.conf.example for
a bird.conf example :)).
1999-04-05 20:15:31 +00:00
Martin Mares
c10421d3d4 More changes to the kernel syncer.
o  Now compatible with filtering.
o  Learning of kernel routes supported only on CONFIG_SELF_CONSCIOUS
   systems (on the others it's impossible to get it semantically correct).
o  Learning now stores all of its routes in a separate fib and selects
   the ones the kernel really uses for forwarding packets.
o  Better treatment of CONFIG_AUTO_ROUTES ports.
o  Lots of internal changes.
1999-04-03 13:05:18 +00:00
Martin Mares
69ec9087ad Added new protocol hook for dumping of protocol-dependent route
attributes.

Please implement in all protocols.
1999-04-03 13:01:58 +00:00
Martin Mares
5bc512aa3a Clarify resource dumps and include them in the main debugging dump. 1999-03-29 20:14:33 +00:00
Martin Mares
7f400d1c62 After today's lengthy discussions about filter syntax, let's clean up
whitespace/semicolon rules for whole config file:

   o  All non-zero amounts of whitespace are equivalent to single space
      (aka `all the whitespace has been born equal' ;-)).
   o  Comments count as whitespace.
   o  Whitespace has no syntactic signifance (it can only separate lexical
      elements).
   o  Consequence: line ends are no longer treated as `;'s.
   o  Every declaration must be terminated by an explicit `;' unless
      or by a group enclosed in `{' and `}'.
1999-03-29 19:04:14 +00:00
Martin Mares
7dc4827c96 Added everything protocols need to know about multiple routing tables,
i.e. struct proto now contains field 'table' pointing to routing table
the protocol is attached to. Use this instead of &master_table.

Modified all protocols except the kernel syncer to use this field.
1999-03-26 21:50:43 +00:00
Martin Mares
7e5f5ffdda Moved to a much more systematic way of configuring kernel protocols.
o  Nothing is configured automatically. You _need_ to specify
     the kernel syncer in config file in order to get it started.
  o  Syncing has been split to route syncer (protocol "Kernel") and
     interface syncer (protocol "Device"), device routes are generated
     by protocol "Direct" (now can exist in multiple instances, so that
     it will be possible to feed different device routes to different
     routing tables once multiple tables get supported).

See doc/bird.conf.example for a living example of these shiny features.
1999-03-26 21:44:38 +00:00
Martin Mares
739ebd8e82 Allow different instances of the same protocol with identical preferences. 1999-03-26 21:38:02 +00:00
Martin Mares
4ba84ebc82 Slightly better generator of default protocol instance names. 1999-03-26 21:37:29 +00:00
Martin Mares
b5239f2238 Don't try to manipulate neighbor lists for copied interface structures.
This avoids few nasty references to free memory.
1999-03-26 21:33:36 +00:00
Martin Mares
421838ffef rte_update: Check sanity of incoming entries. Throw out (and log) all routes
to bogus prefixes and non-local routes to host scope addresses.
1999-03-17 15:01:07 +00:00
Martin Mares
529c414953 Allow input and output filters (only accept/reject style as we didn't define
modifying filters yet) to be attached to protocol instances.
1999-03-17 14:31:26 +00:00
Martin Mares
c612a3be31 Removed the `rta_same' hook since it's no longer needed (all protocols
needing some local information should use extended attrs and cached
rta's).
1999-03-17 13:13:18 +00:00
Martin Mares
b77ae37d11 Implemented extended route attributes and all related functions. 1999-03-17 13:09:09 +00:00
Ondrej Filip
c1f8dc9149 Yes, joining the crew. Sorry for being late. Added dummy functions for OSPF. 1999-03-09 22:27:43 +00:00
Martin Mares
e16155ae4a KRT: Implemented asynchronous route / interface state notifications
(via Netlink). Tweaked kernel synchronization rules a bit. Discovered
locking bug in kernel Netlink :-)

Future plans: Hunt all the bugs and solve all the FIXME's.
1999-03-04 18:36:18 +00:00