Deprecated fork of old network stack source from github. Please use official library instead: https://mbed.org/users/mbed_official/code/EthernetInterface/

Committer:
AdamGreen
Date:
Sat Oct 26 08:51:36 2013 +0000
Revision:
1:eadc868c2acf
Parent:
0:3b00827bb0b7
Fix TCP checksum bug and stranded large TCP segments.

Who changed what in which revision?

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