@@ -124,6 +124,8 @@ static void lsp_destroy(struct isis_lsp *lsp)
124
124
125
125
ISIS_FLAGS_CLEAR_ALL (lsp -> SSNflags );
126
126
127
+ isis_te_lsp_event (lsp , LSP_DEL );
128
+
127
129
lsp_clear_data (lsp );
128
130
129
131
if (!LSP_FRAGMENT (lsp -> hdr .lsp_id )) {
@@ -335,6 +337,7 @@ void lsp_inc_seqno(struct isis_lsp *lsp, uint32_t seqno)
335
337
336
338
lsp_pack_pdu (lsp );
337
339
isis_spf_schedule (lsp -> area , lsp -> level );
340
+ isis_te_lsp_event (lsp , LSP_INC );
338
341
}
339
342
340
343
static void lsp_purge_add_poi (struct isis_lsp * lsp ,
@@ -570,8 +573,10 @@ void lsp_update(struct isis_lsp *lsp, struct isis_lsp_hdr *hdr,
570
573
lsp_link_fragment (lsp , lsp0 );
571
574
}
572
575
573
- if (lsp -> hdr .seqno )
576
+ if (lsp -> hdr .seqno ) {
574
577
isis_spf_schedule (lsp -> area , lsp -> level );
578
+ isis_te_lsp_event (lsp , LSP_UPD );
579
+ }
575
580
}
576
581
577
582
/* creation of LSP directly from what we received */
@@ -636,8 +641,10 @@ struct isis_lsp *lsp_new(struct isis_area *area, uint8_t *lsp_id,
636
641
void lsp_insert (struct lspdb_head * head , struct isis_lsp * lsp )
637
642
{
638
643
lspdb_add (head , lsp );
639
- if (lsp -> hdr .seqno )
644
+ if (lsp -> hdr .seqno ) {
640
645
isis_spf_schedule (lsp -> area , lsp -> level );
646
+ isis_te_lsp_event (lsp , LSP_ADD );
647
+ }
641
648
}
642
649
643
650
/*
@@ -1030,6 +1037,10 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
1030
1037
cap .srlb .lower_bound = srdb -> config .srlb_lower_bound ;
1031
1038
/* And finally MSD */
1032
1039
cap .msd = srdb -> config .msd ;
1040
+ } else {
1041
+ /* Disable SR Algorithm */
1042
+ cap .algo [0 ] = SR_ALGORITHM_UNSET ;
1043
+ cap .algo [1 ] = SR_ALGORITHM_UNSET ;
1033
1044
}
1034
1045
1035
1046
isis_tlvs_set_router_capability (lsp -> tlvs , & cap );
@@ -2012,6 +2023,7 @@ int lsp_tick(struct thread *thread)
2012
2023
/* 7.3.16.4 c) record the time to purge
2013
2024
* FIXME */
2014
2025
isis_spf_schedule (lsp -> area , lsp -> level );
2026
+ isis_te_lsp_event (lsp , LSP_TICK );
2015
2027
}
2016
2028
2017
2029
if (lsp -> age_out == 0 ) {
@@ -2166,7 +2178,7 @@ int isis_lsp_iterate_ip_reach(struct isis_lsp *lsp, int family, uint16_t mtid,
2166
2178
if (lsp -> hdr .seqno == 0 || lsp -> hdr .rem_lifetime == 0 )
2167
2179
return LSP_ITER_CONTINUE ;
2168
2180
2169
- /* Parse main LSP. */
2181
+ /* Parse LSP */
2170
2182
if (lsp -> tlvs ) {
2171
2183
if (!fabricd && !pseudo_lsp && family == AF_INET
2172
2184
&& mtid == ISIS_MT_IPV4_UNICAST ) {
@@ -2236,13 +2248,17 @@ int isis_lsp_iterate_ip_reach(struct isis_lsp *lsp, int family, uint16_t mtid,
2236
2248
}
2237
2249
}
2238
2250
2239
- /* Parse LSP fragments. */
2240
- for (ALL_LIST_ELEMENTS_RO (lsp -> lspu .frags , node , frag )) {
2241
- if (!frag -> tlvs )
2242
- continue ;
2251
+ /* Parse LSP fragments if it is not a fragment itself */
2252
+ if (!LSP_FRAGMENT (lsp -> hdr .lsp_id ))
2253
+ for (ALL_LIST_ELEMENTS_RO (lsp -> lspu .frags , node , frag )) {
2254
+ if (!frag -> tlvs )
2255
+ continue ;
2243
2256
2244
- isis_lsp_iterate_ip_reach (frag , family , mtid , cb , arg );
2245
- }
2257
+ if (isis_lsp_iterate_ip_reach (frag , family , mtid , cb ,
2258
+ arg )
2259
+ == LSP_ITER_STOP )
2260
+ return LSP_ITER_STOP ;
2261
+ }
2246
2262
2247
2263
return LSP_ITER_CONTINUE ;
2248
2264
}
@@ -2263,7 +2279,7 @@ int isis_lsp_iterate_is_reach(struct isis_lsp *lsp, uint16_t mtid,
2263
2279
if (lsp -> hdr .seqno == 0 || lsp -> hdr .rem_lifetime == 0 )
2264
2280
return LSP_ITER_CONTINUE ;
2265
2281
2266
- /* Parse main LSP. */
2282
+ /* Parse LSP */
2267
2283
if (lsp -> tlvs ) {
2268
2284
if (pseudo_lsp || mtid == ISIS_MT_IPV4_UNICAST ) {
2269
2285
head = lsp -> tlvs -> oldstyle_reach .head ;
@@ -2295,13 +2311,16 @@ int isis_lsp_iterate_is_reach(struct isis_lsp *lsp, uint16_t mtid,
2295
2311
}
2296
2312
}
2297
2313
2298
- /* Parse LSP fragments. */
2299
- for (ALL_LIST_ELEMENTS_RO (lsp -> lspu .frags , node , frag )) {
2300
- if (!frag -> tlvs )
2301
- continue ;
2314
+ /* Parse LSP fragments if it not a fragment itself. */
2315
+ if (!LSP_FRAGMENT (lsp -> hdr .lsp_id ))
2316
+ for (ALL_LIST_ELEMENTS_RO (lsp -> lspu .frags , node , frag )) {
2317
+ if (!frag -> tlvs )
2318
+ continue ;
2302
2319
2303
- isis_lsp_iterate_is_reach (frag , mtid , cb , arg );
2304
- }
2320
+ if (isis_lsp_iterate_is_reach (frag , mtid , cb , arg )
2321
+ == LSP_ITER_STOP )
2322
+ return LSP_ITER_STOP ;
2323
+ }
2305
2324
2306
2325
return LSP_ITER_CONTINUE ;
2307
2326
}
0 commit comments