code that uses Watchdog to reset Mbed every 30seconds. After 30-60mins, the ethernet interface fails to setup() after WatchDog reset.

Dependencies:   mbed

Committer:
eqon
Date:
Thu Jun 07 05:44:29 2012 +0000
Revision:
0:0ce833f21e63

        

Who changed what in which revision?

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