X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=PLUGINS;h=af43f51fee859d1cf0f5052e7fcac091e40fb782;hp=2cbb427a5c1031b320fef790f451c1497fd68691;hb=6e6bb3246106e680463c106d1ee6b773fc4f9c5a;hpb=315faba747695d905ef13f899e20eaefbf55aa7c diff --git a/PLUGINS b/PLUGINS index 2cbb427..af43f51 100644 --- a/PLUGINS +++ b/PLUGINS @@ -98,9 +98,7 @@ to reestablish the link (0 means immediately). int (*pap_check_hook)(void); int (*pap_passwd_hook)(char *user, char *passwd); -int (*pap_auth_hook)(char *user, int userlen, - char *passwd, int passlen, - char **msgp, int *msglenp, +int (*pap_auth_hook)(char *user, char *passwd, char **msgp, struct wordlist **paddrs, struct wordlist **popts); void (*pap_logout_hook)(void); @@ -147,6 +145,42 @@ pppd's internal `plogout' function. It can be used for accounting purposes. This hook is deprecated and will be replaced by a notifier. +int (*chap_check_hook)(void); +int (*chap_passwd_hook)(char *user, char *passwd); +int (*chap_auth_hook)(char *user, u_char *remmd, + int remmd_len, chap_state *cstate); + +These hooks are designed to allow a plugin to replace the normal CHAP +password processing in pppd with something different (e.g. contacting +an external server). + +The chap_check_hook is called to check whether there is any possibility +that the peer could authenticate itself to us. If it returns 1, pppd +will ask the peer to authenticate itself. If it returns 0, pppd will +not ask the peer to authenticate itself (but if authentication is +required, pppd may exit, or terminate the link before network protocol +negotiation). If it returns -1, pppd will look in the chap-secrets +file as it would normally. + +The chap_passwd_hook is called to determine what password +pppd should use in authenticating itself to the peer with CHAP. The +user string will already be initialized, by the `user' option, the +`name' option, or from the hostname, but can be changed if necessary. +This hook is called only if pppd is a client, not if it is a server. + +MAXSECRETLEN bytes of space are available at *passwd. If this hook +returns 0, pppd will use the value *passwd; if it returns -1, pppd +will fail to authenticate. + +The chap_auth_hook is called to determine whether the response +to a CHAP challenge provided by the peer is valid. user points to +a null-terminated string containing the username supplied +by the peer. remmd points to the response provided by the peer, of +length remmd_len bytes. cstate is the internal CHAP state structure +maintained by pppd. chap_auth_hook is expected to return one of +CHAP_SUCCESS or CHAP_FAILURE. + + int (*null_auth_hook)(struct wordlist **paddrs, struct wordlist **popts); @@ -167,6 +201,22 @@ should be stored in *addrp. If nothing is stored in *addrp, pppd will determine the peer's address in the usual manner. +int (*allowed_address_hook)(u_int32_t addr) + +This hook is called to see if a peer is allowed to use the specified +address. If the hook returns 1, the address is accepted. If it returns +0, the address is rejected. If it returns -1, the address is verified +in the normal away against the appropriate options and secrets files. + + +void (*snoop_recv_hook)(unsigned char *p, int len) +void (*snoop_send_hook)(unsigned char *p, int len) + +These hooks are called whenever pppd receives or sends a packet. The +packet is in p; its length is len. This allows plugins to "snoop in" +on the pppd conversation. The hooks may prove useful in implmenting +L2TP. + A plugin registers itself with a notifier by declaring a procedure of the form: @@ -213,4 +263,4 @@ Here is a list of the currently-implemented notifiers in pppd. -## $Id: PLUGINS,v 1.3 2001/05/21 08:34:33 paulus Exp $ ## +## $Id: PLUGINS,v 1.6 2003/02/25 07:43:09 fcusack Exp $ ##