Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin pim6dd: IPv6 PIM (protocol independent multicast),



details:   https://anonhg.NetBSD.org/src/rev/8d5b1e5c2f14
branches:  trunk
changeset: 474728:8d5b1e5c2f14
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sat Jul 17 14:06:24 1999 +0000

description:
pim6dd: IPv6 PIM (protocol independent multicast),
dense mode routing daemon.

diffstat:

 usr.sbin/Makefile               |     6 +-
 usr.sbin/pim6dd/LICENSE.mrouted |    48 +
 usr.sbin/pim6dd/LICENSE.pimd    |    47 +
 usr.sbin/pim6dd/Makefile        |    11 +
 usr.sbin/pim6dd/VERSION         |     1 +
 usr.sbin/pim6dd/callout.c       |   256 ++++++
 usr.sbin/pim6dd/config.c        |   673 ++++++++++++++++
 usr.sbin/pim6dd/debug.c         |   464 +++++++++++
 usr.sbin/pim6dd/debug.h         |   122 +++
 usr.sbin/pim6dd/defs.h          |   602 ++++++++++++++
 usr.sbin/pim6dd/inet6.c         |   288 +++++++
 usr.sbin/pim6dd/kern.c          |   416 ++++++++++
 usr.sbin/pim6dd/main.c          |   719 +++++++++++++++++
 usr.sbin/pim6dd/mld6.c          |   441 ++++++++++
 usr.sbin/pim6dd/mld6.h          |    45 +
 usr.sbin/pim6dd/mld6_proto.c    |   532 +++++++++++++
 usr.sbin/pim6dd/mrt.c           |   803 +++++++++++++++++++
 usr.sbin/pim6dd/mrt.h           |   228 +++++
 usr.sbin/pim6dd/pathnames.h     |    64 +
 usr.sbin/pim6dd/pim6.c          |   435 ++++++++++
 usr.sbin/pim6dd/pim6_proto.c    |  1569 +++++++++++++++++++++++++++++++++++++++
 usr.sbin/pim6dd/pim6dd.8        |   112 ++
 usr.sbin/pim6dd/pim6dd.conf.5   |   157 +++
 usr.sbin/pim6dd/pimdd.h         |   554 +++++++++++++
 usr.sbin/pim6dd/route.c         |   653 ++++++++++++++++
 usr.sbin/pim6dd/routesock.c     |   369 +++++++++
 usr.sbin/pim6dd/timer.c         |   320 +++++++
 usr.sbin/pim6dd/trace.c         |   488 ++++++++++++
 usr.sbin/pim6dd/trace.h         |   184 ++++
 usr.sbin/pim6dd/vers.c          |     3 +
 usr.sbin/pim6dd/vif.c           |   455 +++++++++++
 usr.sbin/pim6dd/vif.h           |   292 +++++++
 32 files changed, 11354 insertions(+), 3 deletions(-)

diffs (truncated from 11495 to 300 lines):

diff -r d161a0242152 -r 8d5b1e5c2f14 usr.sbin/Makefile
--- a/usr.sbin/Makefile Sat Jul 17 13:03:28 1999 +0000
+++ b/usr.sbin/Makefile Sat Jul 17 14:06:24 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.121 1999/07/14 22:35:20 sommerfeld Exp $
+#      $NetBSD: Makefile,v 1.122 1999/07/17 14:06:24 itojun Exp $
 #      from: @(#)Makefile      5.20 (Berkeley) 6/12/93
 
 # XXX Temporary for NO_SENDMAIL and BUILD_POSTFIX
@@ -25,8 +25,8 @@
        zdump zic
 
 # IPv6
-SUBDIR+=faithd gifconfig ifmcstat mld6query ndp rip6query route6d rtadvd \
-       setkey traceroute6
+SUBDIR+=faithd gifconfig ifmcstat mld6query ndp pim6dd rip6query route6d \
+       rtadvd setkey traceroute6
 
 # ATM PVC
 SUBDIR+=pvcsif pvctxctl
