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