Donatien Garnier / LwIPNetworking

Dependencies:   DebugLib Socket lwip lwip-sys

Dependents:   EthernetInterface

Fork of NetworkingCoreLib by Donatien Garnier

Committer:
donatien
Date:
Tue Jun 12 10:08:54 2012 +0000
Revision:
7:cdd2b0f68b4f
Added socket interface

Who changed what in which revision?

UserRevisionLine numberNew contents of line
donatien 7:cdd2b0f68b4f 1 /* netdb.h */
donatien 7:cdd2b0f68b4f 2 /*
donatien 7:cdd2b0f68b4f 3 Copyright (C) 2012 ARM Limited.
donatien 7:cdd2b0f68b4f 4
donatien 7:cdd2b0f68b4f 5 Permission is hereby granted, free of charge, to any person obtaining a copy of
donatien 7:cdd2b0f68b4f 6 this software and associated documentation files (the "Software"), to deal in
donatien 7:cdd2b0f68b4f 7 the Software without restriction, including without limitation the rights to
donatien 7:cdd2b0f68b4f 8 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
donatien 7:cdd2b0f68b4f 9 of the Software, and to permit persons to whom the Software is furnished to do
donatien 7:cdd2b0f68b4f 10 so, subject to the following conditions:
donatien 7:cdd2b0f68b4f 11
donatien 7:cdd2b0f68b4f 12 The above copyright notice and this permission notice shall be included in all
donatien 7:cdd2b0f68b4f 13 copies or substantial portions of the Software.
donatien 7:cdd2b0f68b4f 14
donatien 7:cdd2b0f68b4f 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
donatien 7:cdd2b0f68b4f 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
donatien 7:cdd2b0f68b4f 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
donatien 7:cdd2b0f68b4f 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
donatien 7:cdd2b0f68b4f 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
donatien 7:cdd2b0f68b4f 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
donatien 7:cdd2b0f68b4f 21 SOFTWARE.
donatien 7:cdd2b0f68b4f 22 */
donatien 7:cdd2b0f68b4f 23
donatien 7:cdd2b0f68b4f 24
donatien 7:cdd2b0f68b4f 25 #ifndef NETDB_H_
donatien 7:cdd2b0f68b4f 26 #define NETDB_H_
donatien 7:cdd2b0f68b4f 27
donatien 7:cdd2b0f68b4f 28 #include "lwip/netdb.h"
donatien 7:cdd2b0f68b4f 29
donatien 7:cdd2b0f68b4f 30 //DNS
donatien 7:cdd2b0f68b4f 31
donatien 7:cdd2b0f68b4f 32 inline struct hostent *gethostbyname(const char *name)
donatien 7:cdd2b0f68b4f 33 {
donatien 7:cdd2b0f68b4f 34 return lwip_gethostbyname(name);
donatien 7:cdd2b0f68b4f 35 }
donatien 7:cdd2b0f68b4f 36
donatien 7:cdd2b0f68b4f 37 inline int gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop)
donatien 7:cdd2b0f68b4f 38 {
donatien 7:cdd2b0f68b4f 39 return lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop);
donatien 7:cdd2b0f68b4f 40 }
donatien 7:cdd2b0f68b4f 41
donatien 7:cdd2b0f68b4f 42 inline void freeaddrinfo(struct addrinfo *ai)
donatien 7:cdd2b0f68b4f 43 {
donatien 7:cdd2b0f68b4f 44 return lwip_freeaddrinfo(ai);
donatien 7:cdd2b0f68b4f 45 }
donatien 7:cdd2b0f68b4f 46
donatien 7:cdd2b0f68b4f 47 inline int getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res)
donatien 7:cdd2b0f68b4f 48 {
donatien 7:cdd2b0f68b4f 49 return lwip_getaddrinfo(nodename, servname, hints, res);
donatien 7:cdd2b0f68b4f 50 }
donatien 7:cdd2b0f68b4f 51
donatien 7:cdd2b0f68b4f 52 #endif /* NETDB_H_ */