mirror of
https://github.com/aaru-dps/aaruremote.git
synced 2025-12-16 19:24:37 +00:00
Use slims for BSD Sockets functions.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <ifaddrs.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int PrintNetworkAddresses()
|
||||
{
|
||||
@@ -49,4 +50,13 @@ int PrintNetworkAddresses()
|
||||
freeifaddrs(ifa_start);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
char* PrintIpv4Address(struct in_addr addr) { return inet_ntoa(addr); }
|
||||
int32_t NetSocket(uint32_t domain, uint32_t type, uint32_t protocol) { return socket(domain, type, protocol); }
|
||||
int32_t NetBind(int32_t sockfd, struct sockaddr* addr, socklen_t addrlen) { return bind(sockfd, addr, addrlen); }
|
||||
int32_t NetListen(int32_t sockfd, uint32_t backlog) { return listen(sockfd, backlog); }
|
||||
int32_t NetAccept(int32_t sockfd, struct sockaddr* addr, socklen_t* addrlen) { return accept(sockfd, addr, addrlen); }
|
||||
int32_t NetRecv(int32_t sockfd, void* buf, int32_t len, uint32_t flags) { return recv(sockfd, buf, len, flags); }
|
||||
int32_t NetWrite(int32_t fd, const void* buf, int32_t size) { return write(fd, buf, size); }
|
||||
int32_t NetClose(int32_t fd) { return close(fd); }
|
||||
|
||||
Reference in New Issue
Block a user