Contains example code to connect the mbed LPC1768 or FRDM-K64F devices to the IBM Internet of Things Cloud service via ethernet.

Dependencies:   C12832 MQTT LM75B MMA7660

Dependents:   MFT_IoT_demo_USB400 IBM_RFID

Committer:
samdanbury
Date:
Wed Aug 20 12:45:14 2014 +0000
Revision:
6:37b6d0d56190
Code completely changed to improve the structure, flow and memory usage of the application

Who changed what in which revision?

UserRevisionLine numberNew contents of line
samdanbury 6:37b6d0d56190 1 /*****************************************************************************
samdanbury 6:37b6d0d56190 2 * ipcp.h - PPP IP NCP: Internet Protocol Network Control Protocol header file.
samdanbury 6:37b6d0d56190 3 *
samdanbury 6:37b6d0d56190 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
samdanbury 6:37b6d0d56190 5 * portions Copyright (c) 1997 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 * 97-12-04 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
samdanbury 6:37b6d0d56190 31 * Original derived from BSD codes.
samdanbury 6:37b6d0d56190 32 *****************************************************************************/
samdanbury 6:37b6d0d56190 33 /*
samdanbury 6:37b6d0d56190 34 * ipcp.h - IP Control Protocol definitions.
samdanbury 6:37b6d0d56190 35 *
samdanbury 6:37b6d0d56190 36 * Copyright (c) 1989 Carnegie Mellon University.
samdanbury 6:37b6d0d56190 37 * All rights reserved.
samdanbury 6:37b6d0d56190 38 *
samdanbury 6:37b6d0d56190 39 * Redistribution and use in source and binary forms are permitted
samdanbury 6:37b6d0d56190 40 * provided that the above copyright notice and this paragraph are
samdanbury 6:37b6d0d56190 41 * duplicated in all such forms and that any documentation,
samdanbury 6:37b6d0d56190 42 * advertising materials, and other materials related to such
samdanbury 6:37b6d0d56190 43 * distribution and use acknowledge that the software was developed
samdanbury 6:37b6d0d56190 44 * by Carnegie Mellon University. The name of the
samdanbury 6:37b6d0d56190 45 * University may not be used to endorse or promote products derived
samdanbury 6:37b6d0d56190 46 * from this software without specific prior written permission.
samdanbury 6:37b6d0d56190 47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
samdanbury 6:37b6d0d56190 48 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
samdanbury 6:37b6d0d56190 49 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
samdanbury 6:37b6d0d56190 50 *
samdanbury 6:37b6d0d56190 51 * $Id: ipcp.h,v 1.4 2010/01/18 20:49:43 goldsimon Exp $
samdanbury 6:37b6d0d56190 52 */
samdanbury 6:37b6d0d56190 53
samdanbury 6:37b6d0d56190 54 #ifndef IPCP_H
samdanbury 6:37b6d0d56190 55 #define IPCP_H
samdanbury 6:37b6d0d56190 56
samdanbury 6:37b6d0d56190 57 /*
samdanbury 6:37b6d0d56190 58 * Options.
samdanbury 6:37b6d0d56190 59 */
samdanbury 6:37b6d0d56190 60 #define CI_ADDRS 1 /* IP Addresses */
samdanbury 6:37b6d0d56190 61 #define CI_COMPRESSTYPE 2 /* Compression Type */
samdanbury 6:37b6d0d56190 62 #define CI_ADDR 3
samdanbury 6:37b6d0d56190 63
samdanbury 6:37b6d0d56190 64 #define CI_MS_DNS1 129 /* Primary DNS value */
samdanbury 6:37b6d0d56190 65 #define CI_MS_WINS1 128 /* Primary WINS value */
samdanbury 6:37b6d0d56190 66 #define CI_MS_DNS2 131 /* Secondary DNS value */
samdanbury 6:37b6d0d56190 67 #define CI_MS_WINS2 130 /* Secondary WINS value */
samdanbury 6:37b6d0d56190 68
samdanbury 6:37b6d0d56190 69 #define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */
samdanbury 6:37b6d0d56190 70 #define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */
samdanbury 6:37b6d0d56190 71 #define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */
samdanbury 6:37b6d0d56190 72 /* maxslot and slot number compression) */
samdanbury 6:37b6d0d56190 73
samdanbury 6:37b6d0d56190 74 #define IPCP_VJ_COMP 0x002d /* current value for VJ compression option */
samdanbury 6:37b6d0d56190 75 #define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */
samdanbury 6:37b6d0d56190 76 /* compression option */
samdanbury 6:37b6d0d56190 77
samdanbury 6:37b6d0d56190 78 typedef struct ipcp_options {
samdanbury 6:37b6d0d56190 79 u_int neg_addr : 1; /* Negotiate IP Address? */
samdanbury 6:37b6d0d56190 80 u_int old_addrs : 1; /* Use old (IP-Addresses) option? */
samdanbury 6:37b6d0d56190 81 u_int req_addr : 1; /* Ask peer to send IP address? */
samdanbury 6:37b6d0d56190 82 u_int default_route : 1; /* Assign default route through interface? */
samdanbury 6:37b6d0d56190 83 u_int proxy_arp : 1; /* Make proxy ARP entry for peer? */
samdanbury 6:37b6d0d56190 84 u_int neg_vj : 1; /* Van Jacobson Compression? */
samdanbury 6:37b6d0d56190 85 u_int old_vj : 1; /* use old (short) form of VJ option? */
samdanbury 6:37b6d0d56190 86 u_int accept_local : 1; /* accept peer's value for ouraddr */
samdanbury 6:37b6d0d56190 87 u_int accept_remote : 1; /* accept peer's value for hisaddr */
samdanbury 6:37b6d0d56190 88 u_int req_dns1 : 1; /* Ask peer to send primary DNS address? */
samdanbury 6:37b6d0d56190 89 u_int req_dns2 : 1; /* Ask peer to send secondary DNS address? */
samdanbury 6:37b6d0d56190 90 u_short vj_protocol; /* protocol value to use in VJ option */
samdanbury 6:37b6d0d56190 91 u_char maxslotindex; /* VJ slots - 1. */
samdanbury 6:37b6d0d56190 92 u_char cflag; /* VJ slot compression flag. */
samdanbury 6:37b6d0d56190 93 u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
samdanbury 6:37b6d0d56190 94 u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */
samdanbury 6:37b6d0d56190 95 u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */
samdanbury 6:37b6d0d56190 96 } ipcp_options;
samdanbury 6:37b6d0d56190 97
samdanbury 6:37b6d0d56190 98 extern fsm ipcp_fsm[];
samdanbury 6:37b6d0d56190 99 extern ipcp_options ipcp_wantoptions[];
samdanbury 6:37b6d0d56190 100 extern ipcp_options ipcp_gotoptions[];
samdanbury 6:37b6d0d56190 101 extern ipcp_options ipcp_allowoptions[];
samdanbury 6:37b6d0d56190 102 extern ipcp_options ipcp_hisoptions[];
samdanbury 6:37b6d0d56190 103
samdanbury 6:37b6d0d56190 104 extern struct protent ipcp_protent;
samdanbury 6:37b6d0d56190 105
samdanbury 6:37b6d0d56190 106 #endif /* IPCP_H */