diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:59:05 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:59:05 -0400 |
| commit | 1f19f33e45791ea59aed048796fc68672c6723a5 (patch) | |
| tree | 54625fba89e91d1c2177801ec635e8528bba937f /static/freebsd/man9/crypto_buffer.9 3.html | |
| parent | ac5e55f5f2af5b92794c2aded46c6bae85b5f5ed (diff) | |
docs: Removed Precompiled HTML
Diffstat (limited to 'static/freebsd/man9/crypto_buffer.9 3.html')
| -rw-r--r-- | static/freebsd/man9/crypto_buffer.9 3.html | 256 |
1 files changed, 0 insertions, 256 deletions
diff --git a/static/freebsd/man9/crypto_buffer.9 3.html b/static/freebsd/man9/crypto_buffer.9 3.html deleted file mode 100644 index cb954fa0..00000000 --- a/static/freebsd/man9/crypto_buffer.9 3.html +++ /dev/null @@ -1,256 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">CRYPTO_BUFFER(9)</td> - <td class="head-vol">Kernel Developer's Manual</td> - <td class="head-rtitle">CRYPTO_BUFFER(9)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">crypto_buffer</code> — - <span class="Nd">symmetric cryptographic request buffers</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<p class="Pp"><code class="In">#include - <<a class="In">opencrypto/cryptodev.h</a>></code></p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">crypto_apply</code>(<var class="Fa">struct cryptop - *crp</var>, <var class="Fa">int off</var>, <var class="Fa">int len</var>, - <var class="Fa">int (*f)(void *, void *, u_int)</var>, <var class="Fa">void - *arg</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">crypto_apply_buf</code>(<var class="Fa">struct crypto_buffer - *cb</var>, <var class="Fa">int off</var>, <var class="Fa">int len</var>, - <var class="Fa">int (*f)(void *, void *, u_int)</var>, <var class="Fa">void - *arg</var>);</p> -<p class="Pp"><var class="Ft">void *</var> - <br/> - <code class="Fn">crypto_buffer_contiguous_subsegment</code>(<var class="Fa">struct - crypto_buffer *cb</var>, <var class="Fa">size_t skip</var>, - <var class="Fa">size_t len</var>);</p> -<p class="Pp"><var class="Ft">size_t</var> - <br/> - <code class="Fn">crypto_buffer_len</code>(<var class="Fa" style="white-space: nowrap;">struct - crypto_buffer *cb</var>);</p> -<p class="Pp"><var class="Ft">void *</var> - <br/> - <code class="Fn">crypto_contiguous_subsegment</code>(<var class="Fa">struct - cryptop *crp</var>, <var class="Fa">size_t skip</var>, - <var class="Fa">size_t len</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">crypto_cursor_init</code>(<var class="Fa">struct - crypto_buffer_cursor *cc</var>, <var class="Fa">const struct crypto_buffer - *cb</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">crypto_cursor_advance</code>(<var class="Fa" style="white-space: nowrap;">struct - crypto_buffer_cursor *cc</var>, - <var class="Fa" style="white-space: nowrap;">size_t amount</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">crypto_cursor_copyback</code>(<var class="Fa">struct - crypto_buffer_cursor *cc</var>, <var class="Fa">int size</var>, - <var class="Fa">const void *src</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">crypto_cursor_copydata</code>(<var class="Fa">struct - crypto_buffer_cursor *cc</var>, <var class="Fa">int size</var>, - <var class="Fa">void *dst</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">crypto_cursor_copydata_noadv</code>(<var class="Fa">struct - crypto_buffer_cursor *cc</var>, <var class="Fa">int size</var>, - <var class="Fa">void *dst</var>);</p> -<p class="Pp"><var class="Ft">void *</var> - <br/> - <code class="Fn">crypto_cursor_segment</code>(<var class="Fa" style="white-space: nowrap;">struct - crypto_buffer_cursor *cc</var>, - <var class="Fa" style="white-space: nowrap;">size_t *len</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">crypto_cursor_copy</code>(<var class="Fa">const struct - crypto_buffer_cursor *fromc</var>, <var class="Fa">struct - crypto_buffer_cursor *toc</var>);</p> -<p class="Pp"><var class="Ft">bool</var> - <br/> - <code class="Fn">CRYPTO_HAS_OUTPUT_BUFFER</code>(<var class="Fa" style="white-space: nowrap;">struct - cryptop *crp</var>);</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">Symmetric cryptographic requests use data buffers to describe the - data to be modified. Requests can either specify a single data buffer whose - contents are modified in place, or requests may specify separate data - buffers for input and output. <var class="Vt">struct crypto_buffer</var> - provides an abstraction that permits cryptographic requests to operate on - different types of buffers. <var class="Vt">struct crypto_cursor</var> - allows cryptographic drivers to iterate over a data buffer.</p> -<p class="Pp" id="CRYPTO_HAS_OUTPUT_BUFFER"><a class="permalink" href="#CRYPTO_HAS_OUTPUT_BUFFER"><code class="Fn">CRYPTO_HAS_OUTPUT_BUFFER</code></a>() - returns true if <var class="Fa">crp</var> uses separate buffers for input - and output and false if <var class="Fa">crp</var> uses a single buffer.</p> -<p class="Pp" id="crypto_buffer_len"><a class="permalink" href="#crypto_buffer_len"><code class="Fn">crypto_buffer_len</code></a>() - returns the length of data buffer <var class="Fa">cb</var> in bytes.</p> -<p class="Pp" id="crypto_apply_buf"><a class="permalink" href="#crypto_apply_buf"><code class="Fn">crypto_apply_buf</code></a>() - invokes a caller-supplied function to a region of the data buffer - <var class="Fa">cb</var>. The function <var class="Fa">f</var> is called one - or more times. For each invocation, the first argument to - <var class="Fa">f</var> is the value of <var class="Fa">arg</var> passed to - <code class="Fn">crypto_apply_buf</code>(). The second and third arguments - to <var class="Fa">f</var> are a pointer and length to a segment of the - buffer mapped into the kernel. The function is called enough times to cover - the <var class="Fa">len</var> bytes of the data buffer which starts at an - offset <var class="Fa">off</var>. If any invocation of - <var class="Fa">f</var> returns a non-zero value, - <code class="Fn">crypto_apply_buf</code>() immediately returns that value - without invoking <var class="Fa">f</var> on any remaining segments of the - region, otherwise <code class="Fn">crypto_apply_buf</code>() returns the - value from the final call to <var class="Fa">f</var>. - <a class="permalink" href="#crypto_apply"><code class="Fn" id="crypto_apply">crypto_apply</code></a>() - invokes the callback <var class="Fa">f</var> on a region of the input data - buffer for <var class="Fa">crp</var>.</p> -<p class="Pp" id="crypto_buffer_contiguous_subsegment"><a class="permalink" href="#crypto_buffer_contiguous_subsegment"><code class="Fn">crypto_buffer_contiguous_subsegment</code></a>() - attempts to locate a single, virtually-contiguous segment of the data buffer - <var class="Fa">cb</var>. The segment must be <var class="Fa">len</var> - bytes long and start at an offset of <var class="Fa">skip</var> bytes. If a - segment is found, a pointer to the start of the segment is returned. - Otherwise, <code class="Dv">NULL</code> is returned. - <a class="permalink" href="#crypto_contiguous_subsegment"><code class="Fn" id="crypto_contiguous_subsegment">crypto_contiguous_subsegment</code></a>() - attempts to locate a single, virtually-contiguous segment in the input data - buffer for <var class="Fa">crp</var>.</p> -<section class="Ss"> -<h2 class="Ss" id="Data_Buffers"><a class="permalink" href="#Data_Buffers">Data - Buffers</a></h2> -<p class="Pp">Data buffers are described by an instance of - <var class="Vt">struct crypto buffer</var>. The - <var class="Fa">cb_type</var> member contains the type of the data buffer. - The following types are supported:</p> -<dl class="Bl-tag"> - <dt id="CRYPTO_BUF_NONE"><a class="permalink" href="#CRYPTO_BUF_NONE"><code class="Dv">CRYPTO_BUF_NONE</code></a></dt> - <dd>An invalid buffer. Used to mark the output buffer when a crypto request - uses a single data buffer.</dd> - <dt id="CRYPTO_BUF_CONTIG"><a class="permalink" href="#CRYPTO_BUF_CONTIG"><code class="Dv">CRYPTO_BUF_CONTIG</code></a></dt> - <dd>An array of bytes mapped into the kernel's address space.</dd> - <dt id="CRYPTO_BUF_UIO"><a class="permalink" href="#CRYPTO_BUF_UIO"><code class="Dv">CRYPTO_BUF_UIO</code></a></dt> - <dd>A scatter/gather list of kernel buffers as described in - <a class="Xr">uio(9)</a>.</dd> - <dt id="CRYPTO_BUF_MBUF"><a class="permalink" href="#CRYPTO_BUF_MBUF"><code class="Dv">CRYPTO_BUF_MBUF</code></a></dt> - <dd>A chain of network memory buffers as described in - <a class="Xr">mbuf(9)</a>.</dd> - <dt id="CRYPTO_BUF_SINGLE_MBUF"><a class="permalink" href="#CRYPTO_BUF_SINGLE_MBUF"><code class="Dv">CRYPTO_BUF_SINGLE_MBUF</code></a></dt> - <dd>A single network memory buffer as described in - <a class="Xr">mbuf(9)</a>.</dd> - <dt id="CRYPTO_BUF_VMPAGE"><a class="permalink" href="#CRYPTO_BUF_VMPAGE"><code class="Dv">CRYPTO_BUF_VMPAGE</code></a></dt> - <dd>A scatter/gather list of <var class="Vt">vm_page_t</var> structures - describing pages in the kernel's address space. This buffer type is only - available if <code class="Dv">CRYPTO_HAS_VMPAGE</code> is true.</dd> -</dl> -<p class="Pp">The structure also contains the following type-specific - fields:</p> -<dl class="Bl-tag"> - <dt><var class="Fa">cb_buf</var></dt> - <dd>A pointer to the start of a <code class="Dv">CRYPTO_BUF_CONTIG</code> data - buffer.</dd> - <dt><var class="Fa">cb_buf_len</var></dt> - <dd>The length of a <code class="Dv">CRYPTO_BUF_CONTIG</code> data buffer</dd> - <dt><var class="Fa">cb_mbuf</var></dt> - <dd>A pointer to a <var class="Vt">struct mbuf</var> for - <code class="Dv">CRYPTO_BUF_MBUF</code> and - <code class="Dv">CRYPTO_BUF_SINGLE_MBUF</code>.</dd> - <dt><var class="Fa">cb_uio</var></dt> - <dd>A pointer to a <var class="Vt">struct uio</var> for - <code class="Dv">CRYPTO_BUF_UIO</code>.</dd> - <dt><var class="Fa">cb_vm_page</var></dt> - <dd>A pointer to an array of <var class="Vt">struct vm_page</var> for - <code class="Dv">CRYPTO_BUF_VMPAGE</code>.</dd> - <dt><var class="Fa">cb_vm_page_len</var></dt> - <dd>The total amount of data included in the <var class="Fa">cb_vm_page</var> - array, in bytes.</dd> - <dt><var class="Fa">cb_vm_page_offset</var></dt> - <dd>Offset in bytes in the first page of <var class="Fa">cb_vm_page</var> - where valid data begins.</dd> -</dl> -</section> -<section class="Ss"> -<h2 class="Ss" id="Cursors"><a class="permalink" href="#Cursors">Cursors</a></h2> -<p class="Pp">Cursors provide a mechanism for iterating over a data buffer. They - are primarily intended for use in software drivers which access data buffers - via virtual addresses.</p> -<p class="Pp" id="crypto_cursor_init"><a class="permalink" href="#crypto_cursor_init"><code class="Fn">crypto_cursor_init</code></a>() - initializes the cursor <var class="Fa">cc</var> to reference the start of - the data buffer <var class="Fa">cb</var>.</p> -<p class="Pp" id="crypto_cursor_advance"><a class="permalink" href="#crypto_cursor_advance"><code class="Fn">crypto_cursor_advance</code></a>() - advances the cursor <var class="Fa">amount</var> bytes forward in the data - buffer.</p> -<p class="Pp" id="crypto_cursor_copyback"><a class="permalink" href="#crypto_cursor_copyback"><code class="Fn">crypto_cursor_copyback</code></a>() - copies <var class="Fa">size</var> bytes from the local buffer pointed to by - <var class="Fa">src</var> into the data buffer associated with - <var class="Fa">cc</var>. The bytes are written to the current position of - <var class="Fa">cc</var>, and the cursor is then advanced by - <var class="Fa">size</var> bytes.</p> -<p class="Pp" id="crypto_cursor_copydata"><a class="permalink" href="#crypto_cursor_copydata"><code class="Fn">crypto_cursor_copydata</code></a>() - copies <var class="Fa">size</var> bytes out of the data buffer associated - with <var class="Fa">cc</var> into a local buffer pointed to by - <var class="Fa">dst</var>. The bytes are read from the current position of - <var class="Fa">cc</var>, and the cursor is then advanced by - <var class="Fa">size</var> bytes.</p> -<p class="Pp" id="crypto_cursor_copydata_noadv"><a class="permalink" href="#crypto_cursor_copydata_noadv"><code class="Fn">crypto_cursor_copydata_noadv</code></a>() - is similar to <code class="Fn">crypto_cursor_copydata</code>() except that - it does not change the current position of <var class="Fa">cc</var>.</p> -<p class="Pp" id="crypto_cursor_segment"><a class="permalink" href="#crypto_cursor_segment"><code class="Fn">crypto_cursor_segment</code></a>() - returns the start of the virtually-contiguous segment at the current - position of <var class="Fa">cc</var>. The length of the segment is stored in - <var class="Fa">len</var>.</p> -</section> -</section> -<section class="Sh"> -<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN - VALUES</a></h1> -<p class="Pp"><code class="Fn">crypto_apply</code>() and - <code class="Fn">crypto_apply_buf</code>() return the return value from the - caller-supplied callback function.</p> -<p class="Pp"><code class="Fn">crypto_buffer_contiguous_subsegment</code>(), - <code class="Fn">crypto_contiguous_subsegment</code>(), and - <code class="Fn">crypto_cursor_segment</code>() return a pointer to a - contiguous segment or <code class="Dv">NULL</code>.</p> -<p class="Pp"><code class="Fn">crypto_buffer_len</code>() returns the length of - a buffer in bytes.</p> -<p class="Pp"><code class="Fn">crypto_cursor_seglen</code>() returns the length - in bytes of a contiguous segment.</p> -<p class="Pp"><code class="Fn">crypto_cursor_copy</code>() makes a deep copy of - the cursor <var class="Fa">fromc</var>. The two copies do not share any - state and can thus be used independently.</p> -<p class="Pp"><code class="Fn">CRYPTO_HAS_OUTPUT_BUFFER</code>() returns true if - the request uses a separate output buffer.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">ipsec(4)</a>, <a class="Xr">crypto(7)</a>, - <a class="Xr">bus_dma(9)</a>, <a class="Xr">crypto(9)</a>, - <a class="Xr">crypto_driver(9)</a>, <a class="Xr">crypto_request(9)</a>, - <a class="Xr">crypto_session(9)</a>, <a class="Xr">mbuf(9)</a>, - <a class="Xr">uio(9)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">The <code class="Nm">crypto_buffer</code> functions first appeared - in <span class="Ux">FreeBSD 13</span>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> -<p class="Pp">The <code class="Nm">crypto_buffer</code> functions and this - manual page were written by <span class="An">John Baldwin</span> - <<a class="Mt" href="mailto:jhb@FreeBSD.org">jhb@FreeBSD.org</a>>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">February 11, 2022</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> |
