Library for Bert van Dam's book "ARM MICROCONTROLLERS" For all chapters with internet.

Dependencies:   mbed

Committer:
ICTFBI
Date:
Fri Oct 16 14:28:26 2015 +0000
Revision:
0:4edb816d21e1
Pre-update 16-10-15

Who changed what in which revision?

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