Is getaddrinfo() supported (Socket programming)
  • Just looking around
    Posts: 18 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
  • Order of the Butterfly
    Order of the Butterfly
    polluks
    Posts: 489 from 2007/10/23
    From: Gelsenkirchen,...
    At least Roadshow supports getaddrinfo()...
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.13
  • »06.05.20 - 14:40
    Profile
  • MorphOS Developer
    Piru
    Posts: 429 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: 534 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 ]
    I see the jimmies have been rustled.
  • »06.05.20 - 16:56
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 429 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
  • Just looking around
    Posts: 18 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: 429 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
  • Just looking around
    Posts: 18 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: 534 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.
    I see the jimmies have been rustled.
  • »07.05.20 - 05:15
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    polluks
    Posts: 489 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
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.13
  • »07.05.20 - 08:51
    Profile