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