创建mbed

Dependencies:   EthernetInterface SDFileSystem mbed-rtos mbed

Committer:
sunyiming
Date:
Tue Mar 06 08:53:46 2018 +0000
Revision:
1:6465a3f5c58a
??OK

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sunyiming 1:6465a3f5c58a 1 /*****************************************************************************
sunyiming 1:6465a3f5c58a 2 * magic.c - Network Random Number Generator program file.
sunyiming 1:6465a3f5c58a 3 *
sunyiming 1:6465a3f5c58a 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
sunyiming 1:6465a3f5c58a 5 * portions Copyright (c) 1997 by Global Election Systems Inc.
sunyiming 1:6465a3f5c58a 6 *
sunyiming 1:6465a3f5c58a 7 * The authors hereby grant permission to use, copy, modify, distribute,
sunyiming 1:6465a3f5c58a 8 * and license this software and its documentation for any purpose, provided
sunyiming 1:6465a3f5c58a 9 * that existing copyright notices are retained in all copies and that this
sunyiming 1:6465a3f5c58a 10 * notice and the following disclaimer are included verbatim in any
sunyiming 1:6465a3f5c58a 11 * distributions. No written agreement, license, or royalty fee is required
sunyiming 1:6465a3f5c58a 12 * for any of the authorized uses.
sunyiming 1:6465a3f5c58a 13 *
sunyiming 1:6465a3f5c58a 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
sunyiming 1:6465a3f5c58a 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
sunyiming 1:6465a3f5c58a 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
sunyiming 1:6465a3f5c58a 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
sunyiming 1:6465a3f5c58a 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
sunyiming 1:6465a3f5c58a 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
sunyiming 1:6465a3f5c58a 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
sunyiming 1:6465a3f5c58a 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
sunyiming 1:6465a3f5c58a 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
sunyiming 1:6465a3f5c58a 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
sunyiming 1:6465a3f5c58a 24 *
sunyiming 1:6465a3f5c58a 25 ******************************************************************************
sunyiming 1:6465a3f5c58a 26 * REVISION HISTORY
sunyiming 1:6465a3f5c58a 27 *
sunyiming 1:6465a3f5c58a 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
sunyiming 1:6465a3f5c58a 29 * Ported to lwIP.
sunyiming 1:6465a3f5c58a 30 * 97-12-04 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc.
sunyiming 1:6465a3f5c58a 31 * Original based on BSD magic.c.
sunyiming 1:6465a3f5c58a 32 *****************************************************************************/
sunyiming 1:6465a3f5c58a 33 /*
sunyiming 1:6465a3f5c58a 34 * magic.c - PPP Magic Number routines.
sunyiming 1:6465a3f5c58a 35 *
sunyiming 1:6465a3f5c58a 36 * Copyright (c) 1989 Carnegie Mellon University.
sunyiming 1:6465a3f5c58a 37 * All rights reserved.
sunyiming 1:6465a3f5c58a 38 *
sunyiming 1:6465a3f5c58a 39 * Redistribution and use in source and binary forms are permitted
sunyiming 1:6465a3f5c58a 40 * provided that the above copyright notice and this paragraph are
sunyiming 1:6465a3f5c58a 41 * duplicated in all such forms and that any documentation,
sunyiming 1:6465a3f5c58a 42 * advertising materials, and other materials related to such
sunyiming 1:6465a3f5c58a 43 * distribution and use acknowledge that the software was developed
sunyiming 1:6465a3f5c58a 44 * by Carnegie Mellon University. The name of the
sunyiming 1:6465a3f5c58a 45 * University may not be used to endorse or promote products derived
sunyiming 1:6465a3f5c58a 46 * from this software without specific prior written permission.
sunyiming 1:6465a3f5c58a 47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
sunyiming 1:6465a3f5c58a 48 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
sunyiming 1:6465a3f5c58a 49 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
sunyiming 1:6465a3f5c58a 50 */
sunyiming 1:6465a3f5c58a 51
sunyiming 1:6465a3f5c58a 52 #include "lwip/opt.h"
sunyiming 1:6465a3f5c58a 53
sunyiming 1:6465a3f5c58a 54 #if PPP_SUPPORT
sunyiming 1:6465a3f5c58a 55
sunyiming 1:6465a3f5c58a 56 #include "ppp.h"
sunyiming 1:6465a3f5c58a 57 #include "randm.h"
sunyiming 1:6465a3f5c58a 58 #include "magic.h"
sunyiming 1:6465a3f5c58a 59
sunyiming 1:6465a3f5c58a 60
sunyiming 1:6465a3f5c58a 61 /*
sunyiming 1:6465a3f5c58a 62 * magicInit - Initialize the magic number generator.
sunyiming 1:6465a3f5c58a 63 *
sunyiming 1:6465a3f5c58a 64 * Since we use another random number generator that has its own
sunyiming 1:6465a3f5c58a 65 * initialization, we do nothing here.
sunyiming 1:6465a3f5c58a 66 */
sunyiming 1:6465a3f5c58a 67 void magicInit()
sunyiming 1:6465a3f5c58a 68 {
sunyiming 1:6465a3f5c58a 69 return;
sunyiming 1:6465a3f5c58a 70 }
sunyiming 1:6465a3f5c58a 71
sunyiming 1:6465a3f5c58a 72 /*
sunyiming 1:6465a3f5c58a 73 * magic - Returns the next magic number.
sunyiming 1:6465a3f5c58a 74 */
sunyiming 1:6465a3f5c58a 75 u32_t magic()
sunyiming 1:6465a3f5c58a 76 {
sunyiming 1:6465a3f5c58a 77 return avRandom();
sunyiming 1:6465a3f5c58a 78 }
sunyiming 1:6465a3f5c58a 79
sunyiming 1:6465a3f5c58a 80 #endif /* PPP_SUPPORT */