mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-06 22:01:29 +00:00
[Pal/Linux-SGX] OCALL cleanup: rename ocall_sock_*() to ocall_*()
Also rename ocall_sock_setopt() to ocall_setsockopt(), to conform to Linux.
This commit is contained in:
@@ -65,8 +65,8 @@ static int pipe_listen(PAL_HANDLE* handle, PAL_NUM pipeid, int options) {
|
||||
|
||||
unsigned int addrlen = sizeof(struct sockaddr_un);
|
||||
struct sockopt sock_options;
|
||||
ret = ocall_sock_listen(AF_UNIX, pipe_type(options), 0, (struct sockaddr*)&addr, &addrlen,
|
||||
&sock_options);
|
||||
ret = ocall_listen(AF_UNIX, pipe_type(options), 0, (struct sockaddr*)&addr, &addrlen,
|
||||
&sock_options);
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -88,7 +88,7 @@ static int pipe_waitforclient(PAL_HANDLE handle, PAL_HANDLE* client) {
|
||||
return -PAL_ERROR_DENIED;
|
||||
|
||||
struct sockopt sock_options;
|
||||
int ret = ocall_sock_accept(handle->pipe.fd, NULL, NULL, &sock_options);
|
||||
int ret = ocall_accept(handle->pipe.fd, NULL, NULL, &sock_options);
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -111,8 +111,8 @@ static int pipe_connect(PAL_HANDLE* handle, PAL_NUM pipeid, int options) {
|
||||
return ret;
|
||||
|
||||
struct sockopt sock_options;
|
||||
ret = ocall_sock_connect(AF_UNIX, pipe_type(options), 0, (void*)&addr,
|
||||
sizeof(struct sockaddr_un), NULL, NULL, &sock_options);
|
||||
ret = ocall_connect(AF_UNIX, pipe_type(options), 0, (void*)&addr,
|
||||
sizeof(struct sockaddr_un), NULL, NULL, &sock_options);
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -188,7 +188,7 @@ static int64_t pipe_read(PAL_HANDLE handle, uint64_t offset, uint64_t len, void*
|
||||
return -PAL_ERROR_INVAL;
|
||||
|
||||
int fd = IS_HANDLE_TYPE(handle, pipeprv) ? handle->pipeprv.fds[0] : handle->pipe.fd;
|
||||
int bytes = ocall_sock_recv(fd, buffer, len, NULL, NULL, NULL, NULL);
|
||||
int bytes = ocall_recv(fd, buffer, len, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (IS_ERR(bytes))
|
||||
return unix_to_pal_error(ERRNO(bytes));
|
||||
@@ -212,7 +212,7 @@ static int64_t pipe_write(PAL_HANDLE handle, uint64_t offset, uint64_t len, cons
|
||||
return -PAL_ERROR_INVAL;
|
||||
|
||||
int fd = IS_HANDLE_TYPE(handle, pipeprv) ? handle->pipeprv.fds[1] : handle->pipe.fd;
|
||||
int bytes = ocall_sock_send(fd, buffer, len, NULL, 0, NULL, 0);
|
||||
int bytes = ocall_send(fd, buffer, len, NULL, 0, NULL, 0);
|
||||
|
||||
PAL_FLG writable = IS_HANDLE_TYPE(handle, pipeprv) ? WRITABLE(1) : WRITABLE(0);
|
||||
|
||||
@@ -309,7 +309,7 @@ static int pipe_delete(PAL_HANDLE handle, int access) {
|
||||
return -PAL_ERROR_INVAL;
|
||||
}
|
||||
|
||||
ocall_sock_shutdown(handle->pipe.fd, shutdown);
|
||||
ocall_shutdown(handle->pipe.fd, shutdown);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -444,7 +444,7 @@ static int proc_delete (PAL_HANDLE handle, int access)
|
||||
}
|
||||
|
||||
if (handle->process.cargo != PAL_IDX_POISON)
|
||||
ocall_sock_shutdown(handle->process.cargo, shutdown);
|
||||
ocall_shutdown(handle->process.cargo, shutdown);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -336,8 +336,8 @@ static int tcp_listen(PAL_HANDLE* handle, char* uri, int options) {
|
||||
memset(&sock_options, 0, sizeof(sock_options));
|
||||
sock_options.reuseaddr = 1; /* sockets are always set as reusable in Graphene */
|
||||
|
||||
ret = ocall_sock_listen(bind_addr->sa_family, sock_type(SOCK_STREAM, options), 0, bind_addr,
|
||||
&bind_addrlen, &sock_options);
|
||||
ret = ocall_listen(bind_addr->sa_family, sock_type(SOCK_STREAM, options), 0, bind_addr,
|
||||
&bind_addrlen, &sock_options);
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -370,7 +370,7 @@ static int tcp_accept(PAL_HANDLE handle, PAL_HANDLE* client) {
|
||||
memset(&sock_options, 0, sizeof(sock_options));
|
||||
sock_options.reuseaddr = 1; /* sockets are always set as reusable in Graphene */
|
||||
|
||||
ret = ocall_sock_accept(handle->sock.fd, &dest_addr, &dest_addrlen, &sock_options);
|
||||
ret = ocall_accept(handle->sock.fd, &dest_addr, &dest_addrlen, &sock_options);
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -416,8 +416,8 @@ static int tcp_connect(PAL_HANDLE* handle, char* uri, int options) {
|
||||
memset(&sock_options, 0, sizeof(sock_options));
|
||||
sock_options.reuseaddr = 1; /* sockets are always set as reusable in Graphene */
|
||||
|
||||
ret = ocall_sock_connect(dest_addr->sa_family, sock_type(SOCK_STREAM, options), 0, dest_addr,
|
||||
dest_addrlen, bind_addr, &bind_addrlen, &sock_options);
|
||||
ret = ocall_connect(dest_addr->sa_family, sock_type(SOCK_STREAM, options), 0, dest_addr,
|
||||
dest_addrlen, bind_addr, &bind_addrlen, &sock_options);
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -470,7 +470,7 @@ static int64_t tcp_read(PAL_HANDLE handle, uint64_t offset, uint64_t len, void*
|
||||
if (len >= (1ULL << (sizeof(unsigned int) * 8)))
|
||||
return -PAL_ERROR_INVAL;
|
||||
|
||||
int bytes = ocall_sock_recv(handle->sock.fd, buf, len, NULL, NULL, NULL, NULL);
|
||||
int bytes = ocall_recv(handle->sock.fd, buf, len, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (IS_ERR(bytes))
|
||||
return unix_to_pal_error(ERRNO(bytes));
|
||||
@@ -495,7 +495,7 @@ static int64_t tcp_write(PAL_HANDLE handle, uint64_t offset, uint64_t len, const
|
||||
if (len >= (1ULL << (sizeof(unsigned int) * 8)))
|
||||
return -PAL_ERROR_INVAL;
|
||||
|
||||
int bytes = ocall_sock_send(handle->sock.fd, buf, len, NULL, 0, NULL, 0);
|
||||
int bytes = ocall_send(handle->sock.fd, buf, len, NULL, 0, NULL, 0);
|
||||
|
||||
if (IS_ERR(bytes)) {
|
||||
bytes = unix_to_pal_error(ERRNO(bytes));
|
||||
@@ -537,8 +537,8 @@ static int udp_bind(PAL_HANDLE* handle, char* uri, int options) {
|
||||
memset(&sock_options, 0, sizeof(sock_options));
|
||||
sock_options.reuseaddr = 1; /* sockets are always set as reusable in Graphene */
|
||||
|
||||
ret = ocall_sock_listen(bind_addr->sa_family, sock_type(SOCK_DGRAM, options), 0, bind_addr,
|
||||
&bind_addrlen, &sock_options);
|
||||
ret = ocall_listen(bind_addr->sa_family, sock_type(SOCK_DGRAM, options), 0, bind_addr,
|
||||
&bind_addrlen, &sock_options);
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -576,9 +576,9 @@ static int udp_connect(PAL_HANDLE* handle, char* uri, int options) {
|
||||
memset(&sock_options, 0, sizeof(sock_options));
|
||||
sock_options.reuseaddr = 1; /* sockets are always set as reusable in Graphene */
|
||||
|
||||
ret = ocall_sock_connect(dest_addr ? dest_addr->sa_family : AF_INET,
|
||||
sock_type(SOCK_DGRAM, options), 0, dest_addr, dest_addrlen, bind_addr,
|
||||
&bind_addrlen, &sock_options);
|
||||
ret = ocall_connect(dest_addr ? dest_addr->sa_family : AF_INET,
|
||||
sock_type(SOCK_DGRAM, options), 0, dest_addr, dest_addrlen, bind_addr,
|
||||
&bind_addrlen, &sock_options);
|
||||
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
@@ -630,7 +630,7 @@ static int64_t udp_receive(PAL_HANDLE handle, uint64_t offset, uint64_t len, voi
|
||||
if (len >= (1ULL << (sizeof(unsigned int) * 8)))
|
||||
return -PAL_ERROR_INVAL;
|
||||
|
||||
int ret = ocall_sock_recv(handle->sock.fd, buf, len, NULL, NULL, NULL, NULL);
|
||||
int ret = ocall_recv(handle->sock.fd, buf, len, NULL, NULL, NULL, NULL);
|
||||
return IS_ERR(ret) ? unix_to_pal_error(ERRNO(ret)) : ret;
|
||||
}
|
||||
|
||||
@@ -651,7 +651,7 @@ static int64_t udp_receivebyaddr(PAL_HANDLE handle, uint64_t offset, uint64_t le
|
||||
struct sockaddr conn_addr;
|
||||
socklen_t conn_addrlen = sizeof(struct sockaddr);
|
||||
|
||||
int bytes = ocall_sock_recv(handle->sock.fd, buf, len, &conn_addr, &conn_addrlen, NULL, NULL);
|
||||
int bytes = ocall_recv(handle->sock.fd, buf, len, &conn_addr, &conn_addrlen, NULL, NULL);
|
||||
|
||||
if (IS_ERR(bytes))
|
||||
return unix_to_pal_error(ERRNO(bytes));
|
||||
@@ -680,7 +680,7 @@ static int64_t udp_send(PAL_HANDLE handle, uint64_t offset, uint64_t len, const
|
||||
if (len >= (1ULL << (sizeof(unsigned int) * 8)))
|
||||
return -PAL_ERROR_INVAL;
|
||||
|
||||
int bytes = ocall_sock_send(handle->sock.fd, buf, len, NULL, 0, NULL, 0);
|
||||
int bytes = ocall_send(handle->sock.fd, buf, len, NULL, 0, NULL, 0);
|
||||
|
||||
if (IS_ERR(bytes)) {
|
||||
bytes = unix_to_pal_error(ERRNO(bytes));
|
||||
@@ -727,7 +727,7 @@ static int64_t udp_sendbyaddr(PAL_HANDLE handle, uint64_t offset, uint64_t len,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
int bytes = ocall_sock_send(handle->sock.fd, buf, len, &conn_addr, conn_addrlen, NULL, 0);
|
||||
int bytes = ocall_send(handle->sock.fd, buf, len, &conn_addr, conn_addrlen, NULL, 0);
|
||||
|
||||
if (IS_ERR(bytes)) {
|
||||
bytes = unix_to_pal_error(ERRNO(bytes));
|
||||
@@ -767,7 +767,7 @@ static int socket_delete(PAL_HANDLE handle, int access) {
|
||||
return -PAL_ERROR_INVAL;
|
||||
}
|
||||
|
||||
ocall_sock_shutdown(handle->sock.fd, shutdown);
|
||||
ocall_shutdown(handle->sock.fd, shutdown);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -850,7 +850,7 @@ static int socket_attrsetbyhdl(PAL_HANDLE handle, PAL_STREAM_ATTR* attr) {
|
||||
struct __kernel_linger l;
|
||||
l.l_onoff = attr->socket.linger ? 1 : 0;
|
||||
l.l_linger = attr->socket.linger;
|
||||
ret = ocall_sock_setopt(fd, SOL_SOCKET, SO_LINGER, &l, sizeof(struct __kernel_linger));
|
||||
ret = ocall_setsockopt(fd, SOL_SOCKET, SO_LINGER, &l, sizeof(struct __kernel_linger));
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -859,7 +859,7 @@ static int socket_attrsetbyhdl(PAL_HANDLE handle, PAL_STREAM_ATTR* attr) {
|
||||
|
||||
if (attr->socket.receivebuf != handle->sock.receivebuf) {
|
||||
val = attr->socket.receivebuf;
|
||||
ret = ocall_sock_setopt(fd, SOL_SOCKET, SO_RCVBUF, &val, sizeof(int));
|
||||
ret = ocall_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, sizeof(int));
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -868,7 +868,7 @@ static int socket_attrsetbyhdl(PAL_HANDLE handle, PAL_STREAM_ATTR* attr) {
|
||||
|
||||
if (attr->socket.sendbuf != handle->sock.sendbuf) {
|
||||
val = attr->socket.sendbuf;
|
||||
ret = ocall_sock_setopt(fd, SOL_SOCKET, SO_SNDBUF, &val, sizeof(int));
|
||||
ret = ocall_setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, sizeof(int));
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -877,7 +877,7 @@ static int socket_attrsetbyhdl(PAL_HANDLE handle, PAL_STREAM_ATTR* attr) {
|
||||
|
||||
if (attr->socket.receivetimeout != handle->sock.receivetimeout) {
|
||||
val = attr->socket.receivetimeout;
|
||||
ret = ocall_sock_setopt(fd, SOL_SOCKET, SO_RCVTIMEO, &val, sizeof(int));
|
||||
ret = ocall_setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &val, sizeof(int));
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -886,7 +886,7 @@ static int socket_attrsetbyhdl(PAL_HANDLE handle, PAL_STREAM_ATTR* attr) {
|
||||
|
||||
if (attr->socket.sendtimeout != handle->sock.sendtimeout) {
|
||||
val = attr->socket.sendtimeout;
|
||||
ret = ocall_sock_setopt(fd, SOL_SOCKET, SO_SNDTIMEO, &val, sizeof(int));
|
||||
ret = ocall_setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &val, sizeof(int));
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -897,7 +897,7 @@ static int socket_attrsetbyhdl(PAL_HANDLE handle, PAL_STREAM_ATTR* attr) {
|
||||
if (HANDLE_TYPE(handle) == pal_type_tcp || HANDLE_TYPE(handle) == pal_type_tcpsrv) {
|
||||
if (attr->socket.tcp_cork != handle->sock.tcp_cork) {
|
||||
val = attr->socket.tcp_cork ? 1 : 0;
|
||||
ret = ocall_sock_setopt(fd, SOL_TCP, TCP_CORK, &val, sizeof(int));
|
||||
ret = ocall_setsockopt(fd, SOL_TCP, TCP_CORK, &val, sizeof(int));
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -906,7 +906,7 @@ static int socket_attrsetbyhdl(PAL_HANDLE handle, PAL_STREAM_ATTR* attr) {
|
||||
|
||||
if (attr->socket.tcp_keepalive != handle->sock.tcp_keepalive) {
|
||||
val = attr->socket.tcp_keepalive ? 1 : 0;
|
||||
ret = ocall_sock_setopt(fd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(int));
|
||||
ret = ocall_setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(int));
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -915,7 +915,7 @@ static int socket_attrsetbyhdl(PAL_HANDLE handle, PAL_STREAM_ATTR* attr) {
|
||||
|
||||
if (attr->socket.tcp_nodelay != handle->sock.tcp_nodelay) {
|
||||
val = attr->socket.tcp_nodelay ? 1 : 0;
|
||||
ret = ocall_sock_setopt(fd, SOL_TCP, TCP_NODELAY, &val, sizeof(int));
|
||||
ret = ocall_setsockopt(fd, SOL_TCP, TCP_NODELAY, &val, sizeof(int));
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -1045,7 +1045,7 @@ static int64_t mcast_send(PAL_HANDLE handle, uint64_t offset, uint64_t size, con
|
||||
if (size >= (1ULL << (sizeof(unsigned int) * 8)))
|
||||
return -PAL_ERROR_INVAL;
|
||||
|
||||
int bytes = ocall_sock_send(handle->mcast.srv, buf, size, NULL, 0, NULL, 0);
|
||||
int bytes = ocall_send(handle->mcast.srv, buf, size, NULL, 0, NULL, 0);
|
||||
|
||||
if (IS_ERR(bytes)) {
|
||||
bytes = unix_to_pal_error(ERRNO(bytes));
|
||||
@@ -1072,7 +1072,7 @@ static int64_t mcast_receive(PAL_HANDLE handle, uint64_t offset, uint64_t size,
|
||||
if (size >= (1ULL << (sizeof(unsigned int) * 8)))
|
||||
return -PAL_ERROR_INVAL;
|
||||
|
||||
int bytes = ocall_sock_recv(handle->mcast.cli, buf, size, NULL, NULL, NULL, NULL);
|
||||
int bytes = ocall_recv(handle->mcast.cli, buf, size, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (IS_ERR(bytes))
|
||||
bytes = unix_to_pal_error(ERRNO(bytes));
|
||||
|
||||
@@ -273,7 +273,7 @@ int _DkSendHandle(PAL_HANDLE hdl, PAL_HANDLE cargo) {
|
||||
}
|
||||
|
||||
int ch = hdl->process.cargo;
|
||||
ret = ocall_sock_send(ch, &hdl_hdr, sizeof(struct hdl_header), NULL, 0, NULL, 0);
|
||||
ret = ocall_send(ch, &hdl_hdr, sizeof(struct hdl_header), NULL, 0, NULL, 0);
|
||||
|
||||
if (IS_ERR(ret)) {
|
||||
free(hdl_data);
|
||||
@@ -289,7 +289,7 @@ int _DkSendHandle(PAL_HANDLE hdl, PAL_HANDLE cargo) {
|
||||
chdr->cmsg_len = CMSG_LEN(fds_size);
|
||||
memcpy(CMSG_DATA(chdr), fds, fds_size);
|
||||
|
||||
ret = ocall_sock_send(ch, hdl_data, hdl_hdr.data_size, NULL, 0, chdr, chdr->cmsg_len);
|
||||
ret = ocall_send(ch, hdl_data, hdl_hdr.data_size, NULL, 0, chdr, chdr->cmsg_len);
|
||||
|
||||
free(hdl_data);
|
||||
return IS_ERR(ret) ? unix_to_pal_error(ERRNO(ret)) : 0;
|
||||
@@ -305,7 +305,7 @@ int _DkReceiveHandle(PAL_HANDLE hdl, PAL_HANDLE* cargo) {
|
||||
|
||||
int ch = hdl->process.cargo;
|
||||
|
||||
int ret = ocall_sock_recv(ch, &hdl_hdr, sizeof(struct hdl_header), NULL, NULL, NULL, NULL);
|
||||
int ret = ocall_recv(ch, &hdl_hdr, sizeof(struct hdl_header), NULL, NULL, NULL, NULL);
|
||||
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
@@ -316,7 +316,7 @@ int _DkReceiveHandle(PAL_HANDLE hdl, PAL_HANDLE* cargo) {
|
||||
* to shield Iago attack.
|
||||
* We know that the file descriptor is an unix domain socket with
|
||||
* blocking mode and that the sender, _DkSendHandle() above, sends the
|
||||
* header with single sendmsg syscall by ocall_sock_send() which
|
||||
* header with single sendmsg syscall by ocall_send() which
|
||||
* transfers a message atomically.
|
||||
*
|
||||
* read size == 0: return error for the caller to try again.
|
||||
@@ -342,7 +342,7 @@ int _DkReceiveHandle(PAL_HANDLE hdl, PAL_HANDLE* cargo) {
|
||||
|
||||
char buffer[hdl_hdr.data_size];
|
||||
char cbuf[cbuf_size];
|
||||
ret = ocall_sock_recv(ch, buffer, hdl_hdr.data_size, NULL, NULL, cbuf, &cbuf_size);
|
||||
ret = ocall_recv(ch, buffer, hdl_hdr.data_size, NULL, NULL, cbuf, &cbuf_size);
|
||||
|
||||
if (IS_ERR(ret))
|
||||
return unix_to_pal_error(ERRNO(ret));
|
||||
|
||||
@@ -36,8 +36,8 @@ noreturn void ocall_exit(int exitcode, int is_exitgroup)
|
||||
}
|
||||
|
||||
int ocall_mmap_untrusted (int fd, uint64_t offset,
|
||||
uint64_t size, unsigned short prot,
|
||||
void ** mem)
|
||||
uint64_t size, unsigned short prot,
|
||||
void ** mem)
|
||||
{
|
||||
int retval = 0;
|
||||
ms_ocall_mmap_untrusted_t * ms;
|
||||
@@ -568,14 +568,14 @@ int ocall_socketpair (int domain, int type, int protocol,
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ocall_sock_listen (int domain, int type, int protocol,
|
||||
struct sockaddr * addr, unsigned int * addrlen,
|
||||
struct sockopt * sockopt)
|
||||
int ocall_listen (int domain, int type, int protocol,
|
||||
struct sockaddr * addr, unsigned int * addrlen,
|
||||
struct sockopt * sockopt)
|
||||
{
|
||||
int retval = 0;
|
||||
unsigned int copied;
|
||||
unsigned int len = addrlen ? *addrlen : 0;
|
||||
ms_ocall_sock_listen_t * ms;
|
||||
ms_ocall_listen_t * ms;
|
||||
|
||||
ms = sgx_alloc_on_ustack(sizeof(*ms));
|
||||
if (!ms) {
|
||||
@@ -594,7 +594,7 @@ int ocall_sock_listen (int domain, int type, int protocol,
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
retval = sgx_ocall(OCALL_SOCK_LISTEN, ms);
|
||||
retval = sgx_ocall(OCALL_LISTEN, ms);
|
||||
|
||||
if (retval >= 0) {
|
||||
if (addr && len) {
|
||||
@@ -615,13 +615,13 @@ int ocall_sock_listen (int domain, int type, int protocol,
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ocall_sock_accept (int sockfd, struct sockaddr * addr,
|
||||
unsigned int * addrlen, struct sockopt * sockopt)
|
||||
int ocall_accept (int sockfd, struct sockaddr * addr,
|
||||
unsigned int * addrlen, struct sockopt * sockopt)
|
||||
{
|
||||
int retval = 0;
|
||||
unsigned int copied;
|
||||
unsigned int len = addrlen ? *addrlen : 0;
|
||||
ms_ocall_sock_accept_t * ms;
|
||||
ms_ocall_accept_t * ms;
|
||||
|
||||
ms = sgx_alloc_on_ustack(sizeof(*ms));
|
||||
if (!ms) {
|
||||
@@ -638,7 +638,7 @@ int ocall_sock_accept (int sockfd, struct sockaddr * addr,
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
retval = sgx_ocall(OCALL_SOCK_ACCEPT, ms);
|
||||
retval = sgx_ocall(OCALL_ACCEPT, ms);
|
||||
|
||||
if (retval >= 0) {
|
||||
if (addr && len) {
|
||||
@@ -659,16 +659,16 @@ int ocall_sock_accept (int sockfd, struct sockaddr * addr,
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ocall_sock_connect (int domain, int type, int protocol,
|
||||
const struct sockaddr * addr,
|
||||
unsigned int addrlen,
|
||||
struct sockaddr * bind_addr,
|
||||
unsigned int * bind_addrlen, struct sockopt * sockopt)
|
||||
int ocall_connect (int domain, int type, int protocol,
|
||||
const struct sockaddr * addr,
|
||||
unsigned int addrlen,
|
||||
struct sockaddr * bind_addr,
|
||||
unsigned int * bind_addrlen, struct sockopt * sockopt)
|
||||
{
|
||||
int retval = 0;
|
||||
unsigned int copied;
|
||||
unsigned int bind_len = bind_addrlen ? *bind_addrlen : 0;
|
||||
ms_ocall_sock_connect_t * ms;
|
||||
ms_ocall_connect_t * ms;
|
||||
|
||||
ms = sgx_alloc_on_ustack(sizeof(*ms));
|
||||
if (!ms) {
|
||||
@@ -689,7 +689,7 @@ int ocall_sock_connect (int domain, int type, int protocol,
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
retval = sgx_ocall(OCALL_SOCK_CONNECT, ms);
|
||||
retval = sgx_ocall(OCALL_CONNECT, ms);
|
||||
|
||||
if (retval >= 0) {
|
||||
if (bind_addr && bind_len) {
|
||||
@@ -710,16 +710,16 @@ int ocall_sock_connect (int domain, int type, int protocol,
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ocall_sock_recv (int sockfd, void * buf, unsigned int count,
|
||||
struct sockaddr * addr, unsigned int * addrlenptr,
|
||||
void * control, uint64_t * controllenptr)
|
||||
int ocall_recv (int sockfd, void * buf, unsigned int count,
|
||||
struct sockaddr * addr, unsigned int * addrlenptr,
|
||||
void * control, uint64_t * controllenptr)
|
||||
{
|
||||
int retval = 0;
|
||||
void * obuf = NULL;
|
||||
unsigned int copied;
|
||||
unsigned int addrlen = addrlenptr ? *addrlenptr : 0;
|
||||
uint64_t controllen = controllenptr ? *controllenptr : 0;
|
||||
ms_ocall_sock_recv_t * ms;
|
||||
ms_ocall_recv_t * ms;
|
||||
|
||||
if ((count + addrlen + controllen) > MAX_UNTRUSTED_STACK_BUF) {
|
||||
retval = ocall_mmap_untrusted(-1, 0, ALLOC_ALIGNUP(count), PROT_READ | PROT_WRITE, &obuf);
|
||||
@@ -749,7 +749,7 @@ int ocall_sock_recv (int sockfd, void * buf, unsigned int count,
|
||||
goto out;
|
||||
}
|
||||
|
||||
retval = sgx_ocall(OCALL_SOCK_RECV, ms);
|
||||
retval = sgx_ocall(OCALL_RECV, ms);
|
||||
|
||||
if (retval >= 0) {
|
||||
if (addr && addrlen) {
|
||||
@@ -783,13 +783,13 @@ out:
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ocall_sock_send (int sockfd, const void * buf, unsigned int count,
|
||||
const struct sockaddr * addr, unsigned int addrlen,
|
||||
void * control, uint64_t controllen)
|
||||
int ocall_send (int sockfd, const void * buf, unsigned int count,
|
||||
const struct sockaddr * addr, unsigned int addrlen,
|
||||
void * control, uint64_t controllen)
|
||||
{
|
||||
int retval = 0;
|
||||
void * obuf = NULL;
|
||||
ms_ocall_sock_send_t * ms;
|
||||
ms_ocall_send_t * ms;
|
||||
|
||||
if (sgx_is_completely_outside_enclave(buf, count)) {
|
||||
/* buf is in untrusted memory (e.g., allowed file mmaped in untrusted memory) */
|
||||
@@ -830,7 +830,7 @@ int ocall_sock_send (int sockfd, const void * buf, unsigned int count,
|
||||
goto out;
|
||||
}
|
||||
|
||||
retval = sgx_ocall(OCALL_SOCK_SEND, ms);
|
||||
retval = sgx_ocall(OCALL_SEND, ms);
|
||||
|
||||
out:
|
||||
sgx_reset_ustack();
|
||||
@@ -839,11 +839,11 @@ out:
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ocall_sock_setopt (int sockfd, int level, int optname,
|
||||
const void * optval, unsigned int optlen)
|
||||
int ocall_setsockopt (int sockfd, int level, int optname,
|
||||
const void * optval, unsigned int optlen)
|
||||
{
|
||||
int retval = 0;
|
||||
ms_ocall_sock_setopt_t * ms;
|
||||
ms_ocall_setsockopt_t * ms;
|
||||
|
||||
ms = sgx_alloc_on_ustack(sizeof(*ms));
|
||||
if (!ms) {
|
||||
@@ -867,16 +867,16 @@ int ocall_sock_setopt (int sockfd, int level, int optname,
|
||||
}
|
||||
}
|
||||
|
||||
retval = sgx_ocall(OCALL_SOCK_SETOPT, ms);
|
||||
retval = sgx_ocall(OCALL_SETSOCKOPT, ms);
|
||||
|
||||
sgx_reset_ustack();
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ocall_sock_shutdown (int sockfd, int how)
|
||||
int ocall_shutdown (int sockfd, int how)
|
||||
{
|
||||
int retval = 0;
|
||||
ms_ocall_sock_shutdown_t * ms;
|
||||
ms_ocall_shutdown_t * ms;
|
||||
|
||||
ms = sgx_alloc_on_ustack(sizeof(*ms));
|
||||
if (!ms) {
|
||||
@@ -887,7 +887,7 @@ int ocall_sock_shutdown (int sockfd, int how)
|
||||
ms->ms_sockfd = sockfd;
|
||||
ms->ms_how = how;
|
||||
|
||||
retval = sgx_ocall(OCALL_SOCK_SHUTDOWN, ms);
|
||||
retval = sgx_ocall(OCALL_SHUTDOWN, ms);
|
||||
|
||||
sgx_reset_ustack();
|
||||
return retval;
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
noreturn void ocall_exit (int exitcode, int is_exitgroup);
|
||||
|
||||
int ocall_mmap_untrusted (int fd, uint64_t offset,
|
||||
uint64_t size, unsigned short prot,
|
||||
void ** mem);
|
||||
uint64_t size, unsigned short prot,
|
||||
void ** mem);
|
||||
|
||||
int ocall_munmap_untrusted (const void * mem, uint64_t size);
|
||||
|
||||
@@ -47,30 +47,30 @@ int ocall_mkdir (const char *pathname, unsigned short mode);
|
||||
|
||||
int ocall_getdents (int fd, struct linux_dirent64 *dirp, unsigned int size);
|
||||
|
||||
int ocall_sock_listen (int domain, int type, int protocol,
|
||||
struct sockaddr * addr, unsigned int * addrlen,
|
||||
struct sockopt * opt);
|
||||
int ocall_listen (int domain, int type, int protocol,
|
||||
struct sockaddr * addr, unsigned int * addrlen,
|
||||
struct sockopt * opt);
|
||||
|
||||
int ocall_sock_accept (int sockfd, struct sockaddr * addr,
|
||||
unsigned int * addrlen, struct sockopt * opt);
|
||||
int ocall_accept (int sockfd, struct sockaddr * addr,
|
||||
unsigned int * addrlen, struct sockopt * opt);
|
||||
|
||||
int ocall_sock_connect (int domain, int type, int protocol,
|
||||
const struct sockaddr * addr, unsigned int addrlen,
|
||||
struct sockaddr * connaddr,
|
||||
unsigned int * connaddrlen, struct sockopt * opt);
|
||||
int ocall_connect (int domain, int type, int protocol,
|
||||
const struct sockaddr * addr, unsigned int addrlen,
|
||||
struct sockaddr * connaddr,
|
||||
unsigned int * connaddrlen, struct sockopt * opt);
|
||||
|
||||
int ocall_sock_recv (int sockfd, void * buf, unsigned int count,
|
||||
struct sockaddr * addr, unsigned int * addrlenptr,
|
||||
void * control, uint64_t * controllenptr);
|
||||
int ocall_recv (int sockfd, void * buf, unsigned int count,
|
||||
struct sockaddr * addr, unsigned int * addrlenptr,
|
||||
void * control, uint64_t * controllenptr);
|
||||
|
||||
int ocall_sock_send (int sockfd, const void * buf, unsigned int count,
|
||||
const struct sockaddr * addr, unsigned int addrlen,
|
||||
void * control, uint64_t controllen);
|
||||
int ocall_send (int sockfd, const void * buf, unsigned int count,
|
||||
const struct sockaddr * addr, unsigned int addrlen,
|
||||
void * control, uint64_t controllen);
|
||||
|
||||
int ocall_sock_setopt (int sockfd, int level, int optname,
|
||||
const void * optval, unsigned int optlen);
|
||||
int ocall_setsockopt (int sockfd, int level, int optname,
|
||||
const void * optval, unsigned int optlen);
|
||||
|
||||
int ocall_sock_shutdown (int sockfd, int how);
|
||||
int ocall_shutdown (int sockfd, int how);
|
||||
|
||||
int ocall_resume_thread (void * tcs);
|
||||
|
||||
|
||||
@@ -42,13 +42,13 @@ enum {
|
||||
OCALL_CREATE_PROCESS,
|
||||
OCALL_FUTEX,
|
||||
OCALL_SOCKETPAIR,
|
||||
OCALL_SOCK_LISTEN,
|
||||
OCALL_SOCK_ACCEPT,
|
||||
OCALL_SOCK_CONNECT,
|
||||
OCALL_SOCK_RECV,
|
||||
OCALL_SOCK_SEND,
|
||||
OCALL_SOCK_SETOPT,
|
||||
OCALL_SOCK_SHUTDOWN,
|
||||
OCALL_LISTEN,
|
||||
OCALL_ACCEPT,
|
||||
OCALL_CONNECT,
|
||||
OCALL_RECV,
|
||||
OCALL_SEND,
|
||||
OCALL_SETSOCKOPT,
|
||||
OCALL_SHUTDOWN,
|
||||
OCALL_GETTIME,
|
||||
OCALL_SLEEP,
|
||||
OCALL_POLL,
|
||||
@@ -175,14 +175,14 @@ typedef struct {
|
||||
const struct sockaddr * ms_addr;
|
||||
unsigned int ms_addrlen;
|
||||
struct sockopt ms_sockopt;
|
||||
} ms_ocall_sock_listen_t;
|
||||
} ms_ocall_listen_t;
|
||||
|
||||
typedef struct {
|
||||
int ms_sockfd;
|
||||
struct sockaddr * ms_addr;
|
||||
unsigned int ms_addrlen;
|
||||
struct sockopt ms_sockopt;
|
||||
} ms_ocall_sock_accept_t;
|
||||
} ms_ocall_accept_t;
|
||||
|
||||
typedef struct {
|
||||
int ms_domain, ms_type, ms_protocol;
|
||||
@@ -191,7 +191,7 @@ typedef struct {
|
||||
struct sockaddr * ms_bind_addr;
|
||||
unsigned int ms_bind_addrlen;
|
||||
struct sockopt ms_sockopt;
|
||||
} ms_ocall_sock_connect_t;
|
||||
} ms_ocall_connect_t;
|
||||
|
||||
typedef struct {
|
||||
PAL_IDX ms_sockfd;
|
||||
@@ -201,7 +201,7 @@ typedef struct {
|
||||
unsigned int ms_addrlen;
|
||||
void * ms_control;
|
||||
uint64_t ms_controllen;
|
||||
} ms_ocall_sock_recv_t;
|
||||
} ms_ocall_recv_t;
|
||||
|
||||
typedef struct {
|
||||
PAL_IDX ms_sockfd;
|
||||
@@ -211,7 +211,7 @@ typedef struct {
|
||||
unsigned int ms_addrlen;
|
||||
void * ms_control;
|
||||
uint64_t ms_controllen;
|
||||
} ms_ocall_sock_send_t;
|
||||
} ms_ocall_send_t;
|
||||
|
||||
typedef struct {
|
||||
int ms_sockfd;
|
||||
@@ -219,12 +219,12 @@ typedef struct {
|
||||
int ms_optname;
|
||||
const void * ms_optval;
|
||||
unsigned int ms_optlen;
|
||||
} ms_ocall_sock_setopt_t;
|
||||
} ms_ocall_setsockopt_t;
|
||||
|
||||
typedef struct {
|
||||
int ms_sockfd;
|
||||
int ms_how;
|
||||
} ms_ocall_sock_shutdown_t;
|
||||
} ms_ocall_shutdown_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned long ms_microsec;
|
||||
|
||||
@@ -276,11 +276,11 @@ static int sock_getopt(int fd, struct sockopt * opt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sgx_ocall_sock_listen(void * pms)
|
||||
static int sgx_ocall_listen(void * pms)
|
||||
{
|
||||
ms_ocall_sock_listen_t * ms = (ms_ocall_sock_listen_t *) pms;
|
||||
ms_ocall_listen_t * ms = (ms_ocall_listen_t *) pms;
|
||||
int ret, fd;
|
||||
ODEBUG(OCALL_SOCK_LISTEN, ms);
|
||||
ODEBUG(OCALL_LISTEN, ms);
|
||||
|
||||
ret = INLINE_SYSCALL(socket, 3, ms->ms_domain,
|
||||
ms->ms_type|SOCK_CLOEXEC,
|
||||
@@ -329,11 +329,11 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sgx_ocall_sock_accept(void * pms)
|
||||
static int sgx_ocall_accept(void * pms)
|
||||
{
|
||||
ms_ocall_sock_accept_t * ms = (ms_ocall_sock_accept_t *) pms;
|
||||
ms_ocall_accept_t * ms = (ms_ocall_accept_t *) pms;
|
||||
int ret, fd;
|
||||
ODEBUG(OCALL_SOCK_ACCEPT, ms);
|
||||
ODEBUG(OCALL_ACCEPT, ms);
|
||||
socklen_t addrlen = ms->ms_addrlen;
|
||||
|
||||
ret = INLINE_SYSCALL(accept4, 4, ms->ms_sockfd, ms->ms_addr,
|
||||
@@ -355,11 +355,11 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sgx_ocall_sock_connect(void * pms)
|
||||
static int sgx_ocall_connect(void * pms)
|
||||
{
|
||||
ms_ocall_sock_connect_t * ms = (ms_ocall_sock_connect_t *) pms;
|
||||
ms_ocall_connect_t * ms = (ms_ocall_connect_t *) pms;
|
||||
int ret, fd;
|
||||
ODEBUG(OCALL_SOCK_CONNECT, ms);
|
||||
ODEBUG(OCALL_CONNECT, ms);
|
||||
|
||||
ret = INLINE_SYSCALL(socket, 3, ms->ms_domain,
|
||||
ms->ms_type|SOCK_CLOEXEC,
|
||||
@@ -417,11 +417,11 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sgx_ocall_sock_recv(void * pms)
|
||||
static int sgx_ocall_recv(void * pms)
|
||||
{
|
||||
ms_ocall_sock_recv_t * ms = (ms_ocall_sock_recv_t *) pms;
|
||||
ms_ocall_recv_t * ms = (ms_ocall_recv_t *) pms;
|
||||
int ret;
|
||||
ODEBUG(OCALL_SOCK_RECV, ms);
|
||||
ODEBUG(OCALL_RECV, ms);
|
||||
struct sockaddr * addr = ms->ms_addr;
|
||||
socklen_t addrlen = ms->ms_addr ? ms->ms_addrlen : 0;
|
||||
|
||||
@@ -458,11 +458,11 @@ static int sgx_ocall_sock_recv(void * pms)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sgx_ocall_sock_send(void * pms)
|
||||
static int sgx_ocall_send(void * pms)
|
||||
{
|
||||
ms_ocall_sock_send_t * ms = (ms_ocall_sock_send_t *) pms;
|
||||
ms_ocall_send_t * ms = (ms_ocall_send_t *) pms;
|
||||
int ret;
|
||||
ODEBUG(OCALL_SOCK_SEND, ms);
|
||||
ODEBUG(OCALL_SEND, ms);
|
||||
const struct sockaddr * addr = ms->ms_addr;
|
||||
socklen_t addrlen = ms->ms_addr ? ms->ms_addrlen : 0;
|
||||
struct sockaddr_in mcast_addr;
|
||||
@@ -492,21 +492,21 @@ static int sgx_ocall_sock_send(void * pms)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sgx_ocall_sock_setopt(void * pms)
|
||||
static int sgx_ocall_setsockopt(void * pms)
|
||||
{
|
||||
ms_ocall_sock_setopt_t * ms = (ms_ocall_sock_setopt_t *) pms;
|
||||
ms_ocall_setsockopt_t * ms = (ms_ocall_setsockopt_t *) pms;
|
||||
int ret;
|
||||
ODEBUG(OCALL_SOCK_SETOPT, ms);
|
||||
ODEBUG(OCALL_SETSOCKOPT, ms);
|
||||
ret = INLINE_SYSCALL(setsockopt, 5,
|
||||
ms->ms_sockfd, ms->ms_level, ms->ms_optname,
|
||||
ms->ms_optval, ms->ms_optlen);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sgx_ocall_sock_shutdown(void * pms)
|
||||
static int sgx_ocall_shutdown(void * pms)
|
||||
{
|
||||
ms_ocall_sock_shutdown_t * ms = (ms_ocall_sock_shutdown_t *) pms;
|
||||
ODEBUG(OCALL_SOCK_SHUTDOWN, ms);
|
||||
ms_ocall_shutdown_t * ms = (ms_ocall_shutdown_t *) pms;
|
||||
ODEBUG(OCALL_SHUTDOWN, ms);
|
||||
INLINE_SYSCALL(shutdown, 2, ms->ms_sockfd, ms->ms_how);
|
||||
return 0;
|
||||
}
|
||||
@@ -615,44 +615,44 @@ static int sgx_ocall_get_attestation(void* pms) {
|
||||
}
|
||||
|
||||
sgx_ocall_fn_t ocall_table[OCALL_NR] = {
|
||||
[OCALL_EXIT] = sgx_ocall_exit,
|
||||
[OCALL_MMAP_UNTRUSTED] = sgx_ocall_mmap_untrusted,
|
||||
[OCALL_MUNMAP_UNTRUSTED]= sgx_ocall_munmap_untrusted,
|
||||
[OCALL_CPUID] = sgx_ocall_cpuid,
|
||||
[OCALL_OPEN] = sgx_ocall_open,
|
||||
[OCALL_CLOSE] = sgx_ocall_close,
|
||||
[OCALL_READ] = sgx_ocall_read,
|
||||
[OCALL_WRITE] = sgx_ocall_write,
|
||||
[OCALL_FSTAT] = sgx_ocall_fstat,
|
||||
[OCALL_FIONREAD] = sgx_ocall_fionread,
|
||||
[OCALL_FSETNONBLOCK] = sgx_ocall_fsetnonblock,
|
||||
[OCALL_FCHMOD] = sgx_ocall_fchmod,
|
||||
[OCALL_FSYNC] = sgx_ocall_fsync,
|
||||
[OCALL_FTRUNCATE] = sgx_ocall_ftruncate,
|
||||
[OCALL_LSEEK] = sgx_ocall_lseek,
|
||||
[OCALL_MKDIR] = sgx_ocall_mkdir,
|
||||
[OCALL_GETDENTS] = sgx_ocall_getdents,
|
||||
[OCALL_RESUME_THREAD] = sgx_ocall_resume_thread,
|
||||
[OCALL_CLONE_THREAD] = sgx_ocall_clone_thread,
|
||||
[OCALL_CREATE_PROCESS] = sgx_ocall_create_process,
|
||||
[OCALL_FUTEX] = sgx_ocall_futex,
|
||||
[OCALL_SOCKETPAIR] = sgx_ocall_socketpair,
|
||||
[OCALL_SOCK_LISTEN] = sgx_ocall_sock_listen,
|
||||
[OCALL_SOCK_ACCEPT] = sgx_ocall_sock_accept,
|
||||
[OCALL_SOCK_CONNECT] = sgx_ocall_sock_connect,
|
||||
[OCALL_SOCK_RECV] = sgx_ocall_sock_recv,
|
||||
[OCALL_SOCK_SEND] = sgx_ocall_sock_send,
|
||||
[OCALL_SOCK_SETOPT] = sgx_ocall_sock_setopt,
|
||||
[OCALL_SOCK_SHUTDOWN] = sgx_ocall_sock_shutdown,
|
||||
[OCALL_GETTIME] = sgx_ocall_gettime,
|
||||
[OCALL_SLEEP] = sgx_ocall_sleep,
|
||||
[OCALL_POLL] = sgx_ocall_poll,
|
||||
[OCALL_RENAME] = sgx_ocall_rename,
|
||||
[OCALL_DELETE] = sgx_ocall_delete,
|
||||
[OCALL_LOAD_DEBUG] = sgx_ocall_load_debug,
|
||||
[OCALL_GET_ATTESTATION] = sgx_ocall_get_attestation,
|
||||
[OCALL_EVENTFD] = sgx_ocall_eventfd,
|
||||
};
|
||||
[OCALL_EXIT] = sgx_ocall_exit,
|
||||
[OCALL_MMAP_UNTRUSTED] = sgx_ocall_mmap_untrusted,
|
||||
[OCALL_MUNMAP_UNTRUSTED] = sgx_ocall_munmap_untrusted,
|
||||
[OCALL_CPUID] = sgx_ocall_cpuid,
|
||||
[OCALL_OPEN] = sgx_ocall_open,
|
||||
[OCALL_CLOSE] = sgx_ocall_close,
|
||||
[OCALL_READ] = sgx_ocall_read,
|
||||
[OCALL_WRITE] = sgx_ocall_write,
|
||||
[OCALL_FSTAT] = sgx_ocall_fstat,
|
||||
[OCALL_FIONREAD] = sgx_ocall_fionread,
|
||||
[OCALL_FSETNONBLOCK] = sgx_ocall_fsetnonblock,
|
||||
[OCALL_FCHMOD] = sgx_ocall_fchmod,
|
||||
[OCALL_FSYNC] = sgx_ocall_fsync,
|
||||
[OCALL_FTRUNCATE] = sgx_ocall_ftruncate,
|
||||
[OCALL_LSEEK] = sgx_ocall_lseek,
|
||||
[OCALL_MKDIR] = sgx_ocall_mkdir,
|
||||
[OCALL_GETDENTS] = sgx_ocall_getdents,
|
||||
[OCALL_RESUME_THREAD] = sgx_ocall_resume_thread,
|
||||
[OCALL_CLONE_THREAD] = sgx_ocall_clone_thread,
|
||||
[OCALL_CREATE_PROCESS] = sgx_ocall_create_process,
|
||||
[OCALL_FUTEX] = sgx_ocall_futex,
|
||||
[OCALL_SOCKETPAIR] = sgx_ocall_socketpair,
|
||||
[OCALL_LISTEN] = sgx_ocall_listen,
|
||||
[OCALL_ACCEPT] = sgx_ocall_accept,
|
||||
[OCALL_CONNECT] = sgx_ocall_connect,
|
||||
[OCALL_RECV] = sgx_ocall_recv,
|
||||
[OCALL_SEND] = sgx_ocall_send,
|
||||
[OCALL_SETSOCKOPT] = sgx_ocall_setsockopt,
|
||||
[OCALL_SHUTDOWN] = sgx_ocall_shutdown,
|
||||
[OCALL_GETTIME] = sgx_ocall_gettime,
|
||||
[OCALL_SLEEP] = sgx_ocall_sleep,
|
||||
[OCALL_POLL] = sgx_ocall_poll,
|
||||
[OCALL_RENAME] = sgx_ocall_rename,
|
||||
[OCALL_DELETE] = sgx_ocall_delete,
|
||||
[OCALL_LOAD_DEBUG] = sgx_ocall_load_debug,
|
||||
[OCALL_GET_ATTESTATION] = sgx_ocall_get_attestation,
|
||||
[OCALL_EVENTFD] = sgx_ocall_eventfd,
|
||||
};
|
||||
|
||||
#define EDEBUG(code, ms) do {} while (0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user