regenerate docs

This commit is contained in:
Samuel Thibault 2025-03-30 12:01:04 +02:00
parent 544a622c2a
commit 44b01d70c6
2 changed files with 153 additions and 123 deletions

View file

@ -787,164 +787,189 @@ the event timer, the function declaration should look like:</p>
<pre><code>int plugin_timer(struct param_timer *data);</code></pre>
<p>A list of the available events follows, with a list of all the fields
in the supplied structure:</p>
<table style="width:96%;">
<table style="width:97%;">
<colgroup>
<col style="width: 31%" />
<col style="width: 31%" />
<col style="width: 31%" />
<col style="width: 29%" />
<col style="width: 29%" />
<col style="width: 29%" />
<col style="width: 8%" />
</colgroup>
<thead>
<tr class="header">
<th>Event</th>
<th>Description</th>
<th>Arguments</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>plugin_init</code></td>
<td><p>Called when the plugin is loaded. A pointer to a struct
containing function pointers is passed as the only argument, allowing
the plugin to call back into the main code.</p>
<td rowspan="2"><h1 id="event">Event</h1>
<p><code>plugin_init</code></p></td>
<td rowspan="2"><h1 id="description">Description</h1>
<p>Called when the plugin is loaded. A pointer to a struct containing
function pointers is passed as the only argument, allowing the plugin to
call back into the main code.</p>
<p>Prior to loading the plugin, <code>l2tpns</code> checks the API
version the plugin was compiled against. All plugins should contain:</p>
<pre><code>int</code></pre>
<pre><code> int</code></pre>
<p>plugin_api_version = PLUGIN_API_VERSION;</p></td>
<td><code>s truct pluginfuncs *</code></td>
<td rowspan="2"><h1 id="arguments">Arguments</h1>
<p><code>s truct pluginfuncs *</code></p></td>
<td></td>
</tr>
<tr class="even">
<td></td>
</tr>
<tr class="odd">
<td>See <code>pluginfuncs</code> structure in <code>plugin.h</code> for
available functions.</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<tr class="even">
<td><code>plugin_done</code></td>
<td>Called when the plugin is unloaded or <code>l2tpns</code> is
shutdown.</td>
<td><code>void</code></td>
</tr>
<tr class="even">
<td>No arguments.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>No arguments.</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><code>plugin_pre_auth</code></td>
<td>Called after a RADIUS response has been received, but before it has
been processed by the code. This will allow you to modify the response
in some way.</td>
<td><code>struct plug in param_pre_auth *</code></td>
<td></td>
</tr>
<tr class="even">
<tr class="odd">
<td><code>tunnelt *t</code></td>
<td>Tunnel.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<tr class="even">
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td></td>
</tr>
<tr class="even">
<td><code>char *username</code></td>
<td>User name.</td>
<td></td>
</tr>
<tr class="odd">
<td><code>char *password</code></td>
<td>Password.</td>
<td><code>char *username</code></td>
<td>User name.</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><code>char *password</code></td>
<td>Password.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><code>int protocol</code></td>
<td>Authentication protocol: <code>0xC023</code> for PAP,
<code>0xC223</code> for CHAP.</td>
<td></td>
</tr>
<tr class="odd">
<td><code>int continue_auth</code></td>
<td>Set to 0 to stop processing authentication modules.</td>
<td></td>
</tr>
<tr class="even">
<td><code>int continue_auth</code></td>
<td>Set to 0 to stop processing authentication modules.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><code>plugin_post_auth</code></td>
<td>Called after a RADIUS response has been received, and the basic
checks have been performed. This is what the <code>garden</code> module
uses to force authentication to be accepted.</td>
<td><code>struct plugi n param_post_auth *</code></td>
<td></td>
</tr>
<tr class="odd">
<tr class="even">
<td><code>tunnelt *t</code></td>
<td>Tunnel.</td>
<td></td>
</tr>
<tr class="even">
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td></td>
</tr>
<tr class="odd">
<td><code>char *username</code></td>
<td>User name.</td>
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><code>char *username</code></td>
<td>User name.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><code>short auth_allowed</code></td>
<td>Initially true or false depending on whether authentication has been
allowed so far. You can set this to 1 or 0 to force authentication to be
accepted or rejected.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<tr class="even">
<td><code>int protocol</code></td>
<td>Authentication protocol: <code>0xC023</code> for PAP,
<code>0xC223</code> for CHAP.</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<tr class="odd">
<td><code>plugin_timer</code></td>
<td>Run once per second.</td>
<td><code>struct p lugin param_timer *</code></td>
</tr>
<tr class="odd">
<td><code>time_t time_now</code></td>
<td>The current unix timestamp.</td>
<td></td>
</tr>
<tr class="even">
<td><code>time_t time_now</code></td>
<td>The current unix timestamp.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><code>plugin_new_session</code></td>
<td>Called after a session is fully set up. The session is now ready to
handle traffic.</td>
<td><code>struct plugin param_new_session *</code></td>
</tr>
<tr class="odd">
<td><code>tunnelt *t</code></td>
<td>Tunnel.</td>
<td></td>
</tr>
<tr class="even">
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td><code>tunnelt *t</code></td>
<td>Tunnel.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><code>plugin_kill_session</code></td>
<td>Called when a session is about to be shut down. This may be called
multiple times for the same session.</td>
<td><code>struct plugin p aram_kill_session *</code></td>
</tr>
<tr class="even">
<td><code>tunnelt *t</code></td>
<td>Tunnel.</td>
<td></td>
</tr>
<tr class="odd">
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td><code>tunnelt *t</code></td>
<td>Tunnel.</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><code>plugin_control</code></td>
<td><p>Called in whenever a <code>nsctl</code> packet is received. This
should handle the packet and form a response if required.</p>
@ -954,119 +979,135 @@ of strings as follows:</p>
<pre><code>char</code></pre>
<p>*plugin_control_hel p[] = { …, NULL };</p></td>
<td><code>struct plu gin param_control *</code></td>
<td></td>
</tr>
<tr class="odd">
<tr class="even">
<td><code>int iam_master</code></td>
<td>If true, this node is the cluster master.</td>
<td></td>
</tr>
<tr class="even">
<td><code>int argc</code></td>
<td><code>nsctl</code> arguments.</td>
<td></td>
</tr>
<tr class="odd">
<td><code>char **argc</code></td>
<td><code>int argc</code></td>
<td><code>nsctl</code> arguments.</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><code>char **argc</code></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><code>int response</code></td>
<td>Response from control message (if handled): should be either
<code>NSCTL_RES_OK</code> or <code>NSCTL_RES_ERR</code>.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<tr class="even">
<td><code>char *additional</code></td>
<td>Additional information, output by <code>nsctl</code> on receiving
the response.</td>
<td></td>
</tr>
<tr class="even">
<td><code>plu gin_radius_response</code></td>
<td>Called whenever a RADIUS response includes a
<code>Cisco-AVPair</code> value. The value is split into
key<code>=</code>value pairs. Will be called once for each pair in the
response.</td>
<td><code>struct plugin para m_radius_response *</code></td>
<td></td>
</tr>
<tr class="odd">
<td colspan="4"><code>plugin_radius_response</code> | Called whenever a
|
<code>struct plugin para | | RADIUS response | m_radius_response *</code>
| | includes a | | | <code>Cisco-AVPair</code> | | | value. The value is
| | | split into | | | key<code>=</code>value pairs. | | | Will be
called once | | | for each pair in the | | | response. | |</td>
</tr>
<tr class="even">
<td><code>tunnelt *t</code></td>
<td>Tunnel.</td>
<td></td>
</tr>
<tr class="even">
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td></td>
</tr>
<tr class="odd">
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><code>char *key</code></td>
<td>Key and value.</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<tr class="odd">
<td><code>char *value</code></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><code>plugin_radius_reset</code></td>
<td>Called whenever a RADIUS CoA request is received to reset any
options to default values before the new values are applied.</td>
<td><code>struct p aram_radius_reset *</code></td>
</tr>
<tr class="even">
<td><code>tunnelt *t</code></td>
<td>Tunnel.</td>
<td></td>
</tr>
<tr class="odd">
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td></td>
</tr>
<tr class="even">
<td><code>pl ugin_radius_account</code></td>
<td>Called when preparing a RADIUS accounting record to allow additional
data to be added to the packet.</td>
<td><code>struct par am_radius_account *</code></td>
<td colspan="4"><code>plugin_radius_reset</code> | Called whenever a |
<code>struct p | | RADIUS CoA request | aram_radius_reset *</code>
| | is received to reset | | | any options to | | | default values | | |
before the new | | | values are applied. | |</td>
</tr>
<tr class="odd">
<td><code>tunnelt *t</code></td>
<td>Tunnel.</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td colspan="4"><code>plugin_radius_account</code> | Called when |
<code>struct par | | preparing a RADIUS | am_radius_account *</code>
| | accounting record to | | | allow additional | | | data to be added
to | | | the packet. | |</td>
</tr>
<tr class="even">
<td><code>tunnelt *t</code></td>
<td>Tunnel.</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td><code>sessiont *s</code></td>
<td>Session.</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><code>uint8_t **packet</code></td>
<td>Pointer to the end of the currently assembled packet buffer. The
value should be incremented by the length of any data added.</td>
<td></td>
</tr>
<tr class="even">
<td><code>p lugin_become_master</code></td>
<td>Called when a node elects itself cluster master.</td>
<td><code>void</code></td>
<td></td>
</tr>
<tr class="odd">
<td colspan="4"><code>plugin_become_master</code> | Called when a node |
<code>void</code> | | elects itself | | | cluster master. | |</td>
</tr>
<tr class="even">
<td>No arguments.</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td><code>plugin _new_session_master</code></td>
<td>Called once for each open session on becoming cluster master.</td>
<td><code>sessiont *</code></td>
<td></td>
</tr>
<tr class="odd">
<td colspan="4"><code>plugin_new_session_master</code> | Called once for
each | <code>sessiont *</code> | open session on | | | becoming cluster
| | | master. | |</td>
</tr>
<tr class="even">
<td>Session.</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>

View file

@ -481,18 +481,7 @@ VPN clients):</p>
# iptables --append FORWARD --in-interface eth0 -j ACCEPT
# echo 1 &gt; /proc/sys/net/ipv4/ip_forward</code></pre>
<h1 id="references">References</h1>
<dl>
<dt>VPN Reference</dt>
<dd>
<p><a
href="http://www.jacco2.dds.nl/networking/freeswan-l2tp.html"></a></p>
</dd>
<dt>L2TPns Project</dt>
<dd>
<p><a href="http://l2tpns.sourceforge.net"></a></p>
</dd>
<dt>OpenSWAN Project</dt>
<dd>
<p><a href="http://www.openswan.org"></a></p>
</dd>
</dl>
<p><a href="http://www.jacco2.dds.nl/networking/freeswan-l2tp.html">VPN
Reference</a></p>
<p><a href="https://code.ffdn.org/l2tpns/l2tpns/">L2TPns Project</a></p>
<p><a href="http://www.openswan.org">OpenSWAN Project</a></p>