OpenBSD CVS

CVS log for src/usr.sbin/ospfd/Attic/imsg.c


[BACK] Up to [local] / src / usr.sbin / ospfd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.22, Wed May 26 16:44:32 2010 UTC (14 years ago) by nicm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.21: +1 -1 lines
FILE REMOVED

Move imsg into libutil and add a man page.

Minor bump for libutil.

Previous versions of this diff and man page looked at by various people.

"you should just commit" deraadt

Revision 1.21 / (download) - annotate - [select for diffs], Wed May 26 13:56:08 2010 UTC (14 years ago) by nicm
Branch: MAIN
Changes since 1.20: +11 -11 lines
Diff to previous 1.20 (colored)

Rename some imsg bits to make namespace collisions less likely buf to
ibuf, buf_read to ibuf_read, READ_BUF_SIZE to IBUF_READ_SIZE.

ok henning gilles claudio jacekm deraadt

Revision 1.20 / (download) - annotate - [select for diffs], Wed Apr 7 18:09:39 2010 UTC (14 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

Remove XXX comment and just close received fd if calloc() fails.

If this happens the imsg may no longer be usable as there may be queued
messages, but this is a) already the case with the code now, and b)
would be the case if recvmsg() fails anyway, so we can document that -1
from imsg_read() invalidates the struct imsgbuf.

discussed with and ok eric

Revision 1.19 / (download) - annotate - [select for diffs], Sat Aug 8 18:33:40 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.18: +6 -3 lines
Diff to previous 1.18 (colored)

Make imsg_clear close and free any fds in the received fd queue as well as
freeing the msgbuf.

While here also remove an unnecessary while loop.

ok eric pyr

