$KAME$ cleanup. address PR 11615 (CMSG_SPACE should be CMSG_LEN).
lots of stabilization/spec cleanup. sync with kame.
This commit is contained in:
parent
b1ba1c6a53
commit
c9236bb0cc
@ -1,4 +1,4 @@
|
||||
KAME Id: BUGS.TODO,v 1.1.1.1 1999/08/08 23:30:57 itojun Exp
|
||||
$KAME: BUGS.TODO,v 1.2 2000/07/24 01:00:28 itojun Exp $
|
||||
|
||||
THIS LIST IS FAR AWAY FROM BEING COMPLETE, so these are the few things
|
||||
that came up at the right moment to be written down.
|
||||
|
@ -1,4 +1,7 @@
|
||||
/*
|
||||
/* $NetBSD: LICENSE.pimd,v 1.2 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: LICENSE.pimd,v 1.2 2000/07/24 01:00:28 itojun Exp $ */
|
||||
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -33,8 +36,6 @@
|
||||
/*
|
||||
* Questions concerning this software should be directed to
|
||||
* Pavlin Ivanov Radoslavov (pavlin@catarina.usc.edu)
|
||||
*
|
||||
* KAME Id: LICENSE.pimd,v 1.1.1.1 1999/08/08 23:30:57 itojun Exp
|
||||
*/
|
||||
/*
|
||||
* Part of this program has been derived from mrouted.
|
||||
|
@ -1,4 +1,4 @@
|
||||
KAME Id: README,v 1.1.1.1 1999/08/08 23:30:57 itojun Exp
|
||||
$KAME: README,v 1.2 2000/07/24 01:00:28 itojun Exp $
|
||||
|
||||
WARNING! WARNING! WARNING!
|
||||
THIS RELEASE IS VERY ALPHA, SO PLEASE DO NOT REDISTRIBUTE AND
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: callout.c,v 1.1 2000/01/28 19:32:46 itojun Exp $ */
|
||||
/* $NetBSD: callout.c,v 1.2 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: callout.c,v 1.6 2000/12/04 06:45:28 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* The mrouted program is covered by the license in the accompanying file
|
||||
@ -32,8 +33,9 @@
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <stdlib.h>
|
||||
#include "debug.h"
|
||||
#include <unistd.h>
|
||||
#include "defs.h"
|
||||
#include "debug.h"
|
||||
#include "callout.h"
|
||||
|
||||
/* the code below implements a callout queue */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: callout.h,v 1.1 2000/01/28 19:32:46 itojun Exp $ */
|
||||
/* $NetBSD: callout.h,v 1.2 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: callout.h,v 1.4 2000/12/04 06:45:28 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -50,8 +51,6 @@
|
||||
#ifndef CALLOUT_H
|
||||
#define CALLOUT_H
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
extern void callout_init __P((void));
|
||||
extern void free_all_callouts __P((void));
|
||||
extern void age_callout_queue __P((int));
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: cfparse.h,v 1.1 2000/01/28 19:32:46 itojun Exp $ */
|
||||
/* $NetBSD: cfparse.h,v 1.2 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: cfparse.h,v 1.2 2000/12/04 06:45:28 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 WIDE Project.
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: cfparse.y,v 1.2 2000/05/19 10:43:46 itojun Exp $ */
|
||||
/* $NetBSD: cfparse.y,v 1.3 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: cfparse.y,v 1.13 2000/12/04 06:45:28 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 WIDE Project.
|
||||
@ -30,17 +31,21 @@
|
||||
*/
|
||||
%{
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <syslog.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "defs.h"
|
||||
#include "rp.h"
|
||||
#include "vif.h"
|
||||
#include "mrt.h"
|
||||
#include "rp.h"
|
||||
|
||||
#include "var.h"
|
||||
#include "vmbuf.h"
|
||||
@ -641,6 +646,10 @@ phyint_config()
|
||||
}
|
||||
}
|
||||
|
||||
/* IPv6 PIM needs one global unicast address (at least for now) */
|
||||
if (max_global_address() == NULL)
|
||||
log(LOG_ERR, 0, "There's no global address available");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@ -689,7 +698,7 @@ rp_config()
|
||||
}
|
||||
|
||||
if (!sa6_rp)
|
||||
sa6_rp = max_global_address(); /* this MUST suceed */
|
||||
sa6_rp = max_global_address(); /* this MUST succeed */
|
||||
my_cand_rp_address = *sa6_rp;
|
||||
|
||||
/*
|
||||
@ -790,7 +799,7 @@ bsr_config()
|
||||
}
|
||||
|
||||
if (!sa6_bsr)
|
||||
sa6_bsr = max_global_address(); /* this MUST suceed */
|
||||
sa6_bsr = max_global_address(); /* this MUST succeed */
|
||||
my_bsr_address = *sa6_bsr;
|
||||
MASKLEN_TO_MASK6(my_bsr_hash_masklen, my_bsr_hash_mask);
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: cftoken.l,v 1.3 2000/10/06 00:13:02 itojun Exp $ */
|
||||
/* $NetBSD: cftoken.l,v 1.4 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: cftoken.l,v 1.8 2000/12/04 06:45:29 itojun Exp $ */
|
||||
|
||||
%{
|
||||
/*
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: config.c,v 1.3 2000/05/19 10:43:47 itojun Exp $ */
|
||||
/* $NetBSD: config.c,v 1.4 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: config.c,v 1.22 2000/12/04 06:45:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -59,29 +60,39 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <syslog.h>
|
||||
#include <stdlib.h>
|
||||
#include "vif.h"
|
||||
#include "pim6.h"
|
||||
#include "inet6.h"
|
||||
#include "rp.h"
|
||||
#include "pimd.h"
|
||||
#include "timer.h"
|
||||
#include "route.h"
|
||||
#include <sys/socket.h>
|
||||
#include <sys/queue.h>
|
||||
#include <net/if.h>
|
||||
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
|
||||
#include <net/if_var.h>
|
||||
#endif
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <netinet6/in6_var.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <syslog.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_GETIFADDRS
|
||||
#include <ifaddrs.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include "config.h"
|
||||
#include <arpa/inet.h>
|
||||
#include <stdio.h>
|
||||
#include "defs.h"
|
||||
#include "config.h"
|
||||
#include "vif.h"
|
||||
#include "pim6.h"
|
||||
#include "inet6.h"
|
||||
#include "mrt.h"
|
||||
#include "rp.h"
|
||||
#include "pimd.h"
|
||||
#include "timer.h"
|
||||
#include "route.h"
|
||||
#include "debug.h"
|
||||
|
||||
void add_phaddr(struct uvif *v, struct sockaddr_in6 *addr,
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: config.h,v 1.1 2000/01/28 19:32:47 itojun Exp $ */
|
||||
/* $NetBSD: config.h,v 1.2 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: config.h,v 1.4 2000/12/04 06:45:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: crc.c,v 1.1 2000/01/28 19:32:47 itojun Exp $ */
|
||||
/* $NetBSD: crc.c,v 1.2 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: crc.c,v 1.4 2000/12/04 06:45:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: crc.h,v 1.1 2000/01/28 19:32:47 itojun Exp $ */
|
||||
/* $NetBSD: crc.h,v 1.2 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: crc.h,v 1.4 2000/12/04 06:45:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: debug.c,v 1.6 2000/10/12 06:33:23 augustss Exp $ */
|
||||
/* $NetBSD: debug.c,v 1.7 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: debug.c,v 1.44 2000/12/04 06:45:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -58,21 +59,22 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <errno.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet/icmp6.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <netinet6/pim6.h>
|
||||
#include "pathnames.h"
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
#include "defs.h"
|
||||
#include "pathnames.h"
|
||||
#include "pimd.h"
|
||||
#include "debug.h"
|
||||
#include "mrt.h"
|
||||
@ -512,6 +514,7 @@ dump_nbrs(fp)
|
||||
struct uvif *v;
|
||||
vifi_t vifi;
|
||||
pim_nbr_entry_t *n;
|
||||
struct phaddr *pa;
|
||||
|
||||
fprintf(fp, "PIM Neighbor List\n");
|
||||
fprintf(fp, " %-3s %6s %-40s %-5s\n",
|
||||
@ -530,8 +533,12 @@ dump_nbrs(fp)
|
||||
else
|
||||
fprintf(fp, " %3s %6s", "", "");
|
||||
fprintf(fp, " %-40s %-5u\n",
|
||||
inet6_fmt(&n->address.sin6_addr),
|
||||
n->timer);
|
||||
sa6_fmt(&n->address), n->timer);
|
||||
|
||||
for (pa = n->aux_addrs; pa; pa = pa->pa_next) {
|
||||
fprintf(fp, "%16s%s\n", "",
|
||||
sa6_fmt(&pa->pa_addr));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -960,16 +967,20 @@ dump_rp_set(fp)
|
||||
cand_rp_t *rp;
|
||||
rp_grp_entry_t *rp_grp_entry;
|
||||
grp_mask_t *grp_mask;
|
||||
int print_upstream;
|
||||
|
||||
fprintf(fp, "---------------------------RP-Set----------------------------\n");
|
||||
fprintf(fp, "Current BSR address: %s Prio: %d Timeout: %d\n",
|
||||
inet6_fmt(&curr_bsr_address.sin6_addr), curr_bsr_priority,
|
||||
pim_bootstrap_timer);
|
||||
fprintf(fp, "%-40s %-3s Group prefix Prio Hold Age\n",
|
||||
"RP-address", "IN");
|
||||
"RP-address/Upstream", "IN");
|
||||
|
||||
for (rp = cand_rp_list; rp != (cand_rp_t *) NULL; rp = rp->next)
|
||||
{
|
||||
char *upstream_str;
|
||||
|
||||
print_upstream = 0;
|
||||
|
||||
fprintf(fp, "%-40s %-3d ",
|
||||
inet6_fmt(&rp->rpentry->address.sin6_addr),
|
||||
@ -983,17 +994,31 @@ dump_rp_set(fp)
|
||||
rp_grp_entry->priority, rp_grp_entry->advholdtime,
|
||||
rp_grp_entry->holdtime);
|
||||
|
||||
if (rp->rpentry->upstream != NULL)
|
||||
upstream_str = sa6_fmt(&rp->rpentry->upstream->address);
|
||||
else
|
||||
upstream_str = "(none)";
|
||||
|
||||
for (rp_grp_entry = rp_grp_entry->rp_grp_next;
|
||||
rp_grp_entry != (rp_grp_entry_t *) NULL;
|
||||
rp_grp_entry = rp_grp_entry->rp_grp_next)
|
||||
{
|
||||
grp_mask = rp_grp_entry->group;
|
||||
fprintf(fp, "%59.16s %-4u %-4u %-3u\n", /* XXX: hardcoding */
|
||||
/* XXX: hardcoding */
|
||||
if (print_upstream == 0) {
|
||||
fprintf(fp, " %-38s", upstream_str);
|
||||
print_upstream = 1;
|
||||
}
|
||||
else
|
||||
fprintf(fp, " %38s", "");
|
||||
fprintf(fp, "%4s %-16.16s %-4u %-4u %-3u\n", "",
|
||||
net6name(&grp_mask->group_addr.sin6_addr,
|
||||
&grp_mask->group_mask),
|
||||
rp_grp_entry->priority,
|
||||
rp_grp_entry->advholdtime, rp_grp_entry->holdtime);
|
||||
}
|
||||
if (print_upstream == 0)
|
||||
fprintf(fp, " %-38s\n", upstream_str);
|
||||
}
|
||||
}
|
||||
return (TRUE);
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: debug.h,v 1.3 2000/10/11 20:23:54 is Exp $ */
|
||||
/* $NetBSD: debug.h,v 1.4 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: debug.h,v 1.11 2000/12/04 06:45:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -49,9 +50,6 @@
|
||||
|
||||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern unsigned long debug;
|
||||
extern int log_nmsgs;
|
||||
extern FILE *log_fp;
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: defs.h,v 1.1 2000/01/28 19:32:47 itojun Exp $ */
|
||||
/* $NetBSD: defs.h,v 1.2 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: defs.h,v 1.4 2000/12/04 06:45:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -49,8 +50,6 @@
|
||||
#ifndef DEFS_H
|
||||
#define DEFS_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#define ELSE else /* To make emacs cc-mode happy */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: inet6.c,v 1.2 2000/05/19 10:43:47 itojun Exp $ */
|
||||
/* $NetBSD: inet6.c,v 1.3 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: inet6.c,v 1.9 2000/12/04 06:45:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1998 WIDE Project.
|
||||
@ -47,6 +48,12 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/param.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <stdio.h>
|
||||
#include <netdb.h>
|
||||
#include <string.h>
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: inet6.h,v 1.2 2000/05/19 10:43:48 itojun Exp $ */
|
||||
/* $NetBSD: inet6.h,v 1.3 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: inet6.h,v 1.6 2000/12/04 06:45:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -48,7 +49,6 @@
|
||||
|
||||
#ifndef INET6_H
|
||||
#define INET6_H
|
||||
#include "vif.h"
|
||||
|
||||
extern int numerichost;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: kern.c,v 1.1 2000/01/28 19:32:48 itojun Exp $ */
|
||||
/* $NetBSD: kern.c,v 1.2 2000/12/04 07:09:35 itojun Exp $ */
|
||||
/* $KAME: kern.c,v 1.7 2000/12/04 06:45:30 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -49,22 +50,28 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <errno.h>
|
||||
#include <sys/queue.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
|
||||
#include <net/if_var.h>
|
||||
#endif
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <netinet6/in6_var.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "defs.h"
|
||||
#include "pimd.h"
|
||||
#include "vif.h"
|
||||
#include "inet6.h"
|
||||
#include "vif.h"
|
||||
#include "mrt.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: kern.h,v 1.1 2000/01/28 19:32:48 itojun Exp $ */
|
||||
/* $NetBSD: kern.h,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: kern.h,v 1.5 2000/12/04 06:45:30 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -48,8 +49,6 @@
|
||||
|
||||
#ifndef KERN_H
|
||||
#define KERN_H
|
||||
#include "vif.h"
|
||||
#include "mrt.h"
|
||||
|
||||
extern void k_set_rcvbuf __P((int socket, int bufsize, int minsize));
|
||||
extern void k_set_hlim __P((int socket, int t));
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: main.c,v 1.4 2000/10/12 06:33:24 augustss Exp $ */
|
||||
/* $NetBSD: main.c,v 1.5 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: main.c,v 1.14 2000/12/04 07:01:08 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -58,8 +59,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@ -67,6 +75,7 @@
|
||||
#include <string.h>
|
||||
#include <syslog.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include "pathnames.h"
|
||||
#include "defs.h"
|
||||
#include "debug.h"
|
||||
@ -80,6 +89,7 @@
|
||||
#include "rp.h"
|
||||
#include "kern.h"
|
||||
#include "cfparse.h"
|
||||
#include "pim6_proto.h"
|
||||
|
||||
char configfilename[256] = _PATH_PIM6D_CONF;
|
||||
char versionstring[100];
|
||||
@ -674,17 +684,25 @@ timer(i)
|
||||
static void
|
||||
cleanup()
|
||||
{
|
||||
vifi_t vifi;
|
||||
struct uvif *v;
|
||||
|
||||
/* inform all neighbors that I'm going to die */
|
||||
for (vifi = 0, v = uvifs; vifi < numvifs; ++vifi, ++v) {
|
||||
if ((v->uv_flags & (VIFF_DOWN|VIFF_DISABLED|MIFF_REGISTER)) == 0)
|
||||
send_pim6_hello(v, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: XXX (not in the spec): if I am the BSR, somehow inform the other
|
||||
* routers I am going down and need to elect another BSR? (probably by
|
||||
* sending a the Cand-RP-set with my_priority=LOWEST?)
|
||||
*
|
||||
*/
|
||||
|
||||
k_stop_pim(mld6_socket);
|
||||
}
|
||||
*/
|
||||
;
|
||||
|
||||
k_stop_pim(mld6_socket);
|
||||
}
|
||||
|
||||
/*
|
||||
* Signal handler. Take note of the fact that the signal arrived so that the
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: mld6.c,v 1.6 2000/10/12 06:33:24 augustss Exp $ */
|
||||
/* $NetBSD: mld6.c,v 1.7 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: mld6.c,v 1.29 2000/12/04 06:45:30 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1998 WIDE Project.
|
||||
@ -78,19 +79,27 @@
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/uio.h>
|
||||
#include <errno.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/icmp6.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet/ip6.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "defs.h"
|
||||
#include "vif.h"
|
||||
#include "mrt.h"
|
||||
#include "mld6.h"
|
||||
#include "kern.h"
|
||||
#include "defs.h"
|
||||
#include "inet6.h"
|
||||
#include "debug.h"
|
||||
#include "mld6_proto.h"
|
||||
@ -168,7 +177,13 @@ init_mld6()
|
||||
k_set_rcvbuf(mld6_socket, SO_RECV_BUF_SIZE_MAX,
|
||||
SO_RECV_BUF_SIZE_MIN); /* lots of input buffering */
|
||||
k_set_hlim(mld6_socket, MINHLIM); /* restrict multicasts to one hop */
|
||||
#if 0
|
||||
/*
|
||||
* Since we don't have to handle DMVRP messages via the MLD6 socket,
|
||||
* we can just let outgoing multicast packets be loop-backed.
|
||||
*/
|
||||
k_set_loop(mld6_socket, FALSE); /* disable multicast loopback */
|
||||
#endif
|
||||
|
||||
/* address initialization */
|
||||
allnodes_group.sin6_addr = in6addr_linklocal_allnodes;
|
||||
@ -473,7 +488,7 @@ make_mld6_msg(type, code, src, dst, group, ifindex, delay, datalen, alert)
|
||||
if (ifindex != -1 || src) {
|
||||
struct in6_pktinfo *pktinfo;
|
||||
|
||||
cmsgp->cmsg_len = CMSG_SPACE(sizeof(struct in6_pktinfo));
|
||||
cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
|
||||
cmsgp->cmsg_level = IPPROTO_IPV6;
|
||||
cmsgp->cmsg_type = IPV6_PKTINFO;
|
||||
pktinfo = (struct in6_pktinfo *)CMSG_DATA(cmsgp);
|
||||
@ -489,7 +504,7 @@ make_mld6_msg(type, code, src, dst, group, ifindex, delay, datalen, alert)
|
||||
int currentlen;
|
||||
void *hbhbuf, *optp = NULL;
|
||||
|
||||
cmsgp->cmsg_len = CMSG_SPACE(hbhlen);
|
||||
cmsgp->cmsg_len = CMSG_LEN(hbhlen);
|
||||
cmsgp->cmsg_level = IPPROTO_IPV6;
|
||||
cmsgp->cmsg_type = IPV6_HOPOPTS;
|
||||
hbhbuf = CMSG_DATA(cmsgp);
|
||||
@ -533,15 +548,11 @@ send_mld6(type, code, src, dst, group, index, delay, datalen, alert)
|
||||
int index, delay, alert;
|
||||
int datalen; /* for trace packets only */
|
||||
{
|
||||
int setloop = 0;
|
||||
struct sockaddr_in6 *dstp;
|
||||
|
||||
make_mld6_msg(type, code, src, dst, group, index, delay, datalen, alert);
|
||||
dstp = (struct sockaddr_in6 *)sndmh.msg_name;
|
||||
if (IN6_ARE_ADDR_EQUAL(&dstp->sin6_addr, &allnodes_group.sin6_addr)) {
|
||||
setloop = 1;
|
||||
k_set_loop(mld6_socket, TRUE);
|
||||
}
|
||||
|
||||
if (sendmsg(mld6_socket, &sndmh, 0) < 0) {
|
||||
if (errno == ENETDOWN)
|
||||
check_vif_state();
|
||||
@ -552,8 +563,6 @@ send_mld6(type, code, src, dst, group, index, delay, datalen, alert)
|
||||
src ? inet6_fmt(&src->sin6_addr) : "(unspec)",
|
||||
ifindex2str(index));
|
||||
|
||||
if (setloop)
|
||||
k_set_loop(mld6_socket, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: mld6.h,v 1.2 2000/05/19 10:43:48 itojun Exp $ */
|
||||
/* $NetBSD: mld6.h,v 1.3 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: mld6.h,v 1.8 2000/12/04 06:45:30 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1998 WIDE Project.
|
||||
@ -49,11 +50,6 @@
|
||||
#ifndef MLD6_H
|
||||
#define MLD6_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define RECV_BUF_SIZE 64*1024
|
||||
#define SO_RECV_BUF_SIZE_MAX 256*1024
|
||||
#define SO_RECV_BUF_SIZE_MIN 48*1024
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: mld6_proto.c,v 1.3 2000/10/12 06:33:24 augustss Exp $ */
|
||||
/* $NetBSD: mld6_proto.c,v 1.4 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: mld6_proto.c,v 1.13 2000/12/04 06:45:30 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1998 WIDE Project.
|
||||
@ -95,20 +96,26 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <netinet/icmp6.h>
|
||||
#include <syslog.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "defs.h"
|
||||
#include "mld6.h"
|
||||
#include "vif.h"
|
||||
#include "debug.h"
|
||||
#include "inet6.h"
|
||||
#include "mrt.h"
|
||||
#include "route.h"
|
||||
#include "callout.h"
|
||||
#include "timer.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: mld6_proto.h,v 1.1 2000/01/28 19:32:49 itojun Exp $ */
|
||||
/* $NetBSD: mld6_proto.h,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: mld6_proto.h,v 1.4 2000/12/04 06:45:30 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -49,8 +50,6 @@
|
||||
#ifndef MLD6_PROTO_H
|
||||
#define MLD6_PROTO_H
|
||||
|
||||
#include "vif.h"
|
||||
|
||||
extern void query_groups __P((struct uvif *v));
|
||||
extern int check_grp_membership __P((struct uvif *v,
|
||||
struct sockaddr_in6 *group));
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: mrt.c,v 1.3 2000/05/19 10:43:49 itojun Exp $ */
|
||||
/* $NetBSD: mrt.c,v 1.4 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: mrt.c,v 1.6 2000/12/04 06:45:30 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -49,9 +50,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <syslog.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "defs.h"
|
||||
#include "mrt.h"
|
||||
#include "vif.h"
|
||||
#include "rp.h"
|
||||
@ -815,7 +825,7 @@ create_grpentry(group)
|
||||
|
||||
/*
|
||||
* Return TRUE if the entry is found and then *mrtPtr is set to point to that
|
||||
* entry. Otherwise return FALSE and *mrtPtr points the the previous entry
|
||||
* entry. Otherwise return FALSE and *mrtPtr points the previous entry
|
||||
* (or NULL if first in the chain.
|
||||
*/
|
||||
static int
|
||||
@ -852,7 +862,7 @@ search_srcmrtlink(srcentry_ptr, group, mrtPtr)
|
||||
|
||||
/*
|
||||
* Return TRUE if the entry is found and then *mrtPtr is set to point to that
|
||||
* entry. Otherwise return FALSE and *mrtPtr points the the previous entry
|
||||
* entry. Otherwise return FALSE and *mrtPtr points the previous entry
|
||||
* (or NULL if first in the chain.
|
||||
*/
|
||||
static int
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: mrt.h,v 1.1 2000/01/28 19:32:49 itojun Exp $ */
|
||||
/* $NetBSD: mrt.h,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: mrt.h,v 1.8 2000/12/04 06:45:30 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -53,18 +54,6 @@
|
||||
#ifndef MRT_H
|
||||
#define MRT_H
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <string.h>
|
||||
#include "defs.h"
|
||||
|
||||
|
||||
/* flags for the mrt entries */
|
||||
|
||||
#define MRTF_SPT 0x0001 /* iif toward source */
|
||||
@ -153,16 +142,16 @@ typedef struct build_jp_message {
|
||||
|
||||
|
||||
typedef struct pim_nbr_entry {
|
||||
struct pim_nbr_entry *next; /* link to next neighbor */
|
||||
struct pim_nbr_entry *prev; /* link to prev neighbor */
|
||||
struct sockaddr_in6 address; /* neighbor address */
|
||||
vifi_t vifi; /* which interface */
|
||||
u_int16 timer; /* for timing out neighbor */
|
||||
build_jp_message_t *build_jp_message; /* A structure for fairly
|
||||
* complicated Join/Prune
|
||||
* message construction.
|
||||
*/
|
||||
|
||||
struct pim_nbr_entry *next; /* link to next neighbor */
|
||||
struct pim_nbr_entry *prev; /* link to prev neighbor */
|
||||
struct sockaddr_in6 address; /* (primary) neighbor address */
|
||||
struct phaddr *aux_addrs; /* additional addresses */
|
||||
vifi_t vifi; /* which interface */
|
||||
u_int16 timer; /* for timing out neighbor */
|
||||
build_jp_message_t *build_jp_message; /* A structure for fairly
|
||||
* complicated Join/Prune
|
||||
* message construction.
|
||||
*/
|
||||
} pim_nbr_entry_t;
|
||||
|
||||
typedef struct srcentry {
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: pathnames.h,v 1.1 2000/01/28 19:32:49 itojun Exp $ */
|
||||
/* $NetBSD: pathnames.h,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: pathnames.h,v 1.8 2000/12/04 06:45:30 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -61,7 +62,7 @@
|
||||
#ifndef PATHNAMES_H
|
||||
#define PATHNAMES_H
|
||||
|
||||
#define _PATH_PIM6D_CONF "/etc/pim6sd.conf"
|
||||
#define _PATH_PIM6D_CONF "/usr/local/v6/etc/pim6sd.conf"
|
||||
#define _PATH_PIM6D_LOGFILE "/var/log/pim6sd.log"
|
||||
|
||||
#if (defined(BSD) && (BSD >= 199103))
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: pim6.c,v 1.2 2000/02/28 07:14:05 itojun Exp $ */
|
||||
/* $NetBSD: pim6.c,v 1.3 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: pim6.c,v 1.14 2000/12/04 06:45:30 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -77,18 +78,24 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/uio.h>
|
||||
#include <errno.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <string.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <netinet6/pim6.h>
|
||||
#include <netinet/ip6.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
#include <signal.h>
|
||||
#include "mld6.h"
|
||||
#include <stdio.h>
|
||||
#include "defs.h"
|
||||
#include "vif.h"
|
||||
#include "mrt.h"
|
||||
#include "mld6.h"
|
||||
#include "kern.h"
|
||||
#include "pim6.h"
|
||||
#include "pimd.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: pim6.h,v 1.1 2000/01/28 19:32:49 itojun Exp $ */
|
||||
/* $NetBSD: pim6.h,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: pim6.h,v 1.5 2000/12/04 06:45:31 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -49,14 +50,6 @@
|
||||
#ifndef PIM6_H
|
||||
#define PIM6_H
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <netinet/in.h>
|
||||
#include <unistd.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
|
||||
extern struct sockaddr_in6 allpim6routers_group;
|
||||
extern char *pim6_send_buf;
|
||||
extern int pim6_socket;
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: pim6_proto.c,v 1.2 2000/05/19 10:43:49 itojun Exp $ */
|
||||
/* $NetBSD: pim6_proto.c,v 1.3 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: pim6_proto.c,v 1.37 2000/12/04 06:45:31 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -107,13 +108,20 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/pim6.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <netinet/ip6.h>
|
||||
#include <syslog.h>
|
||||
#include <stdlib.h>
|
||||
#include "mrt.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "defs.h"
|
||||
#include "mrt.h"
|
||||
#include "vif.h"
|
||||
#include "debug.h"
|
||||
#include "pim6.h"
|
||||
@ -127,13 +135,19 @@
|
||||
#include "kern.h"
|
||||
#include "routesock.h"
|
||||
|
||||
struct pim_hello_options {
|
||||
int holdtime; /* mandatory */
|
||||
struct phaddr *addrs; /* additional addresses (experimental) */
|
||||
};
|
||||
|
||||
/*
|
||||
* Local functions definitions.
|
||||
*/
|
||||
|
||||
static int parse_pim6_hello __P((char *pktPtr , int datalen , struct sockaddr_in6 *src,
|
||||
u_int16 *holdtime));
|
||||
|
||||
static int parse_pim6_hello __P((char *pktPtr, int datalen,
|
||||
struct sockaddr_in6 *src,
|
||||
struct pim_hello_options *));
|
||||
static void set_pim6_nbr_param __P((pim_nbr_entry_t *,
|
||||
struct pim_hello_options *));
|
||||
static int send_pim6_register_stop __P((struct sockaddr_in6 *reg_src , struct sockaddr_in6 *reg_dst ,
|
||||
struct sockaddr_in6 *inner_source,
|
||||
struct sockaddr_in6 *inner_grp));
|
||||
@ -175,7 +189,9 @@ receive_pim6_hello(src, pim_message, datalen)
|
||||
u_int8 *data_ptr;
|
||||
srcentry_t *srcentry_ptr;
|
||||
mrtentry_t *mrtentry_ptr;
|
||||
|
||||
struct pim_hello_options hopts;
|
||||
struct phaddr *addr, *naddr;
|
||||
int result = TRUE;
|
||||
|
||||
if ((mifi = find_vif_direct(src)) == NO_VIF)
|
||||
{
|
||||
@ -197,10 +213,13 @@ receive_pim6_hello(src, pim_message, datalen)
|
||||
|
||||
data_ptr = (u_int8 *) (pim_message + sizeof(struct pim));
|
||||
|
||||
/* Get the Holdtime (in seconds) from the message. Return if error. */
|
||||
|
||||
if (parse_pim6_hello(pim_message, datalen, src, &holdtime) == FALSE)
|
||||
return (FALSE);
|
||||
/* Get Hello options (including Holdtime in seconds) from the message. */
|
||||
memset(&hopts, 0, sizeof(hopts));
|
||||
if (parse_pim6_hello(pim_message, datalen, src, &hopts) == FALSE) {
|
||||
result = FALSE;
|
||||
goto end;
|
||||
}
|
||||
holdtime = hopts.holdtime;
|
||||
IF_DEBUG(DEBUG_PIM_HELLO | DEBUG_PIM_TIMER)
|
||||
log(LOG_DEBUG, 0, "PIM HELLO holdtime from %s is %u",
|
||||
inet6_fmt(&src->sin6_addr), holdtime);
|
||||
@ -228,14 +247,13 @@ receive_pim6_hello(src, pim_message, datalen)
|
||||
* wants to inform us by sending "holdtime=0". Thanks buddy
|
||||
* and see you again!
|
||||
*/
|
||||
|
||||
log(LOG_INFO, 0, "PIM HELLO received: neighbor %s going down",
|
||||
inet6_fmt(&src->sin6_addr));
|
||||
delete_pim6_nbr(nbr);
|
||||
return (TRUE);
|
||||
goto end;
|
||||
}
|
||||
SET_TIMER(nbr->timer, holdtime);
|
||||
return (TRUE);
|
||||
set_pim6_nbr_param(nbr, &hopts);
|
||||
goto end;
|
||||
}
|
||||
else
|
||||
/*
|
||||
@ -253,7 +271,7 @@ receive_pim6_hello(src, pim_message, datalen)
|
||||
new_nbr = (pim_nbr_entry_t *) malloc(sizeof(pim_nbr_entry_t));
|
||||
new_nbr->address = *src;
|
||||
new_nbr->vifi = mifi;
|
||||
SET_TIMER(new_nbr->timer, holdtime);
|
||||
set_pim6_nbr_param(new_nbr, &hopts);
|
||||
new_nbr->build_jp_message = (build_jp_message_t *) NULL;
|
||||
new_nbr->next = nbr;
|
||||
new_nbr->prev = prev_nbr;
|
||||
@ -284,12 +302,12 @@ receive_pim6_hello(src, pim_message, datalen)
|
||||
*/
|
||||
|
||||
if ((bsr_length = create_pim6_bootstrap_message(pim6_send_buf)))
|
||||
send_pim6(pim6_send_buf, &v->uv_linklocal->pa_addr , src , PIM_BOOTSTRAP,
|
||||
bsr_length);
|
||||
|
||||
send_pim6(pim6_send_buf, &v->uv_linklocal->pa_addr, src,
|
||||
PIM_BOOTSTRAP, bsr_length);
|
||||
|
||||
/* The router with highest network address is the elected DR */
|
||||
if (inet6_lessthan(&v->uv_linklocal->pa_addr,&v->uv_pim_neighbors->address))
|
||||
if (inet6_lessthan(&v->uv_linklocal->pa_addr,
|
||||
&v->uv_pim_neighbors->address))
|
||||
{
|
||||
/*
|
||||
* I was the DR, but not anymore. Remove all register_vif from
|
||||
@ -329,12 +347,44 @@ receive_pim6_hello(src, pim_message, datalen)
|
||||
* TODO: XXX: does a new neighbor change any routing entries info? Need
|
||||
* to trigger joins?
|
||||
*/
|
||||
|
||||
IF_DEBUG(DEBUG_PIM_HELLO)
|
||||
log(LOG_DEBUG,0,"I'have got a new neighbor %s on vif %s",inet6_fmt(&src->sin6_addr),v->uv_name);
|
||||
return (TRUE);
|
||||
log(LOG_DEBUG, 0, "I've got a new neighbor %s on vif %s",
|
||||
inet6_fmt(&src->sin6_addr), v->uv_name);
|
||||
|
||||
end:
|
||||
/* free all temporary option data and return */
|
||||
for (addr = hopts.addrs; addr; addr = naddr) {
|
||||
naddr = addr->pa_next;
|
||||
free(addr);
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
static void
|
||||
set_pim6_nbr_param(nbr, opts)
|
||||
pim_nbr_entry_t *nbr;
|
||||
struct pim_hello_options *opts;
|
||||
{
|
||||
struct phaddr *pa, *next_pa;
|
||||
|
||||
if (opts == NULL)
|
||||
return;
|
||||
|
||||
/* set holdtime */
|
||||
SET_TIMER(nbr->timer, opts->holdtime);
|
||||
|
||||
/*
|
||||
* Replace addtional addresses.
|
||||
* XXX: we just replace them, but should we do something special if
|
||||
* there's change in the list?
|
||||
*/
|
||||
for (pa = nbr->aux_addrs; pa; pa = next_pa) {
|
||||
next_pa = pa->pa_next;
|
||||
free(pa);
|
||||
}
|
||||
nbr->aux_addrs = opts->addrs;
|
||||
opts->addrs = NULL; /* copied */
|
||||
}
|
||||
|
||||
void
|
||||
delete_pim6_nbr(nbr_delete)
|
||||
@ -350,6 +400,7 @@ delete_pim6_nbr(nbr_delete)
|
||||
rp_grp_entry_t *rp_grp_entry_ptr;
|
||||
rpentry_t *rpentry_ptr;
|
||||
struct uvif *v;
|
||||
struct phaddr *pa, *next_pa;
|
||||
|
||||
v = &uvifs[nbr_delete->vifi];
|
||||
|
||||
@ -506,24 +557,30 @@ delete_pim6_nbr(nbr_delete)
|
||||
}
|
||||
}
|
||||
|
||||
/* free additional addresses */
|
||||
for (pa = nbr_delete->aux_addrs; pa; pa = next_pa) {
|
||||
next_pa = pa->pa_next;
|
||||
free(pa);
|
||||
}
|
||||
free((char *) nbr_delete);
|
||||
}
|
||||
|
||||
|
||||
/* TODO: simplify it! */
|
||||
static int
|
||||
parse_pim6_hello(pim_message, datalen, src, holdtime)
|
||||
parse_pim6_hello(pim_message, datalen, src, opts)
|
||||
char *pim_message;
|
||||
int datalen;
|
||||
struct sockaddr_in6 *src;
|
||||
u_int16 *holdtime;
|
||||
struct pim_hello_options *opts;
|
||||
{
|
||||
u_int8 *pim_hello_message;
|
||||
u_int8 *data_ptr;
|
||||
u_int8 *data_ptr, *lim;
|
||||
u_int16 option_type;
|
||||
u_int16 option_length;
|
||||
int holdtime_received_ok = FALSE;
|
||||
int option_total_length;
|
||||
pim6_encod_uni_addr_t encod_uniaddr;
|
||||
|
||||
pim_hello_message = (u_int8 *) (pim_message + sizeof(struct pim));
|
||||
datalen -= sizeof(struct pim);
|
||||
@ -539,14 +596,57 @@ parse_pim6_hello(pim_message, datalen, src, holdtime)
|
||||
if (PIM_MESSAGE_HELLO_HOLDTIME_LENGTH != option_length)
|
||||
{
|
||||
IF_DEBUG(DEBUG_PIM_HELLO)
|
||||
log(LOG_DEBUG, 0,
|
||||
log(LOG_INFO, 0,
|
||||
"PIM HELLO Holdtime from %s: invalid OptionLength = %u",
|
||||
inet6_fmt(&src->sin6_addr), option_length);
|
||||
sa6_fmt(src), option_length);
|
||||
return (FALSE);
|
||||
}
|
||||
GET_HOSTSHORT(*holdtime, data_ptr);
|
||||
GET_HOSTSHORT(opts->holdtime, data_ptr);
|
||||
holdtime_received_ok = TRUE;
|
||||
break;
|
||||
case PIM_MESSAGE_HELLO_ADDRESSES:
|
||||
for (lim = data_ptr + option_length; data_ptr < lim; ) {
|
||||
struct phaddr *addr;
|
||||
|
||||
if (*data_ptr != ADDRF_IPv6) {
|
||||
log(LOG_INFO, 0,
|
||||
"PIM HELLO additional address from %s:"
|
||||
"unsupported address type (%d)",
|
||||
sa6_fmt(src), *data_ptr);
|
||||
return(FALSE); /* XXX: should skip */
|
||||
}
|
||||
if (data_ptr + 18 > lim) { /* 18 = sizeof(encoded ipv6 addr) */
|
||||
IF_DEBUG(DEBUG_PIM_HELLO)
|
||||
log(LOG_INFO, 0,
|
||||
"PIM HELLO additional address from %s: "
|
||||
"length inconsistent", sa6_fmt(src));
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
GET_EUADDR6(&encod_uniaddr, data_ptr);
|
||||
IF_DEBUG(DEBUG_PIM_HELLO)
|
||||
log(LOG_DEBUG, 0, "PIM HELLO additional address %s",
|
||||
inet6_fmt(&encod_uniaddr.unicast_addr));
|
||||
if (IN6_ARE_ADDR_EQUAL(&encod_uniaddr.unicast_addr,
|
||||
&src->sin6_addr)) {
|
||||
IF_DEBUG(DEBUG_PIM_HELLO)
|
||||
log(LOG_DEBUG, 0,
|
||||
" same as the neighbor's own address (ignored)");
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((addr = (struct phaddr *)malloc(sizeof(*addr))) == NULL)
|
||||
log(LOG_ERR, errno, "malloc failed in pim6 hello parsing");
|
||||
|
||||
/* XXX: we only use part of the structure */
|
||||
memset(addr, 0, sizeof(*addr));
|
||||
addr->pa_addr.sin6_family = AF_INET6;
|
||||
addr->pa_addr.sin6_len = sizeof(struct sockaddr_in6);
|
||||
addr->pa_addr.sin6_addr = encod_uniaddr.unicast_addr;
|
||||
addr->pa_next = opts->addrs;
|
||||
opts->addrs = addr;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* Ignore any unknown options */
|
||||
break;
|
||||
@ -568,26 +668,50 @@ parse_pim6_hello(pim_message, datalen, src, holdtime)
|
||||
datalen -= option_total_length;
|
||||
pim_hello_message += option_total_length;
|
||||
}
|
||||
|
||||
if (datalen != 0) /* malformed packet */
|
||||
return(FALSE);
|
||||
|
||||
/* holdtime is actually mandatory, so we return FALSE if not included. */
|
||||
return (holdtime_received_ok);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
send_pim6_hello(v, holdtime)
|
||||
struct uvif *v;
|
||||
u_int16 holdtime;
|
||||
{
|
||||
char *buf;
|
||||
u_int8 *data_ptr;
|
||||
u_int8 *data_ptr, *data_ptr0;
|
||||
struct phaddr *pa;
|
||||
|
||||
int datalen;
|
||||
|
||||
buf = pim6_send_buf + sizeof(struct pim);
|
||||
data_ptr = (u_int8 *) buf;
|
||||
|
||||
/* encode the holdtime option */
|
||||
PUT_HOSTSHORT(PIM_MESSAGE_HELLO_HOLDTIME, data_ptr);
|
||||
PUT_HOSTSHORT(PIM_MESSAGE_HELLO_HOLDTIME_LENGTH, data_ptr);
|
||||
PUT_HOSTSHORT(holdtime, data_ptr);
|
||||
|
||||
/* encode the additional addresses option (experimental) */
|
||||
data_ptr0 = data_ptr;
|
||||
data_ptr += 4; /* sizeof(type + length) */
|
||||
for (pa = v->uv_addrs; pa; pa = pa->pa_next) {
|
||||
if (inet6_equal(&v->uv_linklocal->pa_addr, &pa->pa_addr))
|
||||
continue;
|
||||
|
||||
PUT_EUADDR6(pa->pa_addr.sin6_addr, data_ptr);
|
||||
}
|
||||
if ((datalen = data_ptr - data_ptr0 - 4) > 0) {
|
||||
/* at least one address is encoded. */
|
||||
PUT_HOSTSHORT(PIM_MESSAGE_HELLO_ADDRESSES, data_ptr0);
|
||||
PUT_HOSTSHORT(datalen, data_ptr0);
|
||||
}
|
||||
else
|
||||
data_ptr = data_ptr0; /* rewind the pointer */
|
||||
|
||||
datalen = data_ptr - (u_int8 *) buf;
|
||||
|
||||
send_pim6(pim6_send_buf, &v->uv_linklocal->pa_addr,
|
||||
@ -626,6 +750,21 @@ receive_pim6_register(reg_src, reg_dst, pim_message, datalen)
|
||||
|
||||
pim6dstat.in_pim6_register++;
|
||||
|
||||
/*
|
||||
* Message length validation.
|
||||
* This is almost done in the kernel, but the kernel does not pefrome
|
||||
* the check for NULL register messages. Thus, we always check this for
|
||||
* safety.
|
||||
*/
|
||||
if (sizeof(struct pim) + sizeof(pim_register_t) +
|
||||
sizeof(struct ip6_hdr) > datalen) {
|
||||
IF_DEBUG(DEBUG_PIM_REGISTER)
|
||||
log(LOG_INFO, 0,
|
||||
"PIM register: short packet (len = %d) from %s",
|
||||
datalen, sa6_fmt(reg_src));
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
register_p = (pim_register_t *) (pim_message + sizeof(struct pim));
|
||||
|
||||
borderBit = ntohl(register_p->reg_flags) & PIM_MESSAGE_REGISTER_BORDER_BIT;
|
||||
@ -633,7 +772,18 @@ receive_pim6_register(reg_src, reg_dst, pim_message, datalen)
|
||||
ntohl(register_p->reg_flags) & PIM_MESSAGE_REGISTER_NULL_REGISTER_BIT;
|
||||
|
||||
/* initialize the pointer to the encapsulated packet */
|
||||
ip = (struct ip6_hdr *) (register_p + 1);
|
||||
ip = (struct ip6_hdr *)(register_p + 1);
|
||||
|
||||
/* check the IP version (especially for the null register...see above) */
|
||||
if ((ip->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) {
|
||||
IF_DEBUG(DEBUG_PIM_REGISTER)
|
||||
log(LOG_INFO, 0,
|
||||
"PIM register: incorrect IP version (%d) of the inner"
|
||||
" packet from %s",
|
||||
ip->ip6_vfc & IPV6_VERSION_MASK,
|
||||
sa6_fmt(reg_src));
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* We are keeping all addresses in network order,
|
||||
@ -1557,7 +1707,7 @@ receive_pim6_join_prune(src, dst, pim_message, datalen)
|
||||
if (my_action == PIM_ACTION_JOIN)
|
||||
{
|
||||
/* Override the Prune by scheduling a Join */
|
||||
jp_value = (RANDOM() % 11) / (10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT);
|
||||
jp_value = (RANDOM() % (int)(10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT)) / 10;
|
||||
/* TODO: XXX: TIMER implem. dependency! */
|
||||
if (mrtentry_rp->jp_timer > jp_value)
|
||||
SET_TIMER(mrtentry_rp->jp_timer, jp_value);
|
||||
@ -1577,7 +1727,13 @@ receive_pim6_join_prune(src, dst, pim_message, datalen)
|
||||
if (my_action == PIM_ACTION_JOIN)
|
||||
{
|
||||
|
||||
jp_value = (RANDOM() % 11) / (10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT);
|
||||
/*
|
||||
* make a random delay between 0 to
|
||||
* PIM_RANDOM_DELAY_JOIN_TIMEOUT.
|
||||
* Note that the default value of the random
|
||||
* delay is 4.5, thus we need to multiply 10.
|
||||
*/
|
||||
jp_value = (RANDOM() % (int)(10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT)) / 10;
|
||||
/* TODO: XXX: TIMER implem. dependency! */
|
||||
if (grpentry_ptr->grp_route->jp_timer >
|
||||
jp_value)
|
||||
@ -1592,7 +1748,7 @@ receive_pim6_join_prune(src, dst, pim_message, datalen)
|
||||
if (my_action == PIM_ACTION_JOIN)
|
||||
{
|
||||
|
||||
jp_value = (RANDOM() % 11) / (10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT);
|
||||
jp_value = (RANDOM() % (int)(10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT)) / 10;
|
||||
/* TODO: XXX: TIMER implem. dependency! */
|
||||
if (mrtentry_srcs->jp_timer > jp_value)
|
||||
SET_TIMER(mrtentry_srcs->jp_timer, jp_value);
|
||||
@ -1721,7 +1877,7 @@ receive_pim6_join_prune(src, dst, pim_message, datalen)
|
||||
if (my_action == PIM_ACTION_JOIN)
|
||||
{
|
||||
/* Override the Prune by scheduling a Join */
|
||||
jp_value = (RANDOM() % 11) / (10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT);
|
||||
jp_value = (RANDOM() % (int)(10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT)) / 10;
|
||||
/* TODO: XXX: TIMER implem. dependency! */
|
||||
if (mrtentry_ptr->jp_timer > jp_value)
|
||||
SET_TIMER(mrtentry_ptr->jp_timer, jp_value);
|
||||
@ -1740,7 +1896,7 @@ receive_pim6_join_prune(src, dst, pim_message, datalen)
|
||||
upstream_router);
|
||||
if (my_action == PIM_ACTION_JOIN)
|
||||
{
|
||||
jp_value = (RANDOM() % 11) / (10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT);
|
||||
jp_value = (RANDOM() % (int)(10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT)) / 10;
|
||||
/* TODO: XXX: TIMER implem. dependency! */
|
||||
if (mrtentry_ptr->jp_timer > jp_value)
|
||||
SET_TIMER(mrtentry_ptr->jp_timer, jp_value);
|
||||
@ -1771,7 +1927,7 @@ receive_pim6_join_prune(src, dst, pim_message, datalen)
|
||||
if (my_action == PIM_ACTION_JOIN)
|
||||
{
|
||||
/* Override the Prune by scheduling a Join */
|
||||
jp_value = (RANDOM() % 11) / (10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT);
|
||||
jp_value = (RANDOM() % (int)(10 * PIM_RANDOM_DELAY_JOIN_TIMEOUT)) / 10;
|
||||
/* TODO: XXX: TIMER implem. dependency! */
|
||||
if (mrtentry_ptr->jp_timer > jp_value)
|
||||
SET_TIMER(mrtentry_ptr->jp_timer, jp_value);
|
||||
@ -3582,7 +3738,7 @@ receive_pim6_bootstrap(src, dst, pim_message, datalen)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (local_address(dst) == NO_VIF)
|
||||
if (local_address(dst) == NO_VIF) {
|
||||
/*
|
||||
* TODO: XXX: this situation should be handled earlier: The
|
||||
* destination is neither ALL_PIM_ROUTERS nor me
|
||||
@ -3591,6 +3747,7 @@ receive_pim6_bootstrap(src, dst, pim_message, datalen)
|
||||
"receive_pim6_bootstrap: Bootstrap with an invalid dst(%s)",
|
||||
inet6_fmt(&dst->sin6_addr));
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* Probably unicasted from the current DR */
|
||||
if (cand_rp_list != (cand_rp_t *) NULL)
|
||||
@ -3633,13 +3790,12 @@ receive_pim6_bootstrap(src, dst, pim_message, datalen)
|
||||
|
||||
if (cand_rp_flag == TRUE)
|
||||
{
|
||||
/* If change in the BSR address, send immediately Cand-RP-Adv */
|
||||
/* If change in the BSR address, schedule immediate Cand-RP-Adv */
|
||||
/* TODO: use some random delay? */
|
||||
|
||||
if (!inet6_equal(&new_bsr_address , &curr_bsr_address))
|
||||
{
|
||||
send_pim6_cand_rp_adv();
|
||||
SET_TIMER(pim_cand_rp_adv_timer, my_cand_rp_adv_period);
|
||||
SET_TIMER(pim_cand_rp_adv_timer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: pim6_proto.h,v 1.1 2000/01/28 19:32:50 itojun Exp $ */
|
||||
/* $NetBSD: pim6_proto.h,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: pim6_proto.h,v 1.5 2000/12/04 06:45:31 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -51,9 +52,6 @@
|
||||
|
||||
#ifndef PIM6_PROTO_H
|
||||
#define PIM6_PROTO_H
|
||||
#include "defs.h"
|
||||
#include "vif.h"
|
||||
#include "mrt.h"
|
||||
|
||||
extern build_jp_message_t *build_jp_message_pool;
|
||||
extern int build_jp_message_pool_counter;
|
||||
|
@ -1,5 +1,6 @@
|
||||
.\" $NetBSD: pim6sd.8,v 1.3 2000/11/07 06:43:37 lukem Exp $
|
||||
.\"
|
||||
.\" $NetBSD: pim6sd.8,v 1.4 2000/12/04 07:09:36 itojun Exp $
|
||||
.\" $KAME: pim6sd.8,v 1.10 2000/12/04 06:39:29 itojun Exp $
|
||||
.\"
|
||||
.\" Copyright (C) 1999 WIDE Project.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
@ -27,8 +28,6 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" KAME Id: pim6sd.8,v 1.5 2000/05/05 14:57:14 sumikawa Exp
|
||||
.\"
|
||||
.Dd June 10, 1999
|
||||
.Dt PIM6SD 8
|
||||
.Os
|
||||
@ -153,4 +152,11 @@ daemon needs to run on the system.
|
||||
The kernel unicast routing table is periodically polled by
|
||||
.Nm
|
||||
in order to follow changes of existing unicast routes.
|
||||
.Pp
|
||||
.Nm
|
||||
must be used on an IPv6 router.
|
||||
Be sure to set
|
||||
.Li net.inet6.ip6.forwarding
|
||||
variable to 1 with
|
||||
.Xr sysctl 8 .
|
||||
.\"
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\" $NetBSD: pim6sd.conf.5,v 1.3 2000/07/10 08:58:31 itojun Exp $
|
||||
.\" $KAME: pim6sd.conf.5,v 1.13 2000/07/10 08:53:00 itojun Exp $
|
||||
.\" $NetBSD: pim6sd.conf.5,v 1.4 2000/12/04 07:09:36 itojun Exp $
|
||||
.\" $KAME: pim6sd.conf.5,v 1.14 2000/08/14 04:53:23 jinmei Exp $
|
||||
.\"
|
||||
.\" Copyright (C) 1999 WIDE Project.
|
||||
.\" All rights reserved.
|
||||
@ -135,8 +135,6 @@ listner on the interface.
|
||||
.Xc
|
||||
Specifies a default preference value when sending a PIM assert message.
|
||||
Preferences are used by assert elections to determine upstream routers.
|
||||
Specifies a default preference value when sending a PIM assert message.
|
||||
Preferences are used by assert elections to determine upstream routers.
|
||||
Currently
|
||||
.Xr pim6sd 8
|
||||
does not have an effective method to obtain preferences and metrics from the
|
||||
|
@ -1,4 +1,5 @@
|
||||
.\" $NetBSD: pim6stat.1,v 1.4 2000/11/07 06:43:37 lukem Exp $
|
||||
.\" $NetBSD: pim6stat.1,v 1.5 2000/12/04 07:09:36 itojun Exp $
|
||||
.\" $KAME: pim6stat.1,v 1.8 2000/12/04 06:28:26 itojun Exp $
|
||||
.\"
|
||||
.\" Copyright (C) 1999 WIDE Project.
|
||||
.\" All rights reserved.
|
||||
@ -27,8 +28,6 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" KAME Id: pim6stat.1,v 1.5 2000/05/05 14:57:14 sumikawa Exp
|
||||
.\"
|
||||
.Dd July 28, 1999
|
||||
.Dt PIM6STAT 1
|
||||
.Os
|
||||
@ -64,7 +63,7 @@ specifies the PID file of the currently running daemon.
|
||||
specifies to dump statistics instead of status (for sparse mode only).
|
||||
.It Fl w
|
||||
specifies the wait period in seconds between sending a signal to the
|
||||
daemon and outputs the dumpfile.
|
||||
daemon and dumping the status or statistics to the dumpfile.
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width /var/run/pim6sd.pidX -compact
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: pimd.h,v 1.1 2000/01/28 19:32:50 itojun Exp $ */
|
||||
/* $NetBSD: pimd.h,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: pimd.h,v 1.10 2000/12/04 06:45:31 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -52,11 +53,6 @@
|
||||
#ifndef PIMD_H
|
||||
#define PIMD_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include "defs.h"
|
||||
|
||||
#define PIM_PROTOCOL_VERSION 2
|
||||
|
||||
/* PIM protocol timers (in seconds) */
|
||||
@ -275,6 +271,9 @@ typedef struct pim_jp_encod_grp_ {
|
||||
#define PIM_MESSAGE_HELLO_HOLDTIME_LENGTH 2
|
||||
#define PIM_MESSAGE_HELLO_HOLDTIME_FOREVER 0xffff
|
||||
|
||||
/* PIM HELLO additional addresses option (experimental) */
|
||||
#define PIM_MESSAGE_HELLO_ADDRESSES 65001
|
||||
|
||||
/* PIM_REGISTER definitions */
|
||||
#define PIM_MESSAGE_REGISTER_BORDER_BIT 0x80000000
|
||||
#define PIM_MESSAGE_REGISTER_NULL_REGISTER_BIT 0x40000000
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: route.c,v 1.2 2000/07/23 23:05:38 mycroft Exp $ */
|
||||
/* $NetBSD: route.c,v 1.3 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: route.c,v 1.14 2000/12/04 06:45:31 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -50,7 +51,17 @@
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet/ip6.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include "defs.h"
|
||||
#include "pimd.h"
|
||||
#include "vif.h"
|
||||
#include "mrt.h"
|
||||
@ -62,8 +73,6 @@
|
||||
#include "kern.h"
|
||||
#include "timer.h"
|
||||
#include "inet6.h"
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <netinet/ip6.h>
|
||||
#include "routesock.h"
|
||||
|
||||
static void process_cache_miss __P((struct mrt6msg * im));
|
||||
@ -208,45 +217,54 @@ set_incoming(srcentry_ptr, srctype)
|
||||
/*
|
||||
* The upstream router must be a (PIM router) neighbor, otherwise we are
|
||||
* in big trouble ;-).
|
||||
* Yes but the neighbors are link-local and the rp is global ipv6..
|
||||
*/
|
||||
/* WARNING WARNING WARNING WARNING */
|
||||
/* If the router is directly connected to the RP and the RP is the BSR , the next hop is
|
||||
* the globally reachable addresse of the RP : NOT link local neighbor but
|
||||
* a ipv6 global neighbor...
|
||||
* the upstream router is the globally reachable router...
|
||||
*
|
||||
*/
|
||||
/* WARNING WARNING WARNING WARNING */
|
||||
|
||||
v = &uvifs[srcentry_ptr->incoming];
|
||||
if (inet6_equal(&source,&neighbor_addr))
|
||||
{
|
||||
srcentry_ptr->upstream=v->uv_pim_neighbors;
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
for (n = v->uv_pim_neighbors; n != NULL; n = n->next)
|
||||
{
|
||||
if (inet6_lessthan(&neighbor_addr,&n->address))
|
||||
struct phaddr *pa;
|
||||
|
||||
#if 0
|
||||
/* we must go through all entries for aux_addr match */
|
||||
if (inet6_lessthan(&neighbor_addr, &n->address))
|
||||
continue;
|
||||
if (inet6_equal(&neighbor_addr,&n->address))
|
||||
#endif
|
||||
if (inet6_equal(&neighbor_addr, &n->address))
|
||||
{
|
||||
/*
|
||||
* The upstream router is found in the list of neighbors. We are
|
||||
* safe!
|
||||
*/
|
||||
|
||||
srcentry_ptr->upstream = n;
|
||||
IF_DEBUG(DEBUG_RPF)
|
||||
log(LOG_DEBUG, 0,
|
||||
"For src %s, iif is %d, next hop router is %s",
|
||||
inet6_fmt(&source.sin6_addr), srcentry_ptr->incoming,
|
||||
inet6_fmt(&neighbor_addr.sin6_addr));
|
||||
sa6_fmt(&source), srcentry_ptr->incoming,
|
||||
sa6_fmt(&neighbor_addr));
|
||||
return (TRUE);
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
/*
|
||||
* If the router is directly connected to the RP, the next hop is the
|
||||
* globally reachable address of the RP: NOT link-local neighbor but an
|
||||
* IPv6 global neighbor.
|
||||
* Thus, we search through the list of additional addresses of the
|
||||
* neighbor to see if an additional address matches the RP address.
|
||||
* XXX: is there a scope issue here? maybe yes for a site-local RP.
|
||||
*/
|
||||
for (pa = n->aux_addrs; pa; pa = pa->pa_next) {
|
||||
if (inet6_equal(&neighbor_addr, &pa->pa_addr)) {
|
||||
IF_DEBUG(DEBUG_RPF)
|
||||
log(LOG_DEBUG, 0,
|
||||
"For src %s, iif is %d, next hop router is %s"
|
||||
" (aux_addr match)",
|
||||
sa6_fmt(&source), srcentry_ptr->incoming,
|
||||
sa6_fmt(&neighbor_addr));
|
||||
|
||||
srcentry_ptr->upstream = n;
|
||||
return (TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: control the number of messages! */
|
||||
@ -277,25 +295,21 @@ add_leaf(vifi, source, group)
|
||||
if_set new_oifs;
|
||||
if_set new_leaves;
|
||||
|
||||
if ((uvifs[vifi].uv_flags & VIFF_DR) != 0) {
|
||||
/*
|
||||
* I am not the DR on the subnet on which the report is received.
|
||||
* Ignore the report.
|
||||
*/
|
||||
log(LOG_DEBUG, 0, "I'm not the DR on mif %d. Ignore a report.\n",
|
||||
vifi);
|
||||
return;
|
||||
}
|
||||
|
||||
mrtentry_ptr = find_route(&sockaddr6_any, group, MRTF_WC, CREATE);
|
||||
|
||||
if (mrtentry_ptr == (mrtentry_t *) NULL)
|
||||
return;
|
||||
|
||||
if ((mrtentry_ptr->incoming == vifi)
|
||||
&& (!(uvifs[vifi].uv_flags & VIFF_DR)))
|
||||
{
|
||||
/*
|
||||
* The report is received on the iif for this routing entry and I am
|
||||
* not the DR for that subnet. Ignore it.
|
||||
*/
|
||||
|
||||
if (mrtentry_ptr->flags & MRTF_NEW)
|
||||
delete_mrtentry(mrtentry_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
IF_DEBUG(DEBUG_MRT)
|
||||
log(LOG_DEBUG, 0, "Adding vif %d for group %s", vifi,
|
||||
inet6_fmt(&group->sin6_addr));
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: route.h,v 1.1 2000/01/28 19:32:51 itojun Exp $ */
|
||||
/* $NetBSD: route.h,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: route.h,v 1.5 2000/12/04 06:45:31 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -49,8 +50,6 @@
|
||||
#ifndef ROUTE_H
|
||||
#define ROUTE_H
|
||||
|
||||
#include "mrt.h"
|
||||
|
||||
extern u_int32 default_source_preference;
|
||||
extern u_int32 default_source_metric;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: routesock.c,v 1.2 2000/07/23 23:05:38 mycroft Exp $ */
|
||||
/* $NetBSD: routesock.c,v 1.3 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: routesock.c,v 1.10 2000/12/04 06:45:31 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -63,10 +64,13 @@
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/in.h>
|
||||
#include "defs.h"
|
||||
#include <sys/socket.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#ifdef HAVE_ROUTING_SOCKETS
|
||||
#include <net/if_dl.h>
|
||||
#endif
|
||||
@ -76,6 +80,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <syslog.h>
|
||||
#include <stdio.h>
|
||||
#include "vif.h"
|
||||
#include "debug.h"
|
||||
#include "routesock.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: routesock.h,v 1.1 2000/01/28 19:32:51 itojun Exp $ */
|
||||
/* $NetBSD: routesock.h,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: routesock.h,v 1.4 2000/12/04 06:45:31 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: rp.c,v 1.3 2000/07/23 23:05:38 mycroft Exp $ */
|
||||
/* $NetBSD: rp.c,v 1.4 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: rp.c,v 1.15 2000/12/04 06:45:32 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -77,12 +78,24 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <netinet6/pim6.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "defs.h"
|
||||
#include "vif.h"
|
||||
#include "mrt.h"
|
||||
#include "rp.h"
|
||||
#include "pim6_proto.h"
|
||||
#include "pimd.h"
|
||||
#include <netinet6/pim6.h>
|
||||
#include "timer.h"
|
||||
#include "inet6.h"
|
||||
#include "route.h"
|
||||
@ -323,10 +336,10 @@ add_cand_rp(used_cand_rp_list, address)
|
||||
*/
|
||||
|
||||
if (local_address(&rpentry_ptr->address) == NO_VIF)
|
||||
{
|
||||
/* TODO: check for error and delete */
|
||||
set_incoming(rpentry_ptr, PIM_IIF_RP);
|
||||
}
|
||||
{
|
||||
/* TODO: check for error and delete */
|
||||
set_incoming(rpentry_ptr, PIM_IIF_RP);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* TODO: XXX: CHECK!!! */
|
||||
@ -435,7 +448,7 @@ add_rp_grp_entry(used_cand_rp_list, used_grp_mask_list,
|
||||
|
||||
if (!IN6_IS_ADDR_MULTICAST(&group_addr->sin6_addr))
|
||||
{
|
||||
return (rp_grp_entry_t *) NULL;
|
||||
return (rp_grp_entry_t *) NULL;
|
||||
}
|
||||
grp_mask_ptr = add_grp_mask(used_grp_mask_list, group_addr, group_mask,
|
||||
bsr_hash_mask);
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: rp.h,v 1.1 2000/01/28 19:32:52 itojun Exp $ */
|
||||
/* $NetBSD: rp.h,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: rp.h,v 1.5 2000/12/04 06:45:32 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
@ -49,9 +50,6 @@
|
||||
#ifndef RP_H
|
||||
#define RP_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "mrt.h"
|
||||
|
||||
extern cand_rp_t *cand_rp_list;
|
||||
extern grp_mask_t *grp_mask_list;
|
||||
extern cand_rp_t *segmented_cand_rp_list;
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: timer.c,v 1.2 2000/05/19 10:43:51 itojun Exp $ */
|
||||
/* $NetBSD: timer.c,v 1.3 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: timer.c,v 1.13 2000/12/04 06:45:32 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -49,12 +50,22 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "defs.h"
|
||||
#include "pimd.h"
|
||||
#include "mrt.h"
|
||||
#include "vif.h"
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include "timer.h"
|
||||
#include "debug.h"
|
||||
#include "rp.h"
|
||||
@ -556,7 +567,7 @@ age_routes()
|
||||
< kernel_cache_ptr->sg_count.bytecnt))
|
||||
{
|
||||
if (mrtentry_rp->incoming == reg_vif_num)
|
||||
|
||||
{
|
||||
#ifdef KERNEL_MFC_WC_G
|
||||
// TODO (one day :))
|
||||
if (kernel_cache_ptr->source == IN6ADDR_ANY_N)
|
||||
@ -567,9 +578,10 @@ age_routes()
|
||||
continue;
|
||||
}
|
||||
#endif /* KERNEL_MFC_WC_G */
|
||||
pim6dstat.pim6_trans_spt_rp++;
|
||||
switch_shortest_path(&kernel_cache_ptr->source,
|
||||
&kernel_cache_ptr->group);
|
||||
pim6dstat.pim6_trans_spt_rp++;
|
||||
switch_shortest_path(&kernel_cache_ptr->source,
|
||||
&kernel_cache_ptr->group);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -746,6 +758,7 @@ age_routes()
|
||||
< kernel_cache_ptr->sg_count.bytecnt))
|
||||
{
|
||||
if (mrtentry_grp->incoming == reg_vif_num)
|
||||
{
|
||||
#ifdef KERNEL_MFC_WC_G
|
||||
// TODO
|
||||
if (kernel_cache_ptr->source
|
||||
@ -757,9 +770,10 @@ age_routes()
|
||||
continue;
|
||||
}
|
||||
#endif /* KERNEL_MFC_WC_G */
|
||||
pim6dstat.pim6_trans_spt_rp++;
|
||||
switch_shortest_path(&kernel_cache_ptr->source,
|
||||
&kernel_cache_ptr->group);
|
||||
pim6dstat.pim6_trans_spt_rp++;
|
||||
switch_shortest_path(&kernel_cache_ptr->source,
|
||||
&kernel_cache_ptr->group);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: timer.h,v 1.1 2000/01/28 19:32:52 itojun Exp $ */
|
||||
/* $NetBSD: timer.h,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: timer.h,v 1.4 2000/12/04 06:45:32 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 LSIIT Laboratory.
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: trace.c,v 1.1 2000/01/28 19:32:52 itojun Exp $ */
|
||||
/* $NetBSD: trace.c,v 1.2 2000/12/04 07:09:36 itojun Exp $ */
|
||||
/* $KAME: trace.c,v 1.12 2000/12/04 06:45:32 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 WIDE Project.
|
||||
@ -63,8 +64,6 @@
|
||||
/*
|
||||
* Questions concerning this software should be directed to
|
||||
* Pavlin Ivanov Radoslavov (pavlin@catarina.usc.edu)
|
||||
*
|
||||
* KAME Id: trace.c,v 1.7 1999/09/16 08:45:45 jinmei Exp
|
||||
*/
|
||||
/*
|
||||
* Part of this program has been derived from mrouted.
|
||||
@ -78,25 +77,30 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include "vif.h"
|
||||
#include "inet6.h"
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/uio.h>
|
||||
#include <errno.h>
|
||||
#include <sys/queue.h>
|
||||
#include <net/if.h>
|
||||
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
|
||||
#include <net/if_var.h>
|
||||
#endif
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/icmp6.h>
|
||||
#include <netinet/ip6.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <netinet6/in6_var.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "defs.h"
|
||||
#include "vif.h"
|
||||
#include "mrt.h"
|
||||
#include "inet6.h"
|
||||
#include "mld6.h"
|
||||
#include "kern.h"
|
||||
#include "debug.h"
|
||||
@ -310,11 +314,9 @@ accept_mtrace(src, dst, group, ifindex, data, no, datalen)
|
||||
|
||||
/* copy the packet to the sending buffer */
|
||||
p = mld6_send_buf + sizeof(struct mld6_hdr);
|
||||
|
||||
bcopy(data, p, datalen);
|
||||
|
||||
p += datalen;
|
||||
|
||||
|
||||
/*
|
||||
* If there is no room to insert our reply, coopt the previous hop
|
||||
* error indication to relay this fact.
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: trace.h,v 1.1 2000/01/28 19:32:52 itojun Exp $ */
|
||||
/* $NetBSD: trace.h,v 1.2 2000/12/04 07:09:37 itojun Exp $ */
|
||||
/* $KAME: trace.h,v 1.4 2000/12/04 06:45:32 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 WIDE Project.
|
||||
@ -63,8 +64,6 @@
|
||||
/*
|
||||
* Questions concerning this software should be directed to
|
||||
* Pavlin Ivanov Radoslavov (pavlin@catarina.usc.edu)
|
||||
*
|
||||
* KAME Id: trace.h,v 1.2 1999/09/09 15:47:11 jinmei Exp
|
||||
*/
|
||||
/*
|
||||
* Part of this program has been derived from mrouted.
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: var.h,v 1.1 2000/01/28 19:32:53 itojun Exp $ */
|
||||
/* $NetBSD: var.h,v 1.2 2000/12/04 07:09:37 itojun Exp $ */
|
||||
/* $KAME: var.h,v 1.3 2000/07/24 01:00:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -28,13 +29,10 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/* YIPS Id: var.h,v 1.1 1999/10/29 09:04:54 jinmei Exp */
|
||||
|
||||
#if !defined(_VAR_H_)
|
||||
#define _VAR_H_
|
||||
|
||||
#include <sys/socket.h>
|
||||
|
||||
#define MAX3(a,b,c) (a > b ? (a > c ? a : c) : (b > c ? b : c))
|
||||
|
||||
#define CALLOC(size, cast) (cast)calloc(1, (size))
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* $NetBSD: vers.c,v 1.1 2000/01/28 19:32:53 itojun Exp $ */
|
||||
/* $NetBSD: vers.c,v 1.2 2000/12/04 07:09:37 itojun Exp $ */
|
||||
/* $KAME: vers.c,v 1.2 2000/12/04 06:45:32 itojun Exp $ */
|
||||
|
||||
char todaysversion[]="2.1.0-alpha23";
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: vif.c,v 1.2 2000/05/19 10:43:51 itojun Exp $ */
|
||||
/* $NetBSD: vif.c,v 1.3 2000/12/04 07:09:37 itojun Exp $ */
|
||||
/* $KAME: vif.c,v 1.15 2000/12/04 06:45:32 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -58,13 +59,23 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <errno.h>
|
||||
#include <syslog.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "defs.h"
|
||||
#include "vif.h"
|
||||
#include "mld6.h"
|
||||
#include "mrt.h"
|
||||
#include "pim6.h"
|
||||
#include "pimd.h"
|
||||
#include "route.h"
|
||||
@ -133,8 +144,6 @@ void init_vifs()
|
||||
IF_DEBUG(DEBUG_IF)
|
||||
log(LOG_DEBUG,0,"Getting vifs from kernel");
|
||||
config_vifs_from_kernel();
|
||||
if (max_global_address() == NULL)
|
||||
log(LOG_ERR, 0, "There's no global address");
|
||||
IF_DEBUG(DEBUG_IF)
|
||||
log(LOG_DEBUG,0,"Getting vifs from %s",configfilename);
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: vif.h,v 1.2 2000/05/19 10:43:51 itojun Exp $ */
|
||||
/* $NetBSD: vif.h,v 1.3 2000/12/04 07:09:37 itojun Exp $ */
|
||||
/* $KAME: vif.h,v 1.13 2000/12/04 06:45:32 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by the University of Southern California.
|
||||
@ -61,17 +62,6 @@
|
||||
#ifndef VIF_H
|
||||
#define VIF_H
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <net/route.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet6/ip6_mroute.h>
|
||||
#include <netinet/ip_mroute.h>
|
||||
#include "defs.h"
|
||||
|
||||
extern int total_interfaces;
|
||||
extern int udp_socket;
|
||||
extern struct uvif uvifs[];
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: vmbuf.h,v 1.1 2000/01/28 19:32:53 itojun Exp $ */
|
||||
/* $NetBSD: vmbuf.h,v 1.2 2000/12/04 07:09:37 itojun Exp $ */
|
||||
/* $KAME: vmbuf.h,v 1.2 2000/07/24 01:00:29 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -28,7 +29,6 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/* YIPS Id: vmbuf.h,v 1.1 1999/10/29 09:04:55 jinmei Exp */
|
||||
|
||||
typedef struct _vchar_ {
|
||||
u_int32_t t; /* type of the value */
|
||||
@ -46,3 +46,4 @@ extern vchar_t *vdup(vchar_t *);
|
||||
extern int pvdump(vchar_t *);
|
||||
|
||||
#define VREALLOC(ptr, size) ((ptr) = vrealloc((ptr), (size)))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user