testing of combination of LCS and LAN

Dependencies:   mbed

Committer:
damir
Date:
Wed Jan 14 13:29:55 2015 +0000
Revision:
0:a7a6a692162f
Test of LAN

Who changed what in which revision?

UserRevisionLine numberNew contents of line
damir 0:a7a6a692162f 1 /*****************************************************************************
damir 0:a7a6a692162f 2 * randm.h - Random number generator header file.
damir 0:a7a6a692162f 3 *
damir 0:a7a6a692162f 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
damir 0:a7a6a692162f 5 * Copyright (c) 1998 Global Election Systems Inc.
damir 0:a7a6a692162f 6 *
damir 0:a7a6a692162f 7 * The authors hereby grant permission to use, copy, modify, distribute,
damir 0:a7a6a692162f 8 * and license this software and its documentation for any purpose, provided
damir 0:a7a6a692162f 9 * that existing copyright notices are retained in all copies and that this
damir 0:a7a6a692162f 10 * notice and the following disclaimer are included verbatim in any
damir 0:a7a6a692162f 11 * distributions. No written agreement, license, or royalty fee is required
damir 0:a7a6a692162f 12 * for any of the authorized uses.
damir 0:a7a6a692162f 13 *
damir 0:a7a6a692162f 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
damir 0:a7a6a692162f 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
damir 0:a7a6a692162f 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
damir 0:a7a6a692162f 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
damir 0:a7a6a692162f 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
damir 0:a7a6a692162f 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
damir 0:a7a6a692162f 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
damir 0:a7a6a692162f 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
damir 0:a7a6a692162f 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
damir 0:a7a6a692162f 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
damir 0:a7a6a692162f 24 *
damir 0:a7a6a692162f 25 ******************************************************************************
damir 0:a7a6a692162f 26 * REVISION HISTORY
damir 0:a7a6a692162f 27 *
damir 0:a7a6a692162f 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
damir 0:a7a6a692162f 29 * Ported to lwIP.
damir 0:a7a6a692162f 30 * 98-05-29 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
damir 0:a7a6a692162f 31 * Extracted from avos.
damir 0:a7a6a692162f 32 *****************************************************************************/
damir 0:a7a6a692162f 33
damir 0:a7a6a692162f 34 #ifndef RANDM_H
damir 0:a7a6a692162f 35 #define RANDM_H
damir 0:a7a6a692162f 36
damir 0:a7a6a692162f 37 /***********************
damir 0:a7a6a692162f 38 *** PUBLIC FUNCTIONS ***
damir 0:a7a6a692162f 39 ***********************/
damir 0:a7a6a692162f 40 /*
damir 0:a7a6a692162f 41 * Initialize the random number generator.
damir 0:a7a6a692162f 42 */
damir 0:a7a6a692162f 43 void avRandomInit(void);
damir 0:a7a6a692162f 44
damir 0:a7a6a692162f 45 /*
damir 0:a7a6a692162f 46 * Churn the randomness pool on a random event. Call this early and often
damir 0:a7a6a692162f 47 * on random and semi-random system events to build randomness in time for
damir 0:a7a6a692162f 48 * usage. For randomly timed events, pass a null pointer and a zero length
damir 0:a7a6a692162f 49 * and this will use the system timer and other sources to add randomness.
damir 0:a7a6a692162f 50 * If new random data is available, pass a pointer to that and it will be
damir 0:a7a6a692162f 51 * included.
damir 0:a7a6a692162f 52 */
damir 0:a7a6a692162f 53 void avChurnRand(char *randData, u32_t randLen);
damir 0:a7a6a692162f 54
damir 0:a7a6a692162f 55 /*
damir 0:a7a6a692162f 56 * Randomize our random seed value. To be called for truely random events
damir 0:a7a6a692162f 57 * such as user operations and network traffic.
damir 0:a7a6a692162f 58 */
damir 0:a7a6a692162f 59 #if MD5_SUPPORT
damir 0:a7a6a692162f 60 #define avRandomize() avChurnRand(NULL, 0)
damir 0:a7a6a692162f 61 #else /* MD5_SUPPORT */
damir 0:a7a6a692162f 62 void avRandomize(void);
damir 0:a7a6a692162f 63 #endif /* MD5_SUPPORT */
damir 0:a7a6a692162f 64
damir 0:a7a6a692162f 65 /*
damir 0:a7a6a692162f 66 * Use the random pool to generate random data. This degrades to pseudo
damir 0:a7a6a692162f 67 * random when used faster than randomness is supplied using churnRand().
damir 0:a7a6a692162f 68 * Thus it's important to make sure that the results of this are not
damir 0:a7a6a692162f 69 * published directly because one could predict the next result to at
damir 0:a7a6a692162f 70 * least some degree. Also, it's important to get a good seed before
damir 0:a7a6a692162f 71 * the first use.
damir 0:a7a6a692162f 72 */
damir 0:a7a6a692162f 73 void avGenRand(char *buf, u32_t bufLen);
damir 0:a7a6a692162f 74
damir 0:a7a6a692162f 75 /*
damir 0:a7a6a692162f 76 * Return a new random number.
damir 0:a7a6a692162f 77 */
damir 0:a7a6a692162f 78 u32_t avRandom(void);
damir 0:a7a6a692162f 79
damir 0:a7a6a692162f 80
damir 0:a7a6a692162f 81 #endif /* RANDM_H */