OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.14, Wed May 26 16:44:33 2010 UTC (14 years ago) by nicm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +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.13 / (download) - annotate - [select for diffs], Wed May 26 13:56:08 2010 UTC (14 years ago) by nicm
Branch: MAIN
Changes since 1.12: +11 -11 lines
Diff to previous 1.12 (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.12 / (download) - annotate - [select for diffs], Wed Apr 7 18:09:39 2010 UTC (14 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Sat Aug 8 18:33:40 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.10: +6 -3 lines
Diff to previous 1.10 (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.10 / (download) - annotate - [select for diffs], Mon Jun 8 08:30:06 2009 UTC (14 years, 11 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.9: +4 -11 lines
Diff to previous 1.9 (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.9 / (download) - annotate - [select for diffs], Sun Jun 7 05:56:25 2009 UTC (14 years, 11 months ago) by eric
Branch: MAIN
Changes since 1.8: +15 -3 lines
Diff to previous 1.8 (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.8 / (download) - annotate - [select for diffs], Sun Jun 7 00:40:46 2009 UTC (14 years, 11 months ago) by eric
Branch: MAIN
Changes since 1.7: +11 -3 lines
Diff to previous 1.7 (colored)

Make the imsg protocol network-safe.

ok pyr@

Revision 1.7 / (download) - annotate - [select for diffs], Sat Jun 6 22:11:25 2009 UTC (14 years, 11 months ago) by eric
Branch: MAIN
Changes since 1.6: +4 -3 lines
Diff to previous 1.6 (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.6 / (download) - annotate - [select for diffs], Sat Jun 6 05:52:01 2009 UTC (14 years, 11 months ago) by pyr
Branch: MAIN
Changes since 1.5: +43 -53 lines
Diff to previous 1.5 (colored)

sync snmpd with the common imsg code, making it lib ready as well.
ok eric@

Revision 1.5 / (download) - annotate - [select for diffs], Mon Mar 24 16:11:05 2008 UTC (16 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

msg_controllen has to be CMSG_SPACE so that the kernel can account for
each cmsg_len (ie. msg_controllen = sum of CMSG_ALIGN(cmsg_len).  This
works now that kernel fd passing has been fixed to accept a bit of
sloppiness because of this ABI repair.
lots of discussion with kettenis

Revision 1.4 / (download) - annotate - [select for diffs], Sat Mar 15 16:19:02 2008 UTC (16 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

Repair the simple cases for msg_controllen where it should just be
CMSG_SIZE(sizeof(int)), not sizeof(buffer) which may be larger because
of alignment; ok kettenis hshoexer

Revision 1.3 / (download) - annotate - [select for diffs], Thu Mar 13 01:49:53 2008 UTC (16 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +7 -4 lines
Diff to previous 1.2 (colored)

Correct CMSG_SPACE and CMSG_LEN usage everywhere in the tree. Due to
an extensive discussion with otto, kettenis, millert, and hshoexer

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jan 18 02:09:30 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.1: +34 -6 lines
Diff to previous 1.1 (colored)

add a snmpctl command to send traps to registered receivers using
snmpd's imsg trap interface.

Revision 1.1 / (download) - annotate - [select for diffs], Wed Dec 5 09:22:44 2007 UTC (16 years, 6 months ago) by reyk
Branch: MAIN

Start working on snmpd(8) and snmpctl(8), a lightweight SNMP implementation
for OpenBSD.  SNMP is a necessary evil.  This is work in progress, don't
expect too much from it yet.

ok deraadt@

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.