Commit graph

219 commits

Author SHA1 Message Date
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