1.\" 2.\" Copyright (c) 2007-2009 Bruce Simpson. 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 3. The name of the author may not be used to endorse or promote products 14.\" derived from this software without specific prior written permission 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26.\" 27.Dd April 29, 2009 28.Dt MTEST 8 29.Os 30.Sh NAME 31.Nm mtest 32.Nd test multicast socket operations 33.Sh SYNOPSIS 34.Nm 35.Sh DESCRIPTION 36The 37.Nm 38utility 39is a small program for testing multicast socket operations. 40.Pp 41It accepts the following commands, interactively, or as part of a scripted 42input file (useful for automated testing): 43.Pp 44.Bl -tag -width "a ifname e.e.e.e e.e.e.e" -compact -offset indent 45.\" 46.It Ic a Ar ifname Ar mac-addr 47Join the link-layer group address 48.Ar mac-addr 49on interface 50.Ar ifname . 51The group address should be in IEEE 802 MAC format, 52delimited by colon (':') characters. 53.It Ic d Ar ifname Ar mac-addr 54Leave the link-layer group address 55.Ar mac-addr 56on interface 57.Ar ifname . 58.It Ic m Ar ifname Ar 1/0 59Set or reset ALLMULTI mode on interface 60.Ar ifname . 61This option is deprecated and is now a no-op. 62.It Ic p Ar ifname Ar 1/0 63Set or reset promiscuous mode on interface 64.Ar ifname . 65.Pp 66.It Ic j Ar mcast-addr Ar ifname Op Ar source-addr 67Join the multicast address 68.Ar mcast-addr 69on the interface with name 70.Ar ifname . 71.Pp 72If an optional source 73.Ar source-addr 74is specified, a source-specific join will be performed; 75if 76.Nm 77is already joined to the multicast address, the source 78will be added to its filter list. 79.Pp 80.It Ic l Ar mcast-addr Ar ifname Op Ar source-addr 81Leave the multicast address 82.Ar mcast-addr 83on the interface with address 84.Ar ifname . 85If a source 86.Ar source-addr 87is specified, only that source will be left. 88.\" 89.It Ic i Ar mcast-addr Ar ifname Ar n Ar source-addr ... 90Set the socket with membership of 91.Ar mcast-addr 92on interface 93.Ar ifname 94to include filter mode, and add 95.Ar n 96sources beginning with 97.Ar source-addr 98to the inclusion filter list. 99.\" 100.It Ic e Ar mcast-addr Ar ifname Ar n Ar source-addr ... 101Set the socket with membership of 102.Ar mcast-addr 103on interface 104.Ar ifname 105to exclude filter mode, and add 106.Ar n 107sources beginning with 108.Ar source-addr 109to the exclusion filter list. 110.\" 111.It Ic t Ar mcast-addr Ar ifname Ar source-addr 112Set the socket with membership of 113.Ar mcast-addr 114on interface 115.Ar ifname 116to block traffic from source 117.Ar source-addr . 118.\" 119.It Ic b Ar mcast-addr Ar ifname Ar source-addr 120Set the socket with membership of 121.Ar mcast-addr 122on interface 123.Ar ifname 124to allow traffic from source 125.Ar source-addr . 126.\" 127.Pp 128.It Ic g Ar mcast-addr Ar ifname Ar n 129Print 130.Ar n 131source filter entries for 132.Ar mcast-addr 133on interface 134.Ar ifname . 135.\" 136.Pp 137.It Ic f Ar filename 138Read commands from the file 139.Ar filename . 140.It Ic s Ar n 141Sleep for 142.Ar n 143seconds. 144.It Ic ?\& 145List legal commands. 146.It Ic q 147Quit the program. 148.El 149.Sh IMPLEMENTATION NOTES 150For each command implemented by 151.Nm , 152the address family of each argument must be identical; it is not possible 153to mix IPv4 multicast memberships with IPv6, for example. 154.Pp 155To support IPv6, all commands have now changed to accept an interface 156name rather than an interface address. 157For IPv4, the program will perform 158a lookup of the primary IP address based on the interface name. 159This may fail if no primary IP address is assigned. 160.Sh SEE ALSO 161.Rs 162.%A D. Thaler 163.%A B. Fenner 164.%A B. Quinn 165.%T "Socket Interface Extensions for Multicast Filters" 166.%O RFC 3678 167.Re 168.Sh AUTHORS 169.An -split 170.An "Bruce Simpson" 171.An "Steve Deering" 172.An "Wilbert De Graaf" 173