Committer:
mbed714
Date:
Sat Sep 18 23:05:49 2010 +0000
Revision:
0:d616ece2d859

        

Who changed what in which revision?

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