summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/session.h
AgeCommit message (Collapse)Author
2013-05-30When removing "dump (all|updates)" from bgpd.conf and reloading, tellFlorian Obser
the session engine to actually stop logging. Found the hard way by benno@. with & ok benno@ input & ok claudio@
2013-03-07Implements a few missing bits for better templates support:Claudio Jeker
- on config reload also adjust the cloned neighbors so that they get the config changes as well. - clean up sessions that are 1h idle but in state active (instead of down) - add bits to allow bgpctl to destroy cloned neighbors Tested by sthen@ some time ago, OK phessler@
2012-09-12Better graceful restart support (implementing more then just the EoR record).Claudio Jeker
This implements only the "Restarting Client" bits of the RFC -- in other words bgpd will keep the FIB when the client restarts but it will not do GR when restarting itself. The capability is still off by default (you need "announce restart yes" to enable it). Tested by Anders Berggren. OK sthen@
2012-04-12accept() pacing for bgpd based on similar work done on other daemons.Claudio Jeker
OK henning@ sthen@
2011-09-18Reorder the headerfiles a bit. Move the bgpd specific prototypes out ofClaudio Jeker
mrt.h. Now mrt.h includes only protocol specific defines.
2010-12-09The PF_KEY socket is like the routing socket. It must be polled all theClaudio Jeker
time to consume broadcasted messages or the socket gets full and own messages that are needed are lost. This fixes an infinit loop in pfkey_reply that happens when bgpd tcp md5sum is used on a system that also runs a larger IPsec setup. OK henning, lot of patience, debuging and testing by Thomas Boernert
2010-11-18Log sent notification messages as well having them in the log mayClaudio Jeker
help to figure out the cause of flapping session faster. OK henning@ sthen@
2010-10-15Add the FSM suberrors specified in draft-ietf-idr-fsm-subcode. ThisClaudio Jeker
should help identifying FSM errors since the state is know known. OK henning@ sthen@
2010-06-27Instead of specifying the control sockets on the command line have themClaudio Jeker
in bgpd.conf. This allows to add/modify restricted control sockets on runtime. Feature request by a few people how often forgot to add -r path when restarting bgpd (including myself). NOTE: this removes the -s and -r arguments from bgpd so pay attention when updateing. jajaja sthen@, OK henning@
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-17Last bits of MPLS VPN support. Hook kernel routing tables and RIB together.Claudio Jeker
This adds a bit of new config to specify the mapping between an rdomain and the BGP MPLS VPN instance, example: rdomain 1 { descr "CUSTOMER1" rd 65003:1 import-target rt 65003:3 export-target rt 65003:1 depend on mpe0 network 192.168.224/24 } The "depend on mpe0" is a but ugly but for now this is the quickest way to figure out which interface bgp should use to insert the MPLS routes. A big side-effect of this diff is that networks are now internally distributed through kroute.c. This needs some kernel changes that will follow hopefully soon. OK henning@
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@
2009-12-31Instead of passing the config via arguments to the childs on bootup issueClaudio Jeker
a config reload as first step in bootup. This allows childs to start with an empty config and a lot of special cleanup code can bite the dust. Testing by myself and sthen@ with a few configs (more testing welcome). Seems like a good idea henning@ & sthen@
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-09-02Implement all of RFC 4486 BGP Cease Notification Message Subcodes.Claudio Jeker
The other side should now see why a session was dropped. e.g: bgpd: ... received notification: Cease, administratively down OK henning
2009-06-05Adjust print_config to all the stuff added in the last days.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@
2008-09-11remove hackery to un-demote after the session has been established forHenning Brauer
a while, we can now just use a timer (since i rewrote the timer code)
2008-05-08timer_due is not needed any moreHenning Brauer
2008-05-08take advantage of the timewheel: instead of checking each an everyHenning Brauer
timer, just get the first off the queue and check wether it is due
2008-05-08change timer internals so that we use a timewheel (tailq, sorted by expiryHenning Brauer
so that the timer that will expire first is always the first element, and so on). will make the checking a bit faster and moreelegant and more conveniant. ok claudio
2007-12-23provide timer_nextduein, which provides the number of seconds until theHenning Brauer
next timer expires. use that in the session engine's mainloop, which simplifies it and removes the last bits of timer internals knowledge from anywhere outside timer.c.
2007-12-23send timers for bgpctlshow neighbor foo timer in seperate messages afterHenning Brauer
the peer data. makes bgpctl display code independent from timer implementation internals. only running timers are displayed now, stopped ones are skipped.
2007-12-20rework timers.Henning Brauer
stop changing tienmr values directly, always use new timer_(get/set/stop/running) functions. preparation for more to come :) ok claudio
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@
2007-01-04Do not run rde_shutdown() unless bgpd is started with -d.Claudio Jeker
On some of my systems rde_shutdown() takes more than 3min doing nothing more than calling free(3) over and over again.
2006-10-26 * make sure we keep copies of everything we need toHenning Brauer
* remove SAs and flows later again, even if the * configuration info changed due to reload. * We need: SPIs, method, local_addr, remote_addr. * remote_addr cannot change, so no copy. with this, I have just migrated a session from tcp md5sig to ipsec esp ike, just with bgpctl reload (both sides) followed by bgpctl neighbor $foo clear (just one side)! claudio ok
2006-10-26storing the dynamically acquired SPIs for tcpmd5 inside the conf structHenning Brauer
is not such a good idea - it gets nulled on config reloads, and thus we fail to clear the old SAs when the session is restarted after a config reload occured. obvious solution: store the SPIs outside the config area. ok claudio
2006-08-27add code to announce the restart capability according toHenning Brauer
draft-ietf-idr-restart. Do not announce actual restart capabilities, so that this only serves as indicator that we are capable of sending and receiving the End-of-RIB marker. leave disabled for now, since the code to actually send the EoR-marker is currently ifdef'd out (to be fixed soon) and we wanna play safe for 4.0. and juniper doesn't support that capability (which is not a problem per se) and at the same time has its capability negotiation code completely fucked up, if a capability is rejected they don't indicate WHICH capability they reject (which makes that a problem, tho still a small one and we cope). claudio ok
2006-07-28factor out the code to build bgp messages, ok claudio a long time agoHenning Brauer
2006-06-17implement carp demotion control for bgpd.Henning Brauer
sessions can be configured to modify the carp demotion counter for a given interface group (usually, "carp", which has all carp interfaces) when the session is not established. once the session is established for 60 seconds, the demotion is cleared. this, used correctly, can prevent a bgpd-box which lost all sessions (and thus has no routes) to be carp master, while the backup has sessions. thought through and partially hacked on a drive from calgary to vancouver with ryan, ok claudio
2006-05-27Cleanup with lint. Make the poll fd indexes unsigned and because of thatClaudio Jeker
control_accept should also return a unsigned int. Remove old prototype.
2006-05-23allow bgpd to request a route refresh from a neighbor if that neighborHenning Brauer
announced route refresh capabilities
2006-01-24introduce a second control socket, which is restricted to certain messages,Henning Brauer
nameley the show ones. needed for looking glass style applications, monitoring etc. claudio ok
2006-01-03Move functions shared with bgpctl into new file util.c. Simplifies theClaudio Jeker
link between bgpctl and bgpd mostly because of rde_attr.c.
2005-10-19on "bgpctl neighbor foo clear", we used to send a STOP event immediatelyHenning Brauer
followed by a START event. Instead of sending START immediately, start the IdleHoldTimer with a very low value (5 seconds) so that we restart the session these seconds later. some other implementations deal poorly with our previously superfast reconnects, namely, that commercial one from san jose, claudio ok
2005-09-19implement fast reconnectsHenning Brauer
when a peer drops to IDLE, we have to force him in IDLE for some time to prevent fast flapping. however, the forced idle time is annoying when the connection could be re-established immediately, i. e. bgpctl nei $peer clear or similar. implement an error counter per peer, increased every time we receive a notification. when we are in state IDLE and get a connection from the peer in question, check if the error counter is 1 or smaller. if so, change state to active and accept the connection, otherwise keep the current behaviour and reject the connection. the error counter gets scaled back by the IdleHoldResetTimer that scales the IdleHoldTime back as well
2005-06-04when sending out a notification record the error code and suberror code inHenning Brauer
the peer stats struct, and clear them as soon as the session leaves IDLE
2005-04-05magic police, Jason Ackley <jason@ackley.net>Henning Brauer
2004-12-23introduce getpeerbydesc(), find a peer by its descriptionHenning Brauer
2004-12-23lower latency by processing no more than 25 messages at once for each peerHenning Brauer
2004-12-23sort structs for most optimal alignment, help mickey, claudio okHenning Brauer
2004-11-18add an instance of struct capabilities to peer_conf, and inheritHenning Brauer
peer->capa.ann from this
2004-11-18inside struct peer, replace the occurance of the older struct peer_capaHenning Brauer
by two instances of the new struct capabilities, one for announcements and one for the received capabilities
2004-11-18remove the global 'announce' flag from struct peer_capa, clearHenning Brauer
individual capability flags where needed
2004-11-18struct capa_mp is not needed any more, spotted by claudioHenning Brauer
2004-11-18add code to announce support for IPv6 Unicast.Henning Brauer
disabled for now, claudio ok
2004-11-18it's oupsa oupsa oupsa time...Henning Brauer
writing to a member of a const struct is no good, so un-const struct peer for log_statechange()