ProjetoBB

Dependencies:   F7_Ethernet WebSocketClient mbed mcp3008

Fork of Nucleo_F746ZG_Ethernet by Dieter Graef

Committer:
DieterGraef
Date:
Sat Jun 18 10:49:12 2016 +0000
Revision:
0:f9b6112278fe
Ethernet for the NUCLEO STM32F746 Board Testprogram uses DHCP and NTP to set the clock

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DieterGraef 0:f9b6112278fe 1 /*
DieterGraef 0:f9b6112278fe 2 * Redistribution and use in source and binary forms, with or without modification,
DieterGraef 0:f9b6112278fe 3 * are permitted provided that the following conditions are met:
DieterGraef 0:f9b6112278fe 4 *
DieterGraef 0:f9b6112278fe 5 * 1. Redistributions of source code must retain the above copyright notice,
DieterGraef 0:f9b6112278fe 6 * this list of conditions and the following disclaimer.
DieterGraef 0:f9b6112278fe 7 * 2. Redistributions in binary form must reproduce the above copyright notice,
DieterGraef 0:f9b6112278fe 8 * this list of conditions and the following disclaimer in the documentation
DieterGraef 0:f9b6112278fe 9 * and/or other materials provided with the distribution.
DieterGraef 0:f9b6112278fe 10 * 3. The name of the author may not be used to endorse or promote products
DieterGraef 0:f9b6112278fe 11 * derived from this software without specific prior written permission.
DieterGraef 0:f9b6112278fe 12 *
DieterGraef 0:f9b6112278fe 13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
DieterGraef 0:f9b6112278fe 14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
DieterGraef 0:f9b6112278fe 15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
DieterGraef 0:f9b6112278fe 16 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
DieterGraef 0:f9b6112278fe 17 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
DieterGraef 0:f9b6112278fe 18 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
DieterGraef 0:f9b6112278fe 19 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
DieterGraef 0:f9b6112278fe 20 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
DieterGraef 0:f9b6112278fe 21 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
DieterGraef 0:f9b6112278fe 22 * OF SUCH DAMAGE.
DieterGraef 0:f9b6112278fe 23 *
DieterGraef 0:f9b6112278fe 24 * This file is part of the lwIP TCP/IP stack.
DieterGraef 0:f9b6112278fe 25 *
DieterGraef 0:f9b6112278fe 26 * Author: Simon Goldschmidt
DieterGraef 0:f9b6112278fe 27 *
DieterGraef 0:f9b6112278fe 28 */
DieterGraef 0:f9b6112278fe 29 #ifndef __LWIP_NETDB_H__
DieterGraef 0:f9b6112278fe 30 #define __LWIP_NETDB_H__
DieterGraef 0:f9b6112278fe 31
DieterGraef 0:f9b6112278fe 32 #include "lwip/opt.h"
DieterGraef 0:f9b6112278fe 33
DieterGraef 0:f9b6112278fe 34 #if LWIP_DNS && LWIP_SOCKET
DieterGraef 0:f9b6112278fe 35
DieterGraef 0:f9b6112278fe 36 #include <stddef.h> /* for size_t */
DieterGraef 0:f9b6112278fe 37
DieterGraef 0:f9b6112278fe 38 #include "lwip/inet.h"
DieterGraef 0:f9b6112278fe 39 #include "lwip/sockets.h"
DieterGraef 0:f9b6112278fe 40
DieterGraef 0:f9b6112278fe 41 #ifdef __cplusplus
DieterGraef 0:f9b6112278fe 42 extern "C" {
DieterGraef 0:f9b6112278fe 43 #endif
DieterGraef 0:f9b6112278fe 44
DieterGraef 0:f9b6112278fe 45 /* some rarely used options */
DieterGraef 0:f9b6112278fe 46 #ifndef LWIP_DNS_API_DECLARE_H_ERRNO
DieterGraef 0:f9b6112278fe 47 #define LWIP_DNS_API_DECLARE_H_ERRNO 1
DieterGraef 0:f9b6112278fe 48 #endif
DieterGraef 0:f9b6112278fe 49
DieterGraef 0:f9b6112278fe 50 #ifndef LWIP_DNS_API_DEFINE_ERRORS
DieterGraef 0:f9b6112278fe 51 #define LWIP_DNS_API_DEFINE_ERRORS 1
DieterGraef 0:f9b6112278fe 52 #endif
DieterGraef 0:f9b6112278fe 53
DieterGraef 0:f9b6112278fe 54 #ifndef LWIP_DNS_API_DECLARE_STRUCTS
DieterGraef 0:f9b6112278fe 55 #define LWIP_DNS_API_DECLARE_STRUCTS 1
DieterGraef 0:f9b6112278fe 56 #endif
DieterGraef 0:f9b6112278fe 57
DieterGraef 0:f9b6112278fe 58 #if LWIP_DNS_API_DEFINE_ERRORS
DieterGraef 0:f9b6112278fe 59 /** Errors used by the DNS API functions, h_errno can be one of them */
DieterGraef 0:f9b6112278fe 60 #define EAI_NONAME 200
DieterGraef 0:f9b6112278fe 61 #define EAI_SERVICE 201
DieterGraef 0:f9b6112278fe 62 #define EAI_FAIL 202
DieterGraef 0:f9b6112278fe 63 #define EAI_MEMORY 203
DieterGraef 0:f9b6112278fe 64
DieterGraef 0:f9b6112278fe 65 #define HOST_NOT_FOUND 210
DieterGraef 0:f9b6112278fe 66 #define NO_DATA 211
DieterGraef 0:f9b6112278fe 67 #define NO_RECOVERY 212
DieterGraef 0:f9b6112278fe 68 #define TRY_AGAIN 213
DieterGraef 0:f9b6112278fe 69 #endif /* LWIP_DNS_API_DEFINE_ERRORS */
DieterGraef 0:f9b6112278fe 70
DieterGraef 0:f9b6112278fe 71 #if LWIP_DNS_API_DECLARE_STRUCTS
DieterGraef 0:f9b6112278fe 72 struct hostent {
DieterGraef 0:f9b6112278fe 73 char *h_name; /* Official name of the host. */
DieterGraef 0:f9b6112278fe 74 char **h_aliases; /* A pointer to an array of pointers to alternative host names,
DieterGraef 0:f9b6112278fe 75 terminated by a null pointer. */
DieterGraef 0:f9b6112278fe 76 int h_addrtype; /* Address type. */
DieterGraef 0:f9b6112278fe 77 int h_length; /* The length, in bytes, of the address. */
DieterGraef 0:f9b6112278fe 78 char **h_addr_list; /* A pointer to an array of pointers to network addresses (in
DieterGraef 0:f9b6112278fe 79 network byte order) for the host, terminated by a null pointer. */
DieterGraef 0:f9b6112278fe 80 #define h_addr h_addr_list[0] /* for backward compatibility */
DieterGraef 0:f9b6112278fe 81 };
DieterGraef 0:f9b6112278fe 82
DieterGraef 0:f9b6112278fe 83 struct addrinfo {
DieterGraef 0:f9b6112278fe 84 int ai_flags; /* Input flags. */
DieterGraef 0:f9b6112278fe 85 int ai_family; /* Address family of socket. */
DieterGraef 0:f9b6112278fe 86 int ai_socktype; /* Socket type. */
DieterGraef 0:f9b6112278fe 87 int ai_protocol; /* Protocol of socket. */
DieterGraef 0:f9b6112278fe 88 socklen_t ai_addrlen; /* Length of socket address. */
DieterGraef 0:f9b6112278fe 89 struct sockaddr *ai_addr; /* Socket address of socket. */
DieterGraef 0:f9b6112278fe 90 char *ai_canonname; /* Canonical name of service location. */
DieterGraef 0:f9b6112278fe 91 struct addrinfo *ai_next; /* Pointer to next in list. */
DieterGraef 0:f9b6112278fe 92 };
DieterGraef 0:f9b6112278fe 93 #endif /* LWIP_DNS_API_DECLARE_STRUCTS */
DieterGraef 0:f9b6112278fe 94
DieterGraef 0:f9b6112278fe 95 #if LWIP_DNS_API_DECLARE_H_ERRNO
DieterGraef 0:f9b6112278fe 96 /* application accessable error code set by the DNS API functions */
DieterGraef 0:f9b6112278fe 97 extern int h_errno;
DieterGraef 0:f9b6112278fe 98 #endif /* LWIP_DNS_API_DECLARE_H_ERRNO*/
DieterGraef 0:f9b6112278fe 99
DieterGraef 0:f9b6112278fe 100 struct hostent *lwip_gethostbyname(const char *name);
DieterGraef 0:f9b6112278fe 101 int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
DieterGraef 0:f9b6112278fe 102 size_t buflen, struct hostent **result, int *h_errnop);
DieterGraef 0:f9b6112278fe 103 void lwip_freeaddrinfo(struct addrinfo *ai);
DieterGraef 0:f9b6112278fe 104 int lwip_getaddrinfo(const char *nodename,
DieterGraef 0:f9b6112278fe 105 const char *servname,
DieterGraef 0:f9b6112278fe 106 const struct addrinfo *hints,
DieterGraef 0:f9b6112278fe 107 struct addrinfo **res);
DieterGraef 0:f9b6112278fe 108
DieterGraef 0:f9b6112278fe 109 #if LWIP_COMPAT_SOCKETS
DieterGraef 0:f9b6112278fe 110 #define gethostbyname(name) lwip_gethostbyname(name)
DieterGraef 0:f9b6112278fe 111 #define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \
DieterGraef 0:f9b6112278fe 112 lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop)
DieterGraef 0:f9b6112278fe 113 #define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo)
DieterGraef 0:f9b6112278fe 114 #define getaddrinfo(nodname, servname, hints, res) \
DieterGraef 0:f9b6112278fe 115 lwip_getaddrinfo(nodname, servname, hints, res)
DieterGraef 0:f9b6112278fe 116 #endif /* LWIP_COMPAT_SOCKETS */
DieterGraef 0:f9b6112278fe 117
DieterGraef 0:f9b6112278fe 118 #ifdef __cplusplus
DieterGraef 0:f9b6112278fe 119 }
DieterGraef 0:f9b6112278fe 120 #endif
DieterGraef 0:f9b6112278fe 121
DieterGraef 0:f9b6112278fe 122 #endif /* LWIP_DNS && LWIP_SOCKET */
DieterGraef 0:f9b6112278fe 123
DieterGraef 0:f9b6112278fe 124 #endif /* __LWIP_NETDB_H__ */