summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-03-26 01:58:39 +0000
committerrwatson <rwatson@FreeBSD.org>2006-03-26 01:58:39 +0000
commit72eb76f920e2b08777ad8d633ba6bab24a57b045 (patch)
treeba9f88a9f4cb568f38407ad00cbadbc5e6b7a475 /tools
parent32673f0256e4e7a641e4360babd09901b62d283c (diff)
downloadFreeBSD-src-72eb76f920e2b08777ad8d633ba6bab24a57b045.zip
FreeBSD-src-72eb76f920e2b08777ad8d633ba6bab24a57b045.tar.gz
Add simple ipxsocket regression test: open, and close, various IPX socket
types supported by the FreeBSD netipx implementation.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/netipx/ipxsocket/Makefile8
-rw-r--r--tools/regression/netipx/ipxsocket/ipxsocket.c72
2 files changed, 80 insertions, 0 deletions
diff --git a/tools/regression/netipx/ipxsocket/Makefile b/tools/regression/netipx/ipxsocket/Makefile
new file mode 100644
index 0000000..65157fa
--- /dev/null
+++ b/tools/regression/netipx/ipxsocket/Makefile
@@ -0,0 +1,8 @@
+#
+# $FreeBSD$
+#
+
+PROG= ipxsocket
+NO_MAN=
+
+.include <bsd.prog.mk>
diff --git a/tools/regression/netipx/ipxsocket/ipxsocket.c b/tools/regression/netipx/ipxsocket/ipxsocket.c
new file mode 100644
index 0000000..2b9c4e0
--- /dev/null
+++ b/tools/regression/netipx/ipxsocket/ipxsocket.c
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (c) 2006 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * Simple regression test to open and then immediately close various types of
+ * PF_IPX sockets.
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netipx/ipx.h>
+
+#include <err.h>
+#include <unistd.h>
+
+int
+main(int argc, char *argv[])
+{
+ int s;
+
+ s = socket(PF_IPX, SOCK_DGRAM, 0);
+ if (s < 0)
+ warn("socket(PF_IPX, SOCK_DGRAM, 0)");
+ else
+ close(s);
+
+ s = socket(PF_IPX, SOCK_STREAM, 0);
+ if (s < 0)
+ warn("socket(PF_IPX, SOCK_STREAM, 0)");
+ else
+ close(s);
+
+ s = socket(PF_IPX, SOCK_SEQPACKET, 0);
+ if (s < 0)
+ warn("socket(PF_IPX, SOCK_SEQPACKET, 0)");
+ else
+ close(s);
+
+ s = socket(PF_IPX, SOCK_RAW, 0);
+ if (s < 0)
+ warn("socket(PF_IPX, SOCK_RAW, 0)");
+ else
+ close(s);
+
+ return (0);
+}
OpenPOWER on IntegriCloud