#define ISO8601_FORMAT "%Y-%m-%dT%H:%M:%S"
/* socket types supported */
-int types[3] = {SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM};
-char sock_fullpath[PATH_MAX + 1];
+static int types[3] = {SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM};
+static char sock_fullpath[PATH_MAX + 1];
-void test_abort_client_server(int abort_type);
-void test_abort_client(int abort_type);
-void test_abort_server(pid_t pid, int abort_type);
+static void test_abort_client_server(int abort_type);
+static void test_abort_client(int abort_type);
+static void test_abort_server(pid_t pid, int abort_type);
/* timestamps for debug and error logs */
-char *get_timestamp(void)
+static char *get_timestamp(void)
{
struct tm *tm;
time_t t;
}
/* macro to display information about a failed test and increment the errct */
-void test_fail_fl(char *msg, char *file, int line)
+static void test_fail_fl(char *msg, char *file, int line)
{
char *timestamp;
timestamp = get_timestamp();
#define test_fail(msg) test_fail_fl(msg, __FILE__, __LINE__)
/* Convert name to the full path of the socket. Assumes name is in cwd. */
-char *fullpath(char *name)
+static char *fullpath(char *name)
{
char cwd[PATH_MAX + 1];
#if DEBUG == 1
/* macros to display debugging information */
-void debug_fl(char *msg, char *file, int line)
+static void debug_fl(char *msg, char *file, int line)
{
char *timestamp;
timestamp = get_timestamp();
} \
} while (0)
-void test_socket(void)
+static void test_socket(void)
{
struct stat statbuf, statbuf2;
int sd, sd2;
debug("leaving test_socket()");
}
-void test_header(void)
+static void test_header(void)
{
struct sockaddr_un sun;
debug("entering test_header()");
}
}
-void test_socketpair(void)
+static void test_socketpair(void)
{
char buf[128];
struct sockaddr_un addr;
debug("leaving test_socketpair()");
}
-void test_ucred(void)
+static void test_ucred(void)
{
struct uucred credentials;
socklen_t ucred_length;
CLOSE(sv[1]);
}
-void test_getsockname(void)
+static void test_getsockname(void)
{
int sd;
int rc;
CLOSE(sd);
}
-void test_bind(void)
+static void test_bind(void)
{
struct sockaddr_un addr;
struct sockaddr_un sock_addr;
debug("leaving test_bind()");
}
-void test_listen(void)
+static void test_listen(void)
{
int rc;
debug("leaving test_listen()");
}
-void test_shutdown(void)
+static void test_shutdown(void)
{
int how[3] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
int sd;
debug("leaving test_shutdown()");
}
-void test_close(void)
+static void test_close(void)
{
struct sockaddr_un addr;
int sd, sd2;
debug("leaving test_close()");
}
-void test_sockopts(void)
+static void test_sockopts(void)
{
int i;
int rc;
debug("leaving test_sockopts()");
}
-void test_read(void)
+static void test_read(void)
{
int rc;
int fd;
debug("leaving test_read()");
}
-void test_write(void)
+static void test_write(void)
{
int rc;
char buf[BUFSIZE];
debug("leaving test_write()");
}
-void test_dup(void)
+static void test_dup(void)
{
struct stat info1;
struct stat info2;
debug("leaving test_dup()");
}
-void test_dup2(void)
+static void test_dup2(void)
{
struct stat info1;
struct stat info2;
/*
* A toupper() server. This toy server converts a string to upper case.
*/
-void test_xfer_server(pid_t pid)
+static void test_xfer_server(pid_t pid)
{
int i;
struct timeval tv;
int status;
int rc;
int sd;
- char buf[BUFSIZE];
+ unsigned char buf[BUFSIZE];
socklen_t client_addr_size;
int client_sd;
struct sockaddr_un addr;
errct += WEXITSTATUS(status);
}
-int server_ready = 0;
+static int server_ready = 0;
/* signal handler for the client */
-void test_xfer_sighdlr(int sig)
+static void test_xfer_sighdlr(int sig)
{
debug("entering signal handler");
switch (sig) {
/*
* A toupper() client.
*/
-void test_xfer_client(void)
+static void test_xfer_client(void)
{
struct uucred credentials;
socklen_t ucred_length;
exit(errct);
}
-void test_xfer(void)
+static void test_xfer(void)
{
pid_t pid;
UNLINK(TEST_SUN_PATH);
}
-void test_simple_client(int type)
+static void test_simple_client(int type)
{
char buf[BUFSIZE];
int sd, rc;
exit(errct);
}
-void test_simple_server(int type, pid_t pid)
+static void test_simple_server(int type, pid_t pid)
{
char buf[BUFSIZE];
int sd, rc, client_sd, status;
errct += WEXITSTATUS(status);
}
-void test_abort_client_server(int abort_type)
+static void test_abort_client_server(int abort_type)
{
pid_t pid;
debug("test_simple_client_server()");
UNLINK(TEST_SUN_PATH);
}
-void test_abort_client(int abort_type)
+static void test_abort_client(int abort_type)
{
char buf[BUFSIZE];
int sd, rc;
exit(errct);
}
-void test_abort_server(pid_t pid, int abort_type)
+static void test_abort_server(pid_t pid, int abort_type)
{
char buf[BUFSIZE];
int sd, rc, client_sd, status;
errct += WEXITSTATUS(status);
}
-void test_simple_client_server(int type)
+static void test_simple_client_server(int type)
{
pid_t pid;
debug("test_simple_client_server()");
UNLINK(TEST_SUN_PATH);
}
-void test_vectorio(int type)
+static void test_vectorio(int type)
{
int sv[2];
int rc;
debug("done vector io tests");
}
-void test_msg(int type)
+static void test_msg(int type)
{
int sv[2];
int rc;
}
}
-void test_msg_dgram(void)
+static void test_msg_dgram(void)
{
int rc;
int src;
UNLINK(TEST_SUN_PATHB);
}
-void test_scm_credentials(void)
+static void test_scm_credentials(void)
{
int rc;
int src;
UNLINK(TEST_SUN_PATHB);
}
-void test_connect(void)
+static void test_connect(void)
{
int i, sd, sds[2], rc;
debug("exiting test_connect()");
}
-int test_multiproc_read(void)
+static int test_multiproc_read(void)
{
/* test that when we fork() a process with an open socket descriptor,
* the descriptor in each process points to the same thing.
return 0;
}
-int test_multiproc_write(void)
+static int test_multiproc_write(void)
{
/* test that when we fork() a process with an open socket descriptor,
* the descriptor in each process points to the same thing.
return 0;
}
-void test_fd_passing_child(int sd)
+static void test_fd_passing_child(int sd)
{
int fd, rc;
char x = 'x';
exit(errct);
}
-void test_fd_passing_parent(int sd)
+static void test_fd_passing_parent(int sd)
{
int rc, fd;
char x;
}
}
-void test_permissions(void) {
+static void test_permissions(void) {
/* Test bind and connect for permission verification
*
* After creating a UDS socket we change user credentials. At that
UNLINK(TEST_SUN_PATH);
}
-void test_fd_passing(void) {
+static void test_fd_passing(void) {
int status;
int sv[2];
pid_t pid;
}
}
-void test_select()
+static void test_select()
{
- int i, nfds = -1;
+ int nfds = -1;
int socks[2];
fd_set readfds, writefds;
struct timeval tv;
close(socks[1]);
}
-void test_select_close(void)
+static void test_select_close(void)
{
int res, socks[2];
fd_set readfds;
close(socks[0]);
}
-void test_fchmod()
+static void test_fchmod()
{
int socks[2];
struct stat st1, st2;
static void
test_listen_close(void)
{
- socklen_t len;
int server_sd, client_sd;
- struct sockaddr_un server_addr, client_addr, addr;
+ struct sockaddr_un server_addr, client_addr;
int status;
char byte;
static void
test_listen_close_nb(void)
{
- socklen_t len;
int server_sd, client_sd;
- struct sockaddr_un server_addr, client_addr, addr;
+ struct sockaddr_un server_addr, client_addr;
int status;
char byte;