From 2bdba5ed73ca813933ce84c6ee7fc6ee99e717c2 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 1 Oct 2021 12:57:47 +0300 Subject: [PATCH] net: fix declarations of C.htonl/C.htons/C.ntohl/C.ntohs in aasocket.c.v --- vlib/net/aasocket.c.v | 8 ++++---- vlib/net/unix/aasocket.c.v | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/vlib/net/aasocket.c.v b/vlib/net/aasocket.c.v index 0f69ae21be..4979f6aa05 100644 --- a/vlib/net/aasocket.c.v +++ b/vlib/net/aasocket.c.v @@ -33,9 +33,11 @@ fn C.socket(domain AddrFamily, typ SocketType, protocol int) int // fn C.setsockopt(sockfd int, level int, optname int, optval voidptr, optlen C.socklen_t) int fn C.setsockopt(sockfd int, level int, optname int, optval voidptr, optlen u32) int -fn C.htonl(hostlong u32) int +fn C.htonl(host u32) u32 +fn C.htons(host u16) u16 -fn C.htons(netshort u16) int +fn C.ntohl(net u32) u32 +fn C.ntohs(net u16) u16 // fn C.bind(sockfd int, addr &C.sockaddr, addrlen C.socklen_t) int // use voidptr for arg 2 becasue sockaddr is a generic descriptor for any kind of socket operation, @@ -68,8 +70,6 @@ fn C.recvfrom(sockfd int, buf voidptr, len usize, flags int, src_addr &Addr, add fn C.shutdown(socket int, how int) int -fn C.ntohs(netshort u16) int - // fn C.getpeername(sockfd int, addr &C.sockaddr, addlen &C.socklen_t) int fn C.getpeername(sockfd int, addr &Addr, addlen &u32) int diff --git a/vlib/net/unix/aasocket.c.v b/vlib/net/unix/aasocket.c.v index 7f762a574c..929463883e 100644 --- a/vlib/net/unix/aasocket.c.v +++ b/vlib/net/unix/aasocket.c.v @@ -74,8 +74,6 @@ struct C.sockaddr_storage { // fn C.shutdown() int -// fn C.ntohs() int - // fn C.getpeername() int // fn C.inet_ntop(af int, src voidptr, dst charptr, dst_size int) charptr