added internet-address->dotted-string
This commit is contained in:
parent
d58a39d813
commit
e3f2877ab9
|
@ -146,6 +146,15 @@
|
||||||
(byte-vector-ref address 1)
|
(byte-vector-ref address 1)
|
||||||
(byte-vector-ref address 0)))
|
(byte-vector-ref address 0)))
|
||||||
|
|
||||||
|
;;; This proc and its inverse should be in a general IP module.
|
||||||
|
(define (internet-host-address->dotted-string bv)
|
||||||
|
(let* ((byte0 (byte-vector-ref bv 0))
|
||||||
|
(byte1 (byte-vector-ref bv 1))
|
||||||
|
(byte2 (byte-vector-ref bv 2))
|
||||||
|
(byte3 (byte-vector-ref bv 3)))
|
||||||
|
(string-append (number->string byte3) "." (number->string byte2) "."
|
||||||
|
(number->string byte1) "." (number->string byte0))))
|
||||||
|
|
||||||
(define (internet-host-address-to-number address)
|
(define (internet-host-address-to-number address)
|
||||||
(byte-vector->integer address))
|
(byte-vector->integer address))
|
||||||
|
|
||||||
|
|
|
@ -669,6 +669,7 @@
|
||||||
internet-host-address-from-bytes
|
internet-host-address-from-bytes
|
||||||
internet-host-address-to-number
|
internet-host-address-to-number
|
||||||
internet-host-address-to-bytes
|
internet-host-address-to-bytes
|
||||||
|
internet-host-address->dotted-string
|
||||||
|
|
||||||
host-info
|
host-info
|
||||||
host-info?
|
host-info?
|
||||||
|
|
Loading…
Reference in New Issue