diff --git a/lib/chibi/net.sld b/lib/chibi/net.sld index e13b28c3..9f7506cc 100644 --- a/lib/chibi/net.sld +++ b/lib/chibi/net.sld @@ -2,7 +2,7 @@ (define-library (chibi net) (export sockaddr? address-info? get-address-info make-address-info socket connect bind accept listen open-socket-pair - sockaddr-name sockaddr-port + sockaddr-name sockaddr-port make-sockaddr with-net-io open-net-io make-listener-socket address-info-family address-info-socket-type address-info-protocol address-info-address address-info-address-length address-info-next @@ -15,6 +15,7 @@ socket-opt/keepalive socket-opt/oobinline socket-opt/sndbuf socket-opt/rcvbuf socket-opt/dontroute socket-opt/rcvlowat socket-opt/sndlowat + get-peer-name ;; C structs sockaddr addrinfo) (import (chibi) (chibi filesystem)) diff --git a/lib/chibi/net.stub b/lib/chibi/net.stub index 9c3b28e4..2023b85d 100644 --- a/lib/chibi/net.stub +++ b/lib/chibi/net.stub @@ -7,6 +7,7 @@ (define-c-int-type socklen_t) (define-c-struct sockaddr + constructor: (make-sockaddr) predicate: sockaddr?) (define-c-struct addrinfo @@ -84,6 +85,9 @@ (c-include "accept.c") +(define-c errno (get-peer-name getpeername) + (fileno sockaddr (result (value (sizeof sockaddr) socklen_t)))) + (define-c errno getsockopt (fileno int int (result int) (result (value (sizeof int) socklen_t))))