James Sutton / Mbed 2 deprecated IBMIoTClientEthernetExample-MACfix-DebugFix

Dependencies:   C12832 EthernetInterface LM75B MMA7660 MQTT mbed-rtos mbed

Fork of IBMIoTClientEthernetExample-MACfix by Chris Styles

Committer:
icraggs
Date:
Wed Oct 01 13:27:35 2014 +0000
Revision:
8:80d49dd91542
Parent:
6:37b6d0d56190
Remove conditional compilation for IBM IoT settings

Who changed what in which revision?

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