diff options
author | ru <ru@FreeBSD.org> | 2004-01-27 20:25:14 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2004-01-27 20:25:14 +0000 |
commit | adc82a1e80759afba2cfae432d4ee1ca190be1f4 (patch) | |
tree | 92ee6204e54cff03c751ded7b2d193159acbf5f2 /lib/libnetgraph/netgraph.h | |
parent | f24f6452fe6f2143c7c182fae610d62cfa8994b8 (diff) | |
download | FreeBSD-src-adc82a1e80759afba2cfae432d4ee1ca190be1f4.zip FreeBSD-src-adc82a1e80759afba2cfae432d4ee1ca190be1f4.tar.gz |
- Added three new interfaces, NgAllocRecvMsg(), NgAllocRecvAsciiMsg(),
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
Diffstat (limited to 'lib/libnetgraph/netgraph.h')
-rw-r--r-- | lib/libnetgraph/netgraph.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libnetgraph/netgraph.h b/lib/libnetgraph/netgraph.h index d0f402c..4eb15bd 100644 --- a/lib/libnetgraph/netgraph.h +++ b/lib/libnetgraph/netgraph.h @@ -54,9 +54,12 @@ int NgSendAsciiMsg(int, const char *, const char *, ...) __printflike(3, 4); int NgSendReplyMsg(int, const char *, const struct ng_mesg *, const void *, size_t); int NgRecvMsg(int, struct ng_mesg *, size_t, char *); +int NgAllocRecvMsg(int, struct ng_mesg **, char *); int NgRecvAsciiMsg(int, struct ng_mesg *, size_t, char *); +int NgAllocRecvAsciiMsg(int, struct ng_mesg **, char *); int NgSendData(int, const char *, const u_char *, size_t); int NgRecvData(int, u_char *, size_t, char *); +int NgAllocRecvData(int, u_char **, char *); int NgSetDebug(int); void NgSetErrLog(void (*)(const char *fmt, ...), void (*)(const char *fmt, ...)); |