diff -r d161a0242152 -r 8d5b1e5c2f14 usr.sbin/pim6dd/LICENSE.mrouted
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/pim6dd/LICENSE.mrouted   Sat Jul 17 14:06:24 1999 +0000
@@ -0,0 +1,48 @@
+
+The mrouted program is covered by the following license.  Use of the
+mrouted program represents acceptance of these terms and conditions.
+
+1. STANFORD grants to LICENSEE a nonexclusive and nontransferable license
+to use, copy and modify the computer software ``mrouted'' (hereinafter
+called the ``Program''), upon the terms and conditions hereinafter set
+out and until Licensee discontinues use of the Licensed Program.
+
+2. LICENSEE acknowledges that the Program is a research tool still in
+the development state, that it is being supplied ``as is,'' without any
+accompanying services from STANFORD, and that this license is entered
+into in order to encourage scientific collaboration aimed at further
+development and application of the Program.
+
+3. LICENSEE may copy the Program and may sublicense others to use object
+code copies of the Program or any derivative version of the Program.
+All copies must contain all copyright and other proprietary notices found
+in the Program as provided by STANFORD.  Title to copyright to the
+Program remains with STANFORD.
+
+4. LICENSEE may create derivative versions of the Program.  LICENSEE
+hereby grants STANFORD a royalty-free license to use, copy, modify,
+distribute and sublicense any such derivative works.  At the time
+LICENSEE provides a copy of a derivative version of the Program to a
+third party, LICENSEE shall provide STANFORD with one copy of the source
+code of the derivative version at no charge to STANFORD.
+
+5. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.
+By way of example, but not limitation, STANFORD MAKES NO REPRESENTATION
+OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR
+THAT THE USE OF THE LICENSED PROGRAM WILL NOT INFRINGE ANY PATENTS,
+COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. STANFORD shall not be held liable
+for any liability nor for any direct, indirect or consequential damages
+with respect to any claim by LICENSEE or any third party on account of or
+arising from this Agreement or use of the Program.
+
+6. This agreement shall be construed, interpreted and applied in
+accordance with the State of California and any legal action arising
+out of this Agreement or use of the Program shall be filed in a court
+in the State of California.
+
+7. Nothing in this Agreement shall be construed as conferring rights to
+use in advertising, publicity or otherwise any trademark or the name
+of ``Stanford''.
+
+The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
+Leland Stanford Junior University.
diff -r d161a0242152 -r 8d5b1e5c2f14 usr.sbin/pim6dd/LICENSE.pimd
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/pim6dd/LICENSE.pimd      Sat Jul 17 14:06:24 1999 +0000
@@ -0,0 +1,47 @@
+/*
+ *  Copyright (c) 1998 by the University of Southern California.
+ *  All rights reserved.
+ *
+ *  Permission to use, copy, modify, and distribute this software and
+ *  its documentation in source and binary forms for lawful
+ *  purposes and without fee is hereby granted, provided
+ *  that the above copyright notice appear in all copies and that both
+ *  the copyright notice and this permission notice appear in supporting
+ *  documentation, and that any documentation, advertising materials,
+ *  and other materials related to such distribution and use acknowledge
+ *  that the software was developed by the University of Southern
+ *  California and/or Information Sciences Institute.
+ *  The name of the University of Southern California may not
+ *  be used to endorse or promote products derived from this software
+ *  without specific prior written permission.
+ *
+ *  THE UNIVERSITY OF SOUTHERN CALIFORNIA DOES NOT MAKE ANY REPRESENTATIONS
+ *  ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE.  THIS SOFTWARE IS
+ *  PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
+ *  INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND 
+ *  NON-INFRINGEMENT.
+ *
+ *  IN NO EVENT SHALL USC, OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY
+ *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, WHETHER IN CONTRACT,
+ *  TORT, OR OTHER FORM OF ACTION, ARISING OUT OF OR IN CONNECTION WITH,
+ *  THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ *  Other copyrights might apply to parts of this software and are so
+ *  noted when applicable.
+ */
+/*
+ *  Questions concerning this software should be directed to 
+ *  Pavlin Ivanov Radoslavov (pavlin%catarina.usc.edu@localhost)
+ *
+ *  $Id: LICENSE.pimd,v 1.1 1999/07/17 14:06:24 itojun Exp $
+ */
+/*
+ * Part of this program has been derived from mrouted.
+ * The mrouted program is covered by the license in the accompanying file
+ * named "LICENSE.mrouted".
+ *
+ * The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
+ * Leland Stanford Junior University.
+ *
+ */
diff -r d161a0242152 -r 8d5b1e5c2f14 usr.sbin/pim6dd/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/pim6dd/Makefile  Sat Jul 17 14:06:24 1999 +0000
@@ -0,0 +1,11 @@
+# $NetBSD: Makefile,v 1.1 1999/07/17 14:06:24 itojun Exp $
+
+PROG=  pim6dd
+SRCS=  mld6.c mld6_proto.c \
+       inet6.c kern.c main.c config.c debug.c routesock.c vers.c callout.c \
+       route.c vif.c timer.c mrt.c pim6.c pim6_proto.c trace.c
+MAN=   pim6dd.8 pim6dd.conf.5
+
+CPPFLAGS+=-DINET6 -DPIM -DIOCTL_OK_ON_RAW_SOCKET
+
+.include <bsd.prog.mk>
diff -r d161a0242152 -r 8d5b1e5c2f14 usr.sbin/pim6dd/VERSION
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/pim6dd/VERSION   Sat Jul 17 14:06:24 1999 +0000
@@ -0,0 +1,1 @@
+0.2.1.0-alpha15
diff -r d161a0242152 -r 8d5b1e5c2f14 usr.sbin/pim6dd/callout.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/pim6dd/callout.c Sat Jul 17 14:06:24 1999 +0000
@@ -0,0 +1,256 @@
+/*     $NetBSD: callout.c,v 1.1 1999/07/17 14:06:24 itojun Exp $       */
+
+/*
+ * The mrouted program is covered by the license in the accompanying file
+ * named "LICENSE.mrouted". Use of the mrouted program represents acceptance
+ * of the terms and conditions listed in that file.
+ *
+ * The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
+ * Leland Stanford Junior University.
+ *
+ *
+ * callout.c,v 3.8.4.5 1997/05/16 20:18:25 fenner Exp
+ */
+
+#include "defs.h"
+
+/* the code below implements a callout queue */
+static int id = 0;
+static struct timeout_q  *Q = 0; /* pointer to the beginning of timeout queue */
+
+struct timeout_q {
+    struct timeout_q *next;            /* next event */
+    int                     id;  
+    cfunc_t          func;             /* function to call */
+    void            *data;             /* func's data */
+    int              time;             /* time offset to next event*/
+};
+
+#ifdef CALLOUT_DEBUG
+static void print_Q __P((void));
+#else
+#define        print_Q()       
+#endif
+
+void
+callout_init()
+{
+    if (Q) {
+       log(LOG_ERR, 0, "timer used before callout_init()");
+       exit(1);
+    }
+    Q = (struct timeout_q *) 0;
+}
+
+void
+free_all_callouts()
+{
+    struct timeout_q *p;
+    
+    while (Q) {
+       p = Q;
+       Q = Q->next;
+       free(p);
+    }
+}
+
+
+/*
+ * elapsed_time seconds have passed; perform all the events that should
+ * happen.
+ */
+void
+age_callout_queue(elapsed_time)
+    int elapsed_time;
+{
+    struct timeout_q *ptr, *expQ;
+    
+#ifdef CALLOUT_DEBUG
+    IF_DEBUG(DEBUG_TIMEOUT)
+       log(LOG_DEBUG, 0, "aging queue (elapsed time %d):", elapsed_time);
+    print_Q();
+#endif
+
+    expQ = Q;
+    ptr = NULL;
+    
+    while (Q) {
+       if (Q->time > elapsed_time) {
+           Q->time -= elapsed_time;
+           if (ptr) {
+               ptr->next = NULL;
+               break;
+           }
+           return;
+       } else {
+           elapsed_time -= Q->time;
+           ptr = Q;
+           Q = Q->next;
+       }
+    }
+    
+    /* handle queue of expired timers */
+    while (expQ) {
+       ptr = expQ;
+       if (ptr->func)
+           ptr->func(ptr->data);
+       expQ = expQ->next;
+       free(ptr);
+    }
+}
+
+/*
+ * Return in how many seconds age_callout_queue() would like to be called.
+ * Return -1 if there are no events pending.
+ */
+int
+timer_nextTimer()
+{
+    if (Q) {
+       if (Q->time < 0) {
+           log(LOG_WARNING, 0, "timer_nextTimer top of queue says %d", 
+               Q->time);
+           return 0;
+       }
+       return Q->time;
+    }
+    return -1;
+}
+
+/* 
+ * sets the timer
+ */
+int
+timer_setTimer(delay, action, data)
+    int        delay;          /* number of units for timeout */
+    cfunc_t    action;         /* function to be called on timeout */
+    void       *data;          /* what to call the timeout function with */
+{
+    struct     timeout_q  *ptr, *node, *prev;
+    
+#ifdef CALLOUT_DEBUG
+    IF_DEBUG(DEBUG_TIMEOUT)
+       log(LOG_DEBUG, 0, "setting timer:");
+    print_Q();
+#endif
+
+    /* create a node */        
+    node = (struct timeout_q *)malloc(sizeof(struct timeout_q));
+    if (node == 0) {
+       log(LOG_WARNING, 0, "Malloc Failed in timer_settimer\n");
+       return -1;
+    }
+    node->func = action; 
+    node->data = data;
+    node->time = delay; 
+    node->next = 0;    
+    node->id   = ++id;
+    
+    prev = ptr = Q;
+    
+    /* insert node in the queue */
+    
+    /* if the queue is empty, insert the node and return */



Home | Main Index | Thread Index | Old Index