+/*!
+ @function mbuf_attachcluster
+ @discussion Attach an external buffer as a cluster for an mbuf. If mbuf
+ points to a NULL mbuf_t, an mbuf will be allocated for you. If
+ mbuf points to a non-NULL mbuf_t, the user-supplied mbuf will
+ be used instead. The caller is responsible for allocating the
+ external buffer by calling mbuf_alloccluster().
+ @param how Blocking or non-blocking.
+ @param type The type of the mbuf if mbuf is non-NULL; otherwise ignored.
+ @param mbuf Pointer to the address of the mbuf; if NULL, an mbuf will
+ be allocated, otherwise, it must point to a valid mbuf address.
+ If the user-supplied mbuf is already attached to a cluster, the
+ current cluster will be freed before the mbuf gets attached to
+ the supplied external buffer. Note that this routine may return
+ a different mbuf_t than the one you passed in.
+ @param extbuf Address of the external buffer.
+ @param extfree Free routine for the external buffer; the caller is
+ required to defined a routine that will be invoked when the
+ mbuf is freed.
+ @param extsize Size of the external buffer.
+ @param extarg Private value that will be passed to the free routine
+ when it is called at the time the mbuf is freed.
+ @result 0 on success
+ EINVAL - Invalid parameter
+ ENOMEM - Not enough memory available
+ */
+extern errno_t mbuf_attachcluster(mbuf_how_t how, mbuf_type_t type,
+ mbuf_t *mbuf, caddr_t extbuf, void (*extfree)(caddr_t , u_int, caddr_t),
+ size_t extsize, caddr_t extarg);
+
+/*!
+ @function mbuf_alloccluster
+ @discussion Allocate a cluster that can be later attached to an
+ mbuf by calling mbuf_attachcluster(). The allocated cluster
+ can also be freed (without being attached to an mbuf) by
+ calling mbuf_freecluster(). At the moment this routine
+ will either return a cluster of 2048, 4096 or 16384 bytes
+ depending on the requested size. Note that clusters greater
+ than 4096 bytes might not be available in all configurations;
+ the caller must additionally check for ENOTSUP (see below).
+ @param how Blocking or non-blocking.
+ @param size Pointer to size of requested cluster. Sizes up to 2048
+ will be rounded up to 2048; sizes greater than 2048 and up
+ to 4096 will be rounded up to 4096. Sizes greater than 4096
+ will be rounded up to 16384.
+ @param addr Pointer to the address of the requested cluster.
+ @result 0 on success or ENOMEM if failure. If the caller requests
+ greater than 4096 bytes and the system is unable to fulfill
+ the request due to the lack of jumbo clusters support based
+ on the configuration, this routine will return ENOTSUP.
+ In this case, the caller is advised to use 4096 bytes or
+ smaller during subseqent requests.
+ */
+extern errno_t mbuf_alloccluster(mbuf_how_t how, size_t *size, caddr_t *addr);
+
+/*!
+ @function mbuf_freecluster
+ @discussion Free a cluster that was previously allocated by a call
+ to mbuf_alloccluster(). The caller must pass the actual
+ size of the cluster as returned by mbuf_alloccluster(),
+ which at this point must be either 2048, 4096 or 16384 bytes.
+ @param addr The address of the cluster.
+ @param size The actual size of the cluster.
+ */
+extern void mbuf_freecluster(caddr_t addr, size_t size);