#include <arpa/inet.h>
#include <fcntl.h>
#include <limits.h>
#include <netdb.h>
#include <stdarg.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
Go to the source code of this file.
Macros | |
#define | MOCK_SYSCALL(ret, name, ARG_TYPES, ARG_NAMES) |
Functions | |
int | count_fcntl (int fd, int cmd, unsigned long arg) |
void | count_freeaddrinfo (struct addrinfo *res) |
MOCK_SYSCALL (int, accept,(int sockfd, struct sockaddr *addr, socklen_t *addrlen),(sockfd, addr, addrlen)) | |
MOCK_SYSCALL (int, bind,(int sockfd, const struct sockaddr *addr, socklen_t addrlen),(sockfd, addr, addrlen)) | |
MOCK_SYSCALL (int, close,(int socket),(socket)) | |
MOCK_SYSCALL (int, connect,(int sockfd, const struct sockaddr *addr, socklen_t addrlen),(sockfd, addr, addrlen)) | |
MOCK_SYSCALL (int, getaddrinfo,(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res),(node, service, hints, res)) | |
MOCK_SYSCALL (int, getsockname,(int sockfd, struct sockaddr *addr, socklen_t *addrlen),(sockfd, addr, addrlen)) | |
MOCK_SYSCALL (int, listen,(int sockfd, int backlog),(sockfd, backlog)) | |
MOCK_SYSCALL (int, select,(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout),(nfds, readfds, writefds, exceptfds, timeout)) | |
MOCK_SYSCALL (int, setsockopt,(int sockfd, int level, int optname, const void *optval, socklen_t optlen),(sockfd, level, optname, optval, optlen)) | |
MOCK_SYSCALL (int, socket,(int domain, int type, int protocol),(domain, type, protocol)) | |
MOCK_SYSCALL (ssize_t, read,(int fd, void *buf, size_t count),(fd, buf, count)) | |
MOCK_SYSCALL (ssize_t, write,(int fd, const void *buf, size_t count),(fd, buf, count)) | |
Variables | |
int(* | fake_fcntl )(int fd, int cmd, unsigned long) |
void(* | fake_freeaddrinfo )(struct addrinfo *res) |
int | fcntl_calls |
int | freeaddrinfo_calls |
#define MOCK_SYSCALL | ( | ret, | |
name, | |||
ARG_TYPES, | |||
ARG_NAMES | |||
) |
Definition at line 36 of file test_system_mocks.h.
int count_fcntl | ( | int | fd, |
int | cmd, | ||
unsigned long | arg | ||
) |
Definition at line 63 of file test_system_mocks.c.
void count_freeaddrinfo | ( | struct addrinfo * | res | ) |
Definition at line 78 of file test_system_mocks.c.
MOCK_SYSCALL | ( | int | , |
accept | , | ||
(int sockfd, struct sockaddr *addr, socklen_t *addrlen) | , | ||
(sockfd, addr, addrlen) | |||
) |
MOCK_SYSCALL | ( | int | , |
bind | , | ||
(int sockfd, const struct sockaddr *addr, socklen_t addrlen) | , | ||
(sockfd, addr, addrlen) | |||
) |
MOCK_SYSCALL | ( | int | , |
close | , | ||
(int socket) | , | ||
(socket) | |||
) |
MOCK_SYSCALL | ( | int | , |
connect | , | ||
(int sockfd, const struct sockaddr *addr, socklen_t addrlen) | , | ||
(sockfd, addr, addrlen) | |||
) |
MOCK_SYSCALL | ( | int | , |
getaddrinfo | , | ||
(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res) | , | ||
(node, service, hints, res) | |||
) |
MOCK_SYSCALL | ( | int | , |
getsockname | , | ||
(int sockfd, struct sockaddr *addr, socklen_t *addrlen) | , | ||
(sockfd, addr, addrlen) | |||
) |
MOCK_SYSCALL | ( | int | , |
listen | , | ||
(int sockfd, int backlog) | , | ||
(sockfd, backlog) | |||
) |
MOCK_SYSCALL | ( | int | , |
select | , | ||
(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) | , | ||
(nfds, readfds, writefds, exceptfds, timeout) | |||
) |
MOCK_SYSCALL | ( | int | , |
setsockopt | , | ||
(int sockfd, int level, int optname, const void *optval, socklen_t optlen) | , | ||
(sockfd, level, optname, optval, optlen) | |||
) |
MOCK_SYSCALL | ( | int | , |
socket | , | ||
(int domain, int type, int protocol) | , | ||
(domain, type, protocol) | |||
) |
MOCK_SYSCALL | ( | ssize_t | , |
read | , | ||
(int fd, void *buf, size_t count) | , | ||
(fd, buf, count) | |||
) |
MOCK_SYSCALL | ( | ssize_t | , |
write | , | ||
(int fd, const void *buf, size_t count) | , | ||
(fd, buf, count) | |||
) |
int(* fake_fcntl) (int fd, int cmd, unsigned long) |
Definition at line 49 of file test_system_mocks.c.
void(* fake_freeaddrinfo) (struct addrinfo *res) |
Definition at line 69 of file test_system_mocks.c.
int fcntl_calls |
Definition at line 62 of file test_system_mocks.c.
int freeaddrinfo_calls |
Definition at line 77 of file test_system_mocks.c.