Revision 1.18 / (download) - annotate - [select for diffs], Mon Jun 8 08:30:06 2009 UTC (15 years ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.17: +4 -11 lines
Diff to previous 1.17 (colored)

revert this change by eric@:

Make the imsg protocol network-safe.


it might be network safe, but half the imsg based daemons on my firewalls
dont run anymore.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Jun 7 05:56:25 2009 UTC (15 years ago) by eric
Branch: MAIN
Changes since 1.16: +15 -3 lines
Diff to previous 1.16 (colored)

Change the way fds passed over a socket are retreived on the receiving side.

Currently the receiver fetches an imsg via imsg_get() and if he expects
an fd, he then calls imsg_get_fd() to fetch the next fd queued on the
imsgbuf from which the imsg came.

This changes hides the fd queueing mechanism to the API user.  When closing
an imsg with an fd, the message is flagged so that the receiving end knows
it must dequeue the fd in imsg_get() and return it with the imsg structure.
This way there is no (less) possible screw up from imsg_get_fd() not being
called directly after imsg_get() by the user. The retreived imsg is
self-contained.

ok pyr@, "I like that" henning@

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jun 7 00:40:46 2009 UTC (15 years ago) by eric
Branch: MAIN
Changes since 1.15: +11 -3 lines
Diff to previous 1.15 (colored)

Make the imsg protocol network-safe.

ok pyr@

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jun 6 22:11:25 2009 UTC (15 years ago) by eric
Branch: MAIN
Changes since 1.14: +4 -3 lines
Diff to previous 1.14 (colored)

change the imsg header fields a bit to prepare for upcoming changes.
add a flag field, use u_int32_t for pid_t and extend type to 32 bits
for padding.

ok pyr@

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jun 6 07:31:26 2009 UTC (15 years ago) by eric
Branch: MAIN
Changes since 1.13: +4 -5 lines
Diff to previous 1.13 (colored)

sync ospfctl/ospfd with the common imsg code, making it lib ready as well.

"looks ok" claudio@

Revision 1.13 / (download) - annotate - [select for diffs], Sat Jun 6 05:04:12 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.12: +6 -8 lines
Diff to previous 1.12 (colored)

remove unnecessary and scary pid check in imsg_init.
ok eric@, claudio@

Revision 1.12 / (download) - annotate - [select for diffs], Fri Jun 5 19:33:58 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.11: +111 -30 lines
Diff to previous 1.11 (colored)

make ospfd's imsg lib ready as well.
ok claudio@

Revision 1.11 / (download) - annotate - [select for diffs], Fri Jun 5 01:19:09 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.10: +3 -12 lines
Diff to previous 1.10 (colored)

treat buf->wpos as the size to send out on the wire, not buf->size,
this plays better with dynamic buffers which are now the norm.
ok by a slightly annoyed claudio@, ok eric@

Revision 1.10 / (download) - annotate - [select for diffs], Wed Mar 4 12:51:01 2009 UTC (15 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.9: +9 -5 lines
Diff to previous 1.9 (colored)

Introduce and use buf_size(buf) instead of buf->wpos -- at least in the non
buf/imsg specific code. buf_close() will no force a truncation of the buffer
to the wpos but actually add code in imsg.c to detect and report such silly
behaviour. Makes the buf API a bit more sane.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jul 24 16:46:09 2007 UTC (16 years, 10 months ago) by pyr
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.8: +8 -5 lines
Diff to previous 1.8 (colored)

make imsg_create use dynamic buffers.
this does not change imsg_compose's behavior but allows the message's
buffer to grow and will avoid sending a ton of small messages when
unrolling lists between two processes.

this is needed for sending multiple routes at once when updating the
fib with multipath routes.

discussed and ok claudio@

Revision 1.8 / (download) - annotate - [select for diffs], Mon Mar 19 10:03:25 2007 UTC (17 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

when our red/recv/recvmsg in imsg_read gives EINTR or EAGAIN, do not
signal "connection closed" upstream.
spotted by Valentin Kozamernik <tin@komna.com>

Revision 1.7 / (download) - annotate - [select for diffs], Sat May 27 20:07:42 2006 UTC (18 years ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.6: +3 -2 lines
Diff to previous 1.6 (colored)

sync to bgpd: use ibuf->pid in imsg_create if pid == 0, claudio ok

Revision 1.6 / (download) - annotate - [select for diffs], Fri Feb 10 18:30:47 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.5: +8 -36 lines
Diff to previous 1.5 (colored)

ospfd does not need fd passing via the imsg framework so remove that code
and remove other unneeded functions that are only used in bgpd.

Revision 1.5 / (download) - annotate - [select for diffs], Wed Feb 1 18:31:47 2006 UTC (18 years, 4 months ago) by norby
Branch: MAIN
Changes since 1.4: +1 -17 lines
Diff to previous 1.4 (colored)

zap unused function.

ok claudio@

Revision 1.4 / (download) - annotate - [select for diffs], Tue Apr 26 15:18:22 2005 UTC (19 years, 1 month ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.3: +5 -6 lines
Diff to previous 1.3 (colored)

unify shared code a bit again to make future syncs easier
From: Alexander von Gernler <grunk@pestilenz.org>

Revision 1.3 / (download) - annotate - [select for diffs], Wed Mar 23 10:46:26 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.2: +2 -3 lines
Diff to previous 1.2 (colored)

ssize_t -> size_t, from ntpd, there from Alexander von Gernler

Revision 1.2 / (download) - annotate - [select for diffs], Wed Mar 9 14:14:01 2005 UTC (19 years, 3 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

memcpy/memmove correctness here as well

Revision 1.1 / (download) - annotate - [select for diffs], Fri Jan 28 14:05:40 2005 UTC (19 years, 4 months ago) by claudio
Branch: MAIN

Welcome ospfd
started by Esben Norby some time ago by using the imsg/three process framework
of bgpd. He implemented the basic concept plus the ospf finite state machines.
Later I joined and helped him cleanup, debug and extend his work.
Right now it is not particularly useful, major parts are still missing but is
imported to allow more people to work on it.
status:
The basic protocol works for broadcast networks and the LS database is
synchronized and updated. It is not possible to be DR or BDR on a network
and other interface types like point-to-point are not yet supported.
The shortest path tree is not calculated and so no routing information is
exchanged with the kernel FIB.

Not yet connected to the builds.
OK henning@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.