home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-05 | 108.1 KB | 3,082 lines |
- Newsgroups: comp.sources.unix
- From: casey@gauss.llnl.gov (Casey Leedom)
- Subject: v26i105: mcast - LLNL IP multicast implementation, V1.2.3, Part01/04
- Sender: unix-sources-moderator@vix.com
- Approved: paul@vix.com
-
- Submitted-By: casey@gauss.llnl.gov (Casey Leedom)
- Posting-Number: Volume 26, Issue 105
- Archive-Name: mcast/part01
-
- WHAT IS LLNL MCAST?:
-
- The LLNL MCAST software is an experimental implementation of a
- multicast communication system. It allows applications to communicate
- in a broadcast-like manner with other applications. Multicast would
- typically be used by the parts of a distributed application.
-
- The system consists of an application programming interface (API)
- modeled on the Berkeley socket abstraction, a communications server,
- and a complete set of manual pages.
-
- The communication server implements the multicast message passing
- semantics. A version of the system which uses network level multicast
- facilities is planned, but we needed something up and running quickly
- so other members of our project team could proceed with their work.
- Hence, this version. Our goal is to be able to slip in a true
- multicast implementation using the same API under our applications
- without the applications noticing the difference ...
-
- WHERE TO SEND CORRESPONDENCE:
-
- If you have bug reports, fixes, suggestions, or just want to talk about
- the software, address your correspondence to:
-
- Casey Leedom
- Mail Stop: L-287
- Lawrence Livermore National Laboratory
- Livermore, CA
- USA
-
- email: casey@gauss.llnl.gov
- phone: (USA) 510-423-7775
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 4)."
- # Contents: MANIFEST MEMO Makefile Makefile.tmpl PATCHLEVEL README
- # TODO config config/Makefile.config config/Makefile.std doc
- # doc/Makefile doc/Makefile.tmpl include include/netmcast
- # include/netmcast/Makefile include/netmcast/Makefile.tmpl
- # include/netmcast/mcastd.h libmcast libmcast/Makefile
- # libmcast/Makefile.tmpl libmcast/_mc_state.c libmcast/mc_close.c
- # libmcast/mc_getpeername.c libmcast/mc_getsockname.c
- # libmcast/mc_getsockopt.c libmcast/mc_ioctl.c libmcast/mc_read.c
- # libmcast/mc_readv.c libmcast/mc_recv.c libmcast/mc_recvfrom.c
- # libmcast/mc_send.c libmcast/mc_setsockopt.c libmcast/mc_shutdown.c
- # libmcast/mc_write.c libmcast/mc_writev.c man man/Makefile
- # man/Makefile.tmpl man/mc_close.2 man/mc_shutdown.2 mcastd
- # mcastd/Makefile mcastd/Makefile.tmpl test test/Makefile
- # test/Makefile.tmpl test/mc_hello.c
- # Wrapped by vixie@gw.home.vix.com on Tue Apr 6 12:49:43 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'MANIFEST' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MANIFEST'\"
- else
- echo shar: Extracting \"'MANIFEST'\" \(2761 characters\)
- sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
- X File Name Archive # Description
- X-----------------------------------------------------------
- X ABSTRACT 3
- X MANIFEST 1 This shipping list
- X MEMO 1
- X Makefile 1
- X Makefile.tmpl 1
- X PATCHLEVEL 1
- X README 1
- X TODO 1
- X config 1
- X config/Makefile.config 1
- X config/Makefile.std 1
- X doc 1
- X doc/Makefile 1
- X doc/Makefile.tmpl 1
- X doc/cover.me 3
- X doc/notes.me 4
- X include 1
- X include/netmcast 1
- X include/netmcast/Makefile 1
- X include/netmcast/Makefile.tmpl 1
- X include/netmcast/mcast.h 3
- X include/netmcast/mcastd.h 1
- X libmcast 1
- X libmcast/Makefile 1
- X libmcast/Makefile.tmpl 1
- X libmcast/_mc_read.c 3
- X libmcast/_mc_state.c 1
- X libmcast/_mc_write.c 2
- X libmcast/mc_bind.c 2
- X libmcast/mc_close.c 1
- X libmcast/mc_connect.c 2
- X libmcast/mc_fcntl.c 2
- X libmcast/mc_getpeername.c 1
- X libmcast/mc_getsockname.c 1
- X libmcast/mc_getsockopt.c 1
- X libmcast/mc_ioctl.c 1
- X libmcast/mc_lib.h 2
- X libmcast/mc_read.c 1
- X libmcast/mc_readv.c 1
- X libmcast/mc_recv.c 1
- X libmcast/mc_recvfrom.c 1
- X libmcast/mc_send.c 1
- X libmcast/mc_sendto.c 2
- X libmcast/mc_setsockopt.c 1
- X libmcast/mc_shutdown.c 1
- X libmcast/mc_socket.c 2
- X libmcast/mc_write.c 1
- X libmcast/mc_writev.c 1
- X libmcast/mcast_getgroupbyname.c 2
- X libmcast/mcast_newaddr.c 2
- X libmcast/mcast_sopen.c 2
- X man 1
- X man/Makefile 1
- X man/Makefile.tmpl 1
- X man/mc_bind.2 2
- X man/mc_close.2 1
- X man/mc_connect.2 2
- X man/mc_fcntl.2 2
- X man/mc_getpeername.2 2
- X man/mc_getsockname.2 2
- X man/mc_getsockopt.2 3
- X man/mc_ioctl.2 2
- X man/mc_read.2 3
- X man/mc_recv.2 3
- X man/mc_send.2 3
- X man/mc_shutdown.2 1
- X man/mc_socket.2 3
- X man/mc_write.2 2
- X man/mcast.4 3
- X man/mcast_getgroupbyname.3 2
- X man/mcast_newaddr.3 3
- X man/mcast_sopen.3 3
- X man/mcastd.8 3
- X mcastd 1
- X mcastd/Makefile 1
- X mcastd/Makefile.tmpl 1
- X mcastd/mcastd.c 4
- X test 1
- X test/Makefile 1
- X test/Makefile.tmpl 1
- X test/mc_clock.c 2
- X test/mc_hello.c 1
- X test/mc_listen.c 2
- X test/mc_ping.c 3
- X test/mc_send.c 2
- END_OF_FILE
- if test 2761 -ne `wc -c <'MANIFEST'`; then
- echo shar: \"'MANIFEST'\" unpacked with wrong size!
- fi
- # end of 'MANIFEST'
- fi
- if test -f 'MEMO' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MEMO'\"
- else
- echo shar: Extracting \"'MEMO'\" \(1074 characters\)
- sed "s/^X//" >'MEMO' <<'END_OF_FILE'
- X Thursday, January 11, 1992
- X
- To: Marliss Rash
- X
- XFrom: Leith (Casey) Leedom
- X
- Regarding: Memo of understanding for release of ``MCAST'' software
- X
- X
- Marliss,
- X
- You asked me to tell you why I want do an unrestricted release of the
- MCAST multicast testbed software I developed. There are two fundamental
- reasons:
- X
- X 1. My software software is simple enough that it will allow people to
- X experiment with multicast concepts without getting bogged down in
- X one of the already existing multicast packages. Those existing
- X packages are all enormous and complicated -- although far more
- X sophisticated and more complete than my package.
- X
- X Because of the large amount of startup effort needed to use
- X existing packages, there isn't a widespread general interest in
- X multicast. Thus, I think that distributing my software will
- X benefit the network research community by exposing more people to
- X multicast concepts.
- X
- X 2. This is the equivalent of publishing a paper for me. It will
- X gain me recognition and advance my career.
- X
- X
- X Yours sincerely,
- X
- X Leith (Casey) Leedom
- END_OF_FILE
- if test 1074 -ne `wc -c <'MEMO'`; then
- echo shar: \"'MEMO'\" unpacked with wrong size!
- fi
- # end of 'MEMO'
- fi
- if test -f 'Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile'\"
- else
- echo shar: Extracting \"'Makefile'\" \(597 characters\)
- sed "s/^X//" >'Makefile' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/RCS/Makefile,v 1.1 92/10/16 18:21:06 casey Exp $
- X#
- X
- X TOP = .
- X CURDIR = .
- X
- X.DEFAULT:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- X.c.o:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- all:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std
- END_OF_FILE
- if test 597 -ne `wc -c <'Makefile'`; then
- echo shar: \"'Makefile'\" unpacked with wrong size!
- fi
- # end of 'Makefile'
- fi
- if test -f 'Makefile.tmpl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile.tmpl'\"
- else
- echo shar: Extracting \"'Makefile.tmpl'\" \(435 characters\)
- sed "s/^X//" >'Makefile.tmpl' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/RCS/Makefile.tmpl,v 1.1 92/10/16 18:21:14 casey Exp $
- X#
- X SUBDIRS = doc include/netmcast libmcast mcastd man test
- X
- X.DEFAULT:
- X @set +x; \
- X for i in $(SUBDIRS); do \
- X (cd $$i; echo "Doing " $@ " in " $$i " ..."; \
- X $(MAKE) $(MFLAGS) DESTDIR="$(DESTDIR)" $@); \
- X done
- X
- all: $(SUBDIRS)
- X
- X$(SUBDIRS): FRC
- X @set +x; \
- X (cd $@; echo "Making in $@ ..."; \
- X $(MAKE) $(MFLAGS) DESTDIR="$(DESTDIR)")
- X
- XFRC:
- END_OF_FILE
- if test 435 -ne `wc -c <'Makefile.tmpl'`; then
- echo shar: \"'Makefile.tmpl'\" unpacked with wrong size!
- fi
- # end of 'Makefile.tmpl'
- fi
- if test -f 'PATCHLEVEL' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'PATCHLEVEL'\"
- else
- echo shar: Extracting \"'PATCHLEVEL'\" \(33 characters\)
- sed "s/^X//" >'PATCHLEVEL' <<'END_OF_FILE'
- version 1
- release 2
- patchlevel 3
- END_OF_FILE
- if test 33 -ne `wc -c <'PATCHLEVEL'`; then
- echo shar: \"'PATCHLEVEL'\" unpacked with wrong size!
- fi
- # end of 'PATCHLEVEL'
- fi
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(9246 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- X$Header: /u0/casey/src/mcast/RCS/README,v 1.3 93/01/21 09:37:37 casey Exp $
- X
- X
- X INSTALLATION NOTES ON THE LLNL MCAST DISTRIBUTION
- X
- X
- X Copyright (c) 1992 The Regents of the University of California.
- X All rights reserved.
- X
- X Redistribution and use in source and binary forms, with or without
- X modification, are permitted provided that the following conditions
- X are met:
- X 1. Redistributions of source code must retain the above copyright
- X notice, this list of conditions and the following disclaimer.
- X 2. Redistributions in binary form must reproduce the above copyright
- X notice, this list of conditions and the following disclaimer in the
- X documentation and/or other materials provided with the distribution.
- X 3. All advertising materials mentioning features or use of this software
- X must display the following acknowledgement:
- X This product includes software developed by the University of
- X California, Lawrence Livermore National Laboratory and its
- X contributors.
- X 4. Neither the name of the University nor the names of its contributors
- X may be used to endorse or promote products derived from this software
- X without specific prior written permission.
- X
- X THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X SUCH DAMAGE.
- X
- X
- WHAT IS LLNL MCAST?:
- X
- X The LLNL MCAST software is an experimental implementation of a
- X multicast communication system. It allows applications to communicate
- X in a broadcast-like manner with other applications. Multicast would
- X typically be used by the parts of a distributed application.
- X
- X The system consists of an application programming interface (API)
- X modeled on the Berkeley socket abstraction, a communications server,
- X and a complete set of manual pages.
- X
- X The communication server implements the multicast message passing
- X semantics. A version of the system which uses network level multicast
- X facilities is planned, but we needed something up and running quickly
- X so other members of our project team could proceed with their work.
- X Hence, this version. Our goal is to be able to slip in a true
- X multicast implementation using the same API under our applications
- X without the applications noticing the difference ...
- X
- X
- HOW TO INSTALL MCAST:
- X
- X PORTABILITY:
- X
- X Where possible, this software has been written to conform to
- X ANSI C as defined in ANSI X3.159-1989 and POSIX 1003.1 as
- X defined in IEEE Std 1003.1-1990. Unfortunately there are no
- X standards available yet for networking APIs. Where we were
- X forced to step beyond the ANSI C and POSIX 1003.1 standards,
- X we chose to use the BSD (Berkeley Software Distribution)
- X definitions. As such, it depends on the BSD socket
- X facilities, I/O control mechanisms, select, etc.
- X
- X At the time of this writing the software has been compiled and
- X tested on IBM RS6000s running AIX 3.2, SGIs running IRIX 4.0.1
- X and Suns running SunOS 4.1.1.
- X
- X All the configuration information is contained in the file
- X "config/Makefile.config." The configuration scheme is grossly modeled
- X on the X11 imake scheme, but without imake ... (I told you it was
- X gross.)
- X
- X In any case, each directory contains two Makefiles: "Makefile" and
- X "Makefile.tmpl." The Makefile basically reinvokes make for all
- X targets with roughly the following command:
- X
- X make -f $(TOP)/config/Makefile.config \
- X -f ./Makefile \
- X -f $(TOP)/config/Makefile.std
- X
- X The Makefile.tmpl contains all the real make commands to generate and
- X install the contents of the current directory.
- X
- X You may also have to change the MCD_SERVICE_PORT constant in
- X include/netmcast/mcastd.h if the default port, 8001, conflicts with a
- X port already in use on your system. This constant controls the
- X default port the multicast server uses.
- X
- X After editing config/Makefile.config (and possibly mcastd.h), type
- X the following in the top level directory:
- X
- X host-foo% make clean
- X host-foo% make
- X
- X TESTING THE SYSTEM:
- X
- X If everything went okay, you should now have a working system. To
- X test it, try the following:
- X
- X In one window, type:
- X host-foo% cd mcastd
- X host-foo% ./mcastd -d -l 7
- X (This will start up the multicast server on host-foo.)
- X
- X In second window, type:
- X host-bar% cd test
- X host-bar% setenv MCASTD_SERVER host-foo
- X host-bar% ./mc_listen snee
- X (This will start a small test application up, that listens to
- X multicast group "snee" and outputs any messages it receives onto
- X standard output.)
- X
- X Finally, in a third window, type:
- X host-baz% cd test
- X host-baz% setenv MCASTD_SERVER host-foo
- X host-baz% ./mc_clock snee
- X (This will start a second small test application up, that emits an
- X ASCII date/time stamp onto the multicast group snee every five
- X seconds.)
- X
- X What you should see is copious amounts of output in the window you
- X started mcastd in. It will register nearly every action that it's
- X taking. In the mc_listen window, you should see a data/time stamp
- X appearing once every five seconds.
- X
- X If you want, you can start up multiple listener processes, using
- X the same or different multicast groups, and the same with the clock
- X processes. You can also start up a sender processes, mc_send,
- X which copies standard input to a specified multicast group.
- X
- X For giggles, there's the ubiquitous hello world program, mc_hello,
- X which simply emits the message "hello world!" onto the multicast
- X group "hello-world-group". This is an especially fun application
- X because it shows just how short a working multicast application can
- X be. Not counting comments, it's 18 lines long, two of which are
- X blank and three of which are error recovery.
- X
- X Finally, there's an incomplete version of the nearly as ubiquitous
- X ping program, mc_ping. This program opens a connection to a
- X specified multicast group and sends itself messages in order to
- X measure the round trip time through the multicast server, mcastd.
- X This would be more complete if it allowed one to ping a specified
- X recipient application, say, ``pong,'' to measure application to
- X application round trip time, but other projects were pressing ...
- X
- X Once you're happy with the software and want to install it on your
- X system, just type the following in the top level directory:
- X
- X host-foo% make install
- X host-foo% make clean
- X
- X
- WHERE TO GO FROM HERE:
- X
- X Hopefully the test programs in the "test" subdirectory should serve as
- X useful trivial examples. At least I always find it easier to steal
- X code than to read manual pages. :-)
- X
- X If you find yourself overcome with an urge to RTFM, a complete set of
- X manual pages has been provided. You should probably start with
- X mcast.4, move on to mcast_sopen.3, and finally mc_read.2 and
- X mc_write.2. Once you feel comfortable with those, you should probably
- X attack mc_socket.2, mc_bind.2, mcast_newaddr.3, and
- X mcast_getgroupbyname.3. Mcast_sopen takes much of the pain out of
- X setting up a multicast socket and basically just calls mc_socket,
- X mcast_newaddr, mcast_getgroupbyname, and mc_bind for you.
- X
- X The file ABSTRACT contains a summary abstract of this software. It
- X is used by LLNL's software release program to help catalogue software
- X in a standard form. Similarly, the file MEMO is also part of LLNL's
- X software release process and contains a ``memo of understanding''
- X describing why I wanted to release this software.
- X
- X The file TODO in the top level directory contains a brief set of notes
- X describing things left to finish in the implementation. The file
- X doc/notes.me contains a set of implementation notes about the multicast
- X abstraction we provide, the API, and our experiences. The file
- X doc/cover.me is a short introduction and table of contents which we use
- X when we put together a bound documentation and source printout.
- X
- X
- WHERE TO SEND CORRESPONDENCE:
- X
- X If you have bug reports, fixes, suggestions, or just want to talk about
- X the software, address your correspondence to:
- X
- X Casey Leedom
- X Mail Stop: L-287
- X Lawrence Livermore National Laboratory
- X Livermore, CA
- X USA
- X
- X email: casey@gauss.llnl.gov
- X phone: (USA) 510-423-7775
- END_OF_FILE
- if test 9246 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'TODO' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'TODO'\"
- else
- echo shar: Extracting \"'TODO'\" \(1124 characters\)
- sed "s/^X//" >'TODO' <<'END_OF_FILE'
- X$Header: /u0/casey/src/mcast/RCS/TODO,v 1.1 92/10/16 18:21:18 casey Exp $
- X
- X
- X UNFINISHED WORK ON THE LLNL MCAST DISTRIBUTION
- X
- X
- X o Implement a real naming scheme: registration and lookup. Currently
- X mcast_getgroupbyname just zeros out a multicast address and then
- X strncpy copies the group name into the address. Pretty hokey, but
- X it let us get started.
- X
- X o Implement the readv and writev limcast routines. This will require
- X rewriting the _mc_read and _mc_write low level routines to accept
- X a uio structure. Obviously all the mc_read, mc_write, mc_recv,
- X mc_send, etc. routines will also have to be modified to follow
- X suit.
- X
- X o Implement a way to get the current multicast group membership and
- X also a way to get asynchronous notification of group membership
- X changes.
- X
- X o Write general documentation covering multicast abstraction and
- X interface.
- X
- X o Write up implementation notes for the internal structure of the
- X multicast server. Diagrams describing the varied data structures
- X would be especially nice ...
- X
- X o Well, obviously a true multicast implementation would be nice too ...
- END_OF_FILE
- if test 1124 -ne `wc -c <'TODO'`; then
- echo shar: \"'TODO'\" unpacked with wrong size!
- fi
- # end of 'TODO'
- fi
- if test ! -d 'config' ; then
- echo shar: Creating directory \"'config'\"
- mkdir 'config'
- fi
- if test -f 'config/Makefile.config' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'config/Makefile.config'\"
- else
- echo shar: Extracting \"'config/Makefile.config'\" \(3111 characters\)
- sed "s/^X//" >'config/Makefile.config' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/config/RCS/Makefile.config,v 1.4 93/01/16 19:02:08 casey Exp $
- X#
- X DESTDIR = /TFA/unclassified
- X BINDIR = $(DESTDIR)/bin
- X LIBDIR = $(DESTDIR)/lib
- X INCDIR = $(DESTDIR)/include
- X ETCDIR = $(DESTDIR)/bin
- X MANROOT = $(DESTDIR)/man
- X MAN1DIR = $(MANROOT)/cat1
- X MAN1EXT = 1
- X MAN2DIR = $(MANROOT)/cat2
- X MAN2EXT = 2
- X MAN3DIR = $(MANROOT)/cat3
- X MAN3EXT = 3
- X MAN4DIR = $(MANROOT)/cat4
- X MAN4EXT = 4
- X MAN5DIR = $(MANROOT)/cat5
- X MAN5EXT = 5
- X MAN8DIR = $(MANROOT)/cat8
- X MAN8EXT = 8
- X MANDIRS = $(MAN1DIR) $(MAN2DIR) $(MAN3DIR) $(MAN4DIR) $(MAN5DIR) \
- X $(MAN8DIR)
- X
- X# Specify "man" for MANINSTALL if you want unformatted troff source manual
- X# pages installed in the above locations. Specify "cat" if you want nroff
- X# formatted manual pages installed.
- X#
- X MANINSTALL = cat
- X
- X BUILDINCTOP = $(TOP)/include
- X LIBMCASTDIR = $(TOP)/libmcast
- X LIBMCAST = $(LIBMCASTDIR)/libmcast.a
- X MCASTDDIR = $(TOP)/mcastd
- X MCASTD = $(MCASTDDIR)/mcastd
- X
- X#
- X# Operating system/platform specific values:
- X#
- X# IBM AIX 3.2:
- X# 1. STD_DEFINES should contain -qlanglvl=ansi -D_ALL_SOURCE -D_BSD.
- X# 2. CDEBUGFLAGS should contain -qsrcmsg. It should probably also contain
- X# -qextchk, but that causes the loader to complain about a type
- X# mismatch for mc_fcntl between mc_fcntl.c and mc_ioctl.c in
- X# libmcast when you try to link against the library. This is
- X# completely bogus. CDEBUGFLAGS should also probably contain -g or
- X# -O depending on your debugging/performance needs.
- X# 3. Set RANLIB to /bin/true.
- X#
- X# SGI IRIX 4.0:
- X# 1. CDEBUGFLAGS should contain -prototypes in order to get C function
- X# prototype checking. CDEBUGFLAGS should also probably contain -g
- X# or -O depending on your debugging/performance needs.
- X# 2. Set RANLIB to /bin/true.
- X#
- X# SUN OS 4.1.1:
- X# 1. CC should be an ANSI C compiler like gcc or Sun's unbundled compiler.
- X# Sun's bundled compiler won't work.
- X# 2. If gcc is used, you'll probably have to add -I/usr/include to
- X# STD_INCLUDES because gcc seems to search its own local include
- X# directory before /usr/include which leads to all sorts of problems.
- X# 3. Add -DNEED_STRERROR, -DNEED_OFFSETOF, -DNEED_EXIT_CODES and
- X# -DBROKEN_INET_NTOA to STD_DEFINES. Sun OS 4.1.1 fails to supply
- X# the ANSI C X3.159-1989 strerror routine, the offsetof macro and the
- X# EXIT_SUCCESS and EXIT_FAILURE defines. It also changes inet_ntoa
- X# to take a *pointer to* a struct in_addr instead of the struct itself
- X# (which it fails to document in the manual page).
- X# 4. CDEBUGFLAGS should also probably contain -g or -O depending on your
- X# debugging/performance needs.
- X# 5. Set RANLIB to ranlib.
- X#
- X CC = cc
- X STD_INCLUDES = -I.
- X TOP_INCLUDES = -I$(BUILDINCTOP)
- X INCLUDES =
- X ALLINCLUDES = $(INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
- X STD_DEFINES =
- X DEFINES =
- X ALLDEFINES = $(STD_DEFINES) $(DEFINES)
- X CDEBUGFLAGS = -O -prototypes
- X CFLAGS = $(CDEBUGFLAGS) $(ALLDEFINES) $(ALLINCLUDES)
- X
- X SHELL = /bin/sh
- X AR = ar cq
- X RANLIB = /bin/true
- END_OF_FILE
- if test 3111 -ne `wc -c <'config/Makefile.config'`; then
- echo shar: \"'config/Makefile.config'\" unpacked with wrong size!
- fi
- # end of 'config/Makefile.config'
- fi
- if test -f 'config/Makefile.std' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'config/Makefile.std'\"
- else
- echo shar: Extracting \"'config/Makefile.std'\" \(206 characters\)
- sed "s/^X//" >'config/Makefile.std' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/config/RCS/Makefile.std,v 1.1 92/10/16 18:22:26 casey Exp $
- X#
- X$(LIBMCAST):
- X @echo "Making $(LIBMCAST)"
- X cd $(LIBMCASTDIR); $(MAKE) $(MFLAGS)
- X @echo "Returning to $(CURDIR)"
- END_OF_FILE
- if test 206 -ne `wc -c <'config/Makefile.std'`; then
- echo shar: \"'config/Makefile.std'\" unpacked with wrong size!
- fi
- # end of 'config/Makefile.std'
- fi
- if test ! -d 'doc' ; then
- echo shar: Creating directory \"'doc'\"
- mkdir 'doc'
- fi
- if test -f 'doc/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/Makefile'\"
- else
- echo shar: Extracting \"'doc/Makefile'\" \(605 characters\)
- sed "s/^X//" >'doc/Makefile' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/doc/RCS/Makefile,v 1.1 92/10/16 18:22:28 casey Exp $
- X#
- X TOP = ..
- X CURDIR = ./doc
- X
- X.DEFAULT:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- X.c.o:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- all:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std
- END_OF_FILE
- if test 605 -ne `wc -c <'doc/Makefile'`; then
- echo shar: \"'doc/Makefile'\" unpacked with wrong size!
- fi
- # end of 'doc/Makefile'
- fi
- if test -f 'doc/Makefile.tmpl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/Makefile.tmpl'\"
- else
- echo shar: Extracting \"'doc/Makefile.tmpl'\" \(335 characters\)
- sed "s/^X//" >'doc/Makefile.tmpl' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/doc/RCS/Makefile.tmpl,v 1.1 92/10/16 18:22:30 casey Exp $
- X#
- X
- X TROFF = psroff
- X SRCS = cover.me notes.me
- X
- all:
- X
- print: cover notes
- X
- cover: cover.me
- X $(TROFF) -me cover.me
- X
- notes: notes.me
- X $(TROFF) -me notes.me
- X
- includes:
- X
- install:
- X
- clean:
- X rm -f *~ *.o core a.out MAKELOG
- X
- lint:
- X
- depend:
- END_OF_FILE
- if test 335 -ne `wc -c <'doc/Makefile.tmpl'`; then
- echo shar: \"'doc/Makefile.tmpl'\" unpacked with wrong size!
- fi
- # end of 'doc/Makefile.tmpl'
- fi
- if test ! -d 'include' ; then
- echo shar: Creating directory \"'include'\"
- mkdir 'include'
- fi
- if test ! -d 'include/netmcast' ; then
- echo shar: Creating directory \"'include/netmcast'\"
- mkdir 'include/netmcast'
- fi
- if test -f 'include/netmcast/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'include/netmcast/Makefile'\"
- else
- echo shar: Extracting \"'include/netmcast/Makefile'\" \(635 characters\)
- sed "s/^X//" >'include/netmcast/Makefile' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/include/netmcast/RCS/Makefile,v 1.1 92/10/16 18:22:33 casey Exp $
- X#
- X TOP = ../..
- X CURDIR = ./include/netmcast
- X
- X
- X.DEFAULT:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- X.c.o:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- all:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std
- END_OF_FILE
- if test 635 -ne `wc -c <'include/netmcast/Makefile'`; then
- echo shar: \"'include/netmcast/Makefile'\" unpacked with wrong size!
- fi
- # end of 'include/netmcast/Makefile'
- fi
- if test -f 'include/netmcast/Makefile.tmpl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'include/netmcast/Makefile.tmpl'\"
- else
- echo shar: Extracting \"'include/netmcast/Makefile.tmpl'\" \(338 characters\)
- sed "s/^X//" >'include/netmcast/Makefile.tmpl' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/include/netmcast/RCS/Makefile.tmpl,v 1.2 92/10/16 18:22:35 casey Exp $
- X#
- X INCSRCS = mcast.h
- X
- all: $(INCSRCS)
- X
- includes:
- X
- install: $(INSRCS) $(INCDIR) $(INCDIR)/netmcast
- X cp $(INCSRCS) $(INCDIR)/netmcast
- X
- X$(INCDIR) $(INCDIR)/netmcast:
- X mkdir $@
- X
- clean:
- X rm -f *~ *.o core a.out MAKELOG
- X
- lint:
- depend:
- END_OF_FILE
- if test 338 -ne `wc -c <'include/netmcast/Makefile.tmpl'`; then
- echo shar: \"'include/netmcast/Makefile.tmpl'\" unpacked with wrong size!
- fi
- # end of 'include/netmcast/Makefile.tmpl'
- fi
- if test -f 'include/netmcast/mcastd.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'include/netmcast/mcastd.h'\"
- else
- echo shar: Extracting \"'include/netmcast/mcastd.h'\" \(2888 characters\)
- sed "s/^X//" >'include/netmcast/mcastd.h' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/include/netmcast/RCS/mcastd.h,v 1.1 92/10/16 18:22:37 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef _MCASTD_H_
- X#define _MCASTD_H_
- X
- X#define MCD_SERVER_ENV "MCASTD_SERVER"
- X#define MCD_SERVER_NAME "mcast-server"
- X#define MCD_SERVER_HOST INADDR_LOOPBACK
- X
- X#define MCD_SERVICE_ENV "MCASTD_PORT"
- X#define MCD_SERVICE_NAME "mcast"
- X#define MCD_SERVICE_PORT 8001
- X
- X#define MCD_MCADDR MCADDR_ANY
- X
- typedef struct { /* MACHINE DEPENDENT */
- X unsigned int request:32; /* function request code (see below) */
- X unsigned int :32; /* pad to 64 bits */
- X unsigned int option:32; /* set option state on or off */
- X unsigned int :32; /* pad to 64 bits */
- X mc_addr group; /* multicast group address for BIND */
- X mc_addr local; /* member local address for BIND */
- X mc_addr remote; /* member remote address for BIND */
- X} mcd_message;
- X
- X#define MCD_BIND 1 /* bind group and member addresses */
- X#define MCD_LOOPBACK 2 /* set client loopback state */
- X#define MCD_SHUTDOWNRECV 3 /* set client sendonly state */
- X
- X#endif /* _MCASTD_H_ */
- END_OF_FILE
- if test 2888 -ne `wc -c <'include/netmcast/mcastd.h'`; then
- echo shar: \"'include/netmcast/mcastd.h'\" unpacked with wrong size!
- fi
- # end of 'include/netmcast/mcastd.h'
- fi
- if test ! -d 'libmcast' ; then
- echo shar: Creating directory \"'libmcast'\"
- mkdir 'libmcast'
- fi
- if test -f 'libmcast/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/Makefile'\"
- else
- echo shar: Extracting \"'libmcast/Makefile'\" \(615 characters\)
- sed "s/^X//" >'libmcast/Makefile' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/libmcast/RCS/Makefile,v 1.1 92/10/16 18:22:38 casey Exp $
- X#
- X TOP = ..
- X CURDIR = ./libmcast
- X
- X.DEFAULT:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- X.c.o:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- all:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std
- END_OF_FILE
- if test 615 -ne `wc -c <'libmcast/Makefile'`; then
- echo shar: \"'libmcast/Makefile'\" unpacked with wrong size!
- fi
- # end of 'libmcast/Makefile'
- fi
- if test -f 'libmcast/Makefile.tmpl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/Makefile.tmpl'\"
- else
- echo shar: Extracting \"'libmcast/Makefile.tmpl'\" \(3470 characters\)
- sed "s/^X//" >'libmcast/Makefile.tmpl' <<'END_OF_FILE'
- X #
- X# $Header: /u0/casey/src/mcast/libmcast/RCS/Makefile.tmpl,v 1.2 93/01/16 19:12:39 casey Exp $
- X#
- X
- X SRCS1 = _mc_read.c _mc_state.c _mc_write.c mc_bind.c mc_close.c \
- X mc_connect.c mc_fcntl.c mc_getpeername.c \
- X mc_getsockname.c mc_getsockopt.c mc_ioctl.c mc_read.c \
- X mc_readv.c mc_recv.c mc_recvfrom.c mc_send.c mc_sendto.c \
- X mc_setsockopt.c mc_shutdown.c mc_socket.c mc_write.c \
- X mc_writev.c
- X OBJS1 = _mc_read.o _mc_state.o _mc_write.o mc_bind.o mc_close.o \
- X mc_connect.o mc_fcntl.o mc_getpeername.o \
- X mc_getsockname.o mc_getsockopt.o mc_ioctl.o mc_read.o \
- X mc_readv.o mc_recv.o mc_recvfrom.o mc_send.o mc_sendto.o \
- X mc_setsockopt.o mc_shutdown.o mc_socket.o mc_write.o \
- X mc_writev.o
- X
- X SRCS2 = mcast_getgroupbyname.c mcast_newaddr.c mcast_sopen.c
- X OBJS2 = mcast_getgroupbyname.o mcast_newaddr.o mcast_sopen.o
- X
- X SRCS = $(SRCS1) $(SRCS2)
- X OBJS = $(OBJS1) $(OBJS2)
- X LIBRARY = libmcast.a
- X
- all: $(LIBRARY)
- X
- includes:
- X
- X$(LIBRARY): $(OBJS)
- X rm -f $(LIBRARY)
- X $(AR) $(LIBRARY) $(OBJS)
- X $(RANLIB) $(LIBRARY)
- X
- install: $(LIBRARY) $(LIBDIR)
- X cp $(LIBRARY) $(LIBDIR)/$(LIBRARY)
- X $(RANLIB) $(LIBDIR)/$(LIBRARY)
- X
- X$(LIBDIR):
- X mkdir $@
- X
- clean:
- X rm -f $(LIBRARY)
- X rm -f *~ *.o core a.out MAKELOG
- X
- lint:
- X lint -x $(ALLDEFINES) $(SRCS)
- X
- depend:
- X
- X_mc_read.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- X_mc_state.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- X_mc_write.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_bind.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_close.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_connect.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_fcntl.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_getpeername.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_getsockname.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_getsockopt.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_ioctl.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_read.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_readv.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_recv.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_recvfrom.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_send.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_sendto.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_setsockopt.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_shutdown.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_socket.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_write.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mc_writev.o: mc_lib.h $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mcast_getgroupbyname.o: $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mcast_newaddr.o: $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- mcast_sopen.o: $(BUILDINCTOP)/netmcast/mcast.h $(BUILDINCTOP)/netmcast/mcastd.h
- END_OF_FILE
- if test 3470 -ne `wc -c <'libmcast/Makefile.tmpl'`; then
- echo shar: \"'libmcast/Makefile.tmpl'\" unpacked with wrong size!
- fi
- # end of 'libmcast/Makefile.tmpl'
- fi
- if test -f 'libmcast/_mc_state.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/_mc_state.c'\"
- else
- echo shar: Extracting \"'libmcast/_mc_state.c'\" \(2441 characters\)
- sed "s/^X//" >'libmcast/_mc_state.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/_mc_state.c,v 1.1 92/10/16 18:22:41 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/_mc_state.c,v 1.1 92/10/16 18:22:41 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PRIVATE: global data.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- X/*
- X * Multicast system call emulation state space.
- X */
- mc_state _mc_state[MC_MAX_CONNECTIONS];
- END_OF_FILE
- if test 2441 -ne `wc -c <'libmcast/_mc_state.c'`; then
- echo shar: \"'libmcast/_mc_state.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/_mc_state.c'
- fi
- if test -f 'libmcast/mc_close.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_close.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_close.c'\" \(2650 characters\)
- sed "s/^X//" >'libmcast/mc_close.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_close.c,v 1.2 92/11/17 16:56:11 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_close.c,v 1.2 92/11/17 16:56:11 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_close: close(2) system call emulation routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- int
- mc_close(int s)
- X /*
- X * Close multicast socket.
- X */
- X{
- X mc_state *sp = &_mc_state[s];
- X
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(close(s)); */
- X errno = EBADF;
- X return(-1);
- X }
- X sp->state = 0;
- X return(close(s));
- X}
- END_OF_FILE
- if test 2650 -ne `wc -c <'libmcast/mc_close.c'`; then
- echo shar: \"'libmcast/mc_close.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_close.c'
- fi
- if test -f 'libmcast/mc_getpeername.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_getpeername.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_getpeername.c'\" \(3075 characters\)
- sed "s/^X//" >'libmcast/mc_getpeername.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_getpeername.c,v 1.3 93/01/16 19:43:25 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_getpeername.c,v 1.3 93/01/16 19:43:25 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_getpeername: getpeername(2) system call emulation
- X * routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- int
- mc_getpeername(int s, struct sockaddr *name, int *namelen)
- X /*
- X * Get remote name of a connected multicast socket.
- X */
- X{
- X mc_state *sp = &_mc_state[s];
- X struct sockaddr_mcast *np = (struct sockaddr_mcast *)name;
- X int len = min(*namelen, sizeof(struct sockaddr_mcast));
- X struct sockaddr_mcast tmp;
- X
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(recvfrom(s, buf, len, flags)); */
- X errno = EBADF;
- X return(-1);
- X }
- X if (sp->state & MC_CORRUPTED) {
- X errno = EIO;
- X return(-1);
- X }
- X tmp.family = sp->family;
- X tmp.group = sp->group;
- X tmp.member = sp->remote;
- X (void)memcpy(np, &tmp, len);
- X *namelen = len;
- X return(0);
- X}
- END_OF_FILE
- if test 3075 -ne `wc -c <'libmcast/mc_getpeername.c'`; then
- echo shar: \"'libmcast/mc_getpeername.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_getpeername.c'
- fi
- if test -f 'libmcast/mc_getsockname.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_getsockname.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_getsockname.c'\" \(3183 characters\)
- sed "s/^X//" >'libmcast/mc_getsockname.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_getsockname.c,v 1.3 93/01/16 19:44:22 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_getsockname.c,v 1.3 93/01/16 19:44:22 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_getsockname: getsockname(2) system call emulation
- X * routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- int
- mc_getsockname(int s, struct sockaddr *name, int *namelen)
- X /*
- X * Get local name of a multicast socket.
- X */
- X{
- X mc_state *sp = &_mc_state[s];
- X struct sockaddr_mcast *np = (struct sockaddr_mcast *)name;
- X int len = min(*namelen, sizeof(struct sockaddr_mcast));
- X struct sockaddr_mcast tmp;
- X
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(recvfrom(s, buf, len, flags)); */
- X errno = EBADF;
- X return(-1);
- X }
- X if (sp->state & MC_CORRUPTED) {
- X errno = EIO;
- X return(-1);
- X }
- X /* temped to check to see if socket if bound, but that isn't done for
- X the standard protocols so we won't either */
- X tmp.family = sp->family;
- X tmp.group = sp->group;
- X tmp.member = sp->local;
- X (void)memcpy(np, &tmp, len);
- X *namelen = len;
- X return(0);
- X}
- END_OF_FILE
- if test 3183 -ne `wc -c <'libmcast/mc_getsockname.c'`; then
- echo shar: \"'libmcast/mc_getsockname.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_getsockname.c'
- fi
- if test -f 'libmcast/mc_getsockopt.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_getsockopt.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_getsockopt.c'\" \(3281 characters\)
- sed "s/^X//" >'libmcast/mc_getsockopt.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_getsockopt.c,v 1.2 92/11/17 16:56:15 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_getsockopt.c,v 1.2 92/11/17 16:56:15 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_getsockopt: getsockopt(2) system call emulation
- X * routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- int
- mc_getsockopt(int s, int level, int optname, void *optval, int *optlen)
- X /*
- X * Get multicast socket options. Only socket level (SOL_SOCKET)
- X * options are supported and very few of them at that ...
- X */
- X{
- X mc_state *sp = &_mc_state[s];
- X
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(getsockopt(s, level, optname, optval, optlen)); */
- X errno = EBADF;
- X return(-1);
- X }
- X if (sp->state & MC_CORRUPTED) {
- X errno = EIO;
- X return(-1);
- X }
- X if (level != SOL_SOCKET) {
- X /* only socket level options supported */
- X errno = ENOPROTOOPT;
- X return(-1);
- X }
- X if (optname == SO_TYPE)
- X return(sp->type);
- X if (optname != SO_SNDBUF && optname != SO_RCVBUF
- X && optname != SO_ERROR) {
- X /* so far only a few socket options supported */
- X errno = ENOPROTOOPT;
- X return(-1);
- X }
- X return(getsockopt(s, level, optname, optval, optlen));
- X}
- END_OF_FILE
- if test 3281 -ne `wc -c <'libmcast/mc_getsockopt.c'`; then
- echo shar: \"'libmcast/mc_getsockopt.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_getsockopt.c'
- fi
- if test -f 'libmcast/mc_ioctl.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_ioctl.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_ioctl.c'\" \(3493 characters\)
- sed "s/^X//" >'libmcast/mc_ioctl.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_ioctl.c,v 1.2 92/11/17 16:56:15 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_ioctl.c,v 1.2 92/11/17 16:56:15 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_ioctl: ioctl(2) system call emulation routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- X/*VARARGS2*/
- int
- mc_ioctl(int s, int request, ...)
- X /*
- X * Perform I/O control operation on multicast socket. Most of the
- X * operations are duplicates of fcntl operations and are, in fact,
- X * shunted off to fcntl to be performed.
- X */
- X{
- X mc_state *sp = &_mc_state[s];
- X va_list va;
- X
- X va_start(va, request);
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(ioctl(s, request, va_arg(va, int))); */
- X errno = EBADF;
- X return(-1);
- X }
- X if (sp->state & MC_CORRUPTED) {
- X errno = EIO;
- X return(-1);
- X }
- X
- X switch (request) {
- X default:
- X errno = EINVAL;
- X return(-1);
- X
- X case MCIOCLOOPBACK:
- X return(mc_fcntl(s, F_SETFL, sp->flags | MCO_LOOPBACK));
- X
- X case FIONBIO:
- X return(mc_fcntl(s, F_SETFL, sp->flags | O_NONBLOCK));
- X
- X case FIONREAD:
- X /*
- X * We only return the amount of data left to read in the
- X * current message instead of the agregate of all received
- X * messages. Oh well ...
- X */
- X if (sp->resid == 0)
- X if (_mc_pullup(s, O_NONBLOCK) < 0)
- X return(-1);
- X *va_arg(va, long *) = sp->resid;
- X return(0);
- X }
- X /*NOTREACHED*/
- X va_end(va);
- X}
- END_OF_FILE
- if test 3493 -ne `wc -c <'libmcast/mc_ioctl.c'`; then
- echo shar: \"'libmcast/mc_ioctl.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_ioctl.c'
- fi
- if test -f 'libmcast/mc_read.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_read.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_read.c'\" \(2872 characters\)
- sed "s/^X//" >'libmcast/mc_read.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_read.c,v 1.1 92/10/16 18:22:47 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_read.c,v 1.1 92/10/16 18:22:47 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_read: read(2) system call emulation routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- int
- mc_read(int s, void *buf, size_t len)
- X{
- X mc_state *sp = &_mc_state[s];
- X
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(read(s, buf, len)); */
- X errno = EBADF;
- X return(-1);
- X }
- X if (sp->state & MC_CORRUPTED) {
- X errno = EIO;
- X return(-1);
- X }
- X if ((int)len <= 0) {
- X errno = EINVAL;
- X return(-1);
- X }
- X if (!(sp->state & MC_BOUND)) {
- X errno = EPIPE;
- X return(-1);
- X }
- X if (sp->state & MC_SHUTDOWNRECV)
- X return(0);
- X return(_mc_read(s, buf, len, 0, NULL));
- X}
- END_OF_FILE
- if test 2872 -ne `wc -c <'libmcast/mc_read.c'`; then
- echo shar: \"'libmcast/mc_read.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_read.c'
- fi
- if test -f 'libmcast/mc_readv.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_readv.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_readv.c'\" \(2993 characters\)
- sed "s/^X//" >'libmcast/mc_readv.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_readv.c,v 1.2 93/01/16 19:47:40 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_readv.c,v 1.2 93/01/16 19:47:40 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_readv: readv(2) system call emulation routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- X/*ARGSUSED*/ /* this is only because readv isn't really implemented yet */
- int
- mc_readv(int s, const struct iovec *iov, int iovcnt)
- X{
- X mc_state *sp = &_mc_state[s];
- X
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(read(s, buf, len)); */
- X errno = EBADF;
- X return(-1);
- X }
- X if (sp->state & MC_CORRUPTED) {
- X errno = EIO;
- X return(-1);
- X }
- X if (iovcnt < 0) {
- X errno = EINVAL;
- X return(-1);
- X }
- X if (!(sp->state & MC_BOUND)) {
- X errno = EDESTADDRREQ;
- X return(-1);
- X }
- X if (sp->state & MC_SHUTDOWNRECV)
- X return(0);
- X /* readv not implemented yet ... */
- X errno = EIO;
- X return(-1);
- X}
- END_OF_FILE
- if test 2993 -ne `wc -c <'libmcast/mc_readv.c'`; then
- echo shar: \"'libmcast/mc_readv.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_readv.c'
- fi
- if test -f 'libmcast/mc_recv.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_recv.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_recv.c'\" \(2481 characters\)
- sed "s/^X//" >'libmcast/mc_recv.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_recv.c,v 1.1 92/10/16 18:22:48 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_recv.c,v 1.1 92/10/16 18:22:48 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_recv: recv(2) system call emulation routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- int
- mc_recv(int s, void *buf, int len, int flags)
- X{
- X return(mc_recvfrom(s, buf, len, flags, NULL, 0));
- X}
- END_OF_FILE
- if test 2481 -ne `wc -c <'libmcast/mc_recv.c'`; then
- echo shar: \"'libmcast/mc_recv.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_recv.c'
- fi
- if test -f 'libmcast/mc_recvfrom.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_recvfrom.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_recvfrom.c'\" \(3260 characters\)
- sed "s/^X//" >'libmcast/mc_recvfrom.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_recvfrom.c,v 1.2 93/01/16 19:48:40 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_recvfrom.c,v 1.2 93/01/16 19:48:40 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_recvfrom: recvfrom(2) system call emulation routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- int
- mc_recvfrom(int s, void *buf, int len, int flags,
- X struct sockaddr *from, int *fromlen)
- X{
- X mc_state *sp = &_mc_state[s];
- X struct sockaddr_mcast *np = (struct sockaddr_mcast *)from;
- X
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(recvfrom(s, buf, len, flags)); */
- X errno = EBADF;
- X return(-1);
- X }
- X if (sp->state & MC_CORRUPTED) {
- X errno = EIO;
- X return(-1);
- X }
- X if (len < 0) {
- X errno = EINVAL;
- X return(-1);
- X }
- X if (sp->state & MC_SHUTDOWNRECV)
- X return(0);
- X if (!(sp->state & MC_BOUND)) {
- X errno = EPIPE;
- X return(-1);
- X }
- X if (from == NULL)
- X return(_mc_read(s, buf, len, flags, NULL));
- X if (*fromlen < sizeof(struct sockaddr_mcast)) {
- X errno = EINVAL;
- X return(-1);
- X }
- X *fromlen = sizeof(struct sockaddr_mcast);
- X np->family = sp->family;
- X np->group = sp->group;
- X return(_mc_read(s, buf, len, flags, &np->member));
- X}
- END_OF_FILE
- if test 3260 -ne `wc -c <'libmcast/mc_recvfrom.c'`; then
- echo shar: \"'libmcast/mc_recvfrom.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_recvfrom.c'
- fi
- if test -f 'libmcast/mc_send.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_send.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_send.c'\" \(2485 characters\)
- sed "s/^X//" >'libmcast/mc_send.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_send.c,v 1.2 93/01/16 19:49:39 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_send.c,v 1.2 93/01/16 19:49:39 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_send: send(2) system call emulation routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- int
- mc_send(int s, const void *buf, int len, int flags)
- X{
- X return(mc_sendto(s, buf, len, flags, NULL, 0));
- X}
- END_OF_FILE
- if test 2485 -ne `wc -c <'libmcast/mc_send.c'`; then
- echo shar: \"'libmcast/mc_send.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_send.c'
- fi
- if test -f 'libmcast/mc_setsockopt.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_setsockopt.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_setsockopt.c'\" \(3213 characters\)
- sed "s/^X//" >'libmcast/mc_setsockopt.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_setsockopt.c,v 1.2 92/11/17 16:56:16 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_setsockopt.c,v 1.2 92/11/17 16:56:16 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_setsockopt: setsockopt(2) system call emulation
- X * routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- int
- mc_setsockopt(int s, int level, int optname, const void *optval, int optlen)
- X /*
- X * Set multicast socket options. Only socket level (SOL_SOCKET)
- X * options are supported and very few of them at that ...
- X */
- X{
- X mc_state *sp = &_mc_state[s];
- X
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(setsockopt(s, level, optname, optval, optlen)); */
- X errno = EBADF;
- X return(-1);
- X }
- X if (sp->state & MC_CORRUPTED) {
- X errno = EIO;
- X return(-1);
- X }
- X if (level != SOL_SOCKET) {
- X /* only socket level options supported */
- X errno = ENOPROTOOPT;
- X return(-1);
- X }
- X if (optname != SO_SNDBUF && optname != SO_RCVBUF) {
- X /* so far only a few socket options supported */
- X errno = ENOPROTOOPT;
- X return(-1);
- X }
- X return(setsockopt(s, level, optname, optval, optlen));
- X}
- END_OF_FILE
- if test 3213 -ne `wc -c <'libmcast/mc_setsockopt.c'`; then
- echo shar: \"'libmcast/mc_setsockopt.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_setsockopt.c'
- fi
- if test -f 'libmcast/mc_shutdown.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_shutdown.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_shutdown.c'\" \(3176 characters\)
- sed "s/^X//" >'libmcast/mc_shutdown.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_shutdown.c,v 1.1 92/10/16 18:22:51 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_shutdown.c,v 1.1 92/10/16 18:22:51 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_shutdown: shutdown(2) system call emulation routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- int
- mc_shutdown(int s, int how)
- X{
- X mc_state *sp = &_mc_state[s];
- X int mask;
- X
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(close(s)); */
- X errno = EBADF;
- X return(-1);
- X }
- X if (how == 0)
- X mask = MC_SHUTDOWNRECV;
- X else if (how == 1)
- X mask = MC_SHUTDOWNSEND;
- X else if (how == 2)
- X mask = MC_SHUTDOWNRECV|MC_SHUTDOWNSEND;
- X else {
- X errno = EINVAL;
- X return(-1);
- X }
- X /* if SHUTDOWNRECV requested and we aren't already in that state ... */
- X if ((mask & ~sp->state) & MC_SHUTDOWNRECV) {
- X mcd_message command;
- X
- X (void)memset(&command, 0, sizeof(command));
- X command.request = htonl(MCD_SHUTDOWNRECV);
- X command.option = htonl(1);
- X if (_mc_write(s, &command, sizeof(command), 0, &MCD_MCADDR) < 0)
- X return(-1);
- X }
- X sp->state |= mask;
- X return(0);
- X}
- END_OF_FILE
- if test 3176 -ne `wc -c <'libmcast/mc_shutdown.c'`; then
- echo shar: \"'libmcast/mc_shutdown.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_shutdown.c'
- fi
- if test -f 'libmcast/mc_write.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_write.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_write.c'\" \(2908 characters\)
- sed "s/^X//" >'libmcast/mc_write.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_write.c,v 1.2 93/01/16 19:53:33 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_write.c,v 1.2 93/01/16 19:53:33 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_write: write(2) system call emulation routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- int
- mc_write(int s, const void *buf, size_t len)
- X{
- X mc_state *sp = &_mc_state[s];
- X
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(write(s, buf, len)); */
- X errno = EBADF;
- X return(-1);
- X }
- X if (sp->state & MC_CORRUPTED) {
- X errno = EIO;
- X return(-1);
- X }
- X if ((int)len <= 0) {
- X errno = EINVAL;
- X return(-1);
- X }
- X if (!(sp->state & MC_BOUND)) {
- X errno = EPIPE;
- X return(-1);
- X }
- X if (sp->state & MC_SHUTDOWNSEND) {
- X errno = EPIPE;
- X return(-1);
- X }
- X return(_mc_write(s, buf, len, 0, NULL));
- X}
- END_OF_FILE
- if test 2908 -ne `wc -c <'libmcast/mc_write.c'`; then
- echo shar: \"'libmcast/mc_write.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_write.c'
- fi
- if test -f 'libmcast/mc_writev.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libmcast/mc_writev.c'\"
- else
- echo shar: Extracting \"'libmcast/mc_writev.c'\" \(3171 characters\)
- sed "s/^X//" >'libmcast/mc_writev.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/libmcast/RCS/mc_writev.c,v 1.2 93/01/16 19:54:15 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/libmcast/RCS/mc_writev.c,v 1.2 93/01/16 19:54:15 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X
- X/*
- X * MCAST SYSLIB PUBLIC: mc_writev: writev(2) system call emulation routine.
- X */
- X
- X
- X#include "mc_lib.h"
- X
- X
- X/*ARGSUSED*/ /* this is only because writev isn't really implemented yet */
- int
- mc_writev(int s, const struct iovec *iov, int iovcnt)
- X{
- X mc_state *sp = &_mc_state[s];
- X
- X if (s < 0 || s >= MC_MAX_CONNECTIONS
- X || !(sp->state & MC_VALID)) {
- X /* return(write(s, buf, len)); */
- X errno = EBADF;
- X return(-1);
- X }
- X if (sp->state & MC_CORRUPTED) {
- X errno = EIO;
- X return(-1);
- X }
- X if (iovcnt < 0) {
- X errno = EINVAL;
- X return(-1);
- X }
- X if (!(sp->state & MC_BOUND)) {
- X errno = EDESTADDRREQ;
- X return(-1);
- X }
- X if (sp->state & MC_SHUTDOWNSEND) {
- X for (;;) {
- X (void)kill(getpid(), SIGPIPE);
- X /*
- X * Loop in case the application has a SIGPIPE
- X * handler and tries to resume this context.
- X */
- X }
- X /*NOTREACHED*/
- X }
- X /* writev not implemented yet ... */
- X errno = EIO;
- X return(-1);
- X}
- END_OF_FILE
- if test 3171 -ne `wc -c <'libmcast/mc_writev.c'`; then
- echo shar: \"'libmcast/mc_writev.c'\" unpacked with wrong size!
- fi
- # end of 'libmcast/mc_writev.c'
- fi
- if test ! -d 'man' ; then
- echo shar: Creating directory \"'man'\"
- mkdir 'man'
- fi
- if test -f 'man/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'man/Makefile'\"
- else
- echo shar: Extracting \"'man/Makefile'\" \(605 characters\)
- sed "s/^X//" >'man/Makefile' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/man/RCS/Makefile,v 1.1 92/10/16 18:22:55 casey Exp $
- X#
- X TOP = ..
- X CURDIR = ./man
- X
- X.DEFAULT:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- X.c.o:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- all:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std
- END_OF_FILE
- if test 605 -ne `wc -c <'man/Makefile'`; then
- echo shar: \"'man/Makefile'\" unpacked with wrong size!
- fi
- # end of 'man/Makefile'
- fi
- if test -f 'man/Makefile.tmpl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'man/Makefile.tmpl'\"
- else
- echo shar: Extracting \"'man/Makefile.tmpl'\" \(2267 characters\)
- sed "s/^X//" >'man/Makefile.tmpl' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/man/RCS/Makefile.tmpl,v 1.2 92/10/16 18:22:57 casey Exp $
- X#
- X
- X MAN2SRCS = mc_bind.2 mc_close.2 mc_connect.2 mc_fcntl.2 \
- X mc_getpeername.2 mc_getsockname.2 mc_getsockopt.2 \
- X mc_ioctl.2 mc_read.2 mc_recv.2 mc_send.2 mc_shutdown.2 \
- X mc_socket.2 mc_write.2
- X MAN3SRCS = mcast_getgroupbyname.3 mcast_newaddr.3 mcast_sopen.3
- X MAN4SRCS = mcast.4
- X MAN8SRCS = mcastd.8
- X
- X MANSRCS = $(MAN1SRCS) $(MAN2SRCS) $(MAN3SRCS) $(MAN4SRCS) \
- X $(MAN5SRCS) $(MAN8SRCS)
- X
- all: $(MANSRCS)
- X
- includes:
- X
- install: $(MANSRCS) $(MANROOT) $(MANDIRS) install_$(MANINSTALL)
- X
- X$(MANROOT) $(MANDIRS):
- X mkdir $@
- X
- install_man:
- X @if [ "$(MAN2SRCS)" != "" ]; then \
- X for i in $(MAN2SRCS); do \
- X m=`basename $$i .2`.$(MAN2EXT); \
- X echo cp $$i $(MAN2DIR)/$$m; \
- X cp $$i $(MAN2DIR)/$$m; \
- X done \
- X fi
- X @if [ "$(MAN3SRCS)" != "" ]; then \
- X for i in $(MAN3SRCS); do \
- X m=`basename $$i .3`.$(MAN3EXT); \
- X echo cp $$i $(MAN3DIR)/$$m; \
- X cp $$i $(MAN3DIR)/$$m; \
- X done \
- X fi
- X @if [ "$(MAN4SRCS)" != "" ]; then \
- X for i in $(MAN4SRCS); do \
- X m=`basename $$i .4`.$(MAN4EXT); \
- X echo cp $$i $(MAN4DIR)/$$m; \
- X cp $$i $(MAN4DIR)/$$m; \
- X done \
- X fi
- X @if [ "$(MAN8SRCS)" != "" ]; then \
- X for i in $(MAN8SRCS); do \
- X m=`basename $$i .8`.$(MAN8EXT); \
- X echo cp $$i $(MAN8DIR)/$$m; \
- X cp $$i $(MAN8DIR)/$$m; \
- X done \
- X fi
- X
- install_cat:
- X @if [ "$(MAN2SRCS)" != "" ]; then \
- X for i in $(MAN2SRCS); do \
- X m=`basename $$i .2`.$(MAN2EXT); \
- X echo nroff -man $$i '>' $(MAN2DIR)/$$m; \
- X nroff -man $$i > $(MAN2DIR)/$$m; \
- X done \
- X fi
- X @if [ "$(MAN3SRCS)" != "" ]; then \
- X for i in $(MAN3SRCS); do \
- X m=`basename $$i .3`.$(MAN3EXT); \
- X echo nroff -man $$i '>' $(MAN3DIR)/$$m; \
- X nroff -man $$i > $(MAN3DIR)/$$m; \
- X done \
- X fi
- X @if [ "$(MAN4SRCS)" != "" ]; then \
- X for i in $(MAN4SRCS); do \
- X m=`basename $$i .4`.$(MAN4EXT); \
- X echo nroff -man $$i '>' $(MAN4DIR)/$$m; \
- X nroff -man $$i > $(MAN4DIR)/$$m; \
- X done \
- X fi
- X @if [ "$(MAN8SRCS)" != "" ]; then \
- X for i in $(MAN8SRCS); do \
- X m=`basename $$i .8`.$(MAN8EXT); \
- X echo nroff -man $$i '>' $(MAN8DIR)/$$m; \
- X nroff -man $$i > $(MAN8DIR)/$$m; \
- X done \
- X fi
- X
- clean:
- X rm -f *~ *.o core a.out MAKELOG
- X
- lint:
- tags:
- depend:
- END_OF_FILE
- if test 2267 -ne `wc -c <'man/Makefile.tmpl'`; then
- echo shar: \"'man/Makefile.tmpl'\" unpacked with wrong size!
- fi
- # end of 'man/Makefile.tmpl'
- fi
- if test -f 'man/mc_close.2' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'man/mc_close.2'\"
- else
- echo shar: Extracting \"'man/mc_close.2'\" \(3430 characters\)
- sed "s/^X//" >'man/mc_close.2' <<'END_OF_FILE'
- X.\" Copyright (c) 1992 The Regents of the University of California.
- X.\" All rights reserved.
- X.\"
- X.\" Redistribution and use in source and binary forms, with or without
- X.\" modification, are permitted provided that the following conditions
- X.\" are met:
- X.\" 1. Redistributions of source code must retain the above copyright
- X.\" notice, this list of conditions and the following disclaimer.
- X.\" 2. Redistributions in binary form must reproduce the above copyright
- X.\" notice, this list of conditions and the following disclaimer in the
- X.\" documentation and/or other materials provided with the distribution.
- X.\" 3. All advertising materials mentioning features or use of this software
- X.\" must display the following acknowledgement:
- X.\" This product includes software developed by the University of
- X.\" California, Lawrence Livermore National Laboratory and its
- X.\" contributors.
- X.\" 4. Neither the name of the University nor the names of its contributors
- X.\" may be used to endorse or promote products derived from this software
- X.\" without specific prior written permission.
- X.\"
- X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X.\" SUCH DAMAGE.
- X.\"
- X.de Hd
- X.ds Dt \\$4
- X..
- X.Hd $Header: /u0/casey/src/mcast/man/RCS/mc_close.2,v 1.1 92/10/16 18:22:59 casey Exp $
- X.TH MC_CLOSE 2 \*(Dt
- X.SH NAME
- mc_close \- delete a multicast socket descriptor
- X.SH SYNOPSIS
- X.nf
- X.ft B
- X#include <unistd.h>
- X#include <sys/types.h>
- X#include <sys/socket.h>
- X#include <netmcast/mcast.h>
- X
- int
- mc_close(int s)
- X.ft P
- X.fi
- X.SH DESCRIPTION
- The
- X.IR mc_close (2)
- call deletes a multicast socket descriptor from the per-process object
- reference table.
- If this is the last reference to the underlying object, the
- object will be deactivated.
- X.SH COMPATIBILITY
- The
- X.I mc_close
- call emulates the
- X.IR close (2)
- system call for multicast socket descriptors created with the
- X.IR mc_socket (2)
- call.
- See the manual page for
- X.IR close (2)
- for a description of the emulated semantics.
- X.I Mc_close
- does not provide any different semantics from
- X.IR close (2).
- X.SH "RETURN VALUES"
- Upon successful completion, a value of 0 is returned.
- Otherwise, a value of -1 is returned and the global integer variable
- X.I errno
- is set to indicate the error.
- X.SH ERRORS
- See the manual page for
- X.IR close (2)
- for a detailed list of errors associated with the general
- X.IR close (2)
- system call.
- X.I Mc_close
- itself will fail if:
- X.TP 20
- X[EBADF]
- X.I S
- is not a valid multicast socket descriptor as returned by
- X.IR mc_socket (2).
- X.SH "SEE ALSO"
- X.IR close (2),
- X.IR mc_socket (2),
- X.IR mcast (4)
- X.SH STANDARDS
- There are no current standards that address multicast communication.
- The software described in this manual page is experimental and subject
- to change at any time.
- END_OF_FILE
- if test 3430 -ne `wc -c <'man/mc_close.2'`; then
- echo shar: \"'man/mc_close.2'\" unpacked with wrong size!
- fi
- # end of 'man/mc_close.2'
- fi
- if test -f 'man/mc_shutdown.2' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'man/mc_shutdown.2'\"
- else
- echo shar: Extracting \"'man/mc_shutdown.2'\" \(3731 characters\)
- sed "s/^X//" >'man/mc_shutdown.2' <<'END_OF_FILE'
- X.\" Copyright (c) 1992 The Regents of the University of California.
- X.\" All rights reserved.
- X.\"
- X.\" Redistribution and use in source and binary forms, with or without
- X.\" modification, are permitted provided that the following conditions
- X.\" are met:
- X.\" 1. Redistributions of source code must retain the above copyright
- X.\" notice, this list of conditions and the following disclaimer.
- X.\" 2. Redistributions in binary form must reproduce the above copyright
- X.\" notice, this list of conditions and the following disclaimer in the
- X.\" documentation and/or other materials provided with the distribution.
- X.\" 3. All advertising materials mentioning features or use of this software
- X.\" must display the following acknowledgement:
- X.\" This product includes software developed by the University of
- X.\" California, Lawrence Livermore National Laboratory and its
- X.\" contributors.
- X.\" 4. Neither the name of the University nor the names of its contributors
- X.\" may be used to endorse or promote products derived from this software
- X.\" without specific prior written permission.
- X.\"
- X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X.\" SUCH DAMAGE.
- X.\"
- X.de Hd
- X.ds Dt \\$4
- X..
- X.Hd $Header: /u0/casey/src/mcast/man/RCS/mc_shutdown.2,v 1.1 92/10/16 18:23:05 casey Exp $
- X.TH MC_SHUTDOWN 2 \*(Dt
- X.SH NAME
- mc_shutdown \- shut down part of a full-duplex connection
- X.SH SYNOPSIS
- X.nf
- X.ft B
- X#include <sys/types.h>
- X#include <sys/socket.h>
- X#include <netmcast/mast.h>
- X
- int
- mc_shutdown(int s, int how)
- X.ft P
- X.fi
- X.SH DESCRIPTION
- The
- X.I mc_shutdown
- call causes all or part of a full-duplex connection on
- the multicast socket associated with
- X.I s
- to be shut down.
- If
- X.I how
- is 0, further receives will be disallowed.
- If
- X.I how
- is 1, further sends will be disallowed.
- If
- X.I how
- is 2, further sends and receives will be disallowed.
- X.SH COMPATIBILITY
- The
- X.I mc_shutdown
- call emulates the
- X.IR shutdown (2)
- system call for multicast socket descriptors created with the
- X.IR mc_socket (2)
- call.
- See the manual page for
- X.IR shutdown (2)
- for a description of the emulated semantics.
- X.I Mc_shutdown
- does not provide any different semantics from
- X.IR shutdown (2).
- X.SH "RETURN VALUES"
- Upon successful completion, a value of 0 is returned.
- Otherwise, a value of -1 is returned and the global integer variable
- X.I errno
- is set to indicate the error.
- X.SH ERRORS
- See the manual page for
- X.IR shutdown (2)
- for a detailed list of errors associated with the general
- X.IR shutdown (2)
- system call.
- X.I Mc_shutdown
- itself will fail if:
- X.TP 20
- X[EBADF]
- X.I S
- is not a valid multicast socket descriptor as returned by
- X.IR mc_socket (2).
- X.TP 20
- X[EIO]
- The socket state has become corrupted. This is an artifact of a
- client/server implementation of the multicast communication system.
- X.SH "SEE ALSO"
- X.IR mc_connect (2),
- X.IR mc_socket (2),
- X.IR mcast (4),
- X.IR shutdown (2)
- X.SH STANDARDS
- There are no current standards that address multicast communication.
- The software described in this manual page is experimental and subject
- to change at any time.
- END_OF_FILE
- if test 3731 -ne `wc -c <'man/mc_shutdown.2'`; then
- echo shar: \"'man/mc_shutdown.2'\" unpacked with wrong size!
- fi
- # end of 'man/mc_shutdown.2'
- fi
- if test ! -d 'mcastd' ; then
- echo shar: Creating directory \"'mcastd'\"
- mkdir 'mcastd'
- fi
- if test -f 'mcastd/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mcastd/Makefile'\"
- else
- echo shar: Extracting \"'mcastd/Makefile'\" \(613 characters\)
- sed "s/^X//" >'mcastd/Makefile' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/mcastd/RCS/Makefile,v 1.2 92/11/17 16:28:29 casey Exp $
- X#
- X TOP = ..
- X CURDIR = ./mcastd
- X
- X.DEFAULT:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- X.c.o:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- all:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std
- X
- END_OF_FILE
- if test 613 -ne `wc -c <'mcastd/Makefile'`; then
- echo shar: \"'mcastd/Makefile'\" unpacked with wrong size!
- fi
- # end of 'mcastd/Makefile'
- fi
- if test -f 'mcastd/Makefile.tmpl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mcastd/Makefile.tmpl'\"
- else
- echo shar: Extracting \"'mcastd/Makefile.tmpl'\" \(574 characters\)
- sed "s/^X//" >'mcastd/Makefile.tmpl' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/mcastd/RCS/Makefile.tmpl,v 1.1 92/10/16 18:23:11 casey Exp $
- X#
- X SRCS = mcastd.c
- X OBJS = mcastd.o
- X MCASTD = mcastd
- X
- X
- all: $(MCASTD)
- X
- includes:
- X
- X$(MCASTD): $(OBJS)
- X $(CC) $(CFLAGS) -o $(MCASTD) $(OBJS)
- X
- install: $(MCASTD) $(ETCDIR)
- X rm -f $(ETCDIR)/$(MCASTD)
- X cp $(MCASTD) $(ETCDIR)
- X
- X$(ETCDIR):
- X mkdir $(ETCDIR)
- X
- clean:
- X rm -f $(MCASTD)
- X rm -f *~ *.o core a.out MAKELOG
- X
- lint:
- X lint -x $(ALLDEFINES) $(SRCS)
- X
- depend:
- X
- mcastd.o: mcastd.c $(TOP)/include/netmcast/mcast.h
- mcastd.o: mcastd.c $(TOP)/include/netmcast/mcastd.h
- END_OF_FILE
- if test 574 -ne `wc -c <'mcastd/Makefile.tmpl'`; then
- echo shar: \"'mcastd/Makefile.tmpl'\" unpacked with wrong size!
- fi
- # end of 'mcastd/Makefile.tmpl'
- fi
- if test ! -d 'test' ; then
- echo shar: Creating directory \"'test'\"
- mkdir 'test'
- fi
- if test -f 'test/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'test/Makefile'\"
- else
- echo shar: Extracting \"'test/Makefile'\" \(607 characters\)
- sed "s/^X//" >'test/Makefile' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/test/RCS/Makefile,v 1.1 92/10/16 18:23:14 casey Exp $
- X#
- X TOP = ..
- X CURDIR = ./test
- X
- X.DEFAULT:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- X.c.o:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std \
- X $@
- X
- all:
- X @$(MAKE) $(MFLAGS) TOP="$(TOP)" CURDIR="$(CURDIR)" \
- X -f $(TOP)/config/Makefile.config \
- X -f ./Makefile.tmpl \
- X -f $(TOP)/config/Makefile.std
- END_OF_FILE
- if test 607 -ne `wc -c <'test/Makefile'`; then
- echo shar: \"'test/Makefile'\" unpacked with wrong size!
- fi
- # end of 'test/Makefile'
- fi
- if test -f 'test/Makefile.tmpl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'test/Makefile.tmpl'\"
- else
- echo shar: Extracting \"'test/Makefile.tmpl'\" \(1031 characters\)
- sed "s/^X//" >'test/Makefile.tmpl' <<'END_OF_FILE'
- X#
- X# $Header: /u0/casey/src/mcast/test/RCS/Makefile.tmpl,v 1.1 92/10/16 18:23:16 casey Exp $
- X#
- X
- X SRCS = mc_hello.c mc_listen.c mc_send.c mc_clock.c mc_ping.c
- X OBJS = mc_hello.o mc_listen.o mc_send.o mc_clock.o mc_ping.o
- X TESTS = mc_hello mc_listen mc_send mc_clock mc_ping
- X
- all: $(TESTS)
- X
- mc_hello: mc_hello.o $(LIBMCAST)
- X $(CC) -o mc_hello mc_hello.o $(LIBMCAST)
- X
- mc_listen: mc_listen.o $(LIBMCAST)
- X $(CC) -o mc_listen mc_listen.o $(LIBMCAST)
- X
- mc_send: mc_send.o $(LIBMCAST)
- X $(CC) -o mc_send mc_send.o $(LIBMCAST)
- X
- mc_clock: mc_clock.o $(LIBMCAST)
- X $(CC) -o mc_clock mc_clock.o $(LIBMCAST)
- X
- mc_ping: mc_ping.o $(LIBMCAST)
- X $(CC) -o mc_ping mc_ping.o $(LIBMCAST)
- X
- includes:
- X
- install:
- X
- clean:
- X rm -f $(TESTS)
- X rm -f *~ *.o core a.out MAKELOG
- X
- lint:
- X lint -x $(ALLDEFINES) $(SRCS)
- X
- depend:
- X
- mc_hello.o: $(BUILDINCTOP)/netmcast/mcast.h
- mc_listen.o: $(BUILDINCTOP)/netmcast/mcast.h
- mc_send.o: $(BUILDINCTOP)/netmcast/mcast.h
- mc_clock.o: $(BUILDINCTOP)/netmcast/mcast.h
- mc_ping.o: $(BUILDINCTOP)/netmcast/mcast.h
- END_OF_FILE
- if test 1031 -ne `wc -c <'test/Makefile.tmpl'`; then
- echo shar: \"'test/Makefile.tmpl'\" unpacked with wrong size!
- fi
- # end of 'test/Makefile.tmpl'
- fi
- if test -f 'test/mc_hello.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'test/mc_hello.c'\"
- else
- echo shar: Extracting \"'test/mc_hello.c'\" \(2726 characters\)
- sed "s/^X//" >'test/mc_hello.c' <<'END_OF_FILE'
- X/*
- X * $Header: /u0/casey/src/mcast/test/RCS/mc_hello.c,v 1.3 93/01/16 20:18:35 casey Exp $
- X */
- X
- X/*
- X * Copyright (c) 1992 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Lawrence Livermore National Laboratory and its
- X * contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- static char rcsid[] = "$Header: /u0/casey/src/mcast/test/RCS/mc_hello.c,v 1.3 93/01/16 20:18:35 casey Exp $";
- static char copyright[] =
- X "Copyright (c) 1992 The Regents of the University of California.\n"
- X "All rights reserved.\n";
- static char classification[] =
- X "Unclassified\n";
- X#endif
- X
- X/*
- X * Emit "hello world!" onto the "hello-world-group" multicast group.
- X */
- X
- X
- X#include <stdio.h>
- X#include <fcntl.h>
- X#include <sys/types.h>
- X#include <sys/socket.h>
- X#include <netmcast/mcast.h>
- X
- X/*ARGSUSED*/
- main(int argc, char *argv[])
- X{
- X int s;
- X
- X s = mcast_sopen("hello-world-group", PF_MCAST, SOCK_STREAM, O_WRONLY);
- X if (s < 0) {
- X perror("mcast_sopen");
- X exit(1);
- X }
- X (void)mc_write(s, "hello world!\n", 13);
- X (void)mc_close(s);
- X exit(0);
- X /*NOTREACHED*/
- X}
- END_OF_FILE
- if test 2726 -ne `wc -c <'test/mc_hello.c'`; then
- echo shar: \"'test/mc_hello.c'\" unpacked with wrong size!
- fi
- # end of 'test/mc_hello.c'
- fi
- echo shar: End of archive 1 \(of 4\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 4 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-