Is getaddrinfo() supported (Socket programming)
  • Butterfly
    Butterfly
    Posts: 78 from 2020/5/1
    Is getaddrinfo() supported in MorphOS, or is it still the old gethostbyname() we have to use?

    https://blog.erratasec.com/2015/01/you-shouldnt-be-using-gethostbyname.html?m=1
  • »06.05.20 - 14:03
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 779 from 2007/10/23
    From: Gelsenkirchen,...
    At least Roadshow supports getaddrinfo()...
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »06.05.20 - 14:40
    Profile
  • MorphOS Developer
    Piru
    Posts: 576 from 2003/2/24
    From: finland, the l...
    MorphOS supports bsdsocket.library API. This API defines gethostbyname() as the name resolution function.

    Of course support will be added when we get around to implementing IPv6. Until then it isn't needed, nor does it offer any real benefits over gethostnyname().

    PS. I disagree with the notion in that blog post. There's nothing wrong with gethostbyname(). Just because some API is old doesn't necessarily equal it being bad.


    [ Edited by Piru 06.05.2020 - 18:48 ]
  • »06.05.20 - 16:46
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    BSzili
    Posts: 559 from 2012/6/8
    From: Hungary
    AFAIR Miami had its own extensions via miami.library, with POSIX socket functions. For example
    inet_ntop, inet_aton, inet_pton, getaddrinfo/freeaddrinfo, etc.


    (Sorry hit the edit button, not reply - Piru)

    [ Edited by Piru 06.05.2020 - 18:59 ]
    This is just like television, only you can see much further.
  • »06.05.20 - 16:56
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 576 from 2003/2/24
    From: finland, the l...
    Quote:

    BSzili wrote:
    AFAIR Miami had its own extensions via miami.library, with POSIX socket functions. For example
    inet_ntop, inet_aton, inet_pton, getaddrinfo/freeaddrinfo, etc.


    True, but it is unlikely that you would be running Miami on MorphOS, even though it is possible with some care. However, I know no software that uses or requires these extensions.
  • »06.05.20 - 16:59
    Profile
  • Butterfly
    Butterfly
    Posts: 78 from 2020/5/1
    Quote:

    Piru wrote:
    MorphOS supports bsdsocket.library API. This API defines gethostbyname() as the name resolution function.

    Of course support will be added when we get around to implementing IPv6. Until then it isn't needed, nor does it offer any real benefits over gethostnyname().


    It should be easier to port software, even without the need for IPv6.


    Quote:

    Piru wrote:
    PS. I disagree with the notion in that blog post. There's nothing wrong with gethostbyname(). Just because some API is old doesn't necessarily equal it being bad.


    I fully agree.
  • »06.05.20 - 17:16
    Profile
  • MorphOS Developer
    Piru
    Posts: 576 from 2003/2/24
    From: finland, the l...
    Quote:

    duga wrote:
    It should be easier to port software, even without the need for IPv6.

    GNU portability library (gnulib) provides a getaddinfo() wrapper function that uses gethostbyname() internally.

    Either way, you're likely to run into far bigger problems than just getaddrinfo, at least you're doing proper port and not quick'n'dirty ixemul build.

    [ Edited by Piru 06.05.2020 - 20:05 ]
  • »06.05.20 - 18:03
    Profile
  • Butterfly
    Butterfly
    Posts: 78 from 2020/5/1
    Quote:

    Piru wrote:
    Quote:

    duga wrote:
    It should be easier to port software, even without the need for IPv6.

    GNU portability library (gnulib) provides a getaddinfo() wrapper function that uses gethostbyname() internally.

    Either way, you're likely to run into far bigger problems than just getaddrinfo, at least you're doing proper port and not quick'n'dirty ixemul build.


    Thanks, I should check it out.

    It will for sure be quick n' dirty.
  • »06.05.20 - 18:56
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    BSzili
    Posts: 559 from 2012/6/8
    From: Hungary
    Quote:

    Piru wrote:
    Quote:

    BSzili wrote:
    AFAIR Miami had its own extensions via miami.library, with POSIX socket functions. For example
    inet_ntop, inet_aton, inet_pton, getaddrinfo/freeaddrinfo, etc.


    True, but it is unlikely that you would be running Miami on MorphOS, even though it is possible with some care. However, I know no software that uses or requires these extensions.


    You are right. Likely not many software used miami.library for this, if any. Using Roadshow compatible LVOs in bsdsocket.library for these extensions would probably make more sense.
    This is just like television, only you can see much further.
  • »07.05.20 - 05:15
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 779 from 2007/10/23
    From: Gelsenkirchen,...
    I have to use a wrapper for Oricutron and XRoar, so it's not an IPv6 issue... Gnulib is not always an option.

    [ Editiert durch polluks 07.05.2020 - 09:52 ]
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »07.05.20 - 08:51
    Profile
  • Butterfly
    Butterfly
    Posts: 78 from 2020/5/1
    Will getaddrinfo() make an entry in 3.15/3.16 or is it way far down on the feature list for that to happen?
  • »04.10.20 - 21:44
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 2971 from 2003/3/5
    From: Canada
    Adding that (even though it'd only do IPv4) would likely cause a chain-reaction when trying to compile POSIX stuff, enabling even more things that then wouldn't work. You can normally patch that function out in minutes.
  • »04.10.20 - 22:13
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 576 from 2003/2/24
    From: finland, the l...
    Jacek is definitely correct here. Additionally, it'd also result in a class of executables that would no longer work with other bsdsocket.library implementations.

    Meanwhile, what exactly would be the benefit of adding getaddrinfo()? The blog post referenced in the original post offers no plausible reason (that would be relevant for MorphOS as it is now).
  • »04.10.20 - 22:44
    Profile
  • Butterfly
    Butterfly
    Posts: 78 from 2020/5/1
    Piru: I see, so it's better to wait for an updated bsdsocket.library then. The benefit: easier to port Linux C++ source code (in theory).
  • »07.10.20 - 20:28
    Profile