1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
|
/*
* Copyright (c) 1998 by the University of Oregon.
* 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 Oregon.
* The name of the University of Oregon may not be used to endorse or
* promote products derived from this software without specific prior
* written permission.
*
* THE UNIVERSITY OF OREGON 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 UO, 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
* Kurt Windisch (kurtw@antc.uoregon.edu)
*
* $Id: route.c,v 1.3 1999/10/27 11:40:30 jinmei Exp $
*/
/*
* Part of this program has been derived from PIM sparse-mode pimd.
* The pimd program is covered by the license in the accompanying file
* named "LICENSE.pimd".
*
* The pimd program is COPYRIGHT 1998 by University of Southern California.
*
* 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.
*
* $FreeBSD$
*/
#include "defs.h"
static u_int16 max_prune_timeout __P((mrtentry_t *));
static void process_cache_miss __P((struct mrt6msg *im));
static void process_wrong_iif __P((struct mrt6msg *im));
u_int32 default_source_preference = DEFAULT_LOCAL_PREF;
u_int32 default_source_metric = DEFAULT_LOCAL_METRIC;
/* Return the iif for given address */
vifi_t
get_iif(address)
struct sockaddr_in6 *address;
{
struct rpfctl rpfc;
k_req_incoming(address, &rpfc);
if (IN6_IS_ADDR_UNSPECIFIED(&rpfc.rpfneighbor.sin6_addr))
return (NO_VIF);
return (rpfc.iif);
}
/* Return the PIM neighbor toward a source */
/* If route not found or if a local source or if a directly connected source,
* but is not PIM router, or if the first hop router is not a PIM router,
* then return NULL.
*/
pim_nbr_entry_t *
find_pim6_nbr(source)
struct sockaddr_in6 *source;
{
struct rpfctl rpfc;
pim_nbr_entry_t *pim_nbr;
struct sockaddr_in6 *next_hop_router_addr;
if (local_address(source) != NO_VIF)
return (pim_nbr_entry_t *)NULL;
k_req_incoming(source, &rpfc);
if ((IN6_IS_ADDR_UNSPECIFIED(&rpfc.rpfneighbor.sin6_addr))
|| (rpfc.iif == NO_VIF))
return (pim_nbr_entry_t *)NULL;
next_hop_router_addr = &rpfc.rpfneighbor;
for (pim_nbr = uvifs[rpfc.iif].uv_pim_neighbors;
pim_nbr != (pim_nbr_entry_t *)NULL;
pim_nbr = pim_nbr->next)
if (inet6_equal(&pim_nbr->address, next_hop_router_addr))
return(pim_nbr);
return (pim_nbr_entry_t *)NULL;
}
/* TODO: check again the exact setup if the source is local or directly
* connected!!!
*/
/* TODO: XXX: change the metric and preference for all (S,G) entries per
* source?
*/
/* PIMDM TODO - If possible, this would be the place to correct set the
* source's preference and metric to that obtained from the kernel
* and/or unicast routing protocol. For now, set it to the configured
* default for local pref/metric.
*/
/*
* Set the iif, upstream router, preference and metric for the route
* toward the source. Return TRUE is the route was found, othewise FALSE.
* If srctype==PIM_IIF_SOURCE and if the source is directly connected
* then the "upstream" is set to NULL.
* Note that srctype is a hold-over from the PIM-SM daemon and is unused.
*/
int
set_incoming(srcentry_ptr, srctype)
srcentry_t *srcentry_ptr;
int srctype;
{
struct rpfctl rpfc;
struct sockaddr_in6 *source = &srcentry_ptr->address;
struct sockaddr_in6 *neighbor_addr;
register struct uvif *v;
register pim_nbr_entry_t *n;
/* Preference will be 0 if directly connected */
srcentry_ptr->preference = 0;
srcentry_ptr->metric = 0;
if ((srcentry_ptr->incoming = local_address(source)) != NO_VIF) {
/* The source is a local address */
/* TODO: set the upstream to myself? */
srcentry_ptr->upstream = (pim_nbr_entry_t *)NULL;
return (TRUE);
}
if ((srcentry_ptr->incoming = find_vif_direct(source)) == NO_VIF) {
/* TODO: probably need to check the case if the iif is disabled */
/* Use the lastest resource: the kernel unicast routing table */
k_req_incoming(source, &rpfc);
if ((rpfc.iif == NO_VIF) ||
IN6_IS_ADDR_UNSPECIFIED(&rpfc.rpfneighbor.sin6_addr)) {
/* couldn't find a route */
IF_DEBUG(DEBUG_PIM_MRT | DEBUG_RPF)
log(LOG_DEBUG, 0, "NO ROUTE found for %s",
inet6_fmt(&source->sin6_addr));
return(FALSE);
}
srcentry_ptr->incoming = rpfc.iif;
neighbor_addr = &rpfc.rpfneighbor;
}
else {
/* The source is directly connected.
*/
srcentry_ptr->upstream = (pim_nbr_entry_t *)NULL;
return (TRUE);
}
/* set the preference for sources that aren't directly connected. */
v = &uvifs[srcentry_ptr->incoming];
srcentry_ptr->preference = v->uv_local_pref;
srcentry_ptr->metric = v->uv_local_metric;
/*
* The upstream router must be a (PIM router) neighbor, otherwise we
* are in big trouble ;-)
*/
for (n = v->uv_pim_neighbors; n != NULL; n = n->next) {
if (inet6_lessthan(neighbor_addr, &n->address))
continue;
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));
return(TRUE);
}
else break;
}
/* TODO: control the number of messages! */
log(LOG_INFO, 0,
"For src %s, iif is %d, next hop router is %s: NOT A PIM ROUTER",
inet6_fmt(&source->sin6_addr), srcentry_ptr->incoming,
inet6_fmt(&neighbor_addr->sin6_addr));
srcentry_ptr->upstream = (pim_nbr_entry_t *)NULL;
return(FALSE);
}
/* Set the leaves in a new mrtentry */
void set_leaves(mrtentry_ptr)
mrtentry_t *mrtentry_ptr;
{
vifi_t vifi;
struct uvif *v;
/* Check for a group report on each vif */
for (vifi = 0, v = uvifs; vifi < numvifs; ++vifi, ++v)
if(check_multicast_listener(v, &mrtentry_ptr->group->group))
IF_SET(vifi, &mrtentry_ptr->leaves);
}
/* Handle new receiver
*
* TODO: XXX: currently `source` is not used. Will be used with IGMPv3 where
* we have source-specific Join/Prune.
*/
void
add_leaf(vifi, source, group)
vifi_t vifi;
struct sockaddr_in6 *source;
struct sockaddr_in6 *group;
{
grpentry_t *grpentry_ptr;
mrtentry_t *mrtentry_srcs;
if_set new_leaves;
int state_change;
grpentry_ptr = find_group(group);
if (grpentry_ptr == (grpentry_t *)NULL)
return;
/* walk the source list for the group and add vif to oiflist */
for (mrtentry_srcs = grpentry_ptr->mrtlink;
mrtentry_srcs != (mrtentry_t *)NULL;
mrtentry_srcs = mrtentry_srcs->grpnext) {
/* if applicable, add the vif to the leaves */
if (mrtentry_srcs->incoming == vifi)
continue;
if(!(IF_ISSET(vifi, &mrtentry_srcs->leaves))) {
IF_DEBUG(DEBUG_MRT)
log(LOG_DEBUG, 0, "Adding leaf vif %d for src %s group %s",
vifi,
inet6_fmt(&mrtentry_srcs->source->address.sin6_addr),
inet6_fmt(&group->sin6_addr));
IF_COPY(&mrtentry_srcs->leaves, &new_leaves);
IF_SET(vifi, &new_leaves); /* Add the leaf */
state_change =
change_interfaces(mrtentry_srcs,
mrtentry_srcs->incoming,
&mrtentry_srcs->pruned_oifs,
&new_leaves,
&mrtentry_srcs->asserted_oifs);
/* Handle transition from negative cache */
if(state_change == 1)
trigger_join_alert(mrtentry_srcs);
}
}
}
/*
* TODO: XXX: currently `source` is not used. To be used with IGMPv3 where
* we have source-specific joins/prunes.
*/
void
delete_leaf(vifi, source, group)
vifi_t vifi;
struct sockaddr_in6 *source;
struct sockaddr_in6 *group;
{
grpentry_t *grpentry_ptr;
mrtentry_t *mrtentry_srcs;
if_set new_leaves;
int state_change;
/* mrtentry_t *mrtentry_ptr;
* mrtentry_t *mrtentry_srcs;
* vifbitmap_t new_oifs;
* vifbitmap_t old_oifs;
* vifbitmap_t new_leaves;
*/
grpentry_ptr = find_group(group);
if (grpentry_ptr == (grpentry_t *)NULL)
return;
/* walk the source list for the group and delete vif to leaves */
for (mrtentry_srcs = grpentry_ptr->mrtlink;
mrtentry_srcs != (mrtentry_t *)NULL;
mrtentry_srcs = mrtentry_srcs->grpnext) {
/* if applicable, delete the vif from the leaves */
if (mrtentry_srcs->incoming == vifi)
continue;
if(IF_ISSET(vifi, &mrtentry_srcs->leaves)) {
IF_DEBUG(DEBUG_MRT)
log(LOG_DEBUG, 0, "Deleting leaf vif %d for src %s, group %s",
vifi,
inet6_fmt(&mrtentry_srcs->source->address.sin6_addr),
inet6_fmt(&group->sin6_addr));
IF_COPY(&mrtentry_srcs->leaves, &new_leaves);
IF_CLR(vifi, &new_leaves); /* Remove the leaf */
state_change =
change_interfaces(mrtentry_srcs,
mrtentry_srcs->incoming,
&mrtentry_srcs->pruned_oifs,
&new_leaves,
&mrtentry_srcs->asserted_oifs);
/* Handle transition to negative cache */
if(state_change == -1)
trigger_prune_alert(mrtentry_srcs);
}
}
}
void
calc_oifs(mrtentry_ptr, oifs_ptr)
mrtentry_t *mrtentry_ptr;
if_set *oifs_ptr;
{
if_set oifs;
/*
* oifs =
* ((nbr_ifs - my_prune) + my_leaves) - my_filters - incoming_interface,
* i.e.`leaves` have higher priority than `prunes`, but lower than `filters'.
* Asserted oifs (those that lost assert) are handled as pruned oifs.
* The incoming interface is always deleted from the oifs
*/
if (mrtentry_ptr == (mrtentry_t *)NULL) {
IF_ZERO(oifs_ptr);
return;
}
IF_COPY(&nbr_mifs, &oifs);
IF_CLR_MASK(&oifs, &mrtentry_ptr->pruned_oifs);
IF_MERGE(&oifs, &mrtentry_ptr->leaves, &oifs);
IF_CLR_MASK(&oifs, &mrtentry_ptr->asserted_oifs);
IF_CLR_MASK(&oifs, &mrtentry_ptr->filter_oifs);
IF_CLR(mrtentry_ptr->incoming, &oifs);
IF_COPY(&oifs, oifs_ptr);
}
/*
* Set the iif, join/prune/leaves/asserted interfaces. Calculate and
* set the oifs.
* Return 1 if oifs change from NULL to not-NULL.
* Return -1 if oifs change from non-NULL to NULL
* else return 0
* If the iif change or if the oifs change from NULL to non-NULL
* or vice-versa, then schedule that mrtentry join/prune timer to
* timeout immediately.
*/
int
change_interfaces(mrtentry_ptr, new_iif, new_pruned_oifs,
new_leaves_, new_asserted_oifs)
mrtentry_t *mrtentry_ptr;
vifi_t new_iif;
if_set *new_pruned_oifs;
if_set *new_leaves_;
if_set *new_asserted_oifs;
{
if_set old_pruned_oifs; /* unnecessary? */
if_set old_leaves; /* unnecessary? */
if_set new_leaves;
if_set new_real_oifs; /* The result oifs */
if_set old_real_oifs;
if_set old_asserted_oifs; /* unnecessary? */
vifi_t old_iif;
int return_value;
if (mrtentry_ptr == (mrtentry_t *)NULL)
return (0);
IF_COPY(new_leaves_, &new_leaves);
old_iif = mrtentry_ptr->incoming;
IF_COPY(&mrtentry_ptr->leaves, &old_leaves);
IF_COPY(&mrtentry_ptr->pruned_oifs, &old_pruned_oifs);
IF_COPY(&mrtentry_ptr->asserted_oifs, &old_asserted_oifs);
IF_COPY(&mrtentry_ptr->oifs, &old_real_oifs);
mrtentry_ptr->incoming = new_iif;
IF_COPY(new_pruned_oifs, &mrtentry_ptr->pruned_oifs);
IF_COPY(&new_leaves, &mrtentry_ptr->leaves);
IF_COPY(new_asserted_oifs, &mrtentry_ptr->asserted_oifs);
calc_oifs(mrtentry_ptr, &new_real_oifs);
if (IF_ISEMPTY(&old_real_oifs)) {
if (IF_ISEMPTY(&new_real_oifs))
return_value = 0;
else
return_value = 1;
} else {
if (IF_ISEMPTY(&new_real_oifs))
return_value = -1;
else
return_value = 0;
}
if ((IF_SAME(&new_real_oifs, &old_real_oifs))
&& (new_iif == old_iif))
return 0; /* Nothing to change */
IF_COPY(&new_real_oifs, &mrtentry_ptr->oifs);
k_chg_mfc(mld6_socket, &mrtentry_ptr->source->address,
&mrtentry_ptr->group->group, new_iif, &new_real_oifs);
#ifdef RSRR
rsrr_cache_send(mrtentry_ptr, RSRR_NOTIFICATION_OK);
#endif /* RSRR */
return (return_value);
}
/* TODO: implement it. Required to allow changing of the physical interfaces
* configuration without need to restart pimd.
*/
int
delete_vif_from_mrt(vifi)
vifi_t vifi;
{
return TRUE;
}
static u_int16
max_prune_timeout(mrtentry_ptr)
mrtentry_t *mrtentry_ptr;
{
vifi_t vifi;
#if 0
/* XXX: I don't understand how the variable works...(jinmei@kame.net) */
u_int16 time_left = 0;
#endif
u_int16 max_holdtime = 0;
for(vifi=0; vifi < numvifs; ++vifi)
if(IF_ISSET(vifi, &mrtentry_ptr->pruned_oifs) &&
mrtentry_ptr->prune_timers[vifi])
/* XXX - too expensive ? */
if(mrtentry_ptr->prune_timers[vifi] > max_holdtime)
max_holdtime = mrtentry_ptr->prune_timers[vifi];
#if 0
/* XXX: This is original. But does it have any meaning? */
max_holdtime = time_left;
#endif
if(max_holdtime == 0)
max_holdtime = (u_int16)PIM_JOIN_PRUNE_HOLDTIME;
return(max_holdtime);
}
void
process_kernel_call()
{
register struct mrt6msg *im; /* igmpmsg control struct */
im = (struct mrt6msg *) mld6_recv_buf;
switch (im->im6_msgtype) {
case MRT6MSG_NOCACHE:
process_cache_miss(im);
break;
case MRT6MSG_WRONGMIF:
process_wrong_iif(im);
break;
default:
IF_DEBUG(DEBUG_KERN)
log(LOG_DEBUG, 0, "Unknown kernel_call code, %d", im->im6_msgtype);
break;
}
}
/*
* Protocol actions:
* 1. Create (S,G) entry (find_route(CREATE))
* a. set iif and oifs
*/
static void
process_cache_miss(im)
struct mrt6msg *im;
{
static struct sockaddr_in6 source = {sizeof(source), AF_INET6};
static struct sockaddr_in6 group = {sizeof(group), AF_INET6};
mrtentry_t *mrtentry_ptr;
/*
* When there is a cache miss, we check only the header of the packet
* (and only it should be sent up by the kernel.
*/
group.sin6_addr = im->im6_dst;
source.sin6_addr = im->im6_src;
group.sin6_scope_id = inet6_uvif2scopeid(&group, &uvifs[im->im6_mif]);
source.sin6_scope_id = inet6_uvif2scopeid(&source, &uvifs[im->im6_mif]);
IF_DEBUG(DEBUG_MFC)
log(LOG_DEBUG, 0, "Cache miss, src %s, dst %s",
inet6_fmt(&source.sin6_addr), inet6_fmt(&group.sin6_addr));
/* Don't create routing entries for the LAN scoped addresses */
if (IN6_IS_ADDR_MC_NODELOCAL(&group.sin6_addr) ||/* sanity? */
IN6_IS_ADDR_MC_LINKLOCAL(&group.sin6_addr))
return;
/* Create the (S,G) entry */
mrtentry_ptr = find_route(&source, &group, MRTF_SG, CREATE);
if (mrtentry_ptr == (mrtentry_t *)NULL)
return;
mrtentry_ptr->flags &= ~MRTF_NEW;
/* Set oifs */
set_leaves(mrtentry_ptr);
calc_oifs(mrtentry_ptr, &(mrtentry_ptr->oifs));
/* Add it to the kernel */
k_chg_mfc(mld6_socket, &source, &group, mrtentry_ptr->incoming,
&mrtentry_ptr->oifs);
#ifdef RSRR
rsrr_cache_send(mrtentry_ptr, RSRR_NOTIFICATION_OK);
#endif /* RSRR */
/* No need to call change_interfaces, but check for NULL oiflist */
if(IF_ISEMPTY(&mrtentry_ptr->oifs))
trigger_prune_alert(mrtentry_ptr);
}
/*
* A multicast packet has been received on wrong iif by the kernel.
* If the packet was received on a point-to-point interface, rate-limit
* prunes. if the packet was received on a LAN interface, rate-limit
* asserts.
*/
static void
process_wrong_iif(im)
struct mrt6msg *im;
{
static struct sockaddr_in6 source = {sizeof(source), AF_INET6};
static struct sockaddr_in6 group = {sizeof(group), AF_INET6};
mifi_t mifi;
mrtentry_t *mrtentry_ptr;
group.sin6_addr = im->im6_dst;
source.sin6_addr = im->im6_src;
mifi = (mifi_t)im->im6_mif;
group.sin6_scope_id = inet6_uvif2scopeid(&group, &uvifs[mifi]);
source.sin6_scope_id = inet6_uvif2scopeid(&source, &uvifs[mifi]);
/* PIMDM TODO Don't create routing entries for the LAN scoped addresses */
if (IN6_IS_ADDR_MC_NODELOCAL(&group.sin6_addr) ||/* sanity? */
IN6_IS_ADDR_MC_LINKLOCAL(&group.sin6_addr))
return;
mrtentry_ptr = find_route(&source, &group, MRTF_SG, DONT_CREATE);
if(mrtentry_ptr == (mrtentry_t *)NULL)
return;
/* Ratelimit prunes or asserts */
#ifdef notyet
if(uvifs[mifi].uv_flags & VIFF_POINT_TO_POINT) {
/* Wrong vif on P2P interface - rate-limit prunes */
if(mrtentry_ptr->last_prune[mifi] == virtual_time)
/* Skip due to rate-limiting */
return;
mrtentry_ptr->last_prune[mifi] = virtual_time;
if(uvifs[mifi].uv_rmt_addr)
send_pim6_jp(mrtentry_ptr, PIM_ACTION_PRUNE, mifi,
uvifs[mifi].uv_rmt_addr,
max_prune_timeout(mrtentry_ptr), 0);
else
log(LOG_WARNING, 0,
"Can't send wrongvif prune on p2p %s: no remote address",
uvifs[mifi].uv_lcl_addr);
} else
#endif
{
/* Wrong vif on LAN interface - rate-limit asserts */
if(mrtentry_ptr->last_assert[mifi] == virtual_time)
/* Skip due to rate-limiting */
return;
mrtentry_ptr->last_assert[mifi] = virtual_time;
/* Send the assert */
send_pim6_assert(&source, &group, mifi, mrtentry_ptr);
}
}
void
trigger_prune_alert(mrtentry_ptr)
mrtentry_t *mrtentry_ptr;
{
IF_DEBUG(DEBUG_MRT)
log(LOG_DEBUG, 0, "Now negative cache for src %s, grp %s - pruning",
inet6_fmt(&mrtentry_ptr->source->address.sin6_addr),
inet6_fmt(&mrtentry_ptr->group->group.sin6_addr));
/* Set the entry timer to the max of the prune timers */
SET_TIMER(mrtentry_ptr->timer, max_prune_timeout(mrtentry_ptr));
/* Send a prune */
if(mrtentry_ptr->upstream)
send_pim6_jp(mrtentry_ptr, PIM_ACTION_PRUNE, mrtentry_ptr->incoming,
&mrtentry_ptr->upstream->address,
max_prune_timeout(mrtentry_ptr), 0);
}
void
trigger_join_alert(mrtentry_ptr)
mrtentry_t *mrtentry_ptr;
{
IF_DEBUG(DEBUG_MRT)
log(LOG_DEBUG, 0, "Now forwarding state for src %s, grp %s - grafting",
inet6_fmt(&mrtentry_ptr->source->address.sin6_addr),
inet6_fmt(&mrtentry_ptr->group->group.sin6_addr));
/* Refresh the entry timer */
SET_TIMER(mrtentry_ptr->timer, PIM_DATA_TIMEOUT);
/* Send graft */
send_pim6_graft(mrtentry_ptr);
}
|