summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde.h
AgeCommit message (Collapse)Author
2010-11-18Accept but ignore (treat as withdraw) updates with AS_CONFED_* pathClaudio Jeker
segments. Bgpd does not support confederations but it is too extreme to close a session because a path contained such elements. OK henning@, sthen@
2010-05-26Rename some imsg bits to make namespace collisions less likely buf toNicholas Marriott
ibuf, buf_read to ibuf_read, READ_BUF_SIZE to IBUF_READ_SIZE. ok henning gilles claudio jacekm deraadt
2010-05-19Add softreconfig support for peers changing the RIB. Done by first unloadingClaudio Jeker
the old RIB and then via softreconfig in and a special softreconfig out loading the new RIB. Feature requested and testeded by Elisa Jasinska. OK henning@
2010-05-17Implement two new filters, max-as-len and max-as-seq. The first is limitingClaudio Jeker
the length of an AS path (matches if the path is longer then the specified lenght) the second matches when a sequence of the same AS number is longer then the specified length). max-as-len is good to protect crappy comercial bgp boxes from other crappy comercial bgp boxes. max-as-seq was a feature request from SwissIX and maybe EuroIX to find and filter prepends. Additinal testing and OK sthen@
2010-05-03Make it possible to load multiple routing tables at the same time and useClaudio Jeker
those for alternate RIBs. This allows to use "rde rib TESTIT rtable 1". NOTE: nexthop verification has changed for alternate tables. For now nexthop will only be verified against the main routing table (id 0). Because of this "nexthop qualify via bgp" may now compare the nexthops against bgpd routes from a different RIB. Tested by sthen@, OK to move on by henning@
2010-03-29I'm going to need community_ext_conv() outside of rde_attr.c soon, so moveClaudio Jeker
the prototype to rde.h
2010-03-29We always allocate rib ids dynamicaly so there is no need for allowingClaudio Jeker
fixed id allocation. Makes code simpler. OK henning
2010-03-05Allow to filter for ext-community attributes. Currently only perfect matchesClaudio Jeker
work but that's already better then nothing. OK sthen@
2010-03-03Replace enum rib_state with enum reconf_action since their doing the same.Claudio Jeker
NEW is now REINIT, ACTIVE is KEEP and DELETE and NONE stay the same.
2010-01-13Add support for BGP MPLS VPN aka RFC 4364. This is only the RDE part soClaudio Jeker
that it is possible to use OpenBGPD as a route-reflector for VPNv4. Some clean up of the BGP MP code so that multiple protocols are easier supported. kroute/kernel support not yet done but comming. OK henning@, reyk@
2010-01-10Generate a EoR marker in the update list instead of sending it independentClaudio Jeker
of the actual update dump. This will get us the right barrier and the EoR is no longer sent way before the actual dump. Currently a nop since graceful restart is turned off (unless you have announce restart yes in the config). put it in henning@
2010-01-10Switch rib_dump() to use AID instead of AFs. OK henning@Claudio Jeker
2009-12-18Merge rde_filter_community() with community_match() and kill a uselessClaudio Jeker
indirection.
2009-12-16Implement "set ext-community [delete] subtype key:value" to set and deleteClaudio Jeker
extended communities as specified in RFC 4360. No matching implemented yet and stuff like * and neighbor-as are neither supported but will be soon. Looks good henning & sthen, manpage fixed by jmc
2009-12-08Big AID change part two. This changes the mp capability into an array ofClaudio Jeker
flags. This makes a lot of code much easier since the comparison is now trivial. Additionally calculate the negotiated capabilities for a session in the SE and pass that and only that to the RDE. This makes the decisions in the RDE a lot easier. OK henning@
2009-12-01Use an artificial address family id in struct bgpd_addr and almost everywhereClaudio Jeker
else. Adds conversion functions to map AFI/SAFI and the Unix AF_ values from and into AID used in bgpd. This is needed to support things like MPLS VPN and other upcomming changes that need to play a lot with AFI/SAFI pairs. Mostly mechanical change, henning@ has no particular issues with this. Must go in so that I can continue working.
2009-10-05Load prefixes into new created RIBs at reload time by walking over theClaudio Jeker
Adj-RIB-In. This only works correctly when softreconfig in is enabled (which is the default). This is needed to allow dynamic creation of additional RIBs. OK henning@
2009-08-06Implement the error handling as proposed in draft-ietf-idr-optional-transitiveClaudio Jeker
for optional transitive attributes. In short if the partial bit is set on an optional transitive attribute but the attribute fails validation ignore the attribute or mark the path as ineligible instead of killing the session with a NOTIFICATION. Tested, input and OK sthen, OK henning
2009-06-06Some preliminary filter magic to support multiple RIBs on the filters.Claudio Jeker
It is ugly but does the trick for now. Filters will be rewritten anyway. The rib specifier only makes sense on from rules. e.g. deny rib OMG from any
2009-06-06Only the main Loc-RIB should update the FIB for now. So introduce aClaudio Jeker
F_RIB_NOFIB flag and apply it on all RIBs that are not F_RIB_NOEVALUATE.
2009-06-06Only generate updates for peers that are member of the RIB that update isClaudio Jeker
comming from.
2009-06-04Implement rib_find and add a rib id to struct rde_peer.Claudio Jeker
2009-06-04Add "rde rib <name>" to the config and allow the rde to use these other RIBs.Claudio Jeker
Still a bit hackish, reload is missing and printconf as well. Looks good h@
2009-06-03Better way to allocate new RIBs.Claudio Jeker
2009-06-02Move the rest of the rib dump functions into rde_rib.c where it belongs.Claudio Jeker
2009-06-01Use only one list to queue the dump contextes on. Use the list in structClaudio Jeker
rib_context instead of the ctl specific rde_dump_ctx to make it more general.
2009-06-01Holy simplification batman. Use the per rib entry flags to lock entriesClaudio Jeker
when interrupting rib dumps and now we no longer need evil RB magic to find the next entry on restart.
2009-06-01Instead of storing a pointer to the RIB head in the RIB element use thatClaudio Jeker
space for a flags field and the RIB id. In the end bgpd will be able to lock RIB elements and therefore make it possible to interrupt all tree walks.
2009-05-27Move update and withdraw code into own functions to simplify the necessaryClaudio Jeker
changes to make multiple RIB functional. Also change the way we account the prefixes per peer (for maxprefix check). Every prefix that was added to any RIB is counted. OK henning@
2009-05-21Make it possible to turn off the decision process per RIB. This is mainlyClaudio Jeker
used for the Adj-Rib-In. Also initialize the Adj-Rib-In correctly and mark it a noevaluate.
2009-05-17F_LOCAL and F_ORIGINAL are gone. The Adj-Rib-In is now a distinct tree.Claudio Jeker
Fix pf table code by checking if the aspath has a pftableid set or not instead of doing the F_LOCAL dance. This works because the in the Adj-Rib-In it is impossible to set pftableid.
2009-05-17Rework most of the RDE to allow multiple RIBs. This is mostly preparationClaudio Jeker
work by changing the way the RDE DB is built. struct prefix and struct pt_entry are simplified and extended with a rib_entry where the decision tree is run on. From now on a prefix can only reside on one particular RIB which simplifies the code a bit. Currently there are two fixed ribs (adj-rib-in and the local-rib) which needs to be made more dynamic in upcomming commits. This is work in progress, the RDE seems to work for me and sthen@ (no flames comming out of our testrouters but there is still a lot missing) Move into the tree to simplify developement -- henning@
2009-04-23Rework the way we handle announced networks. Instead of two freak rde_peersClaudio Jeker
use one that is less freaky. Merge bgpctl and config networks into one tree. First step of a larger change in the RDE and this goes now in to allow to move forward.
2009-03-19Implement a attr_writebuf() function that works on a struct buf instead ofClaudio Jeker
a pre allocated piece of memory. Will be used by newer mrt code. OK henning@
2009-01-13Replace NEW_ASPATH/NEW_AGGREGATOR with the naming from RFC4893,Stuart Henderson
AS4_PATH/AS4_AGGREGATOR. No binary change. ok claudio
2008-11-21Track nexthops when the underlying route is changing. Until now true nexthopsClaudio Jeker
were only resolved when they were added. This calls for troubles if something like ospfd starts to change the underlying routes. Tested by gollo@, OK henning@
2008-01-23Add defines for extended communities. OK henning@Claudio Jeker
2007-11-27Prefixes or actually pathes that would cause a rooting loops should not beClaudio Jeker
dropped when parsed but instead be added to the RIB marked as not eligible. So the decision process does not pick them up as a valid route. Tested and some ideas by Tony Sarendal (tony (at) polarcap (dot) org)
2007-06-01Remove a stupid wrapper function that does nothing more then calling anotherClaudio Jeker
function with the same arguments.
2007-04-23Make bgpd 4-byte AS compatible. All internal representations of AS numbersClaudio Jeker
are now 4-byte instead of the old 2-byte numbers. The only exception are communities because they can not be switched. The RDE will inflate and deflate the ASPATH and AGGREGATOR attributes on demand and create the NEW_ASPATH and NEW_AGGREGATOR field whenever needed. Both old and new stile sessions are supported and can be mixed. Currently new stile sessions with the 4-byte AS number capability turned on are only enabled if one of the AS numbers involved is a 4-byte one. This is based on an initial diff by Geoff Huston gih (at) apnic (dot) net Cleanup, testing and bug-fixes by myself (via AS 3.10). Currently mrt table dumps are producing incompatible output this will be fixed afterwards -- this diff is already big enough. "get it in if you think it is ready" henning@
2007-04-06Count the updates and withdraws for additional statisic gathering.Claudio Jeker
Discussed with henning@
2007-01-26Massiv rework of the control imsg flow. Main changes:Claudio Jeker
- dedicated pipe between the SE and the RDE for control messages - restartable RB tree dumps in the RDE - queuing limits both in the SE and RDE The result is a dramatic decrease of memory consumption on operations like bgpctl show rib. Previously all messages where first stored in the RDE then passed to the SE where they got queued in case bgpctl was not fast enough. Now only a small number of messages is generated and passed to the SE and the SE has an additional limit instead of acting like an infinite buffer. Without this the bgpd on bgpd.networx.ch would not survive a single minute. looks good henning@
2006-11-10char -> u_char in a few placesHenning Brauer
apparently from Jeff Rizzo <riz@NetBSD.org> via "Thomas E. Spanjaard" <tgen@netphreax.net>, ok claudio
2006-05-28Even better nexthop delete behaviour. Do not delete nexthop if they are usedClaudio Jeker
by filter sets or if the nexthop is currently looked up. With this the "nexthop_update: non-existent nexthop" warning should be history. OK henning@
2006-05-28Preload and pin nexthop used in filtersets so the are validiated when used.Claudio Jeker
This will fix problems with set nexthop on outgoing filters. Found by gluk@ OK henning@
2006-04-12It is no longer allowed to change attributes in place. This corrupts theClaudio Jeker
attribute cache. Instead remove attribute and readd it after beeing changed. This should fix the "att_diff: equal attributes encountered" error seen by Tony Sarendal. OK henning@
2006-04-05remote_bgpid is stored in host byte order so a htonl() is needed when puttingClaudio Jeker
the value on the wire. This solves the backward originator-ids seend by Tony Sarendal. OK henning@
2006-04-04add "set nexthop self", force nexthop to be set to own address even with IBGPHenning Brauer
requested & tested Falk Brockerhoff <fb@smartterra.de>, and tony sarendal tested this too. claudio ok
2006-03-22Add a new SHOW imsg to send optional attributes to bgpctl. This can be usedClaudio Jeker
to show communites in bgpctl output. Only send these messages if it they are requested to reduce the overhead for simple listings. Looks good henning@
2006-02-09Implement "set community delete 65001:*" and friends. This will removeClaudio Jeker
communities from the path attributes. Useful to make sure that the ones you set later are set by a (evil) peer. OK henning@