xref: /freebsd/usr.sbin/ppp/auth.h (revision cd9647a100862f877a4459adffd24751a7026122)
11ae349f5Scvs2svn /*
21ae349f5Scvs2svn  *	    Written by Toshiharu OHNO (tony-o@iij.ad.jp)
31ae349f5Scvs2svn  *
41ae349f5Scvs2svn  *   Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
51ae349f5Scvs2svn  *
61ae349f5Scvs2svn  * Redistribution and use in source and binary forms are permitted
71ae349f5Scvs2svn  * provided that the above copyright notice and this paragraph are
81ae349f5Scvs2svn  * duplicated in all such forms and that any documentation,
91ae349f5Scvs2svn  * advertising materials, and other materials related to such
101ae349f5Scvs2svn  * distribution and use acknowledge that the software was developed
111ae349f5Scvs2svn  * by the Internet Initiative Japan.  The name of the
121ae349f5Scvs2svn  * IIJ may not be used to endorse or promote products derived
131ae349f5Scvs2svn  * from this software without specific prior written permission.
141ae349f5Scvs2svn  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
151ae349f5Scvs2svn  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
161ae349f5Scvs2svn  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
171ae349f5Scvs2svn  *
18cd9647a1SBrian Somers  * $Id: auth.h,v 1.10.2.4 1998/03/01 01:07:38 brian Exp $
191ae349f5Scvs2svn  *
201ae349f5Scvs2svn  *	TODO:
211ae349f5Scvs2svn  */
221ae349f5Scvs2svn 
2363b73463SBrian Somers struct physical;
2463b73463SBrian Somers 
251ae349f5Scvs2svn typedef enum {
261ae349f5Scvs2svn   VALID,
271ae349f5Scvs2svn   INVALID,
281ae349f5Scvs2svn   NOT_FOUND
291ae349f5Scvs2svn } LOCAL_AUTH_VALID;
301ae349f5Scvs2svn 
311ae349f5Scvs2svn struct authinfo {
32e2ebb036SBrian Somers   void (*ChallengeFunc)(struct authinfo *, int, struct physical *);
331ae349f5Scvs2svn   struct pppTimer authtimer;
341ae349f5Scvs2svn   int retry;
351ae349f5Scvs2svn   int id;
3663b73463SBrian Somers   struct physical *physical;
37cd9647a1SBrian Somers   struct {
38cd9647a1SBrian Somers     u_int fsmretry;
39cd9647a1SBrian Somers   } cfg;
401ae349f5Scvs2svn };
411ae349f5Scvs2svn 
42e2ebb036SBrian Somers extern void authinfo_Init(struct authinfo *);
43e2ebb036SBrian Somers 
44455aabc3SBrian Somers extern const char *Auth2Nam(u_short);
451ae349f5Scvs2svn extern LOCAL_AUTH_VALID LocalAuthValidate(const char *, const char *, const char *);
461ae349f5Scvs2svn extern void StopAuthTimer(struct authinfo *);
47e2ebb036SBrian Somers extern void StartAuthChallenge(struct authinfo *, struct physical *,
48e2ebb036SBrian Somers                    void (*fn)(struct authinfo *, int, struct physical *));
491ae349f5Scvs2svn extern void LocalAuthInit(void);
507a6f8720SBrian Somers extern int AuthValidate(struct bundle *, const char *, const char *,
517a6f8720SBrian Somers                         const char *, struct physical *);
527a6f8720SBrian Somers extern char *AuthGetSecret(struct bundle *, const char *, const char *, int,
537a6f8720SBrian Somers                            int, struct physical *);
54