[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT/LWIP PATCH 1/5] Revisit netdb.h declarations


  • To: Costin Lupu <costin.lup@xxxxxxxxx>, "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
  • Date: Mon, 9 Sep 2019 15:54:12 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stud.acs.upb.ro; dmarc=pass action=none header.from=stud.acs.upb.ro; dkim=pass header.d=stud.acs.upb.ro; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CuklNpOok+iB4AjIyq8fIdYfHAdc3V8PTnLv5N9pGP4=; b=NClAW61rY6+GHRRbFVnJ4RetKHQUAJaw4k8m4FCygta4RvUQNMU++JgS6THGcIl4T+J4+Qg0QuXQGQ/5zjP1BCDNrt75Fs+Swzy7QLCjQeOjhPghLpuUqcQUiqrpOZo2lxC9lt0t3FTJY4luE25Z3jTF4uhzaRYkUGJeelV3XGZlevT3AEunHCn8ej+MxCFz9vyIrY6hMTwSRv9u++Rg6m7odiKcZRTi7Fuo3z1APgWWKvoTZwGyB4m0UC7zbevNce0tjZ4SMdCVNyT5xyk8LuZ7kJ5fzQH4K5/bD65MZo9ZJUJwDtddYDqZtx6BVnPHy/3T1kY85QJdU0/t9YCMGQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D+/0o+Jc3kzlwah38OYbzoI22RVoKNJzWoyAoExwvXhYfBS4I420Hy3rqtkVXe7H3HTQEM5D+BBO728siHaN6HpxeZ7tB6GbUcL9Xg2FPhCSaIPN4boe1wlx3gnI9BE8UjjAPycUkHKJIqxZ8+1MSYDtuCqyPThx0AlS3uDVQX9xWXESMfWTJUU5uqsl0LCUqZRGeJ5s+sOq1SomQ9mw4cKbmMhMlRiN1up+DyvTgjkgaqU2ugbfZn3tAEvTcDQPpJMKcqiA2VUe/NTwCOWlhyU4U2bzFcAbeGAuvhR3xUp05liK0Qb9EtmujSuw9xcKHiKPMS2s2/66V0vQo1mIXQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=vlad_andrei.badoiu@xxxxxxxxxxxxxxx;
  • Cc: "felipe.huici@xxxxxxxxx" <felipe.huici@xxxxxxxxx>, "simon.kuenzer@xxxxxxxxx" <simon.kuenzer@xxxxxxxxx>
  • Delivery-date: Mon, 09 Sep 2019 15:54:19 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHVZybSQjOvBvWNq0y+q1Yob2xeKg==
  • Thread-topic: [Minios-devel] [UNIKRAFT/LWIP PATCH 1/5] Revisit netdb.h declarations

Hey Costin,

Sure. 

Thanks,
Vlad

-------- Original message --------
From: Costin Lupu <costin.lup@xxxxxxxxx>
Date: 9/9/19 18:10 (GMT+02:00)
To: "Vlad-Andrei BĂDOIU (78692)" <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>, minios-devel@xxxxxxxxxxxxx
Cc: felipe.huici@xxxxxxxxx, simon.kuenzer@xxxxxxxxx
Subject: Re: [Minios-devel] [UNIKRAFT/LWIP PATCH 1/5] Revisit netdb.h declarations

Hi Vlad,

Please see inline.

On 9/9/19 5:52 PM, Vlad-Andrei BĂDOIU (78692) wrote:
> Hey Costin,
>
> I have one small comment inline.
>
> Thanks,
>
> Vlad
>
> On 04.09.2019 22:09, Costin Lupu wrote:
>> * As we did in commit b0dc593d, we use function wrappers instead of macros for
>> gethostbyname() and gethostbyname_r()
>> * Add missing declarations of functions implemented or stubbed in glue code
>>
>> Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
>> ---
>>  exportsyms.uk   |  1 +
>>  host.c          | 19 +++++++++++++++++++
>>  include/netdb.h | 23 ++++++++++++++++++-----
>>  3 files changed, 38 insertions(+), 5 deletions(-)
>>
>> diff --git a/exportsyms.uk b/exportsyms.uk
>> index 6fe95ec..1ca43f8 100644
>> --- a/exportsyms.uk
>> +++ b/exportsyms.uk
>> @@ -7,6 +7,7 @@ freeaddrinfo
>>  gai_strerror
>>  getaddrinfo
>>  gethostbyaddr
>> +gethostbyname
> |Shouldn't we also export the gethostbyname_r symbol?|||

