A pair of convenience functions that I'd like to eventually
see make their way into OpenSolaris is to copy data from a
static buffer into an mblk and to copy data from an mblk
into a static buffer.

In modern BSD kernels, these functions live under the names of
m_copydata() and m_copyback() (see below.)  I'm not particularly
attached to the names, only the functionality.  Actually, if
there are some suggestions on what they should be called in
OpenSolaris, I'm open...

Comments?

Darren

/*
 * Copy data from an mbuf chain starting "off" bytes from the beginning,
 * continuing for "len" bytes, into the indicated buffer.
 */
void m_copydata(struct mbuf *m, int off, int len, void *vp)

/*
 * Copy data from a buffer back into the indicated mbuf chain,
 * starting "off" bytes from the beginning, extending the mbuf
 * chain if necessary.
 */
void m_copyback(struct mbuf *m0, int off, int len, const void *cp)


_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to