TwitterExample with newer library (2012Aug)

Dependencies:   EthernetNetIf HTTPClient mbed

Committer:
nxpfan
Date:
Wed Aug 29 03:50:19 2012 +0000
Revision:
0:075157567b0c
simple twitter example with newer library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nxpfan 0:075157567b0c 1 /*****************************************************************************
nxpfan 0:075157567b0c 2 * lcp.h - Network Link Control Protocol header file.
nxpfan 0:075157567b0c 3 *
nxpfan 0:075157567b0c 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
nxpfan 0:075157567b0c 5 * portions Copyright (c) 1997 Global Election Systems Inc.
nxpfan 0:075157567b0c 6 *
nxpfan 0:075157567b0c 7 * The authors hereby grant permission to use, copy, modify, distribute,
nxpfan 0:075157567b0c 8 * and license this software and its documentation for any purpose, provided
nxpfan 0:075157567b0c 9 * that existing copyright notices are retained in all copies and that this
nxpfan 0:075157567b0c 10 * notice and the following disclaimer are included verbatim in any
nxpfan 0:075157567b0c 11 * distributions. No written agreement, license, or royalty fee is required
nxpfan 0:075157567b0c 12 * for any of the authorized uses.
nxpfan 0:075157567b0c 13 *
nxpfan 0:075157567b0c 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
nxpfan 0:075157567b0c 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
nxpfan 0:075157567b0c 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
nxpfan 0:075157567b0c 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
nxpfan 0:075157567b0c 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
nxpfan 0:075157567b0c 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
nxpfan 0:075157567b0c 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
nxpfan 0:075157567b0c 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
nxpfan 0:075157567b0c 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
nxpfan 0:075157567b0c 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
nxpfan 0:075157567b0c 24 *
nxpfan 0:075157567b0c 25 ******************************************************************************
nxpfan 0:075157567b0c 26 * REVISION HISTORY
nxpfan 0:075157567b0c 27 *
nxpfan 0:075157567b0c 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
nxpfan 0:075157567b0c 29 * Ported to lwIP.
nxpfan 0:075157567b0c 30 * 97-11-05 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
nxpfan 0:075157567b0c 31 * Original derived from BSD codes.
nxpfan 0:075157567b0c 32 *****************************************************************************/
nxpfan 0:075157567b0c 33 /*
nxpfan 0:075157567b0c 34 * lcp.h - Link Control Protocol definitions.
nxpfan 0:075157567b0c 35 *
nxpfan 0:075157567b0c 36 * Copyright (c) 1989 Carnegie Mellon University.
nxpfan 0:075157567b0c 37 * All rights reserved.
nxpfan 0:075157567b0c 38 *
nxpfan 0:075157567b0c 39 * Redistribution and use in source and binary forms are permitted
nxpfan 0:075157567b0c 40 * provided that the above copyright notice and this paragraph are
nxpfan 0:075157567b0c 41 * duplicated in all such forms and that any documentation,
nxpfan 0:075157567b0c 42 * advertising materials, and other materials related to such
nxpfan 0:075157567b0c 43 * distribution and use acknowledge that the software was developed
nxpfan 0:075157567b0c 44 * by Carnegie Mellon University. The name of the
nxpfan 0:075157567b0c 45 * University may not be used to endorse or promote products derived
nxpfan 0:075157567b0c 46 * from this software without specific prior written permission.
nxpfan 0:075157567b0c 47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
nxpfan 0:075157567b0c 48 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
nxpfan 0:075157567b0c 49 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
nxpfan 0:075157567b0c 50 *
nxpfan 0:075157567b0c 51 * $Id: lcp.h,v 1.4 2010/01/18 20:49:43 goldsimon Exp $
nxpfan 0:075157567b0c 52 */
nxpfan 0:075157567b0c 53
nxpfan 0:075157567b0c 54 #ifndef LCP_H
nxpfan 0:075157567b0c 55 #define LCP_H
nxpfan 0:075157567b0c 56 /*
nxpfan 0:075157567b0c 57 * Options.
nxpfan 0:075157567b0c 58 */
nxpfan 0:075157567b0c 59 #define CI_MRU 1 /* Maximum Receive Unit */
nxpfan 0:075157567b0c 60 #define CI_ASYNCMAP 2 /* Async Control Character Map */
nxpfan 0:075157567b0c 61 #define CI_AUTHTYPE 3 /* Authentication Type */
nxpfan 0:075157567b0c 62 #define CI_QUALITY 4 /* Quality Protocol */
nxpfan 0:075157567b0c 63 #define CI_MAGICNUMBER 5 /* Magic Number */
nxpfan 0:075157567b0c 64 #define CI_PCOMPRESSION 7 /* Protocol Field Compression */
nxpfan 0:075157567b0c 65 #define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
nxpfan 0:075157567b0c 66 #define CI_CALLBACK 13 /* callback */
nxpfan 0:075157567b0c 67 #define CI_MRRU 17 /* max reconstructed receive unit; multilink */
nxpfan 0:075157567b0c 68 #define CI_SSNHF 18 /* short sequence numbers for multilink */
nxpfan 0:075157567b0c 69 #define CI_EPDISC 19 /* endpoint discriminator */
nxpfan 0:075157567b0c 70
nxpfan 0:075157567b0c 71 /*
nxpfan 0:075157567b0c 72 * LCP-specific packet types (code numbers).
nxpfan 0:075157567b0c 73 */
nxpfan 0:075157567b0c 74 #define PROTREJ 8 /* Protocol Reject */
nxpfan 0:075157567b0c 75 #define ECHOREQ 9 /* Echo Request */
nxpfan 0:075157567b0c 76 #define ECHOREP 10 /* Echo Reply */
nxpfan 0:075157567b0c 77 #define DISCREQ 11 /* Discard Request */
nxpfan 0:075157567b0c 78 #define CBCP_OPT 6 /* Use callback control protocol */
nxpfan 0:075157567b0c 79
nxpfan 0:075157567b0c 80 /*
nxpfan 0:075157567b0c 81 * The state of options is described by an lcp_options structure.
nxpfan 0:075157567b0c 82 */
nxpfan 0:075157567b0c 83 typedef struct lcp_options {
nxpfan 0:075157567b0c 84 u_int passive : 1; /* Don't die if we don't get a response */
nxpfan 0:075157567b0c 85 u_int silent : 1; /* Wait for the other end to start first */
nxpfan 0:075157567b0c 86 u_int restart : 1; /* Restart vs. exit after close */
nxpfan 0:075157567b0c 87 u_int neg_mru : 1; /* Negotiate the MRU? */
nxpfan 0:075157567b0c 88 u_int neg_asyncmap : 1; /* Negotiate the async map? */
nxpfan 0:075157567b0c 89 u_int neg_upap : 1; /* Ask for UPAP authentication? */
nxpfan 0:075157567b0c 90 u_int neg_chap : 1; /* Ask for CHAP authentication? */
nxpfan 0:075157567b0c 91 u_int neg_magicnumber : 1; /* Ask for magic number? */
nxpfan 0:075157567b0c 92 u_int neg_pcompression : 1; /* HDLC Protocol Field Compression? */
nxpfan 0:075157567b0c 93 u_int neg_accompression : 1; /* HDLC Address/Control Field Compression? */
nxpfan 0:075157567b0c 94 u_int neg_lqr : 1; /* Negotiate use of Link Quality Reports */
nxpfan 0:075157567b0c 95 u_int neg_cbcp : 1; /* Negotiate use of CBCP */
nxpfan 0:075157567b0c 96 #ifdef PPP_MULTILINK
nxpfan 0:075157567b0c 97 u_int neg_mrru : 1; /* Negotiate multilink MRRU */
nxpfan 0:075157567b0c 98 u_int neg_ssnhf : 1; /* Negotiate short sequence numbers */
nxpfan 0:075157567b0c 99 u_int neg_endpoint : 1; /* Negotiate endpoint discriminator */
nxpfan 0:075157567b0c 100 #endif
nxpfan 0:075157567b0c 101 u_short mru; /* Value of MRU */
nxpfan 0:075157567b0c 102 #ifdef PPP_MULTILINK
nxpfan 0:075157567b0c 103 u_short mrru; /* Value of MRRU, and multilink enable */
nxpfan 0:075157567b0c 104 #endif
nxpfan 0:075157567b0c 105 u_char chap_mdtype; /* which MD type (hashing algorithm) */
nxpfan 0:075157567b0c 106 u32_t asyncmap; /* Value of async map */
nxpfan 0:075157567b0c 107 u32_t magicnumber;
nxpfan 0:075157567b0c 108 int numloops; /* Number of loops during magic number neg. */
nxpfan 0:075157567b0c 109 u32_t lqr_period; /* Reporting period for LQR 1/100ths second */
nxpfan 0:075157567b0c 110 #ifdef PPP_MULTILINK
nxpfan 0:075157567b0c 111 struct epdisc endpoint; /* endpoint discriminator */
nxpfan 0:075157567b0c 112 #endif
nxpfan 0:075157567b0c 113 } lcp_options;
nxpfan 0:075157567b0c 114
nxpfan 0:075157567b0c 115 /*
nxpfan 0:075157567b0c 116 * Values for phase from BSD pppd.h based on RFC 1661.
nxpfan 0:075157567b0c 117 */
nxpfan 0:075157567b0c 118 typedef enum {
nxpfan 0:075157567b0c 119 PHASE_DEAD = 0,
nxpfan 0:075157567b0c 120 PHASE_INITIALIZE,
nxpfan 0:075157567b0c 121 PHASE_ESTABLISH,
nxpfan 0:075157567b0c 122 PHASE_AUTHENTICATE,
nxpfan 0:075157567b0c 123 PHASE_CALLBACK,
nxpfan 0:075157567b0c 124 PHASE_NETWORK,
nxpfan 0:075157567b0c 125 PHASE_TERMINATE
nxpfan 0:075157567b0c 126 } LinkPhase;
nxpfan 0:075157567b0c 127
nxpfan 0:075157567b0c 128
nxpfan 0:075157567b0c 129
nxpfan 0:075157567b0c 130 extern LinkPhase lcp_phase[NUM_PPP]; /* Phase of link session (RFC 1661) */
nxpfan 0:075157567b0c 131 extern lcp_options lcp_wantoptions[];
nxpfan 0:075157567b0c 132 extern lcp_options lcp_gotoptions[];
nxpfan 0:075157567b0c 133 extern lcp_options lcp_allowoptions[];
nxpfan 0:075157567b0c 134 extern lcp_options lcp_hisoptions[];
nxpfan 0:075157567b0c 135 extern ext_accm xmit_accm[];
nxpfan 0:075157567b0c 136
nxpfan 0:075157567b0c 137
nxpfan 0:075157567b0c 138 void lcp_init (int);
nxpfan 0:075157567b0c 139 void lcp_open (int);
nxpfan 0:075157567b0c 140 void lcp_close (int, char *);
nxpfan 0:075157567b0c 141 void lcp_lowerup (int);
nxpfan 0:075157567b0c 142 void lcp_lowerdown(int);
nxpfan 0:075157567b0c 143 void lcp_sprotrej (int, u_char *, int); /* send protocol reject */
nxpfan 0:075157567b0c 144
nxpfan 0:075157567b0c 145 extern struct protent lcp_protent;
nxpfan 0:075157567b0c 146
nxpfan 0:075157567b0c 147 /* Default number of times we receive our magic number from the peer
nxpfan 0:075157567b0c 148 before deciding the link is looped-back. */
nxpfan 0:075157567b0c 149 #define DEFLOOPBACKFAIL 10
nxpfan 0:075157567b0c 150
nxpfan 0:075157567b0c 151 #endif /* LCP_H */