That's right, I forgot to export it. If it's fine with you, I can do it
when upstreaming.

>>  getnameinfo
>>  getpeername
>>  getprotobyname
>> diff --git a/host.c b/host.c
>> index 559d186..9c4c8ea 100644
>> --- a/host.c
>> +++ b/host.c
>> @@ -33,10 +33,29 @@
>> 
>>  #include <unistd.h>
>>  #include <sys/socket.h>
>> +#include <netdb.h>
>> +
>> +
>> +#if LWIP_DNS && LWIP_SOCKET
>> +
>> +#if !(LWIP_COMPAT_SOCKETS)
>> +struct hostent *gethostbyname(const char *name)
>> +{
>> +    return lwip_gethostbyname(name);
>> +}
>> +
>> +int gethostbyname_r(const char *name,
>> +            struct hostent *ret, char *buf, size_t buflen,
>> +            struct hostent **result, int *h_errnop)
>> +{
>> +    return lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop);
>> +}
>> +#endif
>> 
>>  struct hostent *gethostbyaddr(const void *addr __unused,
>>       socklen_t len __unused, int type __unused)
>>  {
>>       return NULL;
>>  }
>> +#endif
>> 
>> diff --git a/include/netdb.h b/include/netdb.h
>> index 0856a49..b100136 100644
>> --- a/include/netdb.h
>> +++ b/include/netdb.h
>> @@ -1,10 +1,16 @@
>>  #include <compat/posix/netdb.h>
>> 
>> -#if LWIP_DNS && LWIP_SOCKET && !(LWIP_COMPAT_SOCKETS)
>> +#if LWIP_DNS && LWIP_SOCKET
>> 
>> -#define gethostbyname(name) lwip_gethostbyname(name)
>> -#define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \
>> -            lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop)
>> +#if !(LWIP_COMPAT_SOCKETS)
>> +struct hostent *gethostbyname(const char *name);
>> +int gethostbyname_r(const char *name,
>> +            struct hostent *ret, char *buf, size_t buflen,
>> +            struct hostent **result, int *h_errnop);
>> +#endif
>> +
>> +struct hostent *gethostbyaddr(const void *addr __unused,
>> +            socklen_t len __unused, int type __unused);
>> 
>>  int getaddrinfo(const char *node, const char *service,
>>               const struct addrinfo *hints,
>> @@ -13,6 +19,9 @@ void freeaddrinfo(struct addrinfo *res);
>> 
>>  #endif /* LWIP_DNS && LWIP_SOCKET && !(LWIP_COMPAT_SOCKETS) */
>> 
>> +const char *gai_strerror(int errcode);
>> +
>> +
>>  struct servent {
>>       char    *s_name;        /* official service name */
>>       char    **s_aliases;    /* alias list */
>> @@ -26,7 +35,11 @@ struct protoent {
>>       int     p_proto;        /* protocol # */
>>  };
>> 
>> -const char *gai_strerror(int errcode);
>> +struct protoent *getprotoent(void);
>> +struct protoent *getprotobyname(const char *name);
>> +struct protoent *getprotobynumber(int num);
>> +void endprotoent(void);
>> +void setprotoent(int stayopen);
>> 
>>  /*
>>   * Constants for getnameinfo()
>
> _______________________________________________
> Minios-devel mailing list
> Minios-devel@xxxxxxxxxxxxxxxxxxxx
> https://lists.xenproject.org/mailman/listinfo/minios-devel
>
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.