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 * lwip DNS resolver header file.
sam_grove 5:3f93dd1d4cb3 3
sam_grove 5:3f93dd1d4cb3 4 * Author: Jim Pettinato
sam_grove 5:3f93dd1d4cb3 5 * April 2007
sam_grove 5:3f93dd1d4cb3 6
sam_grove 5:3f93dd1d4cb3 7 * ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels.
sam_grove 5:3f93dd1d4cb3 8 *
sam_grove 5:3f93dd1d4cb3 9 * Redistribution and use in source and binary forms, with or without
sam_grove 5:3f93dd1d4cb3 10 * modification, are permitted provided that the following conditions
sam_grove 5:3f93dd1d4cb3 11 * are met:
sam_grove 5:3f93dd1d4cb3 12 * 1. Redistributions of source code must retain the above copyright
sam_grove 5:3f93dd1d4cb3 13 * notice, this list of conditions and the following disclaimer.
sam_grove 5:3f93dd1d4cb3 14 * 2. Redistributions in binary form must reproduce the above copyright
sam_grove 5:3f93dd1d4cb3 15 * notice, this list of conditions and the following disclaimer in the
sam_grove 5:3f93dd1d4cb3 16 * documentation and/or other materials provided with the distribution.
sam_grove 5:3f93dd1d4cb3 17 * 3. The name of the author may not be used to endorse or promote
sam_grove 5:3f93dd1d4cb3 18 * products derived from this software without specific prior
sam_grove 5:3f93dd1d4cb3 19 * written permission.
sam_grove 5:3f93dd1d4cb3 20 *
sam_grove 5:3f93dd1d4cb3 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
sam_grove 5:3f93dd1d4cb3 22 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
sam_grove 5:3f93dd1d4cb3 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
sam_grove 5:3f93dd1d4cb3 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
sam_grove 5:3f93dd1d4cb3 25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
sam_grove 5:3f93dd1d4cb3 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
sam_grove 5:3f93dd1d4cb3 27 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
sam_grove 5:3f93dd1d4cb3 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
sam_grove 5:3f93dd1d4cb3 29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
sam_grove 5:3f93dd1d4cb3 30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
sam_grove 5:3f93dd1d4cb3 31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
sam_grove 5:3f93dd1d4cb3 32 */
sam_grove 5:3f93dd1d4cb3 33
sam_grove 5:3f93dd1d4cb3 34 #ifndef __LWIP_DNS_H__
sam_grove 5:3f93dd1d4cb3 35 #define __LWIP_DNS_H__
sam_grove 5:3f93dd1d4cb3 36
sam_grove 5:3f93dd1d4cb3 37 #include "lwip/opt.h"
sam_grove 5:3f93dd1d4cb3 38
sam_grove 5:3f93dd1d4cb3 39 #if LWIP_DNS /* don't build if not configured for use in lwipopts.h */
sam_grove 5:3f93dd1d4cb3 40
sam_grove 5:3f93dd1d4cb3 41 #ifdef __cplusplus
sam_grove 5:3f93dd1d4cb3 42 extern "C" {
sam_grove 5:3f93dd1d4cb3 43 #endif
sam_grove 5:3f93dd1d4cb3 44
sam_grove 5:3f93dd1d4cb3 45 /** DNS timer period */
sam_grove 5:3f93dd1d4cb3 46 #define DNS_TMR_INTERVAL 1000
sam_grove 5:3f93dd1d4cb3 47
sam_grove 5:3f93dd1d4cb3 48 /** DNS field TYPE used for "Resource Records" */
sam_grove 5:3f93dd1d4cb3 49 #define DNS_RRTYPE_A 1 /* a host address */
sam_grove 5:3f93dd1d4cb3 50 #define DNS_RRTYPE_NS 2 /* an authoritative name server */
sam_grove 5:3f93dd1d4cb3 51 #define DNS_RRTYPE_MD 3 /* a mail destination (Obsolete - use MX) */
sam_grove 5:3f93dd1d4cb3 52 #define DNS_RRTYPE_MF 4 /* a mail forwarder (Obsolete - use MX) */
sam_grove 5:3f93dd1d4cb3 53 #define DNS_RRTYPE_CNAME 5 /* the canonical name for an alias */
sam_grove 5:3f93dd1d4cb3 54 #define DNS_RRTYPE_SOA 6 /* marks the start of a zone of authority */
sam_grove 5:3f93dd1d4cb3 55 #define DNS_RRTYPE_MB 7 /* a mailbox domain name (EXPERIMENTAL) */
sam_grove 5:3f93dd1d4cb3 56 #define DNS_RRTYPE_MG 8 /* a mail group member (EXPERIMENTAL) */
sam_grove 5:3f93dd1d4cb3 57 #define DNS_RRTYPE_MR 9 /* a mail rename domain name (EXPERIMENTAL) */
sam_grove 5:3f93dd1d4cb3 58 #define DNS_RRTYPE_NULL 10 /* a null RR (EXPERIMENTAL) */
sam_grove 5:3f93dd1d4cb3 59 #define DNS_RRTYPE_WKS 11 /* a well known service description */
sam_grove 5:3f93dd1d4cb3 60 #define DNS_RRTYPE_PTR 12 /* a domain name pointer */
sam_grove 5:3f93dd1d4cb3 61 #define DNS_RRTYPE_HINFO 13 /* host information */
sam_grove 5:3f93dd1d4cb3 62 #define DNS_RRTYPE_MINFO 14 /* mailbox or mail list information */
sam_grove 5:3f93dd1d4cb3 63 #define DNS_RRTYPE_MX 15 /* mail exchange */
sam_grove 5:3f93dd1d4cb3 64 #define DNS_RRTYPE_TXT 16 /* text strings */
sam_grove 5:3f93dd1d4cb3 65
sam_grove 5:3f93dd1d4cb3 66 /** DNS field CLASS used for "Resource Records" */
sam_grove 5:3f93dd1d4cb3 67 #define DNS_RRCLASS_IN 1 /* the Internet */
sam_grove 5:3f93dd1d4cb3 68 #define DNS_RRCLASS_CS 2 /* the CSNET class (Obsolete - used only for examples in some obsolete RFCs) */
sam_grove 5:3f93dd1d4cb3 69 #define DNS_RRCLASS_CH 3 /* the CHAOS class */
sam_grove 5:3f93dd1d4cb3 70 #define DNS_RRCLASS_HS 4 /* Hesiod [Dyer 87] */
sam_grove 5:3f93dd1d4cb3 71 #define DNS_RRCLASS_FLUSH 0x800 /* Flush bit */
sam_grove 5:3f93dd1d4cb3 72
sam_grove 5:3f93dd1d4cb3 73 /* The size used for the next line is rather a hack, but it prevents including socket.h in all files
sam_grove 5:3f93dd1d4cb3 74 that include memp.h, and that would possibly break portability (since socket.h defines some types
sam_grove 5:3f93dd1d4cb3 75 and constants possibly already define by the OS).
sam_grove 5:3f93dd1d4cb3 76 Calculation rule:
sam_grove 5:3f93dd1d4cb3 77 sizeof(struct addrinfo) + sizeof(struct sockaddr_in) + DNS_MAX_NAME_LENGTH + 1 byte zero-termination */
sam_grove 5:3f93dd1d4cb3 78 #define NETDB_ELEM_SIZE (32 + 16 + DNS_MAX_NAME_LENGTH + 1)
sam_grove 5:3f93dd1d4cb3 79
sam_grove 5:3f93dd1d4cb3 80 #if DNS_LOCAL_HOSTLIST
sam_grove 5:3f93dd1d4cb3 81 /** struct used for local host-list */
sam_grove 5:3f93dd1d4cb3 82 struct local_hostlist_entry {
sam_grove 5:3f93dd1d4cb3 83 /** static hostname */
sam_grove 5:3f93dd1d4cb3 84 const char *name;
sam_grove 5:3f93dd1d4cb3 85 /** static host address in network byteorder */
sam_grove 5:3f93dd1d4cb3 86 ip_addr_t addr;
sam_grove 5:3f93dd1d4cb3 87 struct local_hostlist_entry *next;
sam_grove 5:3f93dd1d4cb3 88 };
sam_grove 5:3f93dd1d4cb3 89 #if DNS_LOCAL_HOSTLIST_IS_DYNAMIC
sam_grove 5:3f93dd1d4cb3 90 #ifndef DNS_LOCAL_HOSTLIST_MAX_NAMELEN
sam_grove 5:3f93dd1d4cb3 91 #define DNS_LOCAL_HOSTLIST_MAX_NAMELEN DNS_MAX_NAME_LENGTH
sam_grove 5:3f93dd1d4cb3 92 #endif
sam_grove 5:3f93dd1d4cb3 93 #define LOCALHOSTLIST_ELEM_SIZE ((sizeof(struct local_hostlist_entry) + DNS_LOCAL_HOSTLIST_MAX_NAMELEN + 1))
sam_grove 5:3f93dd1d4cb3 94 #endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
sam_grove 5:3f93dd1d4cb3 95 #endif /* DNS_LOCAL_HOSTLIST */
sam_grove 5:3f93dd1d4cb3 96
sam_grove 5:3f93dd1d4cb3 97 /** Callback which is invoked when a hostname is found.
sam_grove 5:3f93dd1d4cb3 98 * A function of this type must be implemented by the application using the DNS resolver.
sam_grove 5:3f93dd1d4cb3 99 * @param name pointer to the name that was looked up.
sam_grove 5:3f93dd1d4cb3 100 * @param ipaddr pointer to an ip_addr_t containing the IP address of the hostname,
sam_grove 5:3f93dd1d4cb3 101 * or NULL if the name could not be found (or on any other error).
sam_grove 5:3f93dd1d4cb3 102 * @param callback_arg a user-specified callback argument passed to dns_gethostbyname
sam_grove 5:3f93dd1d4cb3 103 */
sam_grove 5:3f93dd1d4cb3 104 typedef void (*dns_found_callback)(const char *name, ip_addr_t *ipaddr, void *callback_arg);
sam_grove 5:3f93dd1d4cb3 105
sam_grove 5:3f93dd1d4cb3 106 void dns_init(void);
sam_grove 5:3f93dd1d4cb3 107 void dns_tmr(void);
sam_grove 5:3f93dd1d4cb3 108 void dns_setserver(u8_t numdns, ip_addr_t *dnsserver);
sam_grove 5:3f93dd1d4cb3 109 ip_addr_t dns_getserver(u8_t numdns);
sam_grove 5:3f93dd1d4cb3 110 err_t dns_gethostbyname(const char *hostname, ip_addr_t *addr,
sam_grove 5:3f93dd1d4cb3 111 dns_found_callback found, void *callback_arg);
sam_grove 5:3f93dd1d4cb3 112
sam_grove 5:3f93dd1d4cb3 113 #if DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC
sam_grove 5:3f93dd1d4cb3 114 int dns_local_removehost(const char *hostname, const ip_addr_t *addr);
sam_grove 5:3f93dd1d4cb3 115 err_t dns_local_addhost(const char *hostname, const ip_addr_t *addr);
sam_grove 5:3f93dd1d4cb3 116 #endif /* DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
sam_grove 5:3f93dd1d4cb3 117
sam_grove 5:3f93dd1d4cb3 118 #ifdef __cplusplus
sam_grove 5:3f93dd1d4cb3 119 }
sam_grove 5:3f93dd1d4cb3 120 #endif
sam_grove 5:3f93dd1d4cb3 121
sam_grove 5:3f93dd1d4cb3 122 #endif /* LWIP_DNS */
sam_grove 5:3f93dd1d4cb3 123
sam_grove 5:3f93dd1d4cb3 124 #endif /* __LWIP_DNS_H__ */