Give water to plants if dry amd pla meanwhile music the music vou can define with note length bind and breake also select several instruments for the sound

Dependencies:   mbed

Committer:
helmut
Date:
Wed Sep 19 14:16:56 2012 +0000
Revision:
0:5150b09127e3
plays mostly music that you can do with notes length breakes and bind; Some already defined; Tool is to start a pump for water to give plant is too dry.; Meanwhie plays music the most part of all

Who changed what in which revision?

UserRevisionLine numberNew contents of line
helmut 0:5150b09127e3 1 /*****************************************************************************
helmut 0:5150b09127e3 2 * chap.h - Network Challenge Handshake Authentication Protocol header file.
helmut 0:5150b09127e3 3 *
helmut 0:5150b09127e3 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
helmut 0:5150b09127e3 5 * portions Copyright (c) 1998 Global Election Systems Inc.
helmut 0:5150b09127e3 6 *
helmut 0:5150b09127e3 7 * The authors hereby grant permission to use, copy, modify, distribute,
helmut 0:5150b09127e3 8 * and license this software and its documentation for any purpose, provided
helmut 0:5150b09127e3 9 * that existing copyright notices are retained in all copies and that this
helmut 0:5150b09127e3 10 * notice and the following disclaimer are included verbatim in any
helmut 0:5150b09127e3 11 * distributions. No written agreement, license, or royalty fee is required
helmut 0:5150b09127e3 12 * for any of the authorized uses.
helmut 0:5150b09127e3 13 *
helmut 0:5150b09127e3 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
helmut 0:5150b09127e3 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
helmut 0:5150b09127e3 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
helmut 0:5150b09127e3 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
helmut 0:5150b09127e3 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
helmut 0:5150b09127e3 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
helmut 0:5150b09127e3 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
helmut 0:5150b09127e3 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
helmut 0:5150b09127e3 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
helmut 0:5150b09127e3 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
helmut 0:5150b09127e3 24 *
helmut 0:5150b09127e3 25 ******************************************************************************
helmut 0:5150b09127e3 26 * REVISION HISTORY
helmut 0:5150b09127e3 27 *
helmut 0:5150b09127e3 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
helmut 0:5150b09127e3 29 * Ported to lwIP.
helmut 0:5150b09127e3 30 * 97-12-03 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc.
helmut 0:5150b09127e3 31 * Original built from BSD network code.
helmut 0:5150b09127e3 32 ******************************************************************************/
helmut 0:5150b09127e3 33 /*
helmut 0:5150b09127e3 34 * chap.h - Challenge Handshake Authentication Protocol definitions.
helmut 0:5150b09127e3 35 *
helmut 0:5150b09127e3 36 * Copyright (c) 1993 The Australian National University.
helmut 0:5150b09127e3 37 * All rights reserved.
helmut 0:5150b09127e3 38 *
helmut 0:5150b09127e3 39 * Redistribution and use in source and binary forms are permitted
helmut 0:5150b09127e3 40 * provided that the above copyright notice and this paragraph are
helmut 0:5150b09127e3 41 * duplicated in all such forms and that any documentation,
helmut 0:5150b09127e3 42 * advertising materials, and other materials related to such
helmut 0:5150b09127e3 43 * distribution and use acknowledge that the software was developed
helmut 0:5150b09127e3 44 * by the Australian National University. The name of the University
helmut 0:5150b09127e3 45 * may not be used to endorse or promote products derived from this
helmut 0:5150b09127e3 46 * software without specific prior written permission.
helmut 0:5150b09127e3 47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
helmut 0:5150b09127e3 48 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
helmut 0:5150b09127e3 49 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
helmut 0:5150b09127e3 50 *
helmut 0:5150b09127e3 51 * Copyright (c) 1991 Gregory M. Christy
helmut 0:5150b09127e3 52 * All rights reserved.
helmut 0:5150b09127e3 53 *
helmut 0:5150b09127e3 54 * Redistribution and use in source and binary forms are permitted
helmut 0:5150b09127e3 55 * provided that the above copyright notice and this paragraph are
helmut 0:5150b09127e3 56 * duplicated in all such forms and that any documentation,
helmut 0:5150b09127e3 57 * advertising materials, and other materials related to such
helmut 0:5150b09127e3 58 * distribution and use acknowledge that the software was developed
helmut 0:5150b09127e3 59 * by the author.
helmut 0:5150b09127e3 60 *
helmut 0:5150b09127e3 61 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
helmut 0:5150b09127e3 62 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
helmut 0:5150b09127e3 63 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
helmut 0:5150b09127e3 64 *
helmut 0:5150b09127e3 65 * $Id: chap.h,v 1.6 2010/01/24 13:19:34 goldsimon Exp $
helmut 0:5150b09127e3 66 */
helmut 0:5150b09127e3 67
helmut 0:5150b09127e3 68 #ifndef CHAP_H
helmut 0:5150b09127e3 69 #define CHAP_H
helmut 0:5150b09127e3 70
helmut 0:5150b09127e3 71 /* Code + ID + length */
helmut 0:5150b09127e3 72 #define CHAP_HEADERLEN 4
helmut 0:5150b09127e3 73
helmut 0:5150b09127e3 74 /*
helmut 0:5150b09127e3 75 * CHAP codes.
helmut 0:5150b09127e3 76 */
helmut 0:5150b09127e3 77
helmut 0:5150b09127e3 78 #define CHAP_DIGEST_MD5 5 /* use MD5 algorithm */
helmut 0:5150b09127e3 79 #define MD5_SIGNATURE_SIZE 16 /* 16 bytes in a MD5 message digest */
helmut 0:5150b09127e3 80 #define CHAP_MICROSOFT 0x80 /* use Microsoft-compatible alg. */
helmut 0:5150b09127e3 81 #define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */
helmut 0:5150b09127e3 82
helmut 0:5150b09127e3 83 #define CHAP_CHALLENGE 1
helmut 0:5150b09127e3 84 #define CHAP_RESPONSE 2
helmut 0:5150b09127e3 85 #define CHAP_SUCCESS 3
helmut 0:5150b09127e3 86 #define CHAP_FAILURE 4
helmut 0:5150b09127e3 87
helmut 0:5150b09127e3 88 /*
helmut 0:5150b09127e3 89 * Challenge lengths (for challenges we send) and other limits.
helmut 0:5150b09127e3 90 */
helmut 0:5150b09127e3 91 #define MIN_CHALLENGE_LENGTH 32
helmut 0:5150b09127e3 92 #define MAX_CHALLENGE_LENGTH 64
helmut 0:5150b09127e3 93 #define MAX_RESPONSE_LENGTH 64 /* sufficient for MD5 or MS-CHAP */
helmut 0:5150b09127e3 94
helmut 0:5150b09127e3 95 /*
helmut 0:5150b09127e3 96 * Each interface is described by a chap structure.
helmut 0:5150b09127e3 97 */
helmut 0:5150b09127e3 98
helmut 0:5150b09127e3 99 typedef struct chap_state {
helmut 0:5150b09127e3 100 int unit; /* Interface unit number */
helmut 0:5150b09127e3 101 int clientstate; /* Client state */
helmut 0:5150b09127e3 102 int serverstate; /* Server state */
helmut 0:5150b09127e3 103 u_char challenge[MAX_CHALLENGE_LENGTH]; /* last challenge string sent */
helmut 0:5150b09127e3 104 u_char chal_len; /* challenge length */
helmut 0:5150b09127e3 105 u_char chal_id; /* ID of last challenge */
helmut 0:5150b09127e3 106 u_char chal_type; /* hash algorithm for challenges */
helmut 0:5150b09127e3 107 u_char id; /* Current id */
helmut 0:5150b09127e3 108 char *chal_name; /* Our name to use with challenge */
helmut 0:5150b09127e3 109 int chal_interval; /* Time until we challenge peer again */
helmut 0:5150b09127e3 110 int timeouttime; /* Timeout time in seconds */
helmut 0:5150b09127e3 111 int max_transmits; /* Maximum # of challenge transmissions */
helmut 0:5150b09127e3 112 int chal_transmits; /* Number of transmissions of challenge */
helmut 0:5150b09127e3 113 int resp_transmits; /* Number of transmissions of response */
helmut 0:5150b09127e3 114 u_char response[MAX_RESPONSE_LENGTH]; /* Response to send */
helmut 0:5150b09127e3 115 u_char resp_length; /* length of response */
helmut 0:5150b09127e3 116 u_char resp_id; /* ID for response messages */
helmut 0:5150b09127e3 117 u_char resp_type; /* hash algorithm for responses */
helmut 0:5150b09127e3 118 char *resp_name; /* Our name to send with response */
helmut 0:5150b09127e3 119 } chap_state;
helmut 0:5150b09127e3 120
helmut 0:5150b09127e3 121
helmut 0:5150b09127e3 122 /*
helmut 0:5150b09127e3 123 * Client (peer) states.
helmut 0:5150b09127e3 124 */
helmut 0:5150b09127e3 125 #define CHAPCS_INITIAL 0 /* Lower layer down, not opened */
helmut 0:5150b09127e3 126 #define CHAPCS_CLOSED 1 /* Lower layer up, not opened */
helmut 0:5150b09127e3 127 #define CHAPCS_PENDING 2 /* Auth us to peer when lower up */
helmut 0:5150b09127e3 128 #define CHAPCS_LISTEN 3 /* Listening for a challenge */
helmut 0:5150b09127e3 129 #define CHAPCS_RESPONSE 4 /* Sent response, waiting for status */
helmut 0:5150b09127e3 130 #define CHAPCS_OPEN 5 /* We've received Success */
helmut 0:5150b09127e3 131
helmut 0:5150b09127e3 132 /*
helmut 0:5150b09127e3 133 * Server (authenticator) states.
helmut 0:5150b09127e3 134 */
helmut 0:5150b09127e3 135 #define CHAPSS_INITIAL 0 /* Lower layer down, not opened */
helmut 0:5150b09127e3 136 #define CHAPSS_CLOSED 1 /* Lower layer up, not opened */
helmut 0:5150b09127e3 137 #define CHAPSS_PENDING 2 /* Auth peer when lower up */
helmut 0:5150b09127e3 138 #define CHAPSS_INITIAL_CHAL 3 /* We've sent the first challenge */
helmut 0:5150b09127e3 139 #define CHAPSS_OPEN 4 /* We've sent a Success msg */
helmut 0:5150b09127e3 140 #define CHAPSS_RECHALLENGE 5 /* We've sent another challenge */
helmut 0:5150b09127e3 141 #define CHAPSS_BADAUTH 6 /* We've sent a Failure msg */
helmut 0:5150b09127e3 142
helmut 0:5150b09127e3 143 extern chap_state chap[];
helmut 0:5150b09127e3 144
helmut 0:5150b09127e3 145 void ChapAuthWithPeer (int, char *, u_char);
helmut 0:5150b09127e3 146 void ChapAuthPeer (int, char *, u_char);
helmut 0:5150b09127e3 147
helmut 0:5150b09127e3 148 extern struct protent chap_protent;
helmut 0:5150b09127e3 149
helmut 0:5150b09127e3 150 #endif /* CHAP_H */