summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/imsg.c
AgeCommit message (Collapse)Author
2005-04-26unify shared code a bit again to make future syncs easierHenning Brauer
From: Alexander von Gernler <grunk@pestilenz.org>
2005-03-23ssize_t -> size_t, from ntpd, there from Alexander von GernlerHenning Brauer
2005-03-09correctness: memmove instead of memcpy where we might have overlapsHenning Brauer
2004-09-17Fix log messageClaudio Jeker
2004-09-16imsg type is really an enum imsg_type and not an intHenning Brauer
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-19better diagnosticsHenning Brauer
2004-08-11Typo. OK henning@Claudio Jeker
2004-07-05fix a few KNF falloutsHenning Brauer
2004-06-20allow for receival of up to 16 fds at once; after discussion with theoHenning Brauer
2004-06-20implement file descriptor passing in the imsg/msgbuf framework, and useHenning Brauer
it to let the main process to prepare new listening sockets (socket() and bind()) on behalf of the session engine, which of course cannot bind() to ports < 1024 any more once it dropped privileges. with some help from theo, claudio ok
2004-04-29sock -> fd; ok henningTheo de Raadt
2004-03-12tweak err reportingHenning Brauer
2004-02-16Extend imsg API so that messages can be composed on the fly. In the RDE itClaudio Jeker
happens often, that imsg consists of multiple objects. OK henning@
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-22s/log_err/log_warn/Henning Brauer
it is like warn(3), nor err(3). so use a less confusing name.
2004-01-09get us a stateful imsg relaying framework, and the first receiver,Henning Brauer
IMSG_CTL_KROUTE, to have the kroute structs forming the fib sent to a control socket. ok claudio@
2004-01-062004Henning Brauer
2004-01-03change imsg_read semantics so that the number of bytes read is returned.Henning Brauer
that means that the callers can (and must) coope with closed connections themselves, what is exactly the desired behaviour.
2004-01-01listen on a AF_LOCAL socket for imsgs too.Henning Brauer
only implemented type yet is IMSG_CTL_SHOW_NEIGHBOR which sends back the struct peer for all neighbors. will be used by bgpdctl
2004-01-01typoHenning Brauer
2004-01-01now that imsg_get uses bigger buffers, one read call can put more than oneHenning Brauer
imsg into the buffer. since imsg_get by definition only returns one imsg we missed the next imsg(s) until the next poll event on the socket in question, building up a queue on that socket. didn't show up as a problem yet... factor out imsg_read, which reads into the buffer. imsg_get now entirely operates on the buffers and does not read(2) itself. make all callers cope by calling imsg_read on poll events and calling imsg_get in a loop until all imsgs are processed.
2003-12-30correctly free after buf_add/_close errs.Henning Brauer
From: Patrick Latifi <pat@eyeo.org>
2003-12-30missing free()s in error cases that (now) lead to program terminationHenning Brauer
From: Patrick Latifi <pat@eyeo.org>
2003-12-28redo the imsg readers to use bigger buffers and less read(2)s. should increaseHenning Brauer
performance even further. gets rif od struct imsg_readbuf; rename peer_read_buf to read_buf as that is more appropriate now.
2003-12-26let imsg_get and imsg_compose not fatal() but return errors upstream.Henning Brauer
make the callers cope.
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-24handle write() returning 0 correctly, adjust the msgbuf API appropriately,Henning Brauer
and make all callers cope.
2003-12-21rename get_imsg() to imsg_get(); that's more consistentHenning Brauer
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-20more cast cleanup imsg_compose takes now a void * argument. OK henning@Claudio Jeker
2003-12-20let buf_add take void *data instead of u_char *data and save a zillionHenning Brauer
evil casts
2003-12-20fatal() is a bit too much on 0 bytes read. imsg_get returns 0 in otherHenning Brauer
cases as well and all receivers cope
2003-12-20read(2)/write(2) return ssize_t, not size_tHenning Brauer
2003-12-17welcome, bgpdHenning Brauer
started by me some time ago with moral support from theo, the proceeded up to the point where the session engine worked correctly. claudio jeker joined then and did a lot of work in the RDE. it is not particulary usefull as application right now as parts are still missing but is imported to enable more people to work on it. status: BGP sessions get established fine, OPEN messages and then KEEPALIVEs exchanged etc. session FSM works fine; NOTIFICATIONs are handled fine, and all connection drops etc I provoked get handled fine. Incoming UPDATE messgages are parsed well and the data entered to the RIB, the decision process is not yet there, neither is outgoing UPDATEs or sync to the kernel routing table. not connected to the builds yet.