Update to multicast 3.5.
This commit is contained in:
parent
bf70a55f72
commit
03bc7e4381
|
@ -0,0 +1,11 @@
|
||||||
|
# from: Id: Makefile,v 1.5 1993/06/24 05:11:16 deering Exp
|
||||||
|
# $Id: Makefile,v 1.1 1995/06/01 05:32:11 mycroft Exp $
|
||||||
|
|
||||||
|
.PATH: ${.CURDIR}/../mrouted
|
||||||
|
CFLAGS+= -I${.CURDIR}/../mrouted
|
||||||
|
|
||||||
|
PROG= map-mbone
|
||||||
|
SRCS= igmp.c inet.c kern.c mapper.c
|
||||||
|
MAN= map-mbone.8
|
||||||
|
|
||||||
|
.include <bsd.prog.mk>
|
|
@ -0,0 +1,89 @@
|
||||||
|
.TH MAP-MBONE 8
|
||||||
|
.UC 5
|
||||||
|
.SH NAME
|
||||||
|
map-mbone \- Multicast connection mapper
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B /usr/sbin/map-mbone
|
||||||
|
[
|
||||||
|
.B \-d
|
||||||
|
.I debug_level
|
||||||
|
] [
|
||||||
|
.B \-f
|
||||||
|
] [
|
||||||
|
.B \-g
|
||||||
|
] [
|
||||||
|
.B \-n
|
||||||
|
] [
|
||||||
|
.B \-r
|
||||||
|
.I retry_count
|
||||||
|
] [
|
||||||
|
.B \-t
|
||||||
|
.I timeout_count
|
||||||
|
] [
|
||||||
|
.B starting_router
|
||||||
|
]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.I map-mbone
|
||||||
|
attempts to display all multicast routers that are reachable from the multicast
|
||||||
|
.I starting_router.
|
||||||
|
If not specified on the command line, the default multicast
|
||||||
|
.I starting_router
|
||||||
|
is the localhost.
|
||||||
|
.PP
|
||||||
|
.I map-mbone
|
||||||
|
traverses neighboring multicast routers by sending the ASK_NEIGHBORS IGMP
|
||||||
|
message to the multicast starting_router. If this multicast router responds,
|
||||||
|
the version number and a list of their neighboring multicast router addresses is
|
||||||
|
part of that response. If the responding router has recent multicast version
|
||||||
|
number, then
|
||||||
|
.I map-mbone
|
||||||
|
requests additional information such as metrics, thresholds, and flags from the
|
||||||
|
multicast router. For each new occurrence of neighboring multicast router in
|
||||||
|
the reply and provided the flooding option has been selected, then
|
||||||
|
.I map-mbone
|
||||||
|
asks each of this multicast router for a list of neighbors. This search
|
||||||
|
for unique routers will continue until no new neighboring multicast routers
|
||||||
|
are reported.
|
||||||
|
.br
|
||||||
|
.ne 5
|
||||||
|
.SH INVOCATION
|
||||||
|
.PP
|
||||||
|
"\-d" option sets the debug level. When the debug level is greater than the
|
||||||
|
default value of 0, addition debugging messages are printed. Regardless of
|
||||||
|
the debug level, an error condition, will always write an error message and will
|
||||||
|
cause
|
||||||
|
.I map-mbone
|
||||||
|
to terminate.
|
||||||
|
Non-zero debug levels have the following effects:
|
||||||
|
.IP "level 1"
|
||||||
|
packet warnings are printed to stderr.
|
||||||
|
.IP "level 2"
|
||||||
|
all level 1 messages plus notifications down networks are printed to stderr.
|
||||||
|
.IP "level 3"
|
||||||
|
all level 2 messages plus notifications of all packet
|
||||||
|
timeouts are printed to stderr.
|
||||||
|
.PP
|
||||||
|
"\-f" option sets flooding option. Flooding allows the recursive search
|
||||||
|
of neighboring multicast routers and is enable by default when starting_router
|
||||||
|
is not used.
|
||||||
|
.PP
|
||||||
|
"\-g" option sets graphing in GraphEd format.
|
||||||
|
.PP
|
||||||
|
"\-n" option disables the DNS lookup for the multicast routers names.
|
||||||
|
.PP
|
||||||
|
"\-r retry_count" sets the neighbor query retry limit. Default is 1 retry.
|
||||||
|
.PP
|
||||||
|
"\-t timeout_count" sets the number of seconds to wait for a neighbor query
|
||||||
|
reply before retrying. Default timeout is 2 seconds.
|
||||||
|
.PP
|
||||||
|
.SH IMPORTANT NOTE
|
||||||
|
.I map-mbone
|
||||||
|
must be run as root.
|
||||||
|
.PP
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR mrouted (8) ,
|
||||||
|
.BR mrinfo (8) ,
|
||||||
|
.BR mtrace (8)
|
||||||
|
.PP
|
||||||
|
.SH AUTHOR
|
||||||
|
Pavel Curtis
|
|
@ -1,8 +1,7 @@
|
||||||
/* Mapper for connections between MRouteD multicast routers.
|
/* Mapper for connections between MRouteD multicast routers.
|
||||||
* Written by Pavel Curtis <Pavel@PARC.Xerox.Com>
|
* Written by Pavel Curtis <Pavel@PARC.Xerox.Com>
|
||||||
*
|
*
|
||||||
* from: Id: mapper.c,v 1.4 1993/06/24 05:11:16 deering Exp
|
* $Id: mapper.c,v 1.1 1995/06/01 05:32:13 mycroft Exp $
|
||||||
* $Id: mapper.c,v 1.1 1994/01/11 20:16:13 brezak Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -22,10 +21,7 @@
|
||||||
* These notices must be retained in any copies of any part of this software.
|
* These notices must be retained in any copies of any part of this software.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#include <string.h>
|
||||||
static char rcsid[] = "$Id: mapper.c,v 1.1 1994/01/11 20:16:13 brezak Exp $";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
@ -38,7 +34,7 @@ static char rcsid[] = "$Id: mapper.c,v 1.1 1994/01/11 20:16:13 brezak Exp $";
|
||||||
|
|
||||||
typedef struct neighbor {
|
typedef struct neighbor {
|
||||||
struct neighbor *next;
|
struct neighbor *next;
|
||||||
u_long addr; /* IP address in NET order */
|
u_int32_t addr; /* IP address in NET order */
|
||||||
u_char metric; /* TTL cost of forwarding */
|
u_char metric; /* TTL cost of forwarding */
|
||||||
u_char threshold; /* TTL threshold to forward */
|
u_char threshold; /* TTL threshold to forward */
|
||||||
u_short flags; /* flags on connection */
|
u_short flags; /* flags on connection */
|
||||||
|
@ -47,13 +43,13 @@ typedef struct neighbor {
|
||||||
|
|
||||||
typedef struct interface {
|
typedef struct interface {
|
||||||
struct interface *next;
|
struct interface *next;
|
||||||
u_long addr; /* IP address of the interface in NET order */
|
u_int32_t addr; /* IP address of the interface in NET order */
|
||||||
Neighbor *neighbors; /* List of neighbors' IP addresses */
|
Neighbor *neighbors; /* List of neighbors' IP addresses */
|
||||||
} Interface;
|
} Interface;
|
||||||
|
|
||||||
typedef struct node {
|
typedef struct node {
|
||||||
u_long addr; /* IP address of this entry in NET order */
|
u_int32_t addr; /* IP address of this entry in NET order */
|
||||||
u_long version; /* which mrouted version is running */
|
u_int32_t version; /* which mrouted version is running */
|
||||||
int tries; /* How many requests sent? -1 for aliases */
|
int tries; /* How many requests sent? -1 for aliases */
|
||||||
union {
|
union {
|
||||||
struct node *alias; /* If alias, to what? */
|
struct node *alias; /* If alias, to what? */
|
||||||
|
@ -64,15 +60,17 @@ typedef struct node {
|
||||||
|
|
||||||
|
|
||||||
Node *routers = 0;
|
Node *routers = 0;
|
||||||
u_long our_addr, target_addr = 0; /* in NET order */
|
u_int32_t our_addr, target_addr = 0; /* in NET order */
|
||||||
int debug = 0;
|
int debug = 0;
|
||||||
int retries = DEFAULT_RETRIES;
|
int retries = DEFAULT_RETRIES;
|
||||||
int timeout = DEFAULT_TIMEOUT;
|
int timeout = DEFAULT_TIMEOUT;
|
||||||
int show_names = TRUE;
|
int show_names = TRUE;
|
||||||
|
vifi_t numvifs; /* to keep loader happy */
|
||||||
|
/* (see COPY_TABLES macro called in kern.c) */
|
||||||
|
|
||||||
|
|
||||||
Node *find_node(addr, ptr)
|
Node *find_node(addr, ptr)
|
||||||
u_long addr;
|
u_int32_t addr;
|
||||||
Node **ptr;
|
Node **ptr;
|
||||||
{
|
{
|
||||||
Node *n = *ptr;
|
Node *n = *ptr;
|
||||||
|
@ -95,7 +93,7 @@ Node *find_node(addr, ptr)
|
||||||
|
|
||||||
|
|
||||||
Interface *find_interface(addr, node)
|
Interface *find_interface(addr, node)
|
||||||
u_long addr;
|
u_int32_t addr;
|
||||||
Node *node;
|
Node *node;
|
||||||
{
|
{
|
||||||
Interface *ifc;
|
Interface *ifc;
|
||||||
|
@ -115,7 +113,7 @@ Interface *find_interface(addr, node)
|
||||||
|
|
||||||
|
|
||||||
Neighbor *find_neighbor(addr, node)
|
Neighbor *find_neighbor(addr, node)
|
||||||
u_long addr;
|
u_int32_t addr;
|
||||||
Node *node;
|
Node *node;
|
||||||
{
|
{
|
||||||
Interface *ifc;
|
Interface *ifc;
|
||||||
|
@ -171,14 +169,14 @@ void log(severity, syserr, format, a, b, c, d, e)
|
||||||
* Send a neighbors-list request.
|
* Send a neighbors-list request.
|
||||||
*/
|
*/
|
||||||
void ask(dst)
|
void ask(dst)
|
||||||
u_long dst;
|
u_int32_t dst;
|
||||||
{
|
{
|
||||||
send_igmp(our_addr, dst, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS,
|
send_igmp(our_addr, dst, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS,
|
||||||
htonl(MROUTED_LEVEL), 0);
|
htonl(MROUTED_LEVEL), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ask2(dst)
|
void ask2(dst)
|
||||||
u_long dst;
|
u_int32_t dst;
|
||||||
{
|
{
|
||||||
send_igmp(our_addr, dst, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS2,
|
send_igmp(our_addr, dst, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS2,
|
||||||
htonl(MROUTED_LEVEL), 0);
|
htonl(MROUTED_LEVEL), 0);
|
||||||
|
@ -189,7 +187,7 @@ void ask2(dst)
|
||||||
* Process an incoming group membership report.
|
* Process an incoming group membership report.
|
||||||
*/
|
*/
|
||||||
void accept_group_report(src, dst, group)
|
void accept_group_report(src, dst, group)
|
||||||
u_long src, dst, group;
|
u_int32_t src, dst, group;
|
||||||
{
|
{
|
||||||
log(LOG_INFO, 0, "ignoring IGMP group membership report from %s to %s",
|
log(LOG_INFO, 0, "ignoring IGMP group membership report from %s to %s",
|
||||||
inet_fmt(src, s1), inet_fmt(dst, s2));
|
inet_fmt(src, s1), inet_fmt(dst, s2));
|
||||||
|
@ -200,7 +198,7 @@ void accept_group_report(src, dst, group)
|
||||||
* Process an incoming neighbor probe message.
|
* Process an incoming neighbor probe message.
|
||||||
*/
|
*/
|
||||||
void accept_probe(src, dst)
|
void accept_probe(src, dst)
|
||||||
u_long src, dst;
|
u_int32_t src, dst;
|
||||||
{
|
{
|
||||||
log(LOG_INFO, 0, "ignoring DVMRP probe from %s to %s",
|
log(LOG_INFO, 0, "ignoring DVMRP probe from %s to %s",
|
||||||
inet_fmt(src, s1), inet_fmt(dst, s2));
|
inet_fmt(src, s1), inet_fmt(dst, s2));
|
||||||
|
@ -211,7 +209,7 @@ void accept_probe(src, dst)
|
||||||
* Process an incoming route report message.
|
* Process an incoming route report message.
|
||||||
*/
|
*/
|
||||||
void accept_report(src, dst, p, datalen)
|
void accept_report(src, dst, p, datalen)
|
||||||
u_long src, dst;
|
u_int32_t src, dst;
|
||||||
char *p;
|
char *p;
|
||||||
int datalen;
|
int datalen;
|
||||||
{
|
{
|
||||||
|
@ -224,7 +222,7 @@ void accept_report(src, dst, p, datalen)
|
||||||
* Process an incoming neighbor-list request message.
|
* Process an incoming neighbor-list request message.
|
||||||
*/
|
*/
|
||||||
void accept_neighbor_request(src, dst)
|
void accept_neighbor_request(src, dst)
|
||||||
u_long src, dst;
|
u_int32_t src, dst;
|
||||||
{
|
{
|
||||||
if (src != our_addr)
|
if (src != our_addr)
|
||||||
log(LOG_INFO, 0,
|
log(LOG_INFO, 0,
|
||||||
|
@ -233,7 +231,7 @@ void accept_neighbor_request(src, dst)
|
||||||
}
|
}
|
||||||
|
|
||||||
void accept_neighbor_request2(src, dst)
|
void accept_neighbor_request2(src, dst)
|
||||||
u_long src, dst;
|
u_int32_t src, dst;
|
||||||
{
|
{
|
||||||
if (src != our_addr)
|
if (src != our_addr)
|
||||||
log(LOG_INFO, 0,
|
log(LOG_INFO, 0,
|
||||||
|
@ -246,7 +244,7 @@ void accept_neighbor_request2(src, dst)
|
||||||
* Process an incoming neighbor-list message.
|
* Process an incoming neighbor-list message.
|
||||||
*/
|
*/
|
||||||
void accept_neighbors(src, dst, p, datalen, level)
|
void accept_neighbors(src, dst, p, datalen, level)
|
||||||
u_long src, dst, level;
|
u_int32_t src, dst, level;
|
||||||
u_char *p;
|
u_char *p;
|
||||||
int datalen;
|
int datalen;
|
||||||
{
|
{
|
||||||
|
@ -257,8 +255,8 @@ void accept_neighbors(src, dst, p, datalen, level)
|
||||||
else if (node->tries == -1) /* follow alias link */
|
else if (node->tries == -1) /* follow alias link */
|
||||||
node = node->u.alias;
|
node = node->u.alias;
|
||||||
|
|
||||||
#define GET_ADDR(a) (a = ((u_long)*p++ << 24), a += ((u_long)*p++ << 16),\
|
#define GET_ADDR(a) (a = ((u_int32_t)*p++ << 24), a += ((u_int32_t)*p++ << 16),\
|
||||||
a += ((u_long)*p++ << 8), a += *p++)
|
a += ((u_int32_t)*p++ << 8), a += *p++)
|
||||||
|
|
||||||
/* if node is running a recent mrouted, ask for additional info */
|
/* if node is running a recent mrouted, ask for additional info */
|
||||||
if (level != 0) {
|
if (level != 0) {
|
||||||
|
@ -284,7 +282,7 @@ void accept_neighbors(src, dst, p, datalen, level)
|
||||||
}
|
}
|
||||||
|
|
||||||
while (datalen > 0) { /* loop through interfaces */
|
while (datalen > 0) { /* loop through interfaces */
|
||||||
u_long ifc_addr;
|
u_int32_t ifc_addr;
|
||||||
u_char metric, threshold, ncount;
|
u_char metric, threshold, ncount;
|
||||||
Node *ifc_node;
|
Node *ifc_node;
|
||||||
Interface *ifc;
|
Interface *ifc;
|
||||||
|
@ -363,7 +361,7 @@ void accept_neighbors(src, dst, p, datalen, level)
|
||||||
|
|
||||||
/* Add the neighbors for this interface */
|
/* Add the neighbors for this interface */
|
||||||
while (ncount--) {
|
while (ncount--) {
|
||||||
u_long neighbor;
|
u_int32_t neighbor;
|
||||||
Neighbor *nb;
|
Neighbor *nb;
|
||||||
Node *n_node;
|
Node *n_node;
|
||||||
|
|
||||||
|
@ -407,7 +405,7 @@ void accept_neighbors(src, dst, p, datalen, level)
|
||||||
}
|
}
|
||||||
|
|
||||||
void accept_neighbors2(src, dst, p, datalen)
|
void accept_neighbors2(src, dst, p, datalen)
|
||||||
u_long src, dst;
|
u_int32_t src, dst;
|
||||||
u_char *p;
|
u_char *p;
|
||||||
int datalen;
|
int datalen;
|
||||||
{
|
{
|
||||||
|
@ -419,7 +417,7 @@ void accept_neighbors2(src, dst, p, datalen)
|
||||||
node = node->u.alias;
|
node = node->u.alias;
|
||||||
|
|
||||||
while (datalen > 0) { /* loop through interfaces */
|
while (datalen > 0) { /* loop through interfaces */
|
||||||
u_long ifc_addr;
|
u_int32_t ifc_addr;
|
||||||
u_char metric, threshold, ncount, flags;
|
u_char metric, threshold, ncount, flags;
|
||||||
Node *ifc_node;
|
Node *ifc_node;
|
||||||
Interface *ifc;
|
Interface *ifc;
|
||||||
|
@ -431,7 +429,7 @@ void accept_neighbors2(src, dst, p, datalen)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ifc_addr = *(u_long*)p;
|
ifc_addr = *(u_int32_t*)p;
|
||||||
p += 4;
|
p += 4;
|
||||||
metric = *p++;
|
metric = *p++;
|
||||||
threshold = *p++;
|
threshold = *p++;
|
||||||
|
@ -499,7 +497,7 @@ void accept_neighbors2(src, dst, p, datalen)
|
||||||
|
|
||||||
/* Add the neighbors for this interface */
|
/* Add the neighbors for this interface */
|
||||||
while (ncount--) {
|
while (ncount--) {
|
||||||
u_long neighbor;
|
u_int32_t neighbor;
|
||||||
Neighbor *nb;
|
Neighbor *nb;
|
||||||
Node *n_node;
|
Node *n_node;
|
||||||
|
|
||||||
|
@ -509,7 +507,7 @@ void accept_neighbors2(src, dst, p, datalen)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
neighbor = *(u_long*)p;
|
neighbor = *(u_int32_t*)p;
|
||||||
p += 4;
|
p += 4;
|
||||||
datalen -= 4;
|
datalen -= 4;
|
||||||
if (neighbor == 0)
|
if (neighbor == 0)
|
||||||
|
@ -574,7 +572,7 @@ int retry_requests(node)
|
||||||
|
|
||||||
|
|
||||||
char *inet_name(addr)
|
char *inet_name(addr)
|
||||||
u_long addr;
|
u_int32_t addr;
|
||||||
{
|
{
|
||||||
struct hostent *e;
|
struct hostent *e;
|
||||||
|
|
||||||
|
@ -653,7 +651,7 @@ void print_map(node)
|
||||||
|
|
||||||
|
|
||||||
char *graph_name(addr, buf)
|
char *graph_name(addr, buf)
|
||||||
u_long addr;
|
u_int32_t addr;
|
||||||
char *buf;
|
char *buf;
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
|
@ -774,7 +772,7 @@ int get_number(var, deflt, pargv, pargc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
u_long host_addr(name)
|
u_int32_t host_addr(name)
|
||||||
char *name;
|
char *name;
|
||||||
{
|
{
|
||||||
struct hostent *e = gethostbyname(name);
|
struct hostent *e = gethostbyname(name);
|
||||||
|
@ -792,7 +790,7 @@ u_long host_addr(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
main(argc, argv)
|
int main(argc, argv)
|
||||||
int argc;
|
int argc;
|
||||||
char *argv[];
|
char *argv[];
|
||||||
{
|
{
|
||||||
|
@ -865,6 +863,9 @@ main(argc, argv)
|
||||||
int addrlen = sizeof(addr);
|
int addrlen = sizeof(addr);
|
||||||
|
|
||||||
addr.sin_family = AF_INET;
|
addr.sin_family = AF_INET;
|
||||||
|
#if (defined(BSD) && (BSD >= 199103))
|
||||||
|
addr.sin_len = sizeof addr;
|
||||||
|
#endif
|
||||||
addr.sin_addr.s_addr = dvmrp_group;
|
addr.sin_addr.s_addr = dvmrp_group;
|
||||||
addr.sin_port = htons(2000); /* any port over 1024 will do... */
|
addr.sin_port = htons(2000); /* any port over 1024 will do... */
|
||||||
if ((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0
|
if ((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0
|
||||||
|
@ -915,7 +916,7 @@ main(argc, argv)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
recvlen = recvfrom(igmp_socket, recv_buf, sizeof(recv_buf),
|
recvlen = recvfrom(igmp_socket, recv_buf, RECV_BUF_SIZE,
|
||||||
0, NULL, &dummy);
|
0, NULL, &dummy);
|
||||||
if (recvlen >= 0)
|
if (recvlen >= 0)
|
||||||
accept_igmp(recvlen);
|
accept_igmp(recvlen);
|
||||||
|
@ -935,3 +936,25 @@ main(argc, argv)
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void accept_prune()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void accept_graft()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void accept_g_ack()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void add_table_entry()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void accept_leave_message()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void accept_mtrace()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void accept_membership_query()
|
||||||
|
{
|
||||||
|
}
|
|
@ -1,12 +0,0 @@
|
||||||
# from: Id: Makefile,v 1.5 1993/06/24 05:11:16 deering Exp
|
|
||||||
# $Id: Makefile,v 1.2 1994/01/14 19:44:50 cgd Exp $
|
|
||||||
|
|
||||||
.PATH: ${.CURDIR}/..
|
|
||||||
CFLAGS+= -I${.CURDIR}/..
|
|
||||||
|
|
||||||
PROG= map-mbone
|
|
||||||
SRCS= igmp.c inet.c kern.c mapper.c
|
|
||||||
NOMAN= noman
|
|
||||||
|
|
||||||
.include "../../Makefile.inc"
|
|
||||||
.include <bsd.prog.mk>
|
|
Loading…
Reference in New Issue