HTTPClient using static IP

Dependencies:   mbed

Committer:
mr_q
Date:
Mon May 30 11:53:37 2011 +0000
Revision:
0:d8f2f7d5f31b
v0.01 Draft

Who changed what in which revision?

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