summaryrefslogtreecommitdiff
path: root/nest/protocol.h
AgeCommit message (Collapse)Author
2023-05-11Channel: configurable feed block sizeMaria Matejka
2023-05-09OLocks in BGP must be freed earlyMaria Matejka
2023-04-24Resource pools are now bound with domains.Maria Matejka
Memory allocation is a fragile part of BIRD and we need checking that everybody is using the resource pools in an appropriate way. To assure this, all the resource pools are associated with locking domains and every resource manipulation is thoroughly checked whether the appropriate locking domain is locked. With transitive resource manipulation like resource dumping or mass free operations, domains are locked and unlocked on the go, thus we require pool domains to have higher order than their parent to allow for this transitive operations. Adding pool locking revealed some cases of insecure memory manipulation and this commit fixes that as well.
2023-04-22Global protocol list is typed to avoid typecast confusionMaria Matejka
2023-04-17IO: added a specific loop pickup group for BFD; to be done better in futureMaria Matejka
2023-04-04Fixed unwanted reloads while reconfiguring protocols with import table onMaria Matejka
2023-04-04Proto: published protocol-loop connectionsMaria Matejka
2023-02-07Protocol shutdown/restart from limits is respecting the loopsMaria Matejka
2023-02-07Merge commit '0bb04d5390f21b0c96fc4894ba5d5510c541f0ef' into HEADMaria Matejka
2023-02-02Interface updates are asynchronousMaria Matejka
Instead of propagating interface updates as they are loaded from kernel, they are enqueued and all the notifications are called from a protocol-specific event. This change allows to break the locking loop between protocols and interfaces. Anyway, this change is based on v2 branch to keep the changes between v2 and v3 smaller.
2023-02-02Proto: Adding a list of associated neighborsMaria Matejka
This makes for safer and faster pruning and notifying as protocol now on its shutdown prunes only its neighbors and nothing else.
2023-01-25VRF setting reduced to one argument, using default dummy iface for default vrfMaria Matejka
2023-01-03Nest: Fix leaking internal attributes in RIP and BabelOndrej Zajicek
During backporting attribute changes from 3.0-branch, some internal attributes (RIP iface and Babel seqno) leaked to 'show route all' output. Allow protocols to hide specific attributes with GA_HIDDEN value. Thanks to Nigel Kukard for the bugreport.
2022-11-07Merge commit '8478de88' into thread-nextMaria Matejka
2022-10-04Merge commit '67256d50' into HEADMaria Matejka
2022-10-04Merge commit 'fb7fb674' into HEADMaria Matejka
2022-10-04Merge commit '71b434a9' into HEADMaria Matejka
2022-10-03Nest: Add channel config flag to distinguish new or copyOndrej Zajicek
It is useful to distinguish whehter channel config returned from channel_config_get() was allocated new, or existing from template. Caller may want to initialize new ones.
2022-09-20Merge commit 'adf37d8e' into thread-nextMaria Matejka
2022-09-09Created a dedicated settle timer structureMaria Matejka
2022-09-08Table access is now locked.Maria Matejka
2022-09-01ROA subscriptions are also converted to export requests.Maria Matejka
By this, the requesting channels do the timers in their own loops, avoiding unnecessary synchronization when the central timer went off. This is of course less effective for now, yet it allows to easily implement selective reloads in future.
2022-08-02Merge commit 'f0507f05ce57398e135651896dace4cb68eeed54' into thread-nextMaria Matejka
2022-07-28Moved the thread starting code to IO loop codeMaria Matejka
2022-07-18Merge commit '94eb0858' into thread-nextMaria Matejka
2022-07-12Removing the rte_modify APIMaria Matejka
For BGP LLGR purposes, there was an API allowing a protocol to directly modify their stale routes in table before flushing them. This API was called by the table prune routine which violates the future locking requirements. Instead of this, BGP now requests a special route export and reimports these routes into the table, allowing for asynchronous execution without locking the table on export.
2022-07-11Export tables merged with BGP prefix hashMaria Matejka
Until now, if export table was enabled, Nest was storing exactly the route before rt_notify() was called on it. This was quite sloppy and spooky and it also wasn't reflecting the changes BGP does before sending. And as BGP is storing the routes to be sent anyway, we are simply keeping the already-sent routes in there to better rule out unneeded reexports. Some of the route attributes (IGP metric, preference) make no sense in BGP, therefore these will be probably replaced by something sensible. Also the nexthop shown in the short output is the BGP nexthop.
2022-07-11Merge commit 'beb5f78a' into backportMaria Matejka
2022-06-27Preexport callback now takes the channel instead of protocol as argumentMaria Matejka
Passing protocol to preexport was in fact a historical relic from the old times when channels weren't a thing. Refactoring that to match current extensibility needs.
2022-06-24Allowed optimized exporting of a subprefix treeMaria Matejka
Added an option for export filter to allow for prefiltering based on the prefix. Routes outside the given prefix are completely ignored. Config is simple: export in <net> <filter>;
2022-06-20Import tables are stored as an attribute layer inside the main tables.Maria Matejka
The separate import tables were too memory-greedy, there is no need for them being stored as full-sized tables.
2022-05-30Merge commit 'd8661a4397e4576ac404661b192dd99d928e7890' into haugesundMaria Matejka
2022-05-30Merge commit '17f91f9e6e70f7e3f29502e854823c0d48571eaa' into haugesundMaria Matejka
2022-05-30Merge commit 'ef6a903e6f44b467f9606018446095521ad01ef1' into haugesundMaria Matejka
2022-05-30Merge commit '4a23ede2b056a41456790cc20a0c3d92a7137693' into haugesundMaria Matejka
2022-05-04Explicit definition structures of route attributesMaria Matejka
Changes in internal API: * Every route attribute must be defined as struct ea_class somewhere. * Registration of route attributes known at startup must be done by ea_register_init() from protocol build functions. * Every attribute has now its symbol registered in a global symbol table defined as SYM_ATTRIBUTE * All attribute ID's are dynamically allocated. * Attribute value custom formatting hook is defined in the ea_class. * Attribute names are the same for display and filters, always prefixed by protocol name. Also added some unit testing code for filters with route attributes.
2022-05-04Splitting route data structures out to libMaria Matejka
2022-04-06Protocols have their own explicit init routinesMaria Matejka
2021-11-22VRF setting reduced to one argument, using default dummy iface for default vrfMaria Matejka
2021-11-22Route sources have an explicit ownerMaria Matejka
This commit prevents use-after-free of routes belonging to protocols which have been already destroyed, delaying also all the protocols' shutdown until all of their routes have been finally propagated through all the pipes down to the appropriate exports. The use-after-free was somehow hypothetic yet theoretically possible in rare conditions, when one BGP protocol authors a lot of routes and the user deletes that protocol by reconfiguring in the same time as next hop update is requested, causing rte_better() to be called on a not-yet-pruned network prefix while the owner protocol has been already freed. In parallel execution environments, this would happen an inter-thread use-after-free, causing possible heisenbugs or other nasty problems.
2021-11-22Routing tables now have their own loops.Maria Matejka
This basically means that: * there are some more levels of indirection and asynchronicity, mostly in cleanup procedures, requiring correct lock ordering * all the internal table operations (prune, next hop update) are done without blocking the other parts of BIRD * the protocols may get their own loops very soon
2021-11-22Global table update pool removedMaria Matejka
2021-11-22Converting the former BFD loop to a universal IO loop and protocol loop.Maria Matejka
There is a simple universal IO loop, taking care of events, timers and sockets. Primarily, one instance of a protocol should use exactly one IO loop to do all its work, as is now done in BFD. Contrary to previous versions, the loop is now launched and cleaned by the nest/proto.c code, allowing for a protocol to just request its own loop by setting the loop's lock order in config higher than the_bird. It is not supported nor checked if any protocol changed the requested lock order in reconfigure. No protocol should do it at all.
2021-11-22Split route table event into separate eventsMaria Matejka
The former rt_event is dropped in favour of separate table events. This allows for selective corking of NHU and prune.
2021-11-22Special table hooks rectified.Maria Matejka
* internal tables are now more standalone, having their own import and export hooks * route refresh/reload uses stale counter instead of stale flag, allowing to drop walking the table at the beginning * route modify (by BGP LLGR) is now done by a special refeed hook, reimporting the modified routes directly without filters
2021-11-22Table import and export are now explicit hooks.Maria Matejka
Channels have now included rt_import_req and rt_export_req to hook into the table instead of just one list node. This will (in future) allow for: * channel import and export bound to different tables * more efficient pipe code (dropping most of the channel code) * conversion of 'show route' to a special kind of export * temporary static routes from CLI The import / export states are also updated to the new algorithms.
2021-11-09Limit containmentMaria Matejka
2021-11-09Route export: rejected by filter bitmapMaria Matejka
If a route has been rejected by filter, store that information to avoid repeated export filter runs on rejected routes.
2021-11-09Protocol stats split to import and exportMaria Matejka
2021-11-09Split route data structure to storage (ro) / manipulation (rw) structures.Maria Matejka
Routes are now allocated only when they are just to be inserted to the table. Updating a route needs a locally allocated route structure. Ownership of the attributes is also now not transfered from protocols to tables and vice versa but just borrowed which should be easier to handle in a multithreaded environment.