Deleted Added
full compact
ip_mroute.c (12579) ip_mroute.c (12820)
1/*
2 * IP multicast forwarding procedures
3 *
4 * Written by David Waitzman, BBN Labs, August 1988.
5 * Modified by Steve Deering, Stanford, February 1989.
6 * Modified by Mark J. Steiglitz, Stanford, May, 1991
7 * Modified by Van Jacobson, LBL, January 1993
8 * Modified by Ajit Thyagarajan, PARC, August 1993
9 * Modified by Bill Fenner, PARC, April 1995
10 *
11 * MROUTING Revision: 3.5
1/*
2 * IP multicast forwarding procedures
3 *
4 * Written by David Waitzman, BBN Labs, August 1988.
5 * Modified by Steve Deering, Stanford, February 1989.
6 * Modified by Mark J. Steiglitz, Stanford, May, 1991
7 * Modified by Van Jacobson, LBL, January 1993
8 * Modified by Ajit Thyagarajan, PARC, August 1993
9 * Modified by Bill Fenner, PARC, April 1995
10 *
11 * MROUTING Revision: 3.5
12 * $Id: ip_mroute.c,v 1.25 1995/11/14 20:34:16 phk Exp $
12 * $Id: ip_mroute.c,v 1.26 1995/12/02 19:38:03 bde Exp $
13 */
14
15
16#include <sys/param.h>
17#include <sys/systm.h>
18#include <sys/mbuf.h>
19#include <sys/socket.h>
20#include <sys/socketvar.h>

--- 46 unchanged lines hidden (view full) ---

67extern int _mrt_ioctl __P((int req, caddr_t data, struct proc *p));
68
69/*
70 * Dummy routines and globals used when multicast routing is not compiled in.
71 */
72
73struct socket *ip_mrouter = NULL;
74static u_int ip_mrtproto = 0;
13 */
14
15
16#include <sys/param.h>
17#include <sys/systm.h>
18#include <sys/mbuf.h>
19#include <sys/socket.h>
20#include <sys/socketvar.h>

--- 46 unchanged lines hidden (view full) ---

67extern int _mrt_ioctl __P((int req, caddr_t data, struct proc *p));
68
69/*
70 * Dummy routines and globals used when multicast routing is not compiled in.
71 */
72
73struct socket *ip_mrouter = NULL;
74static u_int ip_mrtproto = 0;
75struct mrtstat mrtstat;
75static struct mrtstat mrtstat;
76u_int rsvpdebug = 0;
77
78int
79_ip_mrouter_set(cmd, so, m)
80 int cmd;
81 struct socket *so;
82 struct mbuf *m;
83{

--- 130 unchanged lines hidden (view full) ---

214extern void X_ipip_input __P((struct mbuf *m));
215extern struct mrtstat mrtstat;
216static int ip_mrtproto;
217#endif
218
219#define NO_RTE_FOUND 0x1
220#define RTE_FOUND 0x2
221
76u_int rsvpdebug = 0;
77
78int
79_ip_mrouter_set(cmd, so, m)
80 int cmd;
81 struct socket *so;
82 struct mbuf *m;
83{

--- 130 unchanged lines hidden (view full) ---

214extern void X_ipip_input __P((struct mbuf *m));
215extern struct mrtstat mrtstat;
216static int ip_mrtproto;
217#endif
218
219#define NO_RTE_FOUND 0x1
220#define RTE_FOUND 0x2
221
222struct mbuf *mfctable[MFCTBLSIZ];
223u_char nexpire[MFCTBLSIZ];
224struct vif viftable[MAXVIFS];
222static struct mbuf *mfctable[MFCTBLSIZ];
223static u_char nexpire[MFCTBLSIZ];
224static struct vif viftable[MAXVIFS];
225static u_int mrtdebug = 0; /* debug level */
226#define DEBUG_MFC 0x02
227#define DEBUG_FORWARD 0x04
228#define DEBUG_EXPIRE 0x08
229#define DEBUG_XMIT 0x10
230static u_int tbfdebug = 0; /* tbf debug level */
231static u_int rsvpdebug = 0; /* rsvp debug level */
232
233#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */
234#define UPCALL_EXPIRE 6 /* number of timeouts */
235
236/*
237 * Define the token bucket filter structures
238 * tbftable -> each vif has one of these for storing info
239 */
240
225static u_int mrtdebug = 0; /* debug level */
226#define DEBUG_MFC 0x02
227#define DEBUG_FORWARD 0x04
228#define DEBUG_EXPIRE 0x08
229#define DEBUG_XMIT 0x10
230static u_int tbfdebug = 0; /* tbf debug level */
231static u_int rsvpdebug = 0; /* rsvp debug level */
232
233#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */
234#define UPCALL_EXPIRE 6 /* number of timeouts */
235
236/*
237 * Define the token bucket filter structures
238 * tbftable -> each vif has one of these for storing info
239 */
240
241struct tbf tbftable[MAXVIFS];
241static struct tbf tbftable[MAXVIFS];
242#define TBF_REPROCESS (hz / 100) /* 100x / second */
243
244/*
245 * 'Interfaces' associated with decapsulator (so we can tell
246 * packets that went through it from ones that get reflected
247 * by a broken gateway). These interfaces are never linked into
248 * the system ifnet list & no routes point to them. I.e., packets
249 * can't be sent this way. They only exist as a placeholder for
250 * multicast source verification.
251 */
242#define TBF_REPROCESS (hz / 100) /* 100x / second */
243
244/*
245 * 'Interfaces' associated with decapsulator (so we can tell
246 * packets that went through it from ones that get reflected
247 * by a broken gateway). These interfaces are never linked into
248 * the system ifnet list & no routes point to them. I.e., packets
249 * can't be sent this way. They only exist as a placeholder for
250 * multicast source verification.
251 */
252struct ifnet multicast_decap_if[MAXVIFS];
252static struct ifnet multicast_decap_if[MAXVIFS];
253
254#define ENCAP_TTL 64
255#define ENCAP_PROTO IPPROTO_IPIP /* 4 */
256
257/* prototype IP hdr for encapsulated packets */
258static struct ip multicast_encap_iphdr = {
259#if BYTE_ORDER == LITTLE_ENDIAN
260 sizeof(struct ip) >> 2, IPVERSION,

--- 2042 unchanged lines hidden ---
253
254#define ENCAP_TTL 64
255#define ENCAP_PROTO IPPROTO_IPIP /* 4 */
256
257/* prototype IP hdr for encapsulated packets */
258static struct ip multicast_encap_iphdr = {
259#if BYTE_ORDER == LITTLE_ENDIAN
260 sizeof(struct ip) >> 2, IPVERSION,

--- 2042 unchanged lines hidden ---