[dylan-foundry/posix-sockets] 5dd3ca: [posix-sockets] byteswap port numbers.

GitHub <[email protected]> Fri, 04 Dec 2015 07:51:59 -0800
Newsgroups gmane.comp.lang.dylan.gwydion.cvs
Message-ID <5661b69fdc0ad_36a53fa0b9e7b2bc585b@hookshot-fe1-cp1-prd.iad.github.net.mail>
  Branch: refs/heads/master
  Home:   https://github.com/dylan-foundry/posix-sockets
  Commit: 5dd3ca6be99619db1b188dad7b6c5d4d4e78cf54
      https://github.com/dylan-foundry/posix-sockets/commit/5dd3ca6be99619db1b188dad7b6c5d4d4e78cf54
  Author: Bruce Mitchener <[email protected]>
  Date:   2015-12-04 (Fri, 04 Dec 2015)

  Changed paths:
    M posix-sockets/library.dylan
    M posix-sockets/module-posix-sockets.dylan
    M posix-sockets/posix-sockets.lid
    M posix-sockets/socket-address-inet.dylan
    M posix-sockets/socket-address-inet6.dylan
    A posix-sockets/utils.dylan

  Log Message:
  -----------
  [posix-sockets] byteswap port numbers.

port numbers are stored in network byte order, so we need to swap
them to host order on little endian platforms.

We don't call ntohs and friends from the OS here as that isn't
as easy to bind since it is a macro on some platforms. (And the
actual code required is very easy...)

* posix-sockets/utils.dylan
  (ntohs): New function.

* posix-sockets/posix-sockets.lid: Build utils.dylan

* posix-sockets/socket-address-inet.dylan
  (socket-address-port): Call ntohs to convert to host order.

* posix-sockets/socket-address-inet6.dylan
  (socket-address-port): Call ntohs to convert to host order.

* posix-sockets/library.dylan
  (library posix-sockets): Use system.

* posix-sockets/module-posix-sockets.dylan
  (module posix-sockets): Use operating-system to get
   architecture-little-endian?.

_______________________________________________
chatter mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/chatter