]>
git.saurik.com Git - apple/network_cmds.git/blob - mnc.tproj/mnc.h
2 * $Id: mnc.h,v 1.4 2004/09/22 14:07:10 colmmacc Exp $
4 * mnc.h -- Multicast NetCat
6 * Colm MacCarthaigh, <colm@apache.org>
8 * Copyright (c) 2007, Colm MacCarthaigh.
9 * Copyright (c) 2004 - 2006, HEAnet Ltd.
11 * This software is an open source.
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
17 * Redistributions of source code must retain the above copyright notice,
18 * this list of conditions and the following disclaimer.
20 * Redistributions in binary form must reproduce the above copyright notice,
21 * this list of conditions and the following disclaimer in the documentation
22 * and/or other materials provided with the distribution.
24 * Neither the name of the HEAnet Ltd. nor the names of its contributors may
25 * be used to endorse or promote products derived from this software without
26 * specific prior written permission.
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
31 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
32 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 * POSSIBILITY OF SUCH DAMAGE.
47 #include <sys/types.h>
48 #include <sys/socket.h>
58 /* The UDP port MNC will use by default */
59 #define MNC_DEFAULT_PORT "1234"
61 struct mnc_configuration
63 /* Are we sending or recieving ? */
64 enum {SENDER
, LISTENER
} mode
;
66 /* What UDP port are we using ? */
70 struct addrinfo
* group
;
73 struct addrinfo
* source
;
75 /* An interface index for listening */
80 /* Functions in mnc_opts.c */
82 struct mnc_configuration
* parse_arguments(int argc
, char **argv
);
84 /* Functions in mnc_multicast.c */
85 int multicast_setup_listen(int, struct addrinfo
*, struct addrinfo
*, char *);
86 int multicast_setup_send(int, struct addrinfo
*, struct addrinfo
*);
88 /* Functions in mnc_error.c */
89 void mnc_warning(char * string
, ...);
90 void mnc_error(char * string
, ...);