From 44b01d70c60c5cfac7fa199b0bbb8aeddd37a79b Mon Sep 17 00:00:00 2001
From: Samuel Thibault
int plugin_timer(struct param_timer *data);
A list of the available events follows, with a list of all the fields in the supplied structure:
-| Event | -Description | -Arguments | -||||
|---|---|---|---|---|---|---|
plugin_init |
-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. + | Event+
|
+Description+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. Prior to loading the plugin,
+
plugin_api_version = PLUGIN_API_VERSION; |
-s truct pluginfuncs * |
+Arguments+
|
+|
| + | ||||||
See pluginfuncs structure in plugin.h for
available functions. |
+ | |||||
plugin_done |
Called when the plugin is unloaded or l2tpns is
shutdown. |
void |
-||||
| No arguments. | -||||||
| No arguments. | ++ | + | + | |||
plugin_pre_auth |
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. | struct plug in param_pre_auth * |
+||||
tunnelt *t |
Tunnel. | + | ||||
sessiont *s |
Session. | - | ||||
char *username |
-User name. | |||||
char *password |
-Password. | +char *username |
+User name. | +|||
char *password |
+Password. | ++ | + | |||
int protocol |
Authentication protocol: 0xC023 for PAP,
0xC223 for CHAP. |
- | ||||
int continue_auth |
-Set to 0 to stop processing authentication modules. | |||||
int continue_auth |
+Set to 0 to stop processing authentication modules. | ++ | + | |||
plugin_post_auth |
Called after a RADIUS response has been received, and the basic
checks have been performed. This is what the garden module
uses to force authentication to be accepted. |
struct plugi n param_post_auth * |
+||||
tunnelt *t |
Tunnel. | - | ||||
sessiont *s |
-Session. | |||||
char *username |
-User name. | +sessiont *s |
+Session. | +|||
char *username |
+User name. | ++ | + | |||
short auth_allowed |
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. | + | ||||
int protocol |
Authentication protocol: 0xC023 for PAP,
0xC223 for CHAP. |
+ | ||||
plugin_timer |
Run once per second. | struct p lugin param_timer * |
-||||
time_t time_now |
-The current unix timestamp. | |||||
time_t time_now |
+The current unix timestamp. | ++ | + | |||
plugin_new_session |
Called after a session is fully set up. The session is now ready to handle traffic. | struct plugin param_new_session * |
-||||
tunnelt *t |
-Tunnel. | |||||
sessiont *s |
-Session. | +tunnelt *t |
+Tunnel. | +|||
sessiont *s |
+Session. | ++ | + | |||
plugin_kill_session |
Called when a session is about to be shut down. This may be called multiple times for the same session. | struct plugin p aram_kill_session * |
-||||
tunnelt *t |
-Tunnel. | |||||
sessiont *s |
-Session. | +tunnelt *t |
+Tunnel. | +|||
sessiont *s |
+Session. | ++ | + | |||
plugin_control |
Called in whenever a
*plugin_control_hel p[] = { …, NULL }; |
struct plu gin param_control * |
+||||
int iam_master |
If true, this node is the cluster master. | - | ||||
int argc |
-nsctl arguments. |
|||||
char **argc |
+int argc |
+nsctl arguments. |
||||
char **argc |
++ | + | + | |||
int response |
Response from control message (if handled): should be either
NSCTL_RES_OK or NSCTL_RES_ERR. |
+ | ||||
char *additional |
Additional information, output by nsctl on receiving
the response. |
- | ||||
plu gin_radius_response |
-Called whenever a RADIUS response includes a
-Cisco-AVPair value. The value is split into
-key=value pairs. Will be called once for each pair in the
-response. |
-struct plugin para m_radius_response * |
+||||
plugin_radius_response | Called whenever a
+|
+struct plugin para | | RADIUS response | m_radius_response *
+| | includes a | | | Cisco-AVPair | | | value. The value is
+| | | split into | | | key=value pairs. | | | Will be
+called once | | | for each pair in the | | | response. | | |
+||||||
tunnelt *t |
Tunnel. | - | ||||
sessiont *s |
-Session. | |||||
sessiont *s |
+Session. | ++ | + | |||
char *key |
Key and value. | + | ||||
char *value |
- | |||||
plugin_radius_reset |
-Called whenever a RADIUS CoA request is received to reset any -options to default values before the new values are applied. | -struct p aram_radius_reset * |
-||||
tunnelt *t |
-Tunnel. | -- | ||||
sessiont *s |
-Session. | |||||
pl ugin_radius_account |
-Called when preparing a RADIUS accounting record to allow additional -data to be added to the packet. | -struct par am_radius_account * |
+plugin_radius_reset | Called whenever a |
+struct p | | RADIUS CoA request | aram_radius_reset *
+| | is received to reset | | | any options to | | | default values | | |
+before the new | | | values are applied. | | |
|||
tunnelt *t |
Tunnel. | + | ||||
sessiont *s |
Session. | + | ||||
plugin_radius_account | Called when |
+struct par | | preparing a RADIUS | am_radius_account *
+| | accounting record to | | | allow additional | | | data to be added
+to | | | the packet. | | |
+||||||
tunnelt *t |
+Tunnel. | ++ | + | |||
sessiont *s |
+Session. | ++ | + | |||
uint8_t **packet |
Pointer to the end of the currently assembled packet buffer. The value should be incremented by the length of any data added. | - | ||||
p lugin_become_master |
-Called when a node elects itself cluster master. | -void |
+||||
plugin_become_master | Called when a node |
+void | | elects itself | | | cluster master. | | |
+||||||
| No arguments. | - | |||||
plugin _new_session_master |
-Called once for each open session on becoming cluster master. | -sessiont * |
+||||
plugin_new_session_master | Called once for
+each | sessiont * | open session on | | | becoming cluster
+| | | master. | | |
+||||||
| Session. | + | |||||