Integrating the ublox LISA C200 modem

Fork of SprintUSBModemHTTPClientTest by Donatien Garnier

Committer:
sam_grove
Date:
Thu Sep 26 00:44:20 2013 -0500
Revision:
5:3f93dd1d4cb3
Exported program and replaced contents of the repo with the source
to build and debug using keil mdk. Libs NOT upto date are lwip, lwip-sys
and socket. these have newer versions under mbed_official but were starting
from a know working point

Who changed what in which revision?

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