Committer:
zoot661
Date:
Tue May 29 09:49:18 2012 +0000
Revision:
0:f993b6d8b1d8

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
zoot661 0:f993b6d8b1d8 1 /*****************************************************************************
zoot661 0:f993b6d8b1d8 2 * auth.h - PPP Authentication and phase control header file.
zoot661 0:f993b6d8b1d8 3 *
zoot661 0:f993b6d8b1d8 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
zoot661 0:f993b6d8b1d8 5 * portions Copyright (c) 1998 Global Election Systems Inc.
zoot661 0:f993b6d8b1d8 6 *
zoot661 0:f993b6d8b1d8 7 * The authors hereby grant permission to use, copy, modify, distribute,
zoot661 0:f993b6d8b1d8 8 * and license this software and its documentation for any purpose, provided
zoot661 0:f993b6d8b1d8 9 * that existing copyright notices are retained in all copies and that this
zoot661 0:f993b6d8b1d8 10 * notice and the following disclaimer are included verbatim in any
zoot661 0:f993b6d8b1d8 11 * distributions. No written agreement, license, or royalty fee is required
zoot661 0:f993b6d8b1d8 12 * for any of the authorized uses.
zoot661 0:f993b6d8b1d8 13 *
zoot661 0:f993b6d8b1d8 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
zoot661 0:f993b6d8b1d8 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
zoot661 0:f993b6d8b1d8 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
zoot661 0:f993b6d8b1d8 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
zoot661 0:f993b6d8b1d8 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
zoot661 0:f993b6d8b1d8 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
zoot661 0:f993b6d8b1d8 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
zoot661 0:f993b6d8b1d8 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
zoot661 0:f993b6d8b1d8 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
zoot661 0:f993b6d8b1d8 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
zoot661 0:f993b6d8b1d8 24 *
zoot661 0:f993b6d8b1d8 25 ******************************************************************************
zoot661 0:f993b6d8b1d8 26 * REVISION HISTORY
zoot661 0:f993b6d8b1d8 27 *
zoot661 0:f993b6d8b1d8 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
zoot661 0:f993b6d8b1d8 29 * Ported to lwIP.
zoot661 0:f993b6d8b1d8 30 * 97-12-04 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc.
zoot661 0:f993b6d8b1d8 31 * Original derived from BSD pppd.h.
zoot661 0:f993b6d8b1d8 32 *****************************************************************************/
zoot661 0:f993b6d8b1d8 33 /*
zoot661 0:f993b6d8b1d8 34 * pppd.h - PPP daemon global declarations.
zoot661 0:f993b6d8b1d8 35 *
zoot661 0:f993b6d8b1d8 36 * Copyright (c) 1989 Carnegie Mellon University.
zoot661 0:f993b6d8b1d8 37 * All rights reserved.
zoot661 0:f993b6d8b1d8 38 *
zoot661 0:f993b6d8b1d8 39 * Redistribution and use in source and binary forms are permitted
zoot661 0:f993b6d8b1d8 40 * provided that the above copyright notice and this paragraph are
zoot661 0:f993b6d8b1d8 41 * duplicated in all such forms and that any documentation,
zoot661 0:f993b6d8b1d8 42 * advertising materials, and other materials related to such
zoot661 0:f993b6d8b1d8 43 * distribution and use acknowledge that the software was developed
zoot661 0:f993b6d8b1d8 44 * by Carnegie Mellon University. The name of the
zoot661 0:f993b6d8b1d8 45 * University may not be used to endorse or promote products derived
zoot661 0:f993b6d8b1d8 46 * from this software without specific prior written permission.
zoot661 0:f993b6d8b1d8 47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
zoot661 0:f993b6d8b1d8 48 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
zoot661 0:f993b6d8b1d8 49 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
zoot661 0:f993b6d8b1d8 50 *
zoot661 0:f993b6d8b1d8 51 */
zoot661 0:f993b6d8b1d8 52
zoot661 0:f993b6d8b1d8 53 #ifndef AUTH_H
zoot661 0:f993b6d8b1d8 54 #define AUTH_H
zoot661 0:f993b6d8b1d8 55
zoot661 0:f993b6d8b1d8 56 /***********************
zoot661 0:f993b6d8b1d8 57 *** PUBLIC FUNCTIONS ***
zoot661 0:f993b6d8b1d8 58 ***********************/
zoot661 0:f993b6d8b1d8 59
zoot661 0:f993b6d8b1d8 60 /* we are starting to use the link */
zoot661 0:f993b6d8b1d8 61 void link_required (int);
zoot661 0:f993b6d8b1d8 62
zoot661 0:f993b6d8b1d8 63 /* we are finished with the link */
zoot661 0:f993b6d8b1d8 64 void link_terminated (int);
zoot661 0:f993b6d8b1d8 65
zoot661 0:f993b6d8b1d8 66 /* the LCP layer has left the Opened state */
zoot661 0:f993b6d8b1d8 67 void link_down (int);
zoot661 0:f993b6d8b1d8 68
zoot661 0:f993b6d8b1d8 69 /* the link is up; authenticate now */
zoot661 0:f993b6d8b1d8 70 void link_established (int);
zoot661 0:f993b6d8b1d8 71
zoot661 0:f993b6d8b1d8 72 /* a network protocol has come up */
zoot661 0:f993b6d8b1d8 73 void np_up (int, u16_t);
zoot661 0:f993b6d8b1d8 74
zoot661 0:f993b6d8b1d8 75 /* a network protocol has gone down */
zoot661 0:f993b6d8b1d8 76 void np_down (int, u16_t);
zoot661 0:f993b6d8b1d8 77
zoot661 0:f993b6d8b1d8 78 /* a network protocol no longer needs link */
zoot661 0:f993b6d8b1d8 79 void np_finished (int, u16_t);
zoot661 0:f993b6d8b1d8 80
zoot661 0:f993b6d8b1d8 81 /* peer failed to authenticate itself */
zoot661 0:f993b6d8b1d8 82 void auth_peer_fail (int, u16_t);
zoot661 0:f993b6d8b1d8 83
zoot661 0:f993b6d8b1d8 84 /* peer successfully authenticated itself */
zoot661 0:f993b6d8b1d8 85 void auth_peer_success (int, u16_t, char *, int);
zoot661 0:f993b6d8b1d8 86
zoot661 0:f993b6d8b1d8 87 /* we failed to authenticate ourselves */
zoot661 0:f993b6d8b1d8 88 void auth_withpeer_fail (int, u16_t);
zoot661 0:f993b6d8b1d8 89
zoot661 0:f993b6d8b1d8 90 /* we successfully authenticated ourselves */
zoot661 0:f993b6d8b1d8 91 void auth_withpeer_success (int, u16_t);
zoot661 0:f993b6d8b1d8 92
zoot661 0:f993b6d8b1d8 93 /* check authentication options supplied */
zoot661 0:f993b6d8b1d8 94 void auth_check_options (void);
zoot661 0:f993b6d8b1d8 95
zoot661 0:f993b6d8b1d8 96 /* check what secrets we have */
zoot661 0:f993b6d8b1d8 97 void auth_reset (int);
zoot661 0:f993b6d8b1d8 98
zoot661 0:f993b6d8b1d8 99 /* Check peer-supplied username/password */
zoot661 0:f993b6d8b1d8 100 u_char check_passwd (int, char *, int, char *, int, char **, int *);
zoot661 0:f993b6d8b1d8 101
zoot661 0:f993b6d8b1d8 102 /* get "secret" for chap */
zoot661 0:f993b6d8b1d8 103 int get_secret (int, char *, char *, char *, int *, int);
zoot661 0:f993b6d8b1d8 104
zoot661 0:f993b6d8b1d8 105 /* check if IP address is authorized */
zoot661 0:f993b6d8b1d8 106 int auth_ip_addr (int, u32_t);
zoot661 0:f993b6d8b1d8 107
zoot661 0:f993b6d8b1d8 108 /* check if IP address is unreasonable */
zoot661 0:f993b6d8b1d8 109 int bad_ip_adrs (u32_t);
zoot661 0:f993b6d8b1d8 110
zoot661 0:f993b6d8b1d8 111 #endif /* AUTH_H */