Donatien Garnier / LwIPNetworking

Dependencies:   DebugLib Socket lwip lwip-sys

Dependents:   EthernetInterface

Fork of NetworkingCoreLib by Donatien Garnier

Committer:
donatien
Date:
Fri Jun 15 14:17:23 2012 +0000
Revision:
8:387f573a6813
Child:
13:f7d8c8088289
Socket library change, lwip-sys update, IPInterface/LwIPInterface rework

Who changed what in which revision?

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