summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/mrt.c
AgeCommit message (Collapse)Author
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-02-12Switch address and AS fields in mrt dump messages for incoming traffic soClaudio Jeker
that source and destination match the actual traffic flow. Found and initial diff by Adam Chappell (Adam.Chappell at interoute dot com)
2007-02-12Fix some log_warn() messages.Claudio Jeker
2006-02-08For now dump only stuff from the local-RIB into mrt table dumps.Claudio Jeker
Issue found by Andre Oppermann.
2006-01-05Cache optional BGP attributes (mostly communities) and use a simpleClaudio Jeker
pointer plus a ref counter to link the attributes to the path object. Saves +/- 10M on 11 full feeds. Looks good Henning
2005-11-29Add a flags field to struct prefix which will be used shortly. Remove the peerClaudio Jeker
pointer so that the size does not grow. Adding 4 bytes to struct prefix would result in 64MB more memory usage on one of my systems.
2004-12-23KNFHenning Brauer
2004-11-11Store the local v4 and v6 address of a session. For IPv4 sessions the firstClaudio Jeker
IPv6 address with global scope of the interface used by the session is used. In any case the local endpoint of the session is used for one of the two no matter what scope. OK henning@
2004-09-16imsg API cleanup:Henning Brauer
-kill imsg_compose_pid, imsg_compose_fdpass and imsg_create_pid -extend the original imsg_compose/_create API to take pid & fd too -make imsg_compose do imsg_create + imsg_add + imsg_close instead of duplicating the code -adjust all callers to the new API ok claudio
2004-08-13Fix minor issues with IPv6 dumps and add a function for dumping the RIB tableClaudio Jeker
protocol independent. This new dump format is not (yet) supported by the mrtd route_btoa tool. OK henning@
2004-08-11mrt dumps for cloned sessions did not work because the wrong address was used.Claudio Jeker
OK henning@
2004-08-11buf_write() returns -1 on error and -2 on connection closed. Treat bothClaudio Jeker
as errors for mrt dumps.
2004-08-10Always free message buffer on error.Claudio Jeker
2004-08-10Support IPv6 in message and state transition dumps. Table dumps stillClaudio Jeker
unsupported. OK henning@
2004-08-06Monster diff to get one step closer to IPv6 support.Claudio Jeker
Cleanup path attribute handling. First of all kill struct attr_flags, all those infos are now in struct rde_aspath. Second move attribute parser functions into rde.c, rde_attr.c is shared between bgpd and bgpctl. Third reimplementation of the nexthop handling. Make it IPv6 ready and fix some major bug relating to "set nexthop". henning@ OK if it breaks nothing
2004-08-05struct prefix has a pointer to the peer so use it everywhere directly insteadClaudio Jeker
of the detour via aspath.
2004-08-03Make mrt dumps mrt compliant. I already fixed one of those but this oneClaudio Jeker
slipped my attention. Now all bgpd dumps can be read with mrt's route_btoa.
2004-07-28The hole dance to close a mrt file after fd passing in the parent is notClaudio Jeker
needed as the fd is closed while beeing passed. looks good henning@
2004-07-07Stupid typo that may cause a lot of pain. Found by Patrick Latifi. Thanks.Claudio Jeker
2004-07-07Bad interpretation of the oh so well documented mrt spec. Found byClaudio Jeker
Stefan Wahl.
2004-07-03Switch mrt dumping to fd passing. This gives some speed up when extensiveClaudio Jeker
dumping is done. Acctually mrt dumps were broken because of the fd passing. The nice side effect is a much cleaner code, especially in the parent process. OK henning@
2004-06-22Make the RDE IPv6 ready missing is the message handling. The internalClaudio Jeker
prefix tree changed form a hash table to a per AF RB tree. OK henning@ some ideas are from Brent Graveland.
2004-06-20at least somewhat consistently name the TAILQ_ENTRYs... this confused meHenning Brauer
more than once
2004-04-29sock -> fd; ok henningTheo de Raadt
2004-04-28spacingTheo de Raadt
2004-02-27remove unneded peer pointer in struct prefix and change a in_addr_t toClaudio Jeker
struct in_addr. OK henning@
2004-02-25Rewrite some parts of the mrt dump handling. It is no longer possible toClaudio Jeker
dump the filtered updates but therefore it is now possible to dump per neighbor and also to dump the outgoing messages. OK henning@
2004-02-19Make the code more portable. Add some missing header files and make the useClaudio Jeker
of the queue(3) makros more portable. OK henning@ some time ago.
2004-02-02* use macro expansion instead of hardcoding 'buf'.Henning Brauer
From: Patrick Latifi <pat@eyeo.org>, claudio ok
2004-01-27use a struct bgpd_addr instead of sockaddr_in for peer_config->local_addr andHenning Brauer
->remote_addr for easier multiprotocol support ok claudio@
2004-01-22use log_warnx and log_info. reclassify a few messages in the process and fixHenning Brauer
a few messages. ok claudio@
2004-01-11Move all struct in_addr to either struct bgpd_addr or in_addr_t whicheverClaudio Jeker
is more appropriate. The rde uses now in most cases struct bgpd_addr. OK henning@
2004-01-11The buffer changes produced some fallout in the mrt code.Claudio Jeker
Wait until all data has been written out before closing the file and fix some obvious misstakes. OK henning@
2004-01-10RDE update generation. First we queue all updates and withdraws on a perClaudio Jeker
peer basis. A queue runner will dequeue and package those messages to valid bgp UPDATE messages and send them to the SE. Not yet done is per peer type attribute handling (like aspath prepends and nexthop modifications) and the queue runner could be a tad smarter. All in all this gives us a good starting point for the missing parts. OK henning@
2004-01-07Duh. Fixing stupid braino. OK henning@Claudio Jeker
2004-01-06Free buf on error and correct of by one in strlcpy.Claudio Jeker
From Patrick Latifi <pat at eyeo.org> OK henning@
2004-01-062004 OK henning@Claudio Jeker
2004-01-06Fix reopening of dump files.Claudio Jeker
OK henning@
2004-01-05Big overhaul of the mrt code.Claudio Jeker
Dumping of incomming bgp messages is now possible and dumping the (not yet) filtered updates works too. Per neighbor dumps are still missing. OK henning@
2004-01-01conf -> mconfHenning Brauer
causes a conflicht with upcoming changes
2003-12-26when this project started and i added the fatal() function, I made it takeHenning Brauer
the error number as parameter instead of accessing errno, because in one place the error number was not in errno but fetched from a socket. now, of course it makes much more sense to just set errno to the error number just fecthed in this one place instead of having hundreds of fatal() calls all transfer the errno round and round and round... fix this, and also provide a fatalx, which does not care for errno and doesn't invoke strerror. oh, btw, in the place where we fetch the err # from the socket, we don't call fatal anymore anyway...
2003-12-26In the mrt state machine one state was forgotten. This caused the parentClaudio Jeker
process to quit it a fatal buf_close error message. Noticed and reported by jakob@ OK henning@
2003-12-25free where it was allocated; much easier to verifyHenning Brauer
2003-12-24handle write() returning 0 correctly, adjust the msgbuf API appropriately,Henning Brauer
and make all callers cope.
2003-12-23spacingTheo de Raadt
2003-12-21wrap read & write buffers for imsgs into a struct.Henning Brauer
finally gives us read buffers per pipe instead of per process, eleminating a possible race. also gets us a real imsg_init() that does all the boring init work
2003-12-21overhaul the write buffering code.Henning Brauer
introduce msgbuf API and bundle all info needed for the write buffers in a struct msgbuf. also switch to a write queue per handled connection (each bgp session, each pipe) instead of one big one. fixes some subtle problems and is overall nicer. ok claudio@
2003-12-21yet more from the castathon; most aspath functions where accessing non-Claudio Jeker
aligned memory (u_int16_t) therefor crashed the RDE on my sparc64. All buffer specific functions use now void * instead of u_char * so most cast are now history. Tested on sparc64 and i386. OK henning@
2003-12-20knf. OK henning@Claudio Jeker
2003-12-20let buf_add take void *data instead of u_char *data and save a zillionHenning Brauer
evil casts