testing of combination of LCS and LAN

Dependencies:   mbed

Committer:
damir
Date:
Wed Jan 14 13:29:55 2015 +0000
Revision:
0:a7a6a692162f
Test of LAN

Who changed what in which revision?

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