aboutsummaryrefslogtreecommitdiff
path: root/lib/libnetgraph/msg.c
Commit message (Collapse)AuthorAgeFilesLines
* lib: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Atomically update the global gMsgId in libnetgraph.Mark Johnston2019-05-101-7/+4
| | | | | | | | | | | | | | | | | Otherwise concurrently running threads may inadvertently use the same token for different messages. Preserve the behaviour of disallowing negative message tokens, but allow a message token value of zero since this simplifies the code a bit and tokens are documented to be non-negative. PR: 234442 Reported and tested by: eugen MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=347439
* Fix for quite a special case when userland emulates a netgraph node, andGleb Smirnoff2013-03-111-1/+1
| | | | | | | | | | | userland can reply to a message with NGM_HASREPLY bit set. In this case we should not wait for a response to a responce. PR: 176771 Submitted by: Keith Reynolds <keith.reynolds tidalscale.com> Notes: svn path=/head/; revision=248159
* Replace select() by poll() to avoid problems with bigAlexander Motin2007-05-141-5/+6
| | | | | | | | | descriptor number. Approved by: glebius (mentor) Notes: svn path=/head/; revision=169551
* Include sys/socket.h to know about sa_family_t.Gleb Smirnoff2006-10-171-0/+1
| | | | Notes: svn path=/head/; revision=163469
* In the splnet(9) times netgraph(4) was synchronous and if a messageGleb Smirnoff2006-01-121-0/+16
| | | | | | | | | | | | | | | | | | | | | had been replied, the reply was always delivered to the originator synchronously. With introduction of netgraph item callbacks and a wait channel with mutex in ng_socket(4), we have fixed the problem with ngctl(8) returning earlier than the command has been proceeded by target node. But still ngctl(8) can return prior to the reply has arrived to its node. To fix this: - Introduce a new flag for netgraph(4) messages - NGM_HASREPLY. This flag is or'ed with message like NGM_READONLY. - In netgraph userland library if we have sent a message with NGM_HASREPLY flag, then select(2) until reply comes. - Mark appropriate generic commands with NGM_HASREPLY flag, gathering them into one enum {}. Bump generic cookie. Notes: svn path=/head/; revision=154265
* Make this compile with GCC4 by fixing a few signedness related warnings.Maxime Henrion2005-04-261-4/+5
| | | | | | | Reviewed by: md5(1) Notes: svn path=/head/; revision=145546
* When we have converted an ASCII message to binary, set its version inGleb Smirnoff2005-02-041-0/+1
| | | | | | | | | the header. Otherwise we will send a message with zero version. MFC after: 3 days Notes: svn path=/head/; revision=141307
* - Added three new interfaces, NgAllocRecvMsg(), NgAllocRecvAsciiMsg(),Ruslan Ermilov2004-01-271-8/+45
| | | | | | | | | | | | | | and NgAllocRecvData(), that dynamically allocate buffer for a binary message, an ascii message, and a data packet, respectively. The size of the allocated buffer is equal to the socket's receive buffer size to guarantee that a message or a data packet is not truncated. - Get rid of the static size buffer in NgSendAsciiMsg(). OK'ed by: archie, julian Notes: svn path=/head/; revision=125113
* Fixed memory leak in NgSendAsciiMsg().Ruslan Ermilov2004-01-271-1/+4
| | | | Notes: svn path=/head/; revision=125104
* Use the new defines that include the trailing '\0' in the code.Hartmut Brandt2003-11-141-6/+7
| | | | | | | | | | Replace occurences of the magic constant 2 with an offsetof macro call that computes the size of the leading members of the sockaddr. Use strlcpy instead of sprintf where appropriate. Document the new changes in the man page. Notes: svn path=/head/; revision=122649
* Fix bugs in NgSendMsg() and NgSendAsciiMsg() where the wrong tokenArchie Cobbs2001-10-251-2/+2
| | | | | | | | | | value could be returned when the debug level was non-zero. Submitted by: Harti Brandt <brandt@fokus.gmd.de> MFC after: 5 days Notes: svn path=/head/; revision=85456
* Add __FBSDID()s to libnetgraphMatthew Dillon2001-09-301-2/+3
| | | | Notes: svn path=/head/; revision=84215
* - Make sure the message token returned by NgSendMsg() is non-negativeArchie Cobbs2000-06-211-4/+11
| | | | | | | | | - Have NgSendAsciiMsg() return the same token as NgSendMsg() - Document that NgSendMsg() and NgSendAsciiMsg() return the token - Add MLINKS for the functions defined in netgraph(3) Notes: svn path=/head/; revision=61922
* Fix buffer overflow bug in NgSendAsciiMsg().Archie Cobbs2000-06-021-1/+1
| | | | Notes: svn path=/head/; revision=61188
* Add two new generic control messages, NGM_ASCII2BINARY andArchie Cobbs1999-11-301-2/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | NGM_BINARY2ASCII, which convert control messages to ASCII and back. This allows control messages to be sent and received in ASCII form using ngctl(8), which makes ngctl a lot more useful. This also allows all the type-specific debugging code in libnetgraph to go away -- instead, we just ask the node itself to do the ASCII translation for us. Currently, all generic control messages are supported, as well as messages associated with the following node types: async, cisco, ksocket, and ppp. See /usr/share/examples/netgraph/ngctl for an example of using this. Also give ngctl(8) the ability to print out incoming data and control messages at any time. Eventually nghook(8) may be subsumed. Several other misc. bug fixes. Reviewed by: julian Notes: svn path=/head/; revision=53913
* Whistle's Netgraph link-layer (sometimes more) networking infrastructure.Julian Elischer1999-10-211-0/+206
Been in production for 3 years now. Gives Instant Frame relay to if_sr and if_ar drivers, and PPPOE support soon. See: ftp://ftp.whistle.com/pub/archie/netgraph/index.html for on-line manual pages. Reviewed by: Doug Rabson (dfr@freebsd.org) Obtained from: Whistle CVS tree Notes: svn path=/head/; revision=52419