File: | home/sharpd/frr3/ospf6d/ospf6_neighbor.c |
Warning: | line 744, column 2 Value stored to 'p2xp_cfg' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | // SPDX-License-Identifier: GPL-2.0-or-later |
2 | /* |
3 | * Copyright (C) 2003 Yasuhiro Ohara |
4 | */ |
5 | |
6 | #include <zebra.h> |
7 | |
8 | #include "log.h" |
9 | #include "memory.h" |
10 | #include "frrevent.h" |
11 | #include "linklist.h" |
12 | #include "vty.h" |
13 | #include "command.h" |
14 | #include "lib/bfd.h" |
15 | |
16 | #include "ospf6_proto.h" |
17 | #include "ospf6_lsa.h" |
18 | #include "ospf6_lsdb.h" |
19 | #include "ospf6_message.h" |
20 | #include "ospf6_top.h" |
21 | #include "ospf6_area.h" |
22 | #include "ospf6_interface.h" |
23 | #include "ospf6_neighbor.h" |
24 | #include "ospf6_intra.h" |
25 | #include "ospf6_flood.h" |
26 | #include "ospf6d.h" |
27 | #include "ospf6_bfd.h" |
28 | #include "ospf6_abr.h" |
29 | #include "ospf6_asbr.h" |
30 | #include "ospf6_lsa.h" |
31 | #include "ospf6_spf.h" |
32 | #include "ospf6_zebra.h" |
33 | #include "ospf6_gr.h" |
34 | #include "lib/json.h" |
35 | |
36 | DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_NEIGHBOR, "OSPF6 neighbor")static struct memtype MTYPE_OSPF6_NEIGHBOR[1] __attribute__(( section(".data.mtypes"))) = { { .name = "OSPF6 neighbor", .next = ((void*)0), .n_alloc = 0, .size = 0, .ref = ((void*)0), } } ; static void _mtinit_OSPF6_NEIGHBOR(void) __attribute__((constructor (1001))); static void _mtinit_OSPF6_NEIGHBOR(void) { if (_mg_OSPF6D .insert == ((void*)0)) _mg_OSPF6D.insert = &_mg_OSPF6D.types ; MTYPE_OSPF6_NEIGHBOR->ref = _mg_OSPF6D.insert; *_mg_OSPF6D .insert = MTYPE_OSPF6_NEIGHBOR; _mg_OSPF6D.insert = &MTYPE_OSPF6_NEIGHBOR ->next; } static void _mtfini_OSPF6_NEIGHBOR(void) __attribute__ ((destructor)); static void _mtfini_OSPF6_NEIGHBOR(void) { if (MTYPE_OSPF6_NEIGHBOR->next) MTYPE_OSPF6_NEIGHBOR->next ->ref = MTYPE_OSPF6_NEIGHBOR->ref; *MTYPE_OSPF6_NEIGHBOR ->ref = MTYPE_OSPF6_NEIGHBOR->next; } _Static_assert(1, "please add a semicolon after this macro"); |
37 | DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_NEIGHBOR_P2XP_CFG,static struct memtype MTYPE_OSPF6_NEIGHBOR_P2XP_CFG[1] __attribute__ ((section(".data.mtypes"))) = { { .name = "OSPF6 PtP/PtMP neighbor config" , .next = ((void*)0), .n_alloc = 0, .size = 0, .ref = ((void* )0), } }; static void _mtinit_OSPF6_NEIGHBOR_P2XP_CFG(void) __attribute__ ((constructor(1001))); static void _mtinit_OSPF6_NEIGHBOR_P2XP_CFG (void) { if (_mg_OSPF6D.insert == ((void*)0)) _mg_OSPF6D.insert = &_mg_OSPF6D.types; MTYPE_OSPF6_NEIGHBOR_P2XP_CFG->ref = _mg_OSPF6D.insert; *_mg_OSPF6D.insert = MTYPE_OSPF6_NEIGHBOR_P2XP_CFG ; _mg_OSPF6D.insert = &MTYPE_OSPF6_NEIGHBOR_P2XP_CFG-> next; } static void _mtfini_OSPF6_NEIGHBOR_P2XP_CFG(void) __attribute__ ((destructor)); static void _mtfini_OSPF6_NEIGHBOR_P2XP_CFG(void ) { if (MTYPE_OSPF6_NEIGHBOR_P2XP_CFG->next) MTYPE_OSPF6_NEIGHBOR_P2XP_CFG ->next->ref = MTYPE_OSPF6_NEIGHBOR_P2XP_CFG->ref; *MTYPE_OSPF6_NEIGHBOR_P2XP_CFG ->ref = MTYPE_OSPF6_NEIGHBOR_P2XP_CFG->next; } _Static_assert (1, "please add a semicolon after this macro") |
38 | "OSPF6 PtP/PtMP neighbor config")static struct memtype MTYPE_OSPF6_NEIGHBOR_P2XP_CFG[1] __attribute__ ((section(".data.mtypes"))) = { { .name = "OSPF6 PtP/PtMP neighbor config" , .next = ((void*)0), .n_alloc = 0, .size = 0, .ref = ((void* )0), } }; static void _mtinit_OSPF6_NEIGHBOR_P2XP_CFG(void) __attribute__ ((constructor(1001))); static void _mtinit_OSPF6_NEIGHBOR_P2XP_CFG (void) { if (_mg_OSPF6D.insert == ((void*)0)) _mg_OSPF6D.insert = &_mg_OSPF6D.types; MTYPE_OSPF6_NEIGHBOR_P2XP_CFG->ref = _mg_OSPF6D.insert; *_mg_OSPF6D.insert = MTYPE_OSPF6_NEIGHBOR_P2XP_CFG ; _mg_OSPF6D.insert = &MTYPE_OSPF6_NEIGHBOR_P2XP_CFG-> next; } static void _mtfini_OSPF6_NEIGHBOR_P2XP_CFG(void) __attribute__ ((destructor)); static void _mtfini_OSPF6_NEIGHBOR_P2XP_CFG(void ) { if (MTYPE_OSPF6_NEIGHBOR_P2XP_CFG->next) MTYPE_OSPF6_NEIGHBOR_P2XP_CFG ->next->ref = MTYPE_OSPF6_NEIGHBOR_P2XP_CFG->ref; *MTYPE_OSPF6_NEIGHBOR_P2XP_CFG ->ref = MTYPE_OSPF6_NEIGHBOR_P2XP_CFG->next; } _Static_assert (1, "please add a semicolon after this macro"); |
39 | |
40 | static int ospf6_if_p2xp_neighcfg_cmp(const struct ospf6_if_p2xp_neighcfg *a, |
41 | const struct ospf6_if_p2xp_neighcfg *b); |
42 | |
43 | DECLARE_RBTREE_UNIQ(ospf6_if_p2xp_neighcfgs, struct ospf6_if_p2xp_neighcfg,static inline __attribute__((unused)) int ospf6_if_p2xp_neighcfgs__cmp (const struct typed_rb_entry *a, const struct typed_rb_entry * b) { return ospf6_if_p2xp_neighcfg_cmp((__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(a)) || __builtin_types_compatible_p (void *, typeof(a)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(a); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (a); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )), (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(b)) || __builtin_types_compatible_p(void *, typeof( b)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item. re) *__mptr = (void *)(b); (struct ospf6_if_p2xp_neighcfg *)( (char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (b); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) ))); } static inline __attribute__((unused)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_find (const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { const struct typed_rb_entry *re; re = typed_rb_find (&h->rr, &item->item.re, &ospf6_if_p2xp_neighcfgs__cmp ); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(_tmp)) || __builtin_types_compatible_p (void *, typeof(_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_find (struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_find (h, item); } static inline __attribute__((unused)) void ospf6_if_p2xp_neighcfgs_init (struct ospf6_if_p2xp_neighcfgs_head *h) { memset(h, 0, sizeof (*h)); } static inline __attribute__((unused)) void ospf6_if_p2xp_neighcfgs_fini (struct ospf6_if_p2xp_neighcfgs_head *h) { memset(h, 0, sizeof (*h)); } static inline __attribute__((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_add(struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { struct typed_rb_entry *re; re = typed_rb_insert(&h->rr, &item->item. re, ospf6_if_p2xp_neighcfgs__cmp); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(_tmp)) || __builtin_types_compatible_p(void *, typeof (_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item .re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_find_gteq ( const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { const struct typed_rb_entry *re; re = typed_rb_find_gteq (&h->rr, &item->item.re, ospf6_if_p2xp_neighcfgs__cmp ); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(_tmp)) || __builtin_types_compatible_p (void *, typeof(_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_find_lt ( const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { const struct typed_rb_entry *re; re = typed_rb_find_lt (&h->rr, &item->item.re, ospf6_if_p2xp_neighcfgs__cmp ); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(_tmp)) || __builtin_types_compatible_p (void *, typeof(_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_find_lt (struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_find_lt (h, item); } static inline __attribute__((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_find_gteq(struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_find_gteq (h, item); } static inline __attribute__((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_del(struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { struct typed_rb_entry *re; re = typed_rb_remove(&h->rr, &item->item. re); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(_tmp)) || __builtin_types_compatible_p (void *, typeof(_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_pop (struct ospf6_if_p2xp_neighcfgs_head *h) { struct typed_rb_entry *re; re = typed_rb_min(&h->rr); if (!re) return ((void *)0); typed_rb_remove(&h->rr, re); return (__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(re)) || __builtin_types_compatible_p (void *, typeof(re)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(re); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (re); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )); } static inline __attribute__((unused)) void ospf6_if_p2xp_neighcfgs_swap_all(struct ospf6_if_p2xp_neighcfgs_head *a, struct ospf6_if_p2xp_neighcfgs_head *b) { struct ospf6_if_p2xp_neighcfgs_head tmp = *a; *a = *b; *b = tmp; } static inline __attribute__(( unused, pure)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_first (const struct ospf6_if_p2xp_neighcfgs_head *h) { const struct typed_rb_entry *re; re = typed_rb_min(&h->rr); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(_tmp)) || __builtin_types_compatible_p(void *, typeof (_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item .re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_next (const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { const struct typed_rb_entry *re; re = typed_rb_next (&item->item.re); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p(typeof (&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof (_tmp)) || __builtin_types_compatible_p(void *, typeof(_tmp)) , ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)( (char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_first (struct ospf6_if_p2xp_neighcfgs_head *h) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_first(h); } static inline __attribute__ ((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_next (struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_next (h, item); } static inline __attribute__((unused, pure)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_last (const struct ospf6_if_p2xp_neighcfgs_head *h) { const struct typed_rb_entry *re; re = typed_rb_max(&h->rr); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(_tmp)) || __builtin_types_compatible_p(void *, typeof (_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item .re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_prev (const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { const struct typed_rb_entry *re; re = typed_rb_prev (&item->item.re); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p(typeof (&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof (_tmp)) || __builtin_types_compatible_p(void *, typeof(_tmp)) , ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)( (char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_last (struct ospf6_if_p2xp_neighcfgs_head *h) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_last(h); } static inline __attribute__ ((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_prev (struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_prev (h, item); } static inline __attribute__((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_next_safe(struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { struct typed_rb_entry *re; re = item ? typed_rb_next (&item->item.re) : ((void*)0); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(_tmp)) || __builtin_types_compatible_p(void *, typeof (_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item .re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_prev_safe (struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { struct typed_rb_entry *re; re = item ? typed_rb_prev (&item->item.re) : ((void*)0); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(_tmp)) || __builtin_types_compatible_p(void *, typeof (_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item .re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) size_t ospf6_if_p2xp_neighcfgs_count(const struct ospf6_if_p2xp_neighcfgs_head *h) { return h->rr.count; } static inline __attribute__((unused, pure)) _Bool ospf6_if_p2xp_neighcfgs_member (const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { return typed_rb_member(&h->rr, &item-> item.re); } _Static_assert(1, "please add a semicolon after this macro" ); _Static_assert(1, "please add a semicolon after this macro" ) |
44 | item, ospf6_if_p2xp_neighcfg_cmp)static inline __attribute__((unused)) int ospf6_if_p2xp_neighcfgs__cmp (const struct typed_rb_entry *a, const struct typed_rb_entry * b) { return ospf6_if_p2xp_neighcfg_cmp((__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(a)) || __builtin_types_compatible_p (void *, typeof(a)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(a); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (a); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )), (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(b)) || __builtin_types_compatible_p(void *, typeof( b)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item. re) *__mptr = (void *)(b); (struct ospf6_if_p2xp_neighcfg *)( (char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (b); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) ))); } static inline __attribute__((unused)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_find (const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { const struct typed_rb_entry *re; re = typed_rb_find (&h->rr, &item->item.re, &ospf6_if_p2xp_neighcfgs__cmp ); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(_tmp)) || __builtin_types_compatible_p (void *, typeof(_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_find (struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_find (h, item); } static inline __attribute__((unused)) void ospf6_if_p2xp_neighcfgs_init (struct ospf6_if_p2xp_neighcfgs_head *h) { memset(h, 0, sizeof (*h)); } static inline __attribute__((unused)) void ospf6_if_p2xp_neighcfgs_fini (struct ospf6_if_p2xp_neighcfgs_head *h) { memset(h, 0, sizeof (*h)); } static inline __attribute__((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_add(struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { struct typed_rb_entry *re; re = typed_rb_insert(&h->rr, &item->item. re, ospf6_if_p2xp_neighcfgs__cmp); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(_tmp)) || __builtin_types_compatible_p(void *, typeof (_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item .re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_find_gteq ( const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { const struct typed_rb_entry *re; re = typed_rb_find_gteq (&h->rr, &item->item.re, ospf6_if_p2xp_neighcfgs__cmp ); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(_tmp)) || __builtin_types_compatible_p (void *, typeof(_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_find_lt ( const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { const struct typed_rb_entry *re; re = typed_rb_find_lt (&h->rr, &item->item.re, ospf6_if_p2xp_neighcfgs__cmp ); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(_tmp)) || __builtin_types_compatible_p (void *, typeof(_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_find_lt (struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_find_lt (h, item); } static inline __attribute__((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_find_gteq(struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_find_gteq (h, item); } static inline __attribute__((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_del(struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { struct typed_rb_entry *re; re = typed_rb_remove(&h->rr, &item->item. re); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(_tmp)) || __builtin_types_compatible_p (void *, typeof(_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_pop (struct ospf6_if_p2xp_neighcfgs_head *h) { struct typed_rb_entry *re; re = typed_rb_min(&h->rr); if (!re) return ((void *)0); typed_rb_remove(&h->rr, re); return (__builtin_choose_expr ( __builtin_types_compatible_p(typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof(re)) || __builtin_types_compatible_p (void *, typeof(re)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(re); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (re); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )); } static inline __attribute__((unused)) void ospf6_if_p2xp_neighcfgs_swap_all(struct ospf6_if_p2xp_neighcfgs_head *a, struct ospf6_if_p2xp_neighcfgs_head *b) { struct ospf6_if_p2xp_neighcfgs_head tmp = *a; *a = *b; *b = tmp; } static inline __attribute__(( unused, pure)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_first (const struct ospf6_if_p2xp_neighcfgs_head *h) { const struct typed_rb_entry *re; re = typed_rb_min(&h->rr); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(_tmp)) || __builtin_types_compatible_p(void *, typeof (_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item .re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_next (const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { const struct typed_rb_entry *re; re = typed_rb_next (&item->item.re); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p(typeof (&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof (_tmp)) || __builtin_types_compatible_p(void *, typeof(_tmp)) , ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)( (char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_first (struct ospf6_if_p2xp_neighcfgs_head *h) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_first(h); } static inline __attribute__ ((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_next (struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_next (h, item); } static inline __attribute__((unused, pure)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_last (const struct ospf6_if_p2xp_neighcfgs_head *h) { const struct typed_rb_entry *re; re = typed_rb_max(&h->rr); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(_tmp)) || __builtin_types_compatible_p(void *, typeof (_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item .re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) const struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_const_prev (const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { const struct typed_rb_entry *re; re = typed_rb_prev (&item->item.re); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p(typeof (&((struct ospf6_if_p2xp_neighcfg *)0)->item.re), typeof (_tmp)) || __builtin_types_compatible_p(void *, typeof(_tmp)) , ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)( (char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_last (struct ospf6_if_p2xp_neighcfgs_head *h) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_last(h); } static inline __attribute__ ((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_prev (struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { return (struct ospf6_if_p2xp_neighcfg *)ospf6_if_p2xp_neighcfgs_const_prev (h, item); } static inline __attribute__((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_next_safe(struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { struct typed_rb_entry *re; re = item ? typed_rb_next (&item->item.re) : ((void*)0); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(_tmp)) || __builtin_types_compatible_p(void *, typeof (_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item .re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_neighcfgs_prev_safe (struct ospf6_if_p2xp_neighcfgs_head *h, struct ospf6_if_p2xp_neighcfg *item) { struct typed_rb_entry *re; re = item ? typed_rb_prev (&item->item.re) : ((void*)0); return ({ typeof(re) _tmp = (re); _tmp ? (__builtin_choose_expr( __builtin_types_compatible_p (typeof(&((struct ospf6_if_p2xp_neighcfg *)0)->item.re ), typeof(_tmp)) || __builtin_types_compatible_p(void *, typeof (_tmp)), ({ typeof(((struct ospf6_if_p2xp_neighcfg *)0)->item .re) *__mptr = (void *)(_tmp); (struct ospf6_if_p2xp_neighcfg *)((char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }), ({ typeof(((const struct ospf6_if_p2xp_neighcfg *)0)->item.re) *__mptr = (_tmp); (const struct ospf6_if_p2xp_neighcfg *)((const char *)__mptr - __builtin_offsetof(struct ospf6_if_p2xp_neighcfg , item.re)); }) )) : ((void*)0); }); } static inline __attribute__ ((unused, pure)) size_t ospf6_if_p2xp_neighcfgs_count(const struct ospf6_if_p2xp_neighcfgs_head *h) { return h->rr.count; } static inline __attribute__((unused, pure)) _Bool ospf6_if_p2xp_neighcfgs_member (const struct ospf6_if_p2xp_neighcfgs_head *h, const struct ospf6_if_p2xp_neighcfg *item) { return typed_rb_member(&h->rr, &item-> item.re); } _Static_assert(1, "please add a semicolon after this macro" ); _Static_assert(1, "please add a semicolon after this macro" ); |
45 | |
46 | static void p2xp_neigh_refresh(struct ospf6_neighbor *on, uint32_t prev_cost); |
47 | |
48 | DEFINE_HOOK(ospf6_neighbor_change,struct hook _hook_ospf6_neighbor_change = { .name = "ospf6_neighbor_change" , .entries = ((void*)0), .reverse = 0, }; static int hook_call_ospf6_neighbor_change ( struct ospf6_neighbor * on, int state, int next_state) { int hooksum = 0; struct hookent *he = _hook_ospf6_neighbor_change .entries; void *hookarg; union { void *voidptr; int(*fptr) ( struct ospf6_neighbor * on, int state, int next_state); int(*farg) ( void *hookarg ,struct ospf6_neighbor * on, int state, int next_state ); } hookp; for (; he; he = he->next) { hookarg = he->hookarg ; hookp.voidptr = he->hookfn; if (!he->has_arg) hooksum += hookp.fptr (on, state, next_state); else hooksum += hookp .farg (hookarg ,on, state, next_state); } return hooksum; } _Static_assert (1, "please add a semicolon after this macro") |
49 | (struct ospf6_neighbor * on, int state, int next_state),struct hook _hook_ospf6_neighbor_change = { .name = "ospf6_neighbor_change" , .entries = ((void*)0), .reverse = 0, }; static int hook_call_ospf6_neighbor_change ( struct ospf6_neighbor * on, int state, int next_state) { int hooksum = 0; struct hookent *he = _hook_ospf6_neighbor_change .entries; void *hookarg; union { void *voidptr; int(*fptr) ( struct ospf6_neighbor * on, int state, int next_state); int(*farg) ( void *hookarg ,struct ospf6_neighbor * on, int state, int next_state ); } hookp; for (; he; he = he->next) { hookarg = he->hookarg ; hookp.voidptr = he->hookfn; if (!he->has_arg) hooksum += hookp.fptr (on, state, next_state); else hooksum += hookp .farg (hookarg ,on, state, next_state); } return hooksum; } _Static_assert (1, "please add a semicolon after this macro") |
50 | (on, state, next_state))struct hook _hook_ospf6_neighbor_change = { .name = "ospf6_neighbor_change" , .entries = ((void*)0), .reverse = 0, }; static int hook_call_ospf6_neighbor_change ( struct ospf6_neighbor * on, int state, int next_state) { int hooksum = 0; struct hookent *he = _hook_ospf6_neighbor_change .entries; void *hookarg; union { void *voidptr; int(*fptr) ( struct ospf6_neighbor * on, int state, int next_state); int(*farg) ( void *hookarg ,struct ospf6_neighbor * on, int state, int next_state ); } hookp; for (; he; he = he->next) { hookarg = he->hookarg ; hookp.voidptr = he->hookfn; if (!he->has_arg) hooksum += hookp.fptr (on, state, next_state); else hooksum += hookp .farg (hookarg ,on, state, next_state); } return hooksum; } _Static_assert (1, "please add a semicolon after this macro"); |
51 | |
52 | unsigned char conf_debug_ospf6_neighbor = 0; |
53 | |
54 | const char *const ospf6_neighbor_state_str[] = { |
55 | "None", "Down", "Attempt", "Init", "Twoway", |
56 | "ExStart", "ExChange", "Loading", "Full", NULL((void*)0) |
57 | }; |
58 | |
59 | const char *const ospf6_neighbor_event_str[] = { |
60 | "NoEvent", "HelloReceived", "2-WayReceived", "NegotiationDone", |
61 | "ExchangeDone", "LoadingDone", "AdjOK?", "SeqNumberMismatch", |
62 | "BadLSReq", "1-WayReceived", "InactivityTimer", |
63 | }; |
64 | |
65 | int ospf6_neighbor_cmp(void *va, void *vb) |
66 | { |
67 | struct ospf6_neighbor *ona = (struct ospf6_neighbor *)va; |
68 | struct ospf6_neighbor *onb = (struct ospf6_neighbor *)vb; |
69 | |
70 | if (ona->router_id == onb->router_id) |
71 | return 0; |
72 | |
73 | return (ntohl(ona->router_id) < ntohl(onb->router_id)) ? -1 : 1; |
74 | } |
75 | |
76 | struct ospf6_neighbor *ospf6_neighbor_lookup(uint32_t router_id, |
77 | struct ospf6_interface *oi) |
78 | { |
79 | struct listnode *n; |
80 | struct ospf6_neighbor *on; |
81 | |
82 | for (ALL_LIST_ELEMENTS_RO(oi->neighbor_list, n, on)(n) = ((oi->neighbor_list) ? ((oi->neighbor_list)->head ) : ((void*)0)), ((on) = ((void*)0)); (n) != ((void*)0) && ((on) = ((({ static const struct xref_assert _xref __attribute__ ( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 82, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "n", }; static const struct xref * const xref_p_93 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((n) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (n); }), ({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void *)0)), (XREFT_ASSERT), 82, "ospf6d/ospf6_neighbor.c", __func__ , }, .expr = "(n)->data != NULL", }; static const struct xref * const xref_p_94 __attribute__((used, section("xref_array") )) = &(_xref.xref); if (__builtin_expect(((n)->data != ((void*)0)) ? 0 : 1, 0)) do { _zlog_assert_failed(&_xref , ((void*)0)); } while ((n)->data != ((void*)0)); }), (n)-> data)), 1); (n) = ((n) ? ((n)->next) : ((void*)0)), ((on) = ((void*)0))) |
83 | if (on->router_id == router_id) |
84 | return on; |
85 | |
86 | return (struct ospf6_neighbor *)NULL((void*)0); |
87 | } |
88 | |
89 | struct ospf6_neighbor *ospf6_area_neighbor_lookup(struct ospf6_area *area, |
90 | uint32_t router_id) |
91 | { |
92 | struct ospf6_interface *oi; |
93 | struct ospf6_neighbor *nbr; |
94 | struct listnode *node; |
95 | |
96 | for (ALL_LIST_ELEMENTS_RO(area->if_list, node, oi)(node) = ((area->if_list) ? ((area->if_list)->head) : ((void*)0)), ((oi) = ((void*)0)); (node) != ((void*)0) && ((oi) = ((({ static const struct xref_assert _xref __attribute__ ( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 96, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "node", }; static const struct xref * const xref_p_95 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((node) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (node); }), ({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 96, "ospf6d/ospf6_neighbor.c", __func__, }, .expr = "(node)->data != NULL", }; static const struct xref * const xref_p_96 __attribute__((used, section("xref_array" ))) = &(_xref.xref); if (__builtin_expect(((node)->data != ((void*)0)) ? 0 : 1, 0)) do { _zlog_assert_failed(&_xref , ((void*)0)); } while ((node)->data != ((void*)0)); }), ( node)->data)), 1); (node) = ((node) ? ((node)->next) : ( (void*)0)), ((oi) = ((void*)0))) { |
97 | nbr = ospf6_neighbor_lookup(router_id, oi); |
98 | if (nbr) |
99 | return nbr; |
100 | } |
101 | |
102 | return NULL((void*)0); |
103 | } |
104 | |
105 | static void ospf6_neighbor_clear_ls_lists(struct ospf6_neighbor *on) |
106 | { |
107 | struct ospf6_lsa *lsa; |
108 | struct ospf6_lsa *lsanext; |
109 | |
110 | ospf6_lsdb_remove_all(on->summary_list); |
111 | if (on->last_ls_req) { |
112 | ospf6_lsa_unlock(&on->last_ls_req); |
113 | on->last_ls_req = NULL((void*)0); |
114 | } |
115 | |
116 | ospf6_lsdb_remove_all(on->request_list); |
117 | for (ALL_LSDB(on->retrans_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->retrans_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) { |
118 | ospf6_decrement_retrans_count(lsa); |
119 | ospf6_lsdb_remove(lsa, on->retrans_list); |
120 | } |
121 | } |
122 | |
123 | /* create ospf6_neighbor */ |
124 | struct ospf6_neighbor *ospf6_neighbor_create(uint32_t router_id, |
125 | struct ospf6_interface *oi) |
126 | { |
127 | struct ospf6_neighbor *on; |
128 | char buf[16]; |
129 | int type; |
130 | |
131 | on = XCALLOC(MTYPE_OSPF6_NEIGHBOR, sizeof(struct ospf6_neighbor))qcalloc(MTYPE_OSPF6_NEIGHBOR, sizeof(struct ospf6_neighbor)); |
132 | inet_ntop(AF_INET2, &router_id, buf, sizeof(buf)); |
133 | snprintf(on->name, sizeof(on->name), "%s%%%s", buf, oi->interface->name); |
134 | on->ospf6_if = oi; |
135 | on->state = OSPF6_NEIGHBOR_DOWN1; |
136 | on->state_change = 0; |
137 | monotime(&on->last_changed); |
138 | on->router_id = router_id; |
139 | |
140 | on->summary_list = ospf6_lsdb_create(on); |
141 | on->request_list = ospf6_lsdb_create(on); |
142 | on->retrans_list = ospf6_lsdb_create(on); |
143 | |
144 | on->dbdesc_list = ospf6_lsdb_create(on); |
145 | on->lsupdate_list = ospf6_lsdb_create(on); |
146 | on->lsack_list = ospf6_lsdb_create(on); |
147 | |
148 | for (type = 0; type < OSPF6_MESSAGE_TYPE_MAX0x6; type++) { |
149 | on->seqnum_l[type] = 0; |
150 | on->seqnum_h[type] = 0; |
151 | } |
152 | |
153 | on->auth_present = false0; |
154 | |
155 | listnode_add_sort(oi->neighbor_list, on); |
156 | |
157 | ospf6_bfd_info_nbr_create(oi, on); |
158 | return on; |
159 | } |
160 | |
161 | void ospf6_neighbor_delete(struct ospf6_neighbor *on) |
162 | { |
163 | if (on->p2xp_cfg) |
164 | on->p2xp_cfg->active = NULL((void*)0); |
165 | |
166 | ospf6_neighbor_clear_ls_lists(on); |
167 | |
168 | ospf6_lsdb_remove_all(on->dbdesc_list); |
169 | ospf6_lsdb_remove_all(on->lsupdate_list); |
170 | ospf6_lsdb_remove_all(on->lsack_list); |
171 | |
172 | ospf6_lsdb_delete(on->summary_list); |
173 | ospf6_lsdb_delete(on->request_list); |
174 | ospf6_lsdb_delete(on->retrans_list); |
175 | |
176 | ospf6_lsdb_delete(on->dbdesc_list); |
177 | ospf6_lsdb_delete(on->lsupdate_list); |
178 | ospf6_lsdb_delete(on->lsack_list); |
179 | |
180 | EVENT_OFF(on->inactivity_timer)do { if ((on->inactivity_timer)) event_cancel(&(on-> inactivity_timer)); } while (0); |
181 | |
182 | EVENT_OFF(on->last_dbdesc_release_timer)do { if ((on->last_dbdesc_release_timer)) event_cancel(& (on->last_dbdesc_release_timer)); } while (0); |
183 | |
184 | EVENT_OFF(on->thread_send_dbdesc)do { if ((on->thread_send_dbdesc)) event_cancel(&(on-> thread_send_dbdesc)); } while (0); |
185 | EVENT_OFF(on->thread_send_lsreq)do { if ((on->thread_send_lsreq)) event_cancel(&(on-> thread_send_lsreq)); } while (0); |
186 | EVENT_OFF(on->thread_send_lsupdate)do { if ((on->thread_send_lsupdate)) event_cancel(&(on ->thread_send_lsupdate)); } while (0); |
187 | EVENT_OFF(on->thread_send_lsack)do { if ((on->thread_send_lsack)) event_cancel(&(on-> thread_send_lsack)); } while (0); |
188 | EVENT_OFF(on->thread_exchange_done)do { if ((on->thread_exchange_done)) event_cancel(&(on ->thread_exchange_done)); } while (0); |
189 | EVENT_OFF(on->thread_adj_ok)do { if ((on->thread_adj_ok)) event_cancel(&(on->thread_adj_ok )); } while (0); |
190 | EVENT_OFF(on->event_loading_done)do { if ((on->event_loading_done)) event_cancel(&(on-> event_loading_done)); } while (0); |
191 | |
192 | EVENT_OFF(on->gr_helper_info.t_grace_timer)do { if ((on->gr_helper_info.t_grace_timer)) event_cancel( &(on->gr_helper_info.t_grace_timer)); } while (0); |
193 | |
194 | bfd_sess_free(&on->bfd_session); |
195 | XFREE(MTYPE_OSPF6_NEIGHBOR, on)do { qfree(MTYPE_OSPF6_NEIGHBOR, on); on = ((void*)0); } while (0); |
196 | } |
197 | |
198 | void ospf6_neighbor_lladdr_set(struct ospf6_neighbor *on, |
199 | const struct in6_addr *addr) |
200 | { |
201 | if (IPV6_ADDR_SAME(addr, &on->linklocal_addr)(memcmp ((addr), (&on->linklocal_addr), 16) == 0)) |
202 | return; |
203 | |
204 | memcpy(&on->linklocal_addr, addr, sizeof(struct in6_addr)); |
205 | |
206 | if (on->ospf6_if->type == OSPF_IFTYPE_POINTOPOINT1 || |
207 | on->ospf6_if->type == OSPF_IFTYPE_POINTOMULTIPOINT4) { |
208 | uint32_t prev_cost = ospf6_neighbor_cost(on); |
209 | |
210 | p2xp_neigh_refresh(on, prev_cost); |
211 | } |
212 | } |
213 | |
214 | static void ospf6_neighbor_state_change(uint8_t next_state, |
215 | struct ospf6_neighbor *on, int event) |
216 | { |
217 | uint8_t prev_state; |
218 | |
219 | prev_state = on->state; |
220 | on->state = next_state; |
221 | |
222 | if (prev_state == next_state) |
223 | return; |
224 | |
225 | on->state_change++; |
226 | monotime(&on->last_changed); |
227 | |
228 | /* log */ |
229 | if (IS_OSPF6_DEBUG_NEIGHBOR(STATE)(conf_debug_ospf6_neighbor & 0x01)) { |
230 | zlog_debug("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)",do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 234, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), .priority = (7), .ec = (0), .args = ("on->name, &on->router_id, ospf6_neighbor_state_str[prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string(event)" ), }; static const struct xref * const xref_p_97 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), on->name, &on->router_id, ospf6_neighbor_state_str [prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string (event)); } while (0) |
231 | on->name, &on->router_id,do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 234, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), .priority = (7), .ec = (0), .args = ("on->name, &on->router_id, ospf6_neighbor_state_str[prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string(event)" ), }; static const struct xref * const xref_p_97 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), on->name, &on->router_id, ospf6_neighbor_state_str [prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string (event)); } while (0) |
232 | ospf6_neighbor_state_str[prev_state],do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 234, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), .priority = (7), .ec = (0), .args = ("on->name, &on->router_id, ospf6_neighbor_state_str[prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string(event)" ), }; static const struct xref * const xref_p_97 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), on->name, &on->router_id, ospf6_neighbor_state_str [prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string (event)); } while (0) |
233 | ospf6_neighbor_state_str[next_state],do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 234, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), .priority = (7), .ec = (0), .args = ("on->name, &on->router_id, ospf6_neighbor_state_str[prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string(event)" ), }; static const struct xref * const xref_p_97 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), on->name, &on->router_id, ospf6_neighbor_state_str [prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string (event)); } while (0) |
234 | ospf6_neighbor_event_string(event))do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 234, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), .priority = (7), .ec = (0), .args = ("on->name, &on->router_id, ospf6_neighbor_state_str[prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string(event)" ), }; static const struct xref * const xref_p_97 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("Neighbor state change %s (Router-ID: %pI4): [%s]->[%s] (%s)" ), on->name, &on->router_id, ospf6_neighbor_state_str [prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string (event)); } while (0); |
235 | } |
236 | |
237 | /* Optionally notify about adjacency changes */ |
238 | if (CHECK_FLAG(on->ospf6_if->area->ospf6->config_flags,((on->ospf6_if->area->ospf6->config_flags) & ( OSPF6_LOG_ADJACENCY_CHANGES)) |
239 | OSPF6_LOG_ADJACENCY_CHANGES)((on->ospf6_if->area->ospf6->config_flags) & ( OSPF6_LOG_ADJACENCY_CHANGES)) && |
240 | (CHECK_FLAG(on->ospf6_if->area->ospf6->config_flags,((on->ospf6_if->area->ospf6->config_flags) & ( OSPF6_LOG_ADJACENCY_DETAIL)) |
241 | OSPF6_LOG_ADJACENCY_DETAIL)((on->ospf6_if->area->ospf6->config_flags) & ( OSPF6_LOG_ADJACENCY_DETAIL)) || |
242 | (next_state == OSPF6_NEIGHBOR_FULL8) || (next_state < prev_state))) |
243 | zlog_notice("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)",do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .hashu32 = {(5), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 248, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .priority = (5), .ec = (0), .args = ("&on->router_id, vrf_id_to_name(on->ospf6_if->interface->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string(event)" ), }; static const struct xref * const xref_p_98 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)") , &on->router_id, vrf_id_to_name(on->ospf6_if->interface ->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state ], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string (event)); } while (0) |
244 | &on->router_id,do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .hashu32 = {(5), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 248, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .priority = (5), .ec = (0), .args = ("&on->router_id, vrf_id_to_name(on->ospf6_if->interface->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string(event)" ), }; static const struct xref * const xref_p_98 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)") , &on->router_id, vrf_id_to_name(on->ospf6_if->interface ->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state ], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string (event)); } while (0) |
245 | vrf_id_to_name(on->ospf6_if->interface->vrf->vrf_id),do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .hashu32 = {(5), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 248, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .priority = (5), .ec = (0), .args = ("&on->router_id, vrf_id_to_name(on->ospf6_if->interface->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string(event)" ), }; static const struct xref * const xref_p_98 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)") , &on->router_id, vrf_id_to_name(on->ospf6_if->interface ->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state ], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string (event)); } while (0) |
246 | on->name, ospf6_neighbor_state_str[prev_state],do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .hashu32 = {(5), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 248, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .priority = (5), .ec = (0), .args = ("&on->router_id, vrf_id_to_name(on->ospf6_if->interface->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string(event)" ), }; static const struct xref * const xref_p_98 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)") , &on->router_id, vrf_id_to_name(on->ospf6_if->interface ->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state ], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string (event)); } while (0) |
247 | ospf6_neighbor_state_str[next_state],do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .hashu32 = {(5), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 248, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .priority = (5), .ec = (0), .args = ("&on->router_id, vrf_id_to_name(on->ospf6_if->interface->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string(event)" ), }; static const struct xref * const xref_p_98 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)") , &on->router_id, vrf_id_to_name(on->ospf6_if->interface ->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state ], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string (event)); } while (0) |
248 | ospf6_neighbor_event_string(event))do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .hashu32 = {(5), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 248, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)" ), .priority = (5), .ec = (0), .args = ("&on->router_id, vrf_id_to_name(on->ospf6_if->interface->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string(event)" ), }; static const struct xref * const xref_p_98 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("AdjChg: Nbr %pI4(%s) on %s: %s -> %s (%s)") , &on->router_id, vrf_id_to_name(on->ospf6_if->interface ->vrf->vrf_id), on->name, ospf6_neighbor_state_str[prev_state ], ospf6_neighbor_state_str[next_state], ospf6_neighbor_event_string (event)); } while (0); |
249 | |
250 | if (prev_state == OSPF6_NEIGHBOR_FULL8 || |
251 | next_state == OSPF6_NEIGHBOR_FULL8) { |
252 | if (!OSPF6_GR_IS_ACTIVE_HELPER(on)((on)->gr_helper_info.gr_helper_status == 1)) { |
253 | OSPF6_ROUTER_LSA_SCHEDULE(on->ospf6_if->area)do { if ((((on->ospf6_if->area)->flag) & (0x01)) ) ({ static const struct xref_eventsched _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 253, "ospf6d/ospf6_neighbor.c", __func__, }, .funcname = "ospf6_router_lsa_originate" , .dest = "&(on->ospf6_if->area)->thread_router_lsa" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_99 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_router_lsa_originate , on->ospf6_if->area, 0, &(on->ospf6_if->area )->thread_router_lsa); }); } while (0); |
254 | if (on->ospf6_if->state == OSPF6_INTERFACE_DR8) { |
255 | OSPF6_NETWORK_LSA_SCHEDULE(on->ospf6_if)do { if (!(((on->ospf6_if)->flag) & (0x01))) ({ static const struct xref_eventsched _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 255, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_network_lsa_originate", .dest = "&(on->ospf6_if)->thread_network_lsa", .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_100 __attribute__((used, section("xref_array"))) = &(_xref.xref ); _event_add_event(&_xref, master, ospf6_network_lsa_originate , on->ospf6_if, 0, &(on->ospf6_if)->thread_network_lsa ); }); } while (0); |
256 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT(do { if (!(((on->ospf6_if)->flag) & (0x01))) ({ static const struct xref_eventsched _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 257, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_intra_prefix_lsa_originate_transit" , .dest = "&(on->ospf6_if)->thread_intra_prefix_lsa" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_101 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_intra_prefix_lsa_originate_transit , on->ospf6_if, 0, &(on->ospf6_if)->thread_intra_prefix_lsa ); }); } while (0) |
257 | on->ospf6_if)do { if (!(((on->ospf6_if)->flag) & (0x01))) ({ static const struct xref_eventsched _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 257, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_intra_prefix_lsa_originate_transit" , .dest = "&(on->ospf6_if)->thread_intra_prefix_lsa" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_101 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_intra_prefix_lsa_originate_transit , on->ospf6_if, 0, &(on->ospf6_if)->thread_intra_prefix_lsa ); }); } while (0); |
258 | } |
259 | } |
260 | if (next_state == OSPF6_NEIGHBOR_FULL8) |
261 | on->ospf6_if->area->intra_prefix_originate = 1; |
262 | |
263 | if (!OSPF6_GR_IS_ACTIVE_HELPER(on)((on)->gr_helper_info.gr_helper_status == 1)) |
264 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(on->ospf6_if->area)do { if ((((on->ospf6_if->area)->flag) & (0x01)) ) ({ static const struct xref_eventsched _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 264, "ospf6d/ospf6_neighbor.c", __func__, }, .funcname = "ospf6_intra_prefix_lsa_originate_stub" , .dest = "&(on->ospf6_if->area)->thread_intra_prefix_lsa" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_102 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_intra_prefix_lsa_originate_stub , on->ospf6_if->area, 0, &(on->ospf6_if->area )->thread_intra_prefix_lsa); }); } while (0); |
265 | |
266 | if ((prev_state == OSPF6_NEIGHBOR_LOADING7 || |
267 | prev_state == OSPF6_NEIGHBOR_EXCHANGE6) && |
268 | next_state == OSPF6_NEIGHBOR_FULL8) { |
269 | OSPF6_AS_EXTERN_LSA_SCHEDULE(on->ospf6_if)do { if (!(((on->ospf6_if)->flag) & (0x01))) ({ static const struct xref_eventsched _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 269, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_orig_as_external_lsa", .dest = "&(on->ospf6_if)->thread_as_extern_lsa", .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_103 __attribute__((used, section("xref_array"))) = &(_xref.xref ); _event_add_event(&_xref, master, ospf6_orig_as_external_lsa , on->ospf6_if, 0, &(on->ospf6_if)->thread_as_extern_lsa ); }); } while (0); |
270 | on->ospf6_if->area->full_nbrs++; |
271 | } |
272 | |
273 | if (prev_state == OSPF6_NEIGHBOR_FULL8) |
274 | on->ospf6_if->area->full_nbrs--; |
275 | } |
276 | |
277 | if ((prev_state == OSPF6_NEIGHBOR_EXCHANGE6 || |
278 | prev_state == OSPF6_NEIGHBOR_LOADING7) && |
279 | (next_state != OSPF6_NEIGHBOR_EXCHANGE6 && |
280 | next_state != OSPF6_NEIGHBOR_LOADING7)) |
281 | ospf6_maxage_remove(on->ospf6_if->area->ospf6); |
282 | |
283 | hook_call(ospf6_neighbor_change, on, next_state, prev_state)hook_call_ospf6_neighbor_change(on, next_state, prev_state); |
284 | ospf6_bfd_trigger_event(on, prev_state, next_state); |
285 | } |
286 | |
287 | /* RFC2328 section 10.4 */ |
288 | static int need_adjacency(struct ospf6_neighbor *on) |
289 | { |
290 | if (on->ospf6_if->state == OSPF6_INTERFACE_POINTTOPOINT4 || |
291 | on->ospf6_if->state == OSPF6_INTERFACE_POINTTOMULTIPOINT5 || |
292 | on->ospf6_if->state == OSPF6_INTERFACE_DR8 || |
293 | on->ospf6_if->state == OSPF6_INTERFACE_BDR7) |
294 | return 1; |
295 | |
296 | if (on->ospf6_if->drouter == on->router_id || |
297 | on->ospf6_if->bdrouter == on->router_id) |
298 | return 1; |
299 | |
300 | return 0; |
301 | } |
302 | |
303 | void hello_received(struct event *thread) |
304 | { |
305 | struct ospf6_neighbor *on; |
306 | |
307 | on = (struct ospf6_neighbor *)EVENT_ARG(thread)((thread)->arg); |
308 | assert(on)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 308, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on", }; static const struct xref * const xref_p_104 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((on) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on); }); |
309 | |
310 | if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
311 | zlog_debug("Neighbor Event %s: *HelloReceived*", on->name)do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor Event %s: *HelloReceived*" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 311, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor Event %s: *HelloReceived*"), .priority = (7), .ec = (0), .args = ("on->name"), }; static const struct xref * const xref_p_105 __attribute__((used, section("xref_array" ))) = &(_xref.xref); zlog_ref(&_xref, ("Neighbor Event %s: *HelloReceived*" ), on->name); } while (0); |
312 | |
313 | /* reset Inactivity Timer */ |
314 | EVENT_OFF(on->inactivity_timer)do { if ((on->inactivity_timer)) event_cancel(&(on-> inactivity_timer)); } while (0); |
315 | event_add_timer(master, inactivity_timer, on,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 316, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "inactivity_timer", .dest = "&on->inactivity_timer" , .event_type = EVENT_TIMER, }; static const struct xref * const xref_p_106 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_timer(&_xref, master, inactivity_timer , on, on->ospf6_if->dead_interval, &on->inactivity_timer ); }) |
316 | on->ospf6_if->dead_interval, &on->inactivity_timer)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 316, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "inactivity_timer", .dest = "&on->inactivity_timer" , .event_type = EVENT_TIMER, }; static const struct xref * const xref_p_106 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_timer(&_xref, master, inactivity_timer , on, on->ospf6_if->dead_interval, &on->inactivity_timer ); }); |
317 | |
318 | if (on->state <= OSPF6_NEIGHBOR_DOWN1) |
319 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_INIT3, on, |
320 | OSPF6_NEIGHBOR_EVENT_HELLO_RCVD1); |
321 | } |
322 | |
323 | void twoway_received(struct event *thread) |
324 | { |
325 | struct ospf6_neighbor *on; |
326 | |
327 | on = (struct ospf6_neighbor *)EVENT_ARG(thread)((thread)->arg); |
328 | assert(on)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 328, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on", }; static const struct xref * const xref_p_107 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((on) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on); }); |
329 | |
330 | if (on->state > OSPF6_NEIGHBOR_INIT3) |
331 | return; |
332 | |
333 | if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
334 | zlog_debug("Neighbor Event %s: *2Way-Received*", on->name)do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor Event %s: *2Way-Received*" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 334, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor Event %s: *2Way-Received*"), .priority = (7), .ec = (0), .args = ("on->name"), }; static const struct xref * const xref_p_108 __attribute__((used, section("xref_array" ))) = &(_xref.xref); zlog_ref(&_xref, ("Neighbor Event %s: *2Way-Received*" ), on->name); } while (0); |
335 | |
336 | event_add_event(master, neighbor_change, on->ospf6_if, 0, NULL)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 336, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "neighbor_change", .dest = "((void*)0)" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_109 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, neighbor_change , on->ospf6_if, 0, ((void*)0)); }); |
337 | |
338 | if (!need_adjacency(on)) { |
339 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_TWOWAY4, on, |
340 | OSPF6_NEIGHBOR_EVENT_TWOWAY_RCVD2); |
341 | return; |
342 | } |
343 | |
344 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_EXSTART5, on, |
345 | OSPF6_NEIGHBOR_EVENT_TWOWAY_RCVD2); |
346 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT)(on->dbdesc_bits) |= ((0x01)); |
347 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT)(on->dbdesc_bits) |= ((0x02)); |
348 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_IBIT)(on->dbdesc_bits) |= ((0x04)); |
349 | |
350 | EVENT_OFF(on->thread_send_dbdesc)do { if ((on->thread_send_dbdesc)) event_cancel(&(on-> thread_send_dbdesc)); } while (0); |
351 | event_add_event(master, ospf6_dbdesc_send, on, 0,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 352, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_dbdesc_send", .dest = "&on->thread_send_dbdesc" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_110 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_dbdesc_send , on, 0, &on->thread_send_dbdesc); }) |
352 | &on->thread_send_dbdesc)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 352, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_dbdesc_send", .dest = "&on->thread_send_dbdesc" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_110 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_dbdesc_send , on, 0, &on->thread_send_dbdesc); }); |
353 | } |
354 | |
355 | void negotiation_done(struct event *thread) |
356 | { |
357 | struct ospf6_neighbor *on; |
358 | struct ospf6_lsa *lsa, *lsanext; |
359 | |
360 | on = (struct ospf6_neighbor *)EVENT_ARG(thread)((thread)->arg); |
361 | assert(on)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 361, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on", }; static const struct xref * const xref_p_111 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((on) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on); }); |
362 | |
363 | if (on->state != OSPF6_NEIGHBOR_EXSTART5) |
364 | return; |
365 | |
366 | if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
367 | zlog_debug("Neighbor Event %s: *NegotiationDone*", on->name)do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor Event %s: *NegotiationDone*" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 367, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor Event %s: *NegotiationDone*"), .priority = (7), .ec = (0), .args = ("on->name"), }; static const struct xref * const xref_p_112 __attribute__((used, section("xref_array" ))) = &(_xref.xref); zlog_ref(&_xref, ("Neighbor Event %s: *NegotiationDone*" ), on->name); } while (0); |
368 | |
369 | /* clear ls-list */ |
370 | ospf6_neighbor_clear_ls_lists(on); |
371 | |
372 | /* Interface scoped LSAs */ |
373 | for (ALL_LSDB(on->ospf6_if->lsdb, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->ospf6_if ->lsdb, 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock(lsa) && ((lsanext) = ospf6_lsdb_next( iterend, (lsa)), 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext )) { |
374 | if (OSPF6_LSA_IS_MAXAGE(lsa)(ospf6_lsa_age_current (lsa) == 3600)) { |
375 | ospf6_increment_retrans_count(lsa); |
376 | ospf6_lsdb_add(ospf6_lsa_copy(lsa), on->retrans_list); |
377 | } else |
378 | ospf6_lsdb_add(ospf6_lsa_copy(lsa), on->summary_list); |
379 | } |
380 | |
381 | /* Area scoped LSAs */ |
382 | for (ALL_LSDB(on->ospf6_if->area->lsdb, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->ospf6_if ->area->lsdb, 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock(lsa) && ((lsanext) = ospf6_lsdb_next( iterend, (lsa)), 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext )) { |
383 | if (OSPF6_LSA_IS_MAXAGE(lsa)(ospf6_lsa_age_current (lsa) == 3600)) { |
384 | ospf6_increment_retrans_count(lsa); |
385 | ospf6_lsdb_add(ospf6_lsa_copy(lsa), on->retrans_list); |
386 | } else |
387 | ospf6_lsdb_add(ospf6_lsa_copy(lsa), on->summary_list); |
388 | } |
389 | |
390 | /* AS scoped LSAs */ |
391 | for (ALL_LSDB(on->ospf6_if->area->ospf6->lsdb, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->ospf6_if ->area->ospf6->lsdb, 0, 0, 0, &lsa); (lsa) != (( void*)0) && ospf6_lsa_lock(lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)), 1); ospf6_lsa_unlock(& lsa), (lsa) = (lsanext)) { |
392 | if (OSPF6_LSA_IS_MAXAGE(lsa)(ospf6_lsa_age_current (lsa) == 3600)) { |
393 | ospf6_increment_retrans_count(lsa); |
394 | ospf6_lsdb_add(ospf6_lsa_copy(lsa), on->retrans_list); |
395 | } else |
396 | ospf6_lsdb_add(ospf6_lsa_copy(lsa), on->summary_list); |
397 | } |
398 | |
399 | UNSET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_IBIT)(on->dbdesc_bits) &= ~((0x04)); |
400 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_EXCHANGE6, on, |
401 | OSPF6_NEIGHBOR_EVENT_NEGOTIATION_DONE3); |
402 | } |
403 | |
404 | static void ospf6_neighbor_last_dbdesc_release(struct event *thread) |
405 | { |
406 | struct ospf6_neighbor *on = EVENT_ARG(thread)((thread)->arg); |
407 | |
408 | assert(on)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 408, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on", }; static const struct xref * const xref_p_113 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((on) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on); }); |
409 | memset(&on->dbdesc_last, 0, sizeof(struct ospf6_dbdesc)); |
410 | } |
411 | |
412 | void exchange_done(struct event *thread) |
413 | { |
414 | struct ospf6_neighbor *on; |
415 | |
416 | on = (struct ospf6_neighbor *)EVENT_ARG(thread)((thread)->arg); |
417 | assert(on)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 417, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on", }; static const struct xref * const xref_p_114 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((on) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on); }); |
418 | |
419 | if (on->state != OSPF6_NEIGHBOR_EXCHANGE6) |
420 | return; |
421 | |
422 | if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
423 | zlog_debug("Neighbor Event %s: *ExchangeDone*", on->name)do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor Event %s: *ExchangeDone*" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 423, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor Event %s: *ExchangeDone*"), .priority = (7), .ec = (0), .args = ("on->name"), }; static const struct xref * const xref_p_115 __attribute__((used, section("xref_array" ))) = &(_xref.xref); zlog_ref(&_xref, ("Neighbor Event %s: *ExchangeDone*" ), on->name); } while (0); |
424 | |
425 | EVENT_OFF(on->thread_send_dbdesc)do { if ((on->thread_send_dbdesc)) event_cancel(&(on-> thread_send_dbdesc)); } while (0); |
426 | ospf6_lsdb_remove_all(on->dbdesc_list); |
427 | |
428 | /* RFC 2328 (10.8): Release the last dbdesc after dead_interval */ |
429 | if (!CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT)((on->dbdesc_bits) & ((0x01)))) { |
430 | EVENT_OFF(on->last_dbdesc_release_timer)do { if ((on->last_dbdesc_release_timer)) event_cancel(& (on->last_dbdesc_release_timer)); } while (0); |
431 | event_add_timer(master, ospf6_neighbor_last_dbdesc_release, on,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 433, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_neighbor_last_dbdesc_release" , .dest = "&on->last_dbdesc_release_timer", .event_type = EVENT_TIMER, }; static const struct xref * const xref_p_116 __attribute__((used, section("xref_array"))) = &(_xref.xref ); _event_add_timer(&_xref, master, ospf6_neighbor_last_dbdesc_release , on, on->ospf6_if->dead_interval, &on->last_dbdesc_release_timer ); }) |
432 | on->ospf6_if->dead_interval,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 433, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_neighbor_last_dbdesc_release" , .dest = "&on->last_dbdesc_release_timer", .event_type = EVENT_TIMER, }; static const struct xref * const xref_p_116 __attribute__((used, section("xref_array"))) = &(_xref.xref ); _event_add_timer(&_xref, master, ospf6_neighbor_last_dbdesc_release , on, on->ospf6_if->dead_interval, &on->last_dbdesc_release_timer ); }) |
433 | &on->last_dbdesc_release_timer)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 433, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_neighbor_last_dbdesc_release" , .dest = "&on->last_dbdesc_release_timer", .event_type = EVENT_TIMER, }; static const struct xref * const xref_p_116 __attribute__((used, section("xref_array"))) = &(_xref.xref ); _event_add_timer(&_xref, master, ospf6_neighbor_last_dbdesc_release , on, on->ospf6_if->dead_interval, &on->last_dbdesc_release_timer ); }); |
434 | } |
435 | |
436 | if (on->request_list->count == 0) |
437 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_FULL8, on, |
438 | OSPF6_NEIGHBOR_EVENT_EXCHANGE_DONE4); |
439 | else { |
440 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_LOADING7, on, |
441 | OSPF6_NEIGHBOR_EVENT_EXCHANGE_DONE4); |
442 | |
443 | event_add_event(master, ospf6_lsreq_send, on, 0,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 444, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_lsreq_send", .dest = "&on->thread_send_lsreq" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_117 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_lsreq_send , on, 0, &on->thread_send_lsreq); }) |
444 | &on->thread_send_lsreq)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 444, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_lsreq_send", .dest = "&on->thread_send_lsreq" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_117 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_lsreq_send , on, 0, &on->thread_send_lsreq); }); |
445 | } |
446 | } |
447 | |
448 | /* Check loading state. */ |
449 | void ospf6_check_nbr_loading(struct ospf6_neighbor *on) |
450 | { |
451 | /* RFC2328 Section 10.9: When the neighbor responds to these requests |
452 | with the proper Link State Update packet(s), the Link state request |
453 | list is truncated and a new Link State Request packet is sent. |
454 | */ |
455 | if ((on->state == OSPF6_NEIGHBOR_LOADING7) || |
456 | (on->state == OSPF6_NEIGHBOR_EXCHANGE6)) { |
457 | if (on->request_list->count == 0) |
458 | event_add_event(master, loading_done, on, 0,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 459, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "loading_done", .dest = "&on->event_loading_done" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_118 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, loading_done , on, 0, &on->event_loading_done); }) |
459 | &on->event_loading_done)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 459, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "loading_done", .dest = "&on->event_loading_done" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_118 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, loading_done , on, 0, &on->event_loading_done); }); |
460 | else if (on->last_ls_req == NULL((void*)0)) { |
461 | EVENT_OFF(on->thread_send_lsreq)do { if ((on->thread_send_lsreq)) event_cancel(&(on-> thread_send_lsreq)); } while (0); |
462 | event_add_event(master, ospf6_lsreq_send, on, 0,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 463, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_lsreq_send", .dest = "&on->thread_send_lsreq" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_119 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_lsreq_send , on, 0, &on->thread_send_lsreq); }) |
463 | &on->thread_send_lsreq)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 463, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_lsreq_send", .dest = "&on->thread_send_lsreq" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_119 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_lsreq_send , on, 0, &on->thread_send_lsreq); }); |
464 | } |
465 | } |
466 | } |
467 | |
468 | void loading_done(struct event *thread) |
469 | { |
470 | struct ospf6_neighbor *on; |
471 | |
472 | on = (struct ospf6_neighbor *)EVENT_ARG(thread)((thread)->arg); |
473 | assert(on)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 473, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on", }; static const struct xref * const xref_p_120 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((on) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on); }); |
474 | |
475 | if (on->state != OSPF6_NEIGHBOR_LOADING7) |
476 | return; |
477 | |
478 | if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
479 | zlog_debug("Neighbor Event %s: *LoadingDone*", on->name)do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor Event %s: *LoadingDone*" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 479, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor Event %s: *LoadingDone*"), .priority = (7), .ec = (0), .args = ("on->name"), }; static const struct xref * const xref_p_121 __attribute__((used, section("xref_array" ))) = &(_xref.xref); zlog_ref(&_xref, ("Neighbor Event %s: *LoadingDone*" ), on->name); } while (0); |
480 | |
481 | assert(on->request_list->count == 0)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 481, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on->request_list->count == 0", } ; static const struct xref * const xref_p_122 __attribute__(( used, section("xref_array"))) = &(_xref.xref); if (__builtin_expect ((on->request_list->count == 0) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on->request_list->count == 0); }); |
482 | |
483 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_FULL8, on, |
484 | OSPF6_NEIGHBOR_EVENT_LOADING_DONE5); |
485 | } |
486 | |
487 | void adj_ok(struct event *thread) |
488 | { |
489 | struct ospf6_neighbor *on; |
490 | |
491 | on = (struct ospf6_neighbor *)EVENT_ARG(thread)((thread)->arg); |
492 | assert(on)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 492, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on", }; static const struct xref * const xref_p_123 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((on) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on); }); |
493 | |
494 | if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
495 | zlog_debug("Neighbor Event %s: *AdjOK?*", on->name)do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor Event %s: *AdjOK?*" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 495, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor Event %s: *AdjOK?*"), .priority = ( 7), .ec = (0), .args = ("on->name"), }; static const struct xref * const xref_p_124 __attribute__((used, section("xref_array" ))) = &(_xref.xref); zlog_ref(&_xref, ("Neighbor Event %s: *AdjOK?*" ), on->name); } while (0); |
496 | |
497 | if (on->state == OSPF6_NEIGHBOR_TWOWAY4 && need_adjacency(on)) { |
498 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_EXSTART5, on, |
499 | OSPF6_NEIGHBOR_EVENT_ADJ_OK6); |
500 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT)(on->dbdesc_bits) |= ((0x01)); |
501 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT)(on->dbdesc_bits) |= ((0x02)); |
502 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_IBIT)(on->dbdesc_bits) |= ((0x04)); |
503 | |
504 | EVENT_OFF(on->thread_send_dbdesc)do { if ((on->thread_send_dbdesc)) event_cancel(&(on-> thread_send_dbdesc)); } while (0); |
505 | event_add_event(master, ospf6_dbdesc_send, on, 0,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 506, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_dbdesc_send", .dest = "&on->thread_send_dbdesc" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_125 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_dbdesc_send , on, 0, &on->thread_send_dbdesc); }) |
506 | &on->thread_send_dbdesc)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 506, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_dbdesc_send", .dest = "&on->thread_send_dbdesc" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_125 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_dbdesc_send , on, 0, &on->thread_send_dbdesc); }); |
507 | |
508 | } else if (on->state >= OSPF6_NEIGHBOR_EXSTART5 && !need_adjacency(on)) { |
509 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_TWOWAY4, on, |
510 | OSPF6_NEIGHBOR_EVENT_ADJ_OK6); |
511 | ospf6_neighbor_clear_ls_lists(on); |
512 | } |
513 | } |
514 | |
515 | void seqnumber_mismatch(struct event *thread) |
516 | { |
517 | struct ospf6_neighbor *on; |
518 | |
519 | on = (struct ospf6_neighbor *)EVENT_ARG(thread)((thread)->arg); |
520 | assert(on)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 520, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on", }; static const struct xref * const xref_p_126 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((on) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on); }); |
521 | |
522 | if (on->state < OSPF6_NEIGHBOR_EXCHANGE6) |
523 | return; |
524 | |
525 | if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
526 | zlog_debug("Neighbor Event %s: *SeqNumberMismatch*", on->name)do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor Event %s: *SeqNumberMismatch*" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 526, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor Event %s: *SeqNumberMismatch*"), .priority = (7), .ec = (0), .args = ("on->name"), }; static const struct xref * const xref_p_127 __attribute__((used, section("xref_array" ))) = &(_xref.xref); zlog_ref(&_xref, ("Neighbor Event %s: *SeqNumberMismatch*" ), on->name); } while (0); |
527 | |
528 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_EXSTART5, on, |
529 | OSPF6_NEIGHBOR_EVENT_SEQNUMBER_MISMATCH7); |
530 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT)(on->dbdesc_bits) |= ((0x01)); |
531 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT)(on->dbdesc_bits) |= ((0x02)); |
532 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_IBIT)(on->dbdesc_bits) |= ((0x04)); |
533 | |
534 | ospf6_neighbor_clear_ls_lists(on); |
535 | |
536 | EVENT_OFF(on->thread_send_dbdesc)do { if ((on->thread_send_dbdesc)) event_cancel(&(on-> thread_send_dbdesc)); } while (0); |
537 | on->dbdesc_seqnum++; /* Incr seqnum as per RFC2328, sec 10.3 */ |
538 | |
539 | event_add_event(master, ospf6_dbdesc_send, on, 0,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 540, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_dbdesc_send", .dest = "&on->thread_send_dbdesc" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_128 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_dbdesc_send , on, 0, &on->thread_send_dbdesc); }) |
540 | &on->thread_send_dbdesc)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 540, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_dbdesc_send", .dest = "&on->thread_send_dbdesc" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_128 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_dbdesc_send , on, 0, &on->thread_send_dbdesc); }); |
541 | } |
542 | |
543 | void bad_lsreq(struct event *thread) |
544 | { |
545 | struct ospf6_neighbor *on; |
546 | |
547 | on = (struct ospf6_neighbor *)EVENT_ARG(thread)((thread)->arg); |
548 | assert(on)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 548, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on", }; static const struct xref * const xref_p_129 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((on) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on); }); |
549 | |
550 | if (on->state < OSPF6_NEIGHBOR_EXCHANGE6) |
551 | return; |
552 | |
553 | if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
554 | zlog_debug("Neighbor Event %s: *BadLSReq*", on->name)do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor Event %s: *BadLSReq*" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 554, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor Event %s: *BadLSReq*"), .priority = (7), .ec = (0), .args = ("on->name"), }; static const struct xref * const xref_p_130 __attribute__((used, section("xref_array" ))) = &(_xref.xref); zlog_ref(&_xref, ("Neighbor Event %s: *BadLSReq*" ), on->name); } while (0); |
555 | |
556 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_EXSTART5, on, |
557 | OSPF6_NEIGHBOR_EVENT_BAD_LSREQ8); |
558 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT)(on->dbdesc_bits) |= ((0x01)); |
559 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT)(on->dbdesc_bits) |= ((0x02)); |
560 | SET_FLAG(on->dbdesc_bits, OSPF6_DBDESC_IBIT)(on->dbdesc_bits) |= ((0x04)); |
561 | |
562 | ospf6_neighbor_clear_ls_lists(on); |
563 | |
564 | EVENT_OFF(on->thread_send_dbdesc)do { if ((on->thread_send_dbdesc)) event_cancel(&(on-> thread_send_dbdesc)); } while (0); |
565 | on->dbdesc_seqnum++; /* Incr seqnum as per RFC2328, sec 10.3 */ |
566 | |
567 | event_add_event(master, ospf6_dbdesc_send, on, 0,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 568, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_dbdesc_send", .dest = "&on->thread_send_dbdesc" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_131 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_dbdesc_send , on, 0, &on->thread_send_dbdesc); }) |
568 | &on->thread_send_dbdesc)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 568, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "ospf6_dbdesc_send", .dest = "&on->thread_send_dbdesc" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_131 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_dbdesc_send , on, 0, &on->thread_send_dbdesc); }); |
569 | } |
570 | |
571 | void oneway_received(struct event *thread) |
572 | { |
573 | struct ospf6_neighbor *on; |
574 | |
575 | on = (struct ospf6_neighbor *)EVENT_ARG(thread)((thread)->arg); |
576 | assert(on)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 576, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on", }; static const struct xref * const xref_p_132 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((on) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on); }); |
577 | |
578 | if (on->state < OSPF6_NEIGHBOR_TWOWAY4) |
579 | return; |
580 | |
581 | if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
582 | zlog_debug("Neighbor Event %s: *1Way-Received*", on->name)do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor Event %s: *1Way-Received*" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 582, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor Event %s: *1Way-Received*"), .priority = (7), .ec = (0), .args = ("on->name"), }; static const struct xref * const xref_p_133 __attribute__((used, section("xref_array" ))) = &(_xref.xref); zlog_ref(&_xref, ("Neighbor Event %s: *1Way-Received*" ), on->name); } while (0); |
583 | |
584 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_INIT3, on, |
585 | OSPF6_NEIGHBOR_EVENT_ONEWAY_RCVD9); |
586 | event_add_event(master, neighbor_change, on->ospf6_if, 0, NULL)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 586, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "neighbor_change", .dest = "((void*)0)" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_134 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, neighbor_change , on->ospf6_if, 0, ((void*)0)); }); |
587 | |
588 | ospf6_neighbor_clear_ls_lists(on); |
589 | |
590 | EVENT_OFF(on->thread_send_dbdesc)do { if ((on->thread_send_dbdesc)) event_cancel(&(on-> thread_send_dbdesc)); } while (0); |
591 | EVENT_OFF(on->thread_send_lsreq)do { if ((on->thread_send_lsreq)) event_cancel(&(on-> thread_send_lsreq)); } while (0); |
592 | EVENT_OFF(on->thread_send_lsupdate)do { if ((on->thread_send_lsupdate)) event_cancel(&(on ->thread_send_lsupdate)); } while (0); |
593 | EVENT_OFF(on->thread_send_lsack)do { if ((on->thread_send_lsack)) event_cancel(&(on-> thread_send_lsack)); } while (0); |
594 | EVENT_OFF(on->thread_exchange_done)do { if ((on->thread_exchange_done)) event_cancel(&(on ->thread_exchange_done)); } while (0); |
595 | EVENT_OFF(on->thread_adj_ok)do { if ((on->thread_adj_ok)) event_cancel(&(on->thread_adj_ok )); } while (0); |
596 | } |
597 | |
598 | void inactivity_timer(struct event *thread) |
599 | { |
600 | struct ospf6_neighbor *on; |
601 | |
602 | on = (struct ospf6_neighbor *)EVENT_ARG(thread)((thread)->arg); |
603 | assert(on)({ static const struct xref_assert _xref __attribute__( (used )) = { .xref = { (((void*)0)), (XREFT_ASSERT), 603, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "on", }; static const struct xref * const xref_p_135 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((on) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (on); }); |
604 | |
605 | if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
606 | zlog_debug("Neighbor Event %s: *InactivityTimer*", on->name)do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("Neighbor Event %s: *InactivityTimer*" ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 606, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("Neighbor Event %s: *InactivityTimer*"), .priority = (7), .ec = (0), .args = ("on->name"), }; static const struct xref * const xref_p_136 __attribute__((used, section("xref_array" ))) = &(_xref.xref); zlog_ref(&_xref, ("Neighbor Event %s: *InactivityTimer*" ), on->name); } while (0); |
607 | |
608 | on->drouter = on->prev_drouter = 0; |
609 | on->bdrouter = on->prev_bdrouter = 0; |
610 | |
611 | if (!OSPF6_GR_IS_ACTIVE_HELPER(on)((on)->gr_helper_info.gr_helper_status == 1)) { |
612 | on->drouter = on->prev_drouter = 0; |
613 | on->bdrouter = on->prev_bdrouter = 0; |
614 | |
615 | ospf6_neighbor_state_change(OSPF6_NEIGHBOR_DOWN1, on, |
616 | OSPF6_NEIGHBOR_EVENT_INACTIVITY_TIMER10); |
617 | event_add_event(master, neighbor_change, on->ospf6_if, 0, NULL)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 617, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "neighbor_change", .dest = "((void*)0)" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_137 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, neighbor_change , on->ospf6_if, 0, ((void*)0)); }); |
618 | |
619 | listnode_delete(on->ospf6_if->neighbor_list, on); |
620 | ospf6_neighbor_delete(on); |
621 | |
622 | } else { |
623 | if (IS_DEBUG_OSPF6_GRconf_debug_ospf6_gr) |
624 | zlog_debug("%s, Acting as HELPER for this neighbour, So restart the dead timer.",do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("%s, Acting as HELPER for this neighbour, So restart the dead timer." ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 625, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("%s, Acting as HELPER for this neighbour, So restart the dead timer." ), .priority = (7), .ec = (0), .args = ("__PRETTY_FUNCTION__" ), }; static const struct xref * const xref_p_138 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("%s, Acting as HELPER for this neighbour, So restart the dead timer." ), __PRETTY_FUNCTION__); } while (0) |
625 | __PRETTY_FUNCTION__)do { static struct xrefdata_logmsg _xrefdata = { .xrefdata = { .xref = ((void*)0), .uid = {}, .hashstr = ("%s, Acting as HELPER for this neighbour, So restart the dead timer." ), .hashu32 = {(7), (0)}, }, }; static const struct xref_logmsg _xref __attribute__( (used)) = { .xref = { (&_xrefdata.xrefdata ), (XREFT_LOGMSG), 625, "ospf6d/ospf6_neighbor.c", __func__, } , .fmtstring = ("%s, Acting as HELPER for this neighbour, So restart the dead timer." ), .priority = (7), .ec = (0), .args = ("__PRETTY_FUNCTION__" ), }; static const struct xref * const xref_p_138 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); zlog_ref (&_xref, ("%s, Acting as HELPER for this neighbour, So restart the dead timer." ), __PRETTY_FUNCTION__); } while (0); |
626 | |
627 | event_add_timer(master, inactivity_timer, on,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 629, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "inactivity_timer", .dest = "&on->inactivity_timer" , .event_type = EVENT_TIMER, }; static const struct xref * const xref_p_139 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_timer(&_xref, master, inactivity_timer , on, on->ospf6_if->dead_interval, &on->inactivity_timer ); }) |
628 | on->ospf6_if->dead_interval,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 629, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "inactivity_timer", .dest = "&on->inactivity_timer" , .event_type = EVENT_TIMER, }; static const struct xref * const xref_p_139 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_timer(&_xref, master, inactivity_timer , on, on->ospf6_if->dead_interval, &on->inactivity_timer ); }) |
629 | &on->inactivity_timer)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 629, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "inactivity_timer", .dest = "&on->inactivity_timer" , .event_type = EVENT_TIMER, }; static const struct xref * const xref_p_139 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_timer(&_xref, master, inactivity_timer , on, on->ospf6_if->dead_interval, &on->inactivity_timer ); }); |
630 | } |
631 | } |
632 | |
633 | /* P2P/P2MP stuff */ |
634 | |
635 | uint32_t ospf6_neighbor_cost(struct ospf6_neighbor *on) |
636 | { |
637 | if (on->p2xp_cfg && on->p2xp_cfg->cfg_cost) |
638 | return on->p2xp_cfg->cost; |
639 | return on->ospf6_if->cost; |
640 | } |
641 | |
642 | static int ospf6_if_p2xp_neighcfg_cmp(const struct ospf6_if_p2xp_neighcfg *a, |
643 | const struct ospf6_if_p2xp_neighcfg *b) |
644 | { |
645 | return IPV6_ADDR_CMP(&a->addr, &b->addr)memcmp ((&a->addr), (&b->addr), 16); |
646 | } |
647 | |
648 | struct ospf6_if_p2xp_neighcfg *ospf6_if_p2xp_find(struct ospf6_interface *oi, |
649 | const struct in6_addr *addr) |
650 | { |
651 | struct ospf6_if_p2xp_neighcfg ref; |
652 | |
653 | if (!oi) |
654 | return NULL((void*)0); |
655 | |
656 | ref.addr = *addr; |
657 | return ospf6_if_p2xp_neighcfgs_find(&oi->p2xp_neighs, &ref); |
658 | } |
659 | |
660 | static struct ospf6_if_p2xp_neighcfg * |
661 | ospf6_if_p2xp_get(struct ospf6_interface *oi, const struct in6_addr *addr) |
662 | { |
663 | struct ospf6_if_p2xp_neighcfg ref, *ret; |
664 | |
665 | if (!oi) |
666 | return NULL((void*)0); |
667 | |
668 | ref.addr = *addr; |
669 | ret = ospf6_if_p2xp_neighcfgs_find(&oi->p2xp_neighs, &ref); |
670 | if (!ret) { |
671 | ret = XCALLOC(MTYPE_OSPF6_NEIGHBOR_P2XP_CFG, sizeof(*ret))qcalloc(MTYPE_OSPF6_NEIGHBOR_P2XP_CFG, sizeof(*ret)); |
672 | ret->addr = *addr; |
673 | ret->ospf6_if = oi; |
674 | |
675 | ospf6_if_p2xp_neighcfgs_add(&oi->p2xp_neighs, ret); |
676 | } |
677 | |
678 | return ret; |
679 | } |
680 | |
681 | static void ospf6_if_p2xp_destroy(struct ospf6_if_p2xp_neighcfg *p2xp_cfg) |
682 | { |
683 | EVENT_OFF(p2xp_cfg->t_unicast_hello)do { if ((p2xp_cfg->t_unicast_hello)) event_cancel(&(p2xp_cfg ->t_unicast_hello)); } while (0); |
684 | ospf6_if_p2xp_neighcfgs_del(&p2xp_cfg->ospf6_if->p2xp_neighs, p2xp_cfg); |
685 | |
686 | XFREE(MTYPE_OSPF6_NEIGHBOR_P2XP_CFG, p2xp_cfg)do { qfree(MTYPE_OSPF6_NEIGHBOR_P2XP_CFG, p2xp_cfg); p2xp_cfg = ((void*)0); } while (0); |
687 | } |
688 | |
689 | static void p2xp_neigh_refresh(struct ospf6_neighbor *on, uint32_t prev_cost) |
690 | { |
691 | if (on->p2xp_cfg) |
692 | on->p2xp_cfg->active = NULL((void*)0); |
693 | on->p2xp_cfg = ospf6_if_p2xp_find(on->ospf6_if, &on->linklocal_addr); |
694 | if (on->p2xp_cfg) |
695 | on->p2xp_cfg->active = on; |
696 | |
697 | if (ospf6_neighbor_cost(on) != prev_cost) |
698 | OSPF6_ROUTER_LSA_SCHEDULE(on->ospf6_if->area)do { if ((((on->ospf6_if->area)->flag) & (0x01)) ) ({ static const struct xref_eventsched _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 698, "ospf6d/ospf6_neighbor.c", __func__, }, .funcname = "ospf6_router_lsa_originate" , .dest = "&(on->ospf6_if->area)->thread_router_lsa" , .event_type = EVENT_EVENT, }; static const struct xref * const xref_p_140 __attribute__((used, section("xref_array"))) = & (_xref.xref); _event_add_event(&_xref, master, ospf6_router_lsa_originate , on->ospf6_if->area, 0, &(on->ospf6_if->area )->thread_router_lsa); }); } while (0); |
699 | } |
700 | |
701 | /* vty functions */ |
702 | |
703 | #ifndef VTYSH_EXTRACT_PL |
704 | #include "ospf6d/ospf6_neighbor_clippy.c" |
705 | #endif |
706 | |
707 | DEFPY(ipv6_ospf6_p2xp_neigh, ipv6_ospf6_p2xp_neigh_cmd,static const struct cmd_element ipv6_ospf6_p2xp_neigh_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X", .func = ipv6_ospf6_p2xp_neigh , .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n", .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_cmd", .xref = { (((void*)0)), (XREFT_DEFUN ), 710, "ospf6d/ospf6_neighbor.c", "ipv6_ospf6_p2xp_neigh", } , }; static const struct xref * const xref_p_141 __attribute__ ((used, section("xref_array"))) = &(ipv6_ospf6_p2xp_neigh_cmd .xref); static int ipv6_ospf6_p2xp_neigh_magic( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ ((unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)) ) |
708 | "[no] ipv6 ospf6 neighbor X:X::X:X",static const struct cmd_element ipv6_ospf6_p2xp_neigh_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X", .func = ipv6_ospf6_p2xp_neigh , .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n", .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_cmd", .xref = { (((void*)0)), (XREFT_DEFUN ), 710, "ospf6d/ospf6_neighbor.c", "ipv6_ospf6_p2xp_neigh", } , }; static const struct xref * const xref_p_141 __attribute__ ((used, section("xref_array"))) = &(ipv6_ospf6_p2xp_neigh_cmd .xref); static int ipv6_ospf6_p2xp_neigh_magic( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ ((unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)) ) |
709 | NO_STR IP6_STR OSPF6_STR "Configure static neighbor\n"static const struct cmd_element ipv6_ospf6_p2xp_neigh_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X", .func = ipv6_ospf6_p2xp_neigh , .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n", .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_cmd", .xref = { (((void*)0)), (XREFT_DEFUN ), 710, "ospf6d/ospf6_neighbor.c", "ipv6_ospf6_p2xp_neigh", } , }; static const struct xref * const xref_p_141 __attribute__ ((used, section("xref_array"))) = &(ipv6_ospf6_p2xp_neigh_cmd .xref); static int ipv6_ospf6_p2xp_neigh_magic( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ ((unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)) ) |
710 | "Neighbor link-local address\n")static const struct cmd_element ipv6_ospf6_p2xp_neigh_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X", .func = ipv6_ospf6_p2xp_neigh , .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n", .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_cmd", .xref = { (((void*)0)), (XREFT_DEFUN ), 710, "ospf6d/ospf6_neighbor.c", "ipv6_ospf6_p2xp_neigh", } , }; static const struct xref * const xref_p_141 __attribute__ ((used, section("xref_array"))) = &(ipv6_ospf6_p2xp_neigh_cmd .xref); static int ipv6_ospf6_p2xp_neigh_magic( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ ((unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)) ) |
711 | { |
712 | VTY_DECLVAR_CONTEXT(interface, ifp)struct interface *ifp = ((struct interface *)qobj_get_typed(( vty->qobj_index), &qobj_t_interface)); if (!ifp) { vty_out (vty, "Current configuration object was deleted " "by another process.\n" ); return 1; };; |
713 | struct ospf6_interface *oi = ifp->info; |
714 | struct ospf6_if_p2xp_neighcfg *p2xp_cfg; |
715 | |
716 | if (!oi) { |
717 | if (no) |
718 | return CMD_SUCCESS0; |
719 | oi = ospf6_interface_create(ifp); |
720 | } |
721 | |
722 | if (no) { |
723 | struct ospf6_neighbor *on; |
724 | uint32_t prev_cost = 0; |
725 | |
726 | p2xp_cfg = ospf6_if_p2xp_find(oi, &neighbor); |
727 | if (!p2xp_cfg) |
728 | return CMD_SUCCESS0; |
729 | |
730 | on = p2xp_cfg->active; |
731 | if (on) |
732 | prev_cost = ospf6_neighbor_cost(on); |
733 | |
734 | p2xp_cfg->active = NULL((void*)0); |
735 | ospf6_if_p2xp_destroy(p2xp_cfg); |
736 | |
737 | if (on) { |
738 | on->p2xp_cfg = NULL((void*)0); |
739 | p2xp_neigh_refresh(on, prev_cost); |
740 | } |
741 | return CMD_SUCCESS0; |
742 | } |
743 | |
744 | p2xp_cfg = ospf6_if_p2xp_get(oi, &neighbor); |
Value stored to 'p2xp_cfg' is never read | |
745 | return CMD_SUCCESS0; |
746 | } |
747 | |
748 | DEFPY(ipv6_ospf6_p2xp_neigh_cost, ipv6_ospf6_p2xp_neigh_cost_cmd,static const struct cmd_element ipv6_ospf6_p2xp_neigh_cost_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X cost (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_cost, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Outgoing metric for this neighbor\n" "Outgoing metric for this neighbor\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_cost_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 753, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_cost", }, }; static const struct xref * const xref_p_142 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_cost_cmd.xref); static int ipv6_ospf6_p2xp_neigh_cost_magic ( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ (( unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)), long cost, const char * cost_str __attribute__ ((unused))) |
749 | "[no] ipv6 ospf6 neighbor X:X::X:X cost (1-65535)",static const struct cmd_element ipv6_ospf6_p2xp_neigh_cost_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X cost (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_cost, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Outgoing metric for this neighbor\n" "Outgoing metric for this neighbor\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_cost_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 753, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_cost", }, }; static const struct xref * const xref_p_142 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_cost_cmd.xref); static int ipv6_ospf6_p2xp_neigh_cost_magic ( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ (( unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)), long cost, const char * cost_str __attribute__ ((unused))) |
750 | NO_STR IP6_STR OSPF6_STR "Configure static neighbor\n"static const struct cmd_element ipv6_ospf6_p2xp_neigh_cost_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X cost (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_cost, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Outgoing metric for this neighbor\n" "Outgoing metric for this neighbor\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_cost_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 753, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_cost", }, }; static const struct xref * const xref_p_142 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_cost_cmd.xref); static int ipv6_ospf6_p2xp_neigh_cost_magic ( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ (( unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)), long cost, const char * cost_str __attribute__ ((unused))) |
751 | "Neighbor link-local address\n"static const struct cmd_element ipv6_ospf6_p2xp_neigh_cost_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X cost (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_cost, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Outgoing metric for this neighbor\n" "Outgoing metric for this neighbor\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_cost_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 753, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_cost", }, }; static const struct xref * const xref_p_142 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_cost_cmd.xref); static int ipv6_ospf6_p2xp_neigh_cost_magic ( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ (( unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)), long cost, const char * cost_str __attribute__ ((unused))) |
752 | "Outgoing metric for this neighbor\n"static const struct cmd_element ipv6_ospf6_p2xp_neigh_cost_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X cost (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_cost, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Outgoing metric for this neighbor\n" "Outgoing metric for this neighbor\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_cost_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 753, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_cost", }, }; static const struct xref * const xref_p_142 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_cost_cmd.xref); static int ipv6_ospf6_p2xp_neigh_cost_magic ( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ (( unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)), long cost, const char * cost_str __attribute__ ((unused))) |
753 | "Outgoing metric for this neighbor\n")static const struct cmd_element ipv6_ospf6_p2xp_neigh_cost_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X cost (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_cost, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Outgoing metric for this neighbor\n" "Outgoing metric for this neighbor\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_cost_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 753, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_cost", }, }; static const struct xref * const xref_p_142 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_cost_cmd.xref); static int ipv6_ospf6_p2xp_neigh_cost_magic ( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ (( unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)), long cost, const char * cost_str __attribute__ ((unused))) |
754 | { |
755 | VTY_DECLVAR_CONTEXT(interface, ifp)struct interface *ifp = ((struct interface *)qobj_get_typed(( vty->qobj_index), &qobj_t_interface)); if (!ifp) { vty_out (vty, "Current configuration object was deleted " "by another process.\n" ); return 1; };; |
756 | struct ospf6_interface *oi = ifp->info; |
757 | struct ospf6_if_p2xp_neighcfg *p2xp_cfg; |
758 | uint32_t prev_cost = 0; |
759 | |
760 | if (!oi) { |
761 | if (no) |
762 | return CMD_SUCCESS0; |
763 | oi = ospf6_interface_create(ifp); |
764 | } |
765 | |
766 | p2xp_cfg = ospf6_if_p2xp_get(oi, &neighbor); |
767 | |
768 | if (p2xp_cfg->active) |
769 | prev_cost = ospf6_neighbor_cost(p2xp_cfg->active); |
770 | |
771 | if (no) { |
772 | p2xp_cfg->cfg_cost = false0; |
773 | p2xp_cfg->cost = 0; |
774 | } else { |
775 | p2xp_cfg->cfg_cost = true1; |
776 | p2xp_cfg->cost = cost; |
777 | } |
778 | |
779 | if (p2xp_cfg->active) |
780 | p2xp_neigh_refresh(p2xp_cfg->active, prev_cost); |
781 | return CMD_SUCCESS0; |
782 | } |
783 | |
784 | static void p2xp_unicast_hello_send(struct event *event); |
785 | |
786 | static void p2xp_unicast_hello_sched(struct ospf6_if_p2xp_neighcfg *p2xp_cfg) |
787 | { |
788 | if (!p2xp_cfg->poll_interval || |
789 | (p2xp_cfg->ospf6_if->state != OSPF6_INTERFACE_POINTTOMULTIPOINT5 && |
790 | p2xp_cfg->ospf6_if->state != OSPF6_INTERFACE_POINTTOPOINT4)) |
791 | /* state check covers DOWN state too */ |
792 | EVENT_OFF(p2xp_cfg->t_unicast_hello)do { if ((p2xp_cfg->t_unicast_hello)) event_cancel(&(p2xp_cfg ->t_unicast_hello)); } while (0); |
793 | else |
794 | event_add_timer(master, p2xp_unicast_hello_send, p2xp_cfg,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 796, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "p2xp_unicast_hello_send", .dest = "&p2xp_cfg->t_unicast_hello", .event_type = EVENT_TIMER , }; static const struct xref * const xref_p_143 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); _event_add_timer (&_xref, master, p2xp_unicast_hello_send, p2xp_cfg, p2xp_cfg ->poll_interval, &p2xp_cfg->t_unicast_hello); }) |
795 | p2xp_cfg->poll_interval,({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 796, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "p2xp_unicast_hello_send", .dest = "&p2xp_cfg->t_unicast_hello", .event_type = EVENT_TIMER , }; static const struct xref * const xref_p_143 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); _event_add_timer (&_xref, master, p2xp_unicast_hello_send, p2xp_cfg, p2xp_cfg ->poll_interval, &p2xp_cfg->t_unicast_hello); }) |
796 | &p2xp_cfg->t_unicast_hello)({ static const struct xref_eventsched _xref __attribute__( ( used)) = { .xref = { (((void*)0)), (XREFT_EVENTSCHED), 796, "ospf6d/ospf6_neighbor.c" , __func__, }, .funcname = "p2xp_unicast_hello_send", .dest = "&p2xp_cfg->t_unicast_hello", .event_type = EVENT_TIMER , }; static const struct xref * const xref_p_143 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); _event_add_timer (&_xref, master, p2xp_unicast_hello_send, p2xp_cfg, p2xp_cfg ->poll_interval, &p2xp_cfg->t_unicast_hello); }); |
797 | } |
798 | |
799 | void ospf6_if_p2xp_up(struct ospf6_interface *oi) |
800 | { |
801 | struct ospf6_if_p2xp_neighcfg *p2xp_cfg; |
802 | |
803 | frr_each (ospf6_if_p2xp_neighcfgs, &oi->p2xp_neighs, p2xp_cfg)for (p2xp_cfg = ospf6_if_p2xp_neighcfgs_first(&oi->p2xp_neighs ); p2xp_cfg; p2xp_cfg = ospf6_if_p2xp_neighcfgs_next(&oi-> p2xp_neighs, p2xp_cfg)) |
804 | p2xp_unicast_hello_sched(p2xp_cfg); |
805 | } |
806 | |
807 | static void p2xp_unicast_hello_send(struct event *event) |
808 | { |
809 | struct ospf6_if_p2xp_neighcfg *p2xp_cfg = EVENT_ARG(event)((event)->arg); |
810 | struct ospf6_interface *oi = p2xp_cfg->ospf6_if; |
811 | |
812 | if (oi->state != OSPF6_INTERFACE_POINTTOPOINT4 && |
813 | oi->state != OSPF6_INTERFACE_POINTTOMULTIPOINT5) |
814 | return; |
815 | |
816 | p2xp_unicast_hello_sched(p2xp_cfg); |
817 | |
818 | if (p2xp_cfg->active && p2xp_cfg->active->state >= OSPF6_NEIGHBOR_INIT3) |
819 | return; |
820 | |
821 | ospf6_hello_send_addr(oi, &p2xp_cfg->addr); |
822 | } |
823 | |
824 | DEFPY(ipv6_ospf6_p2xp_neigh_poll_interval,static const struct cmd_element ipv6_ospf6_p2xp_neigh_poll_interval_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X poll-interval (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_poll_interval, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Send unicast hellos to neighbor when down\n" "Unicast hello interval when down (seconds)\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_poll_interval_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 830, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_poll_interval", }, }; static const struct xref * const xref_p_144 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_poll_interval_cmd.xref); static int ipv6_ospf6_p2xp_neigh_poll_interval_magic( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ ((unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)) , long poll_interval, const char * poll_interval_str __attribute__ ((unused))) |
825 | ipv6_ospf6_p2xp_neigh_poll_interval_cmd,static const struct cmd_element ipv6_ospf6_p2xp_neigh_poll_interval_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X poll-interval (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_poll_interval, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Send unicast hellos to neighbor when down\n" "Unicast hello interval when down (seconds)\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_poll_interval_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 830, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_poll_interval", }, }; static const struct xref * const xref_p_144 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_poll_interval_cmd.xref); static int ipv6_ospf6_p2xp_neigh_poll_interval_magic( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ ((unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)) , long poll_interval, const char * poll_interval_str __attribute__ ((unused))) |
826 | "[no] ipv6 ospf6 neighbor X:X::X:X poll-interval (1-65535)",static const struct cmd_element ipv6_ospf6_p2xp_neigh_poll_interval_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X poll-interval (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_poll_interval, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Send unicast hellos to neighbor when down\n" "Unicast hello interval when down (seconds)\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_poll_interval_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 830, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_poll_interval", }, }; static const struct xref * const xref_p_144 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_poll_interval_cmd.xref); static int ipv6_ospf6_p2xp_neigh_poll_interval_magic( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ ((unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)) , long poll_interval, const char * poll_interval_str __attribute__ ((unused))) |
827 | NO_STR IP6_STR OSPF6_STR "Configure static neighbor\n"static const struct cmd_element ipv6_ospf6_p2xp_neigh_poll_interval_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X poll-interval (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_poll_interval, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Send unicast hellos to neighbor when down\n" "Unicast hello interval when down (seconds)\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_poll_interval_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 830, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_poll_interval", }, }; static const struct xref * const xref_p_144 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_poll_interval_cmd.xref); static int ipv6_ospf6_p2xp_neigh_poll_interval_magic( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ ((unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)) , long poll_interval, const char * poll_interval_str __attribute__ ((unused))) |
828 | "Neighbor link-local address\n"static const struct cmd_element ipv6_ospf6_p2xp_neigh_poll_interval_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X poll-interval (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_poll_interval, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Send unicast hellos to neighbor when down\n" "Unicast hello interval when down (seconds)\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_poll_interval_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 830, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_poll_interval", }, }; static const struct xref * const xref_p_144 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_poll_interval_cmd.xref); static int ipv6_ospf6_p2xp_neigh_poll_interval_magic( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ ((unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)) , long poll_interval, const char * poll_interval_str __attribute__ ((unused))) |
829 | "Send unicast hellos to neighbor when down\n"static const struct cmd_element ipv6_ospf6_p2xp_neigh_poll_interval_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X poll-interval (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_poll_interval, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Send unicast hellos to neighbor when down\n" "Unicast hello interval when down (seconds)\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_poll_interval_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 830, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_poll_interval", }, }; static const struct xref * const xref_p_144 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_poll_interval_cmd.xref); static int ipv6_ospf6_p2xp_neigh_poll_interval_magic( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ ((unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)) , long poll_interval, const char * poll_interval_str __attribute__ ((unused))) |
830 | "Unicast hello interval when down (seconds)\n")static const struct cmd_element ipv6_ospf6_p2xp_neigh_poll_interval_cmd = { .string = "[no] ipv6 ospf6 neighbor X:X::X:X poll-interval (1-65535)" , .func = ipv6_ospf6_p2xp_neigh_poll_interval, .doc = "Negate a command or set its defaults\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Configure static neighbor\n" "Neighbor link-local address\n" "Send unicast hellos to neighbor when down\n" "Unicast hello interval when down (seconds)\n" , .attr = 0, .daemon = 0, .name = "ipv6_ospf6_p2xp_neigh_poll_interval_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 830, "ospf6d/ospf6_neighbor.c" , "ipv6_ospf6_p2xp_neigh_poll_interval", }, }; static const struct xref * const xref_p_144 __attribute__((used, section("xref_array" ))) = &(ipv6_ospf6_p2xp_neigh_poll_interval_cmd.xref); static int ipv6_ospf6_p2xp_neigh_poll_interval_magic( const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__ ((unused)), struct cmd_token *argv[] __attribute__ ((unused)), const char * no, struct in6_addr neighbor, const char * neighbor_str __attribute__ ((unused)) , long poll_interval, const char * poll_interval_str __attribute__ ((unused))) |
831 | { |
832 | VTY_DECLVAR_CONTEXT(interface, ifp)struct interface *ifp = ((struct interface *)qobj_get_typed(( vty->qobj_index), &qobj_t_interface)); if (!ifp) { vty_out (vty, "Current configuration object was deleted " "by another process.\n" ); return 1; };; |
833 | struct ospf6_interface *oi = ifp->info; |
834 | struct ospf6_if_p2xp_neighcfg *p2xp_cfg; |
835 | |
836 | if (!oi) { |
837 | if (no) |
838 | return CMD_SUCCESS0; |
839 | oi = ospf6_interface_create(ifp); |
840 | } |
841 | if (no) |
842 | poll_interval = 0; |
843 | |
844 | p2xp_cfg = ospf6_if_p2xp_get(oi, &neighbor); |
845 | p2xp_cfg->poll_interval = poll_interval; |
846 | |
847 | p2xp_unicast_hello_sched(p2xp_cfg); |
848 | return CMD_SUCCESS0; |
849 | } |
850 | |
851 | /* show neighbor structure */ |
852 | static void ospf6_neighbor_show(struct vty *vty, struct ospf6_neighbor *on, |
853 | json_object *json_array, bool_Bool use_json) |
854 | { |
855 | char router_id[16]; |
856 | char duration[64]; |
857 | struct timeval res; |
858 | char nstate[16]; |
859 | char deadtime[64]; |
860 | long h, m, s; |
861 | json_object *json_route; |
862 | |
863 | /* Router-ID (Name) */ |
864 | inet_ntop(AF_INET2, &on->router_id, router_id, sizeof(router_id)); |
865 | #ifdef HAVE_GETNAMEINFO |
866 | { |
867 | } |
868 | #endif /*HAVE_GETNAMEINFO*/ |
869 | |
870 | /* Dead time */ |
871 | h = m = s = 0; |
872 | if (on->inactivity_timer) { |
873 | s = monotime_until(&on->inactivity_timer->u.sands, NULL((void*)0)) / |
874 | 1000000LL; |
875 | h = s / 3600; |
876 | s -= h * 3600; |
877 | m = s / 60; |
878 | s -= m * 60; |
879 | } |
880 | snprintf(deadtime, sizeof(deadtime), "%02ld:%02ld:%02ld", h, m, s); |
881 | |
882 | /* Neighbor State */ |
883 | if (on->ospf6_if->type == OSPF_IFTYPE_POINTOPOINT1) |
884 | snprintf(nstate, sizeof(nstate), "PointToPoint"); |
885 | else if (on->ospf6_if->type == OSPF_IFTYPE_POINTOMULTIPOINT4) |
886 | snprintf(nstate, sizeof(nstate), "PtMultipoint"); |
887 | else { |
888 | if (on->router_id == on->drouter) |
889 | snprintf(nstate, sizeof(nstate), "DR"); |
890 | else if (on->router_id == on->bdrouter) |
891 | snprintf(nstate, sizeof(nstate), "BDR"); |
892 | else |
893 | snprintf(nstate, sizeof(nstate), "DROther"); |
894 | } |
895 | |
896 | /* Duration */ |
897 | monotime_since(&on->last_changed, &res); |
898 | timerstring(&res, duration, sizeof(duration))do { if ((&res)->tv_sec / 60 / 60 / 24) snprintf(duration , sizeof(duration), "%lldd%02lld:%02lld:%02lld", (&res)-> tv_sec / 60LL / 60 / 24, (&res)->tv_sec / 60LL / 60 % 24 , (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL ); else snprintf(duration, sizeof(duration), "%02lld:%02lld:%02lld" , (&res)->tv_sec / 60LL / 60 % 24, (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL); } while (0); |
899 | |
900 | /* |
901 | vty_out (vty, "%-15s %3d %11s %6s/%-12s %11s %s[%s]\n", |
902 | "Neighbor ID", "Pri", "DeadTime", "State", "IfState", |
903 | "Duration", "I/F", "State"); |
904 | */ |
905 | if (use_json) { |
906 | json_route = json_object_new_object(); |
907 | |
908 | json_object_string_add(json_route, "neighborId", router_id); |
909 | json_object_int_add(json_route, "priority", on->priority); |
910 | json_object_string_add(json_route, "deadTime", deadtime); |
911 | json_object_string_add(json_route, "state", |
912 | ospf6_neighbor_state_str[on->state]); |
913 | json_object_string_add(json_route, "ifState", nstate); |
914 | json_object_string_add(json_route, "duration", duration); |
915 | json_object_string_add(json_route, "interfaceName", |
916 | on->ospf6_if->interface->name); |
917 | json_object_string_add(json_route, "interfaceState", |
918 | ospf6_interface_state_str |
919 | [on->ospf6_if->state]); |
920 | |
921 | json_object_array_add(json_array, json_route); |
922 | } else |
923 | vty_out(vty, "%-15s %3d %11s %8s/%-12s %11s %s[%s]\n", |
924 | router_id, on->priority, deadtime, |
925 | ospf6_neighbor_state_str[on->state], nstate, duration, |
926 | on->ospf6_if->interface->name, |
927 | ospf6_interface_state_str[on->ospf6_if->state]); |
928 | } |
929 | |
930 | static void ospf6_neighbor_show_drchoice(struct vty *vty, |
931 | struct ospf6_neighbor *on, |
932 | json_object *json_array, bool_Bool use_json) |
933 | { |
934 | char router_id[16]; |
935 | char drouter[16], bdrouter[16]; |
936 | char duration[64]; |
937 | struct timeval now, res; |
938 | json_object *json_route; |
939 | |
940 | /* |
941 | vty_out (vty, "%-15s %6s/%-11s %-15s %-15s %s[%s]\n", |
942 | "RouterID", "State", "Duration", "DR", "BDR", "I/F", |
943 | "State"); |
944 | */ |
945 | |
946 | inet_ntop(AF_INET2, &on->router_id, router_id, sizeof(router_id)); |
947 | inet_ntop(AF_INET2, &on->drouter, drouter, sizeof(drouter)); |
948 | inet_ntop(AF_INET2, &on->bdrouter, bdrouter, sizeof(bdrouter)); |
949 | |
950 | monotime(&now); |
951 | timersub(&now, &on->last_changed, &res)do { (&res)->tv_sec = (&now)->tv_sec - (&on ->last_changed)->tv_sec; (&res)->tv_usec = (& now)->tv_usec - (&on->last_changed)->tv_usec; if ((&res)->tv_usec < 0) { --(&res)->tv_sec; ( &res)->tv_usec += 1000000; } } while (0); |
952 | timerstring(&res, duration, sizeof(duration))do { if ((&res)->tv_sec / 60 / 60 / 24) snprintf(duration , sizeof(duration), "%lldd%02lld:%02lld:%02lld", (&res)-> tv_sec / 60LL / 60 / 24, (&res)->tv_sec / 60LL / 60 % 24 , (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL ); else snprintf(duration, sizeof(duration), "%02lld:%02lld:%02lld" , (&res)->tv_sec / 60LL / 60 % 24, (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL); } while (0); |
953 | |
954 | if (use_json) { |
955 | json_route = json_object_new_object(); |
956 | json_object_string_add(json_route, "routerId", router_id); |
957 | json_object_string_add(json_route, "state", |
958 | ospf6_neighbor_state_str[on->state]); |
959 | json_object_string_add(json_route, "duration", duration); |
960 | json_object_string_add(json_route, "dRouter", drouter); |
961 | json_object_string_add(json_route, "bdRouter", bdrouter); |
962 | json_object_string_add(json_route, "interfaceName", |
963 | on->ospf6_if->interface->name); |
964 | json_object_string_add(json_route, "interfaceState", |
965 | ospf6_interface_state_str |
966 | [on->ospf6_if->state]); |
967 | |
968 | json_object_array_add(json_array, json_route); |
969 | } else |
970 | vty_out(vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]\n", router_id, |
971 | ospf6_neighbor_state_str[on->state], duration, drouter, |
972 | bdrouter, on->ospf6_if->interface->name, |
973 | ospf6_interface_state_str[on->ospf6_if->state]); |
974 | } |
975 | |
976 | static void ospf6_neighbor_show_detail(struct vty *vty, |
977 | struct ospf6_neighbor *on, |
978 | json_object *json, bool_Bool use_json) |
979 | { |
980 | char drouter[16], bdrouter[16]; |
981 | char linklocal_addr[64], duration[32]; |
982 | struct timeval now, res; |
983 | struct ospf6_lsa *lsa, *lsanext; |
984 | json_object *json_neighbor; |
985 | json_object *json_array; |
986 | char db_desc_str[20]; |
987 | |
988 | inet_ntop(AF_INET610, &on->linklocal_addr, linklocal_addr, |
989 | sizeof(linklocal_addr)); |
990 | inet_ntop(AF_INET2, &on->drouter, drouter, sizeof(drouter)); |
991 | inet_ntop(AF_INET2, &on->bdrouter, bdrouter, sizeof(bdrouter)); |
992 | |
993 | monotime(&now); |
994 | timersub(&now, &on->last_changed, &res)do { (&res)->tv_sec = (&now)->tv_sec - (&on ->last_changed)->tv_sec; (&res)->tv_usec = (& now)->tv_usec - (&on->last_changed)->tv_usec; if ((&res)->tv_usec < 0) { --(&res)->tv_sec; ( &res)->tv_usec += 1000000; } } while (0); |
995 | timerstring(&res, duration, sizeof(duration))do { if ((&res)->tv_sec / 60 / 60 / 24) snprintf(duration , sizeof(duration), "%lldd%02lld:%02lld:%02lld", (&res)-> tv_sec / 60LL / 60 / 24, (&res)->tv_sec / 60LL / 60 % 24 , (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL ); else snprintf(duration, sizeof(duration), "%02lld:%02lld:%02lld" , (&res)->tv_sec / 60LL / 60 % 24, (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL); } while (0); |
996 | |
997 | if (use_json) { |
998 | json_neighbor = json_object_new_object(); |
999 | json_object_string_add(json_neighbor, "area", |
1000 | on->ospf6_if->area->name); |
1001 | json_object_string_add(json_neighbor, "interface", |
1002 | on->ospf6_if->interface->name); |
1003 | json_object_int_add(json_neighbor, "interfaceIndex", |
1004 | on->ospf6_if->interface->ifindex); |
1005 | json_object_int_add(json_neighbor, "neighborInterfaceIndex", |
1006 | on->ifindex); |
1007 | json_object_string_add(json_neighbor, "linkLocalAddress", |
1008 | linklocal_addr); |
1009 | json_object_string_add(json_neighbor, "neighborState", |
1010 | ospf6_neighbor_state_str[on->state]); |
1011 | json_object_string_add(json_neighbor, "neighborStateDuration", |
1012 | duration); |
1013 | json_object_string_add(json_neighbor, "neighborDRouter", |
1014 | drouter); |
1015 | json_object_string_add(json_neighbor, "neighborBdRouter", |
1016 | bdrouter); |
1017 | snprintf(db_desc_str, sizeof(db_desc_str), "%s%s%s", |
1018 | (CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_IBIT)((on->dbdesc_bits) & ((0x04))) |
1019 | ? "Initial " |
1020 | : ""), |
1021 | (CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT)((on->dbdesc_bits) & ((0x02))) ? "More" |
1022 | : ""), |
1023 | (CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT)((on->dbdesc_bits) & ((0x01))) |
1024 | ? "Master" |
1025 | : "Slave")); |
1026 | json_object_string_add(json_neighbor, "dbDescStatus", |
1027 | db_desc_str); |
1028 | |
1029 | json_object_int_add(json_neighbor, "dbDescSeqNumber", |
1030 | (unsigned long)ntohl(on->dbdesc_seqnum)); |
1031 | |
1032 | json_array = json_object_new_array(); |
1033 | json_object_int_add(json_neighbor, "summaryListCount", |
1034 | on->summary_list->count); |
1035 | for (ALL_LSDB(on->summary_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->summary_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1036 | json_object_array_add(json_array, |
1037 | json_object_new_string(lsa->name)); |
1038 | json_object_object_add(json_neighbor, "summaryListLsa", |
1039 | json_array); |
1040 | |
1041 | json_array = json_object_new_array(); |
1042 | json_object_int_add(json_neighbor, "requestListCount", |
1043 | on->request_list->count); |
1044 | for (ALL_LSDB(on->request_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->request_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1045 | json_object_array_add(json_array, |
1046 | json_object_new_string(lsa->name)); |
1047 | json_object_object_add(json_neighbor, "requestListLsa", |
1048 | json_array); |
1049 | |
1050 | json_array = json_object_new_array(); |
1051 | json_object_int_add(json_neighbor, "reTransListCount", |
1052 | on->retrans_list->count); |
1053 | for (ALL_LSDB(on->retrans_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->retrans_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1054 | json_object_array_add(json_array, |
1055 | json_object_new_string(lsa->name)); |
1056 | json_object_object_add(json_neighbor, "reTransListLsa", |
1057 | json_array); |
1058 | |
1059 | |
1060 | timerclear(&res)((&res)->tv_sec = (&res)->tv_usec = 0); |
1061 | if (event_is_scheduled(on->thread_send_dbdesc)) |
1062 | timersub(&on->thread_send_dbdesc->u.sands, &now, &res)do { (&res)->tv_sec = (&on->thread_send_dbdesc-> u.sands)->tv_sec - (&now)->tv_sec; (&res)->tv_usec = (&on->thread_send_dbdesc->u.sands)->tv_usec - (&now)->tv_usec; if ((&res)->tv_usec < 0) { --(&res)->tv_sec; (&res)->tv_usec += 1000000; } } while (0); |
1063 | timerstring(&res, duration, sizeof(duration))do { if ((&res)->tv_sec / 60 / 60 / 24) snprintf(duration , sizeof(duration), "%lldd%02lld:%02lld:%02lld", (&res)-> tv_sec / 60LL / 60 / 24, (&res)->tv_sec / 60LL / 60 % 24 , (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL ); else snprintf(duration, sizeof(duration), "%02lld:%02lld:%02lld" , (&res)->tv_sec / 60LL / 60 % 24, (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL); } while (0); |
1064 | json_object_int_add(json_neighbor, "pendingLsaDbDescCount", |
1065 | on->dbdesc_list->count); |
1066 | json_object_string_add(json_neighbor, "pendingLsaDbDescTime", |
1067 | duration); |
1068 | json_object_string_add(json_neighbor, "dbDescSendThread", |
1069 | (event_is_scheduled(on->thread_send_dbdesc) |
1070 | ? "on" |
1071 | : "off")); |
1072 | json_array = json_object_new_array(); |
1073 | for (ALL_LSDB(on->dbdesc_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->dbdesc_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1074 | json_object_array_add(json_array, |
1075 | json_object_new_string(lsa->name)); |
1076 | json_object_object_add(json_neighbor, "pendingLsaDbDesc", |
1077 | json_array); |
1078 | |
1079 | timerclear(&res)((&res)->tv_sec = (&res)->tv_usec = 0); |
1080 | if (event_is_scheduled(on->thread_send_lsreq)) |
1081 | timersub(&on->thread_send_lsreq->u.sands, &now, &res)do { (&res)->tv_sec = (&on->thread_send_lsreq-> u.sands)->tv_sec - (&now)->tv_sec; (&res)->tv_usec = (&on->thread_send_lsreq->u.sands)->tv_usec - ( &now)->tv_usec; if ((&res)->tv_usec < 0) { -- (&res)->tv_sec; (&res)->tv_usec += 1000000; } } while (0); |
1082 | timerstring(&res, duration, sizeof(duration))do { if ((&res)->tv_sec / 60 / 60 / 24) snprintf(duration , sizeof(duration), "%lldd%02lld:%02lld:%02lld", (&res)-> tv_sec / 60LL / 60 / 24, (&res)->tv_sec / 60LL / 60 % 24 , (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL ); else snprintf(duration, sizeof(duration), "%02lld:%02lld:%02lld" , (&res)->tv_sec / 60LL / 60 % 24, (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL); } while (0); |
1083 | json_object_int_add(json_neighbor, "pendingLsaLsReqCount", |
1084 | on->request_list->count); |
1085 | json_object_string_add(json_neighbor, "pendingLsaLsReqTime", |
1086 | duration); |
1087 | json_object_string_add(json_neighbor, "lsReqSendThread", |
1088 | (event_is_scheduled(on->thread_send_lsreq) |
1089 | ? "on" |
1090 | : "off")); |
1091 | json_array = json_object_new_array(); |
1092 | for (ALL_LSDB(on->request_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->request_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1093 | json_object_array_add(json_array, |
1094 | json_object_new_string(lsa->name)); |
1095 | json_object_object_add(json_neighbor, "pendingLsaLsReq", |
1096 | json_array); |
1097 | |
1098 | |
1099 | timerclear(&res)((&res)->tv_sec = (&res)->tv_usec = 0); |
1100 | if (event_is_scheduled(on->thread_send_lsupdate)) |
1101 | timersub(&on->thread_send_lsupdate->u.sands, &now, &res)do { (&res)->tv_sec = (&on->thread_send_lsupdate ->u.sands)->tv_sec - (&now)->tv_sec; (&res)-> tv_usec = (&on->thread_send_lsupdate->u.sands)-> tv_usec - (&now)->tv_usec; if ((&res)->tv_usec < 0) { --(&res)->tv_sec; (&res)->tv_usec += 1000000 ; } } while (0); |
1102 | timerstring(&res, duration, sizeof(duration))do { if ((&res)->tv_sec / 60 / 60 / 24) snprintf(duration , sizeof(duration), "%lldd%02lld:%02lld:%02lld", (&res)-> tv_sec / 60LL / 60 / 24, (&res)->tv_sec / 60LL / 60 % 24 , (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL ); else snprintf(duration, sizeof(duration), "%02lld:%02lld:%02lld" , (&res)->tv_sec / 60LL / 60 % 24, (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL); } while (0); |
1103 | json_object_int_add(json_neighbor, "pendingLsaLsUpdateCount", |
1104 | on->lsupdate_list->count); |
1105 | json_object_string_add(json_neighbor, "pendingLsaLsUpdateTime", |
1106 | duration); |
1107 | json_object_string_add(json_neighbor, "lsUpdateSendThread", |
1108 | (event_is_scheduled( |
1109 | on->thread_send_lsupdate) |
1110 | ? "on" |
1111 | : "off")); |
1112 | json_array = json_object_new_array(); |
1113 | for (ALL_LSDB(on->lsupdate_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->lsupdate_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1114 | json_object_array_add(json_array, |
1115 | json_object_new_string(lsa->name)); |
1116 | json_object_object_add(json_neighbor, "pendingLsaLsUpdate", |
1117 | json_array); |
1118 | |
1119 | timerclear(&res)((&res)->tv_sec = (&res)->tv_usec = 0); |
1120 | if (event_is_scheduled(on->thread_send_lsack)) |
1121 | timersub(&on->thread_send_lsack->u.sands, &now, &res)do { (&res)->tv_sec = (&on->thread_send_lsack-> u.sands)->tv_sec - (&now)->tv_sec; (&res)->tv_usec = (&on->thread_send_lsack->u.sands)->tv_usec - ( &now)->tv_usec; if ((&res)->tv_usec < 0) { -- (&res)->tv_sec; (&res)->tv_usec += 1000000; } } while (0); |
1122 | timerstring(&res, duration, sizeof(duration))do { if ((&res)->tv_sec / 60 / 60 / 24) snprintf(duration , sizeof(duration), "%lldd%02lld:%02lld:%02lld", (&res)-> tv_sec / 60LL / 60 / 24, (&res)->tv_sec / 60LL / 60 % 24 , (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL ); else snprintf(duration, sizeof(duration), "%02lld:%02lld:%02lld" , (&res)->tv_sec / 60LL / 60 % 24, (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL); } while (0); |
1123 | json_object_int_add(json_neighbor, "pendingLsaLsAckCount", |
1124 | on->lsack_list->count); |
1125 | json_object_string_add(json_neighbor, "pendingLsaLsAckTime", |
1126 | duration); |
1127 | json_object_string_add(json_neighbor, "lsAckSendThread", |
1128 | (event_is_scheduled(on->thread_send_lsack) |
1129 | ? "on" |
1130 | : "off")); |
1131 | json_array = json_object_new_array(); |
1132 | for (ALL_LSDB(on->lsack_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->lsack_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1133 | json_object_array_add(json_array, |
1134 | json_object_new_string(lsa->name)); |
1135 | json_object_object_add(json_neighbor, "pendingLsaLsAck", |
1136 | json_array); |
1137 | |
1138 | bfd_sess_show(vty, json_neighbor, on->bfd_session); |
1139 | |
1140 | if (on->auth_present == true1) { |
1141 | json_object_string_add(json_neighbor, "authStatus", |
1142 | "enabled"); |
1143 | json_object_int_add(json_neighbor, |
1144 | "recvdHelloHigherSeqNo", |
1145 | on->seqnum_h[OSPF6_MESSAGE_TYPE_HELLO0x1]); |
1146 | json_object_int_add(json_neighbor, |
1147 | "recvdHelloLowerSeqNo", |
1148 | on->seqnum_l[OSPF6_MESSAGE_TYPE_HELLO0x1]); |
1149 | json_object_int_add(json_neighbor, |
1150 | "recvdDBDescHigherSeqNo", |
1151 | on->seqnum_h[OSPF6_MESSAGE_TYPE_DBDESC0x2]); |
1152 | json_object_int_add(json_neighbor, |
1153 | "recvdDBDescLowerSeqNo", |
1154 | on->seqnum_l[OSPF6_MESSAGE_TYPE_DBDESC0x2]); |
1155 | json_object_int_add(json_neighbor, |
1156 | "recvdLSReqHigherSeqNo", |
1157 | on->seqnum_h[OSPF6_MESSAGE_TYPE_LSREQ0x3]); |
1158 | json_object_int_add(json_neighbor, |
1159 | "recvdLSReqLowerSeqNo", |
1160 | on->seqnum_l[OSPF6_MESSAGE_TYPE_LSREQ0x3]); |
1161 | json_object_int_add(json_neighbor, |
1162 | "recvdLSUpdHigherSeqNo", |
1163 | on->seqnum_h[OSPF6_MESSAGE_TYPE_LSUPDATE0x4]); |
1164 | json_object_int_add(json_neighbor, |
1165 | "recvdLSUpdLowerSeqNo", |
1166 | on->seqnum_l[OSPF6_MESSAGE_TYPE_LSUPDATE0x4]); |
1167 | json_object_int_add(json_neighbor, |
1168 | "recvdLSAckHigherSeqNo", |
1169 | on->seqnum_h[OSPF6_MESSAGE_TYPE_LSACK0x5]); |
1170 | json_object_int_add(json_neighbor, |
1171 | "recvdLSAckLowerSeqNo", |
1172 | on->seqnum_l[OSPF6_MESSAGE_TYPE_LSACK0x5]); |
1173 | } else |
1174 | json_object_string_add(json_neighbor, "authStatus", |
1175 | "disabled"); |
1176 | |
1177 | json_object_object_add(json, on->name, json_neighbor); |
1178 | |
1179 | } else { |
1180 | vty_out(vty, " Neighbor %s\n", on->name); |
1181 | vty_out(vty, " Area %s via interface %s (ifindex %d)\n", |
1182 | on->ospf6_if->area->name, on->ospf6_if->interface->name, |
1183 | on->ospf6_if->interface->ifindex); |
1184 | vty_out(vty, " His IfIndex: %d Link-local address: %s\n", |
1185 | on->ifindex, linklocal_addr); |
1186 | vty_out(vty, " State %s for a duration of %s\n", |
1187 | ospf6_neighbor_state_str[on->state], duration); |
1188 | vty_out(vty, " His choice of DR/BDR %s/%s, Priority %d\n", |
1189 | drouter, bdrouter, on->priority); |
1190 | vty_out(vty, " DbDesc status: %s%s%s SeqNum: %#lx\n", |
1191 | (CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_IBIT)((on->dbdesc_bits) & ((0x04))) |
1192 | ? "Initial " |
1193 | : ""), |
1194 | (CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT)((on->dbdesc_bits) & ((0x02))) ? "More " |
1195 | : ""), |
1196 | (CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT)((on->dbdesc_bits) & ((0x01))) |
1197 | ? "Master" |
1198 | : "Slave"), |
1199 | (unsigned long)ntohl(on->dbdesc_seqnum)); |
1200 | |
1201 | vty_out(vty, " Summary-List: %d LSAs\n", |
1202 | on->summary_list->count); |
1203 | for (ALL_LSDB(on->summary_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->summary_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1204 | vty_out(vty, " %s\n", lsa->name); |
1205 | |
1206 | vty_out(vty, " Request-List: %d LSAs\n", |
1207 | on->request_list->count); |
1208 | for (ALL_LSDB(on->request_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->request_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1209 | vty_out(vty, " %s\n", lsa->name); |
1210 | |
1211 | vty_out(vty, " Retrans-List: %d LSAs\n", |
1212 | on->retrans_list->count); |
1213 | for (ALL_LSDB(on->retrans_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->retrans_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1214 | vty_out(vty, " %s\n", lsa->name); |
1215 | |
1216 | timerclear(&res)((&res)->tv_sec = (&res)->tv_usec = 0); |
1217 | if (event_is_scheduled(on->thread_send_dbdesc)) |
1218 | timersub(&on->thread_send_dbdesc->u.sands, &now, &res)do { (&res)->tv_sec = (&on->thread_send_dbdesc-> u.sands)->tv_sec - (&now)->tv_sec; (&res)->tv_usec = (&on->thread_send_dbdesc->u.sands)->tv_usec - (&now)->tv_usec; if ((&res)->tv_usec < 0) { --(&res)->tv_sec; (&res)->tv_usec += 1000000; } } while (0); |
1219 | timerstring(&res, duration, sizeof(duration))do { if ((&res)->tv_sec / 60 / 60 / 24) snprintf(duration , sizeof(duration), "%lldd%02lld:%02lld:%02lld", (&res)-> tv_sec / 60LL / 60 / 24, (&res)->tv_sec / 60LL / 60 % 24 , (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL ); else snprintf(duration, sizeof(duration), "%02lld:%02lld:%02lld" , (&res)->tv_sec / 60LL / 60 % 24, (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL); } while (0); |
1220 | vty_out(vty, |
1221 | " %d Pending LSAs for DbDesc in Time %s [thread %s]\n", |
1222 | on->dbdesc_list->count, duration, |
1223 | (event_is_scheduled(on->thread_send_dbdesc) ? "on" |
1224 | : "off")); |
1225 | for (ALL_LSDB(on->dbdesc_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->dbdesc_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1226 | vty_out(vty, " %s\n", lsa->name); |
1227 | |
1228 | timerclear(&res)((&res)->tv_sec = (&res)->tv_usec = 0); |
1229 | if (event_is_scheduled(on->thread_send_lsreq)) |
1230 | timersub(&on->thread_send_lsreq->u.sands, &now, &res)do { (&res)->tv_sec = (&on->thread_send_lsreq-> u.sands)->tv_sec - (&now)->tv_sec; (&res)->tv_usec = (&on->thread_send_lsreq->u.sands)->tv_usec - ( &now)->tv_usec; if ((&res)->tv_usec < 0) { -- (&res)->tv_sec; (&res)->tv_usec += 1000000; } } while (0); |
1231 | timerstring(&res, duration, sizeof(duration))do { if ((&res)->tv_sec / 60 / 60 / 24) snprintf(duration , sizeof(duration), "%lldd%02lld:%02lld:%02lld", (&res)-> tv_sec / 60LL / 60 / 24, (&res)->tv_sec / 60LL / 60 % 24 , (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL ); else snprintf(duration, sizeof(duration), "%02lld:%02lld:%02lld" , (&res)->tv_sec / 60LL / 60 % 24, (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL); } while (0); |
1232 | vty_out(vty, |
1233 | " %d Pending LSAs for LSReq in Time %s [thread %s]\n", |
1234 | on->request_list->count, duration, |
1235 | (event_is_scheduled(on->thread_send_lsreq) ? "on" |
1236 | : "off")); |
1237 | for (ALL_LSDB(on->request_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->request_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1238 | vty_out(vty, " %s\n", lsa->name); |
1239 | |
1240 | timerclear(&res)((&res)->tv_sec = (&res)->tv_usec = 0); |
1241 | if (event_is_scheduled(on->thread_send_lsupdate)) |
1242 | timersub(&on->thread_send_lsupdate->u.sands, &now, &res)do { (&res)->tv_sec = (&on->thread_send_lsupdate ->u.sands)->tv_sec - (&now)->tv_sec; (&res)-> tv_usec = (&on->thread_send_lsupdate->u.sands)-> tv_usec - (&now)->tv_usec; if ((&res)->tv_usec < 0) { --(&res)->tv_sec; (&res)->tv_usec += 1000000 ; } } while (0); |
1243 | timerstring(&res, duration, sizeof(duration))do { if ((&res)->tv_sec / 60 / 60 / 24) snprintf(duration , sizeof(duration), "%lldd%02lld:%02lld:%02lld", (&res)-> tv_sec / 60LL / 60 / 24, (&res)->tv_sec / 60LL / 60 % 24 , (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL ); else snprintf(duration, sizeof(duration), "%02lld:%02lld:%02lld" , (&res)->tv_sec / 60LL / 60 % 24, (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL); } while (0); |
1244 | vty_out(vty, |
1245 | " %d Pending LSAs for LSUpdate in Time %s [thread %s]\n", |
1246 | on->lsupdate_list->count, duration, |
1247 | (event_is_scheduled(on->thread_send_lsupdate) ? "on" |
1248 | : "off")); |
1249 | for (ALL_LSDB(on->lsupdate_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->lsupdate_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1250 | vty_out(vty, " %s\n", lsa->name); |
1251 | |
1252 | timerclear(&res)((&res)->tv_sec = (&res)->tv_usec = 0); |
1253 | if (event_is_scheduled(on->thread_send_lsack)) |
1254 | timersub(&on->thread_send_lsack->u.sands, &now, &res)do { (&res)->tv_sec = (&on->thread_send_lsack-> u.sands)->tv_sec - (&now)->tv_sec; (&res)->tv_usec = (&on->thread_send_lsack->u.sands)->tv_usec - ( &now)->tv_usec; if ((&res)->tv_usec < 0) { -- (&res)->tv_sec; (&res)->tv_usec += 1000000; } } while (0); |
1255 | timerstring(&res, duration, sizeof(duration))do { if ((&res)->tv_sec / 60 / 60 / 24) snprintf(duration , sizeof(duration), "%lldd%02lld:%02lld:%02lld", (&res)-> tv_sec / 60LL / 60 / 24, (&res)->tv_sec / 60LL / 60 % 24 , (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL ); else snprintf(duration, sizeof(duration), "%02lld:%02lld:%02lld" , (&res)->tv_sec / 60LL / 60 % 24, (&res)->tv_sec / 60LL % 60, (&res)->tv_sec % 60LL); } while (0); |
1256 | vty_out(vty, |
1257 | " %d Pending LSAs for LSAck in Time %s [thread %s]\n", |
1258 | on->lsack_list->count, duration, |
1259 | (event_is_scheduled(on->thread_send_lsack) ? "on" |
1260 | : "off")); |
1261 | for (ALL_LSDB(on->lsack_list, lsa, lsanext)const struct route_node *iterend = ospf6_lsdb_head(on->lsack_list , 0, 0, 0, &lsa); (lsa) != ((void*)0) && ospf6_lsa_lock (lsa) && ((lsanext) = ospf6_lsdb_next(iterend, (lsa)) , 1); ospf6_lsa_unlock(&lsa), (lsa) = (lsanext)) |
1262 | vty_out(vty, " %s\n", lsa->name); |
1263 | |
1264 | bfd_sess_show(vty, NULL((void*)0), on->bfd_session); |
1265 | |
1266 | if (on->auth_present == true1) { |
1267 | vty_out(vty, " Authentication header present\n"); |
1268 | vty_out(vty, |
1269 | "\t\t\t hello DBDesc LSReq LSUpd LSAck\n"); |
1270 | vty_out(vty, |
1271 | " Higher sequence no 0x%-10X 0x%-10X 0x%-10X 0x%-10X 0x%-10X\n", |
1272 | on->seqnum_h[OSPF6_MESSAGE_TYPE_HELLO0x1], |
1273 | on->seqnum_h[OSPF6_MESSAGE_TYPE_DBDESC0x2], |
1274 | on->seqnum_h[OSPF6_MESSAGE_TYPE_LSREQ0x3], |
1275 | on->seqnum_h[OSPF6_MESSAGE_TYPE_LSUPDATE0x4], |
1276 | on->seqnum_h[OSPF6_MESSAGE_TYPE_LSACK0x5]); |
1277 | vty_out(vty, |
1278 | " Lower sequence no 0x%-10X 0x%-10X 0x%-10X 0x%-10X 0x%-10X\n", |
1279 | on->seqnum_l[OSPF6_MESSAGE_TYPE_HELLO0x1], |
1280 | on->seqnum_l[OSPF6_MESSAGE_TYPE_DBDESC0x2], |
1281 | on->seqnum_l[OSPF6_MESSAGE_TYPE_LSREQ0x3], |
1282 | on->seqnum_l[OSPF6_MESSAGE_TYPE_LSUPDATE0x4], |
1283 | on->seqnum_l[OSPF6_MESSAGE_TYPE_LSACK0x5]); |
1284 | } else |
1285 | vty_out(vty, " Authentication header not present\n"); |
1286 | } |
1287 | } |
1288 | |
1289 | static void ospf6_neighbor_show_detail_common(struct vty *vty, |
1290 | struct ospf6 *ospf6, bool_Bool uj, |
1291 | bool_Bool detail, bool_Bool drchoice) |
1292 | { |
1293 | struct ospf6_neighbor *on; |
1294 | struct ospf6_interface *oi; |
1295 | struct ospf6_area *oa; |
1296 | struct listnode *i, *j, *k; |
1297 | json_object *json = NULL((void*)0); |
1298 | json_object *json_array = NULL((void*)0); |
1299 | void (*showfunc)(struct vty *, struct ospf6_neighbor *, |
1300 | json_object *json, bool_Bool use_json); |
1301 | |
1302 | if (detail) |
1303 | showfunc = ospf6_neighbor_show_detail; |
1304 | else if (drchoice) |
1305 | showfunc = ospf6_neighbor_show_drchoice; |
1306 | else |
1307 | showfunc = ospf6_neighbor_show; |
1308 | |
1309 | if (uj) { |
1310 | json = json_object_new_object(); |
1311 | json_array = json_object_new_array(); |
1312 | } else { |
1313 | if (showfunc == ospf6_neighbor_show) |
1314 | vty_out(vty, "%-15s %3s %11s %8s/%-12s %11s %s[%s]\n", |
1315 | "Neighbor ID", "Pri", "DeadTime", "State", |
1316 | "IfState", "Duration", "I/F", "State"); |
1317 | else if (showfunc == ospf6_neighbor_show_drchoice) |
1318 | vty_out(vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]\n", |
1319 | "RouterID", "State", "Duration", "DR", "BDR", |
1320 | "I/F", "State"); |
1321 | } |
1322 | |
1323 | for (ALL_LIST_ELEMENTS_RO(ospf6->area_list, i, oa)(i) = ((ospf6->area_list) ? ((ospf6->area_list)->head ) : ((void*)0)), ((oa) = ((void*)0)); (i) != ((void*)0) && ((oa) = ((({ static const struct xref_assert _xref __attribute__ ( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 1323, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "i", }; static const struct xref * const xref_p_145 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((i) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (i); }), ({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void *)0)), (XREFT_ASSERT), 1323, "ospf6d/ospf6_neighbor.c", __func__ , }, .expr = "(i)->data != NULL", }; static const struct xref * const xref_p_146 __attribute__((used, section("xref_array" ))) = &(_xref.xref); if (__builtin_expect(((i)->data != ((void*)0)) ? 0 : 1, 0)) do { _zlog_assert_failed(&_xref , ((void*)0)); } while ((i)->data != ((void*)0)); }), (i)-> data)), 1); (i) = ((i) ? ((i)->next) : ((void*)0)), ((oa) = ((void*)0))) |
1324 | for (ALL_LIST_ELEMENTS_RO(oa->if_list, j, oi)(j) = ((oa->if_list) ? ((oa->if_list)->head) : ((void *)0)), ((oi) = ((void*)0)); (j) != ((void*)0) && ((oi ) = ((({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 1324, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "j", }; static const struct xref * const xref_p_147 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((j) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (j); }), ({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void *)0)), (XREFT_ASSERT), 1324, "ospf6d/ospf6_neighbor.c", __func__ , }, .expr = "(j)->data != NULL", }; static const struct xref * const xref_p_148 __attribute__((used, section("xref_array" ))) = &(_xref.xref); if (__builtin_expect(((j)->data != ((void*)0)) ? 0 : 1, 0)) do { _zlog_assert_failed(&_xref , ((void*)0)); } while ((j)->data != ((void*)0)); }), (j)-> data)), 1); (j) = ((j) ? ((j)->next) : ((void*)0)), ((oi) = ((void*)0))) |
1325 | for (ALL_LIST_ELEMENTS_RO(oi->neighbor_list, k, on)(k) = ((oi->neighbor_list) ? ((oi->neighbor_list)->head ) : ((void*)0)), ((on) = ((void*)0)); (k) != ((void*)0) && ((on) = ((({ static const struct xref_assert _xref __attribute__ ( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 1325, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "k", }; static const struct xref * const xref_p_149 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((k) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (k); }), ({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void *)0)), (XREFT_ASSERT), 1325, "ospf6d/ospf6_neighbor.c", __func__ , }, .expr = "(k)->data != NULL", }; static const struct xref * const xref_p_150 __attribute__((used, section("xref_array" ))) = &(_xref.xref); if (__builtin_expect(((k)->data != ((void*)0)) ? 0 : 1, 0)) do { _zlog_assert_failed(&_xref , ((void*)0)); } while ((k)->data != ((void*)0)); }), (k)-> data)), 1); (k) = ((k) ? ((k)->next) : ((void*)0)), ((on) = ((void*)0))) { |
1326 | if (showfunc == ospf6_neighbor_show_detail) |
1327 | (*showfunc)(vty, on, json, uj); |
1328 | else |
1329 | (*showfunc)(vty, on, json_array, uj); |
1330 | } |
1331 | |
1332 | if (uj) { |
1333 | if (showfunc != ospf6_neighbor_show_detail) |
1334 | json_object_object_add(json, "neighbors", json_array); |
1335 | else |
1336 | json_object_free(json_array); |
1337 | vty_json(vty, json); |
1338 | } |
1339 | } |
1340 | |
1341 | DEFUN(show_ipv6_ospf6_neighbor, show_ipv6_ospf6_neighbor_cmd,static int show_ipv6_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor [<detail|drchoice>] [json]" , .func = show_ipv6_ospf6_neighbor, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Display details\n" "Display DR choices\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1347, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor", }, }; static const struct xref * const xref_p_151 __attribute__((used, section("xref_array")) ) = &(show_ipv6_ospf6_neighbor_cmd.xref); static int show_ipv6_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1342 | "show ipv6 ospf6 [vrf <NAME|all>] neighbor [<detail|drchoice>] [json]",static int show_ipv6_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor [<detail|drchoice>] [json]" , .func = show_ipv6_ospf6_neighbor, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Display details\n" "Display DR choices\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1347, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor", }, }; static const struct xref * const xref_p_151 __attribute__((used, section("xref_array")) ) = &(show_ipv6_ospf6_neighbor_cmd.xref); static int show_ipv6_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1343 | SHOW_STR IP6_STR OSPF6_STR VRF_CMD_HELP_STRstatic int show_ipv6_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor [<detail|drchoice>] [json]" , .func = show_ipv6_ospf6_neighbor, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Display details\n" "Display DR choices\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1347, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor", }, }; static const struct xref * const xref_p_151 __attribute__((used, section("xref_array")) ) = &(show_ipv6_ospf6_neighbor_cmd.xref); static int show_ipv6_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1344 | "All VRFs\n"static int show_ipv6_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor [<detail|drchoice>] [json]" , .func = show_ipv6_ospf6_neighbor, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Display details\n" "Display DR choices\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1347, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor", }, }; static const struct xref * const xref_p_151 __attribute__((used, section("xref_array")) ) = &(show_ipv6_ospf6_neighbor_cmd.xref); static int show_ipv6_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1345 | "Neighbor list\n"static int show_ipv6_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor [<detail|drchoice>] [json]" , .func = show_ipv6_ospf6_neighbor, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Display details\n" "Display DR choices\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1347, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor", }, }; static const struct xref * const xref_p_151 __attribute__((used, section("xref_array")) ) = &(show_ipv6_ospf6_neighbor_cmd.xref); static int show_ipv6_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1346 | "Display details\n"static int show_ipv6_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor [<detail|drchoice>] [json]" , .func = show_ipv6_ospf6_neighbor, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Display details\n" "Display DR choices\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1347, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor", }, }; static const struct xref * const xref_p_151 __attribute__((used, section("xref_array")) ) = &(show_ipv6_ospf6_neighbor_cmd.xref); static int show_ipv6_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1347 | "Display DR choices\n" JSON_STR)static int show_ipv6_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor [<detail|drchoice>] [json]" , .func = show_ipv6_ospf6_neighbor, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Display details\n" "Display DR choices\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1347, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor", }, }; static const struct xref * const xref_p_151 __attribute__((used, section("xref_array")) ) = &(show_ipv6_ospf6_neighbor_cmd.xref); static int show_ipv6_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1348 | { |
1349 | struct ospf6 *ospf6; |
1350 | struct listnode *node; |
1351 | const char *vrf_name = NULL((void*)0); |
1352 | bool_Bool all_vrf = false0; |
1353 | int idx_vrf = 0; |
1354 | int idx_type = 4; |
1355 | bool_Bool uj = use_json(argc, argv); |
1356 | bool_Bool detail = false0; |
1357 | bool_Bool drchoice = false0; |
1358 | |
1359 | OSPF6_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf)do { if (argv_find(argv, argc, "vrf", &idx_vrf)) { vrf_name = argv[idx_vrf + 1]->arg; all_vrf = (!strcmp((vrf_name), ( "all"))); } else { vrf_name = vrf_get_default_name(); } } while (0); |
1360 | |
1361 | if (argv_find(argv, argc, "detail", &idx_type)) |
1362 | detail = true1; |
1363 | else if (argv_find(argv, argc, "drchoice", &idx_type)) |
1364 | drchoice = true1; |
1365 | |
1366 | for (ALL_LIST_ELEMENTS_RO(om6->ospf6, node, ospf6)(node) = ((om6->ospf6) ? ((om6->ospf6)->head) : ((void *)0)), ((ospf6) = ((void*)0)); (node) != ((void*)0) && ((ospf6) = ((({ static const struct xref_assert _xref __attribute__ ( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 1366, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "node", }; static const struct xref * const xref_p_152 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((node) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (node); }), ({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 1366, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "(node)->data != NULL", }; static const struct xref * const xref_p_153 __attribute__((used, section( "xref_array"))) = &(_xref.xref); if (__builtin_expect(((node )->data != ((void*)0)) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while ((node)->data != ((void* )0)); }), (node)->data)), 1); (node) = ((node) ? ((node)-> next) : ((void*)0)), ((ospf6) = ((void*)0))) { |
1367 | if (all_vrf || strcmp(ospf6->name, vrf_name) == 0) { |
1368 | ospf6_neighbor_show_detail_common(vty, ospf6, uj, |
1369 | detail, drchoice); |
1370 | if (!all_vrf) |
1371 | break; |
1372 | } |
1373 | } |
1374 | |
1375 | OSPF6_CMD_CHECK_VRF(uj, all_vrf, ospf6)do { if (uj == 0 && all_vrf == 0 && ospf6 == ( (void*)0)) { vty_out(vty, "%% OSPFv3 instance not found\n"); return 0; } } while (0); |
1376 | |
1377 | return CMD_SUCCESS0; |
1378 | } |
1379 | |
1380 | static int ospf6_neighbor_show_common(struct vty *vty, int argc, |
1381 | struct cmd_token **argv, |
1382 | struct ospf6 *ospf6, int idx_ipv4, bool_Bool uj) |
1383 | { |
1384 | struct ospf6_neighbor *on; |
1385 | struct ospf6_interface *oi; |
1386 | struct ospf6_area *oa; |
1387 | struct listnode *i, *j, *k; |
1388 | void (*showfunc)(struct vty *, struct ospf6_neighbor *, |
1389 | json_object *json, bool_Bool use_json); |
1390 | uint32_t router_id; |
1391 | json_object *json = NULL((void*)0); |
1392 | |
1393 | showfunc = ospf6_neighbor_show_detail; |
1394 | if (uj) |
1395 | json = json_object_new_object(); |
1396 | |
1397 | if ((inet_pton(AF_INET2, argv[idx_ipv4]->arg, &router_id)) != 1) { |
1398 | vty_out(vty, "Router-ID is not parsable: %s\n", |
1399 | argv[idx_ipv4]->arg); |
1400 | return CMD_SUCCESS0; |
1401 | } |
1402 | |
1403 | for (ALL_LIST_ELEMENTS_RO(ospf6->area_list, i, oa)(i) = ((ospf6->area_list) ? ((ospf6->area_list)->head ) : ((void*)0)), ((oa) = ((void*)0)); (i) != ((void*)0) && ((oa) = ((({ static const struct xref_assert _xref __attribute__ ( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 1403, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "i", }; static const struct xref * const xref_p_154 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((i) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (i); }), ({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void *)0)), (XREFT_ASSERT), 1403, "ospf6d/ospf6_neighbor.c", __func__ , }, .expr = "(i)->data != NULL", }; static const struct xref * const xref_p_155 __attribute__((used, section("xref_array" ))) = &(_xref.xref); if (__builtin_expect(((i)->data != ((void*)0)) ? 0 : 1, 0)) do { _zlog_assert_failed(&_xref , ((void*)0)); } while ((i)->data != ((void*)0)); }), (i)-> data)), 1); (i) = ((i) ? ((i)->next) : ((void*)0)), ((oa) = ((void*)0))) |
1404 | for (ALL_LIST_ELEMENTS_RO(oa->if_list, j, oi)(j) = ((oa->if_list) ? ((oa->if_list)->head) : ((void *)0)), ((oi) = ((void*)0)); (j) != ((void*)0) && ((oi ) = ((({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 1404, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "j", }; static const struct xref * const xref_p_156 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((j) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (j); }), ({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void *)0)), (XREFT_ASSERT), 1404, "ospf6d/ospf6_neighbor.c", __func__ , }, .expr = "(j)->data != NULL", }; static const struct xref * const xref_p_157 __attribute__((used, section("xref_array" ))) = &(_xref.xref); if (__builtin_expect(((j)->data != ((void*)0)) ? 0 : 1, 0)) do { _zlog_assert_failed(&_xref , ((void*)0)); } while ((j)->data != ((void*)0)); }), (j)-> data)), 1); (j) = ((j) ? ((j)->next) : ((void*)0)), ((oi) = ((void*)0))) |
1405 | for (ALL_LIST_ELEMENTS_RO(oi->neighbor_list, k, on)(k) = ((oi->neighbor_list) ? ((oi->neighbor_list)->head ) : ((void*)0)), ((on) = ((void*)0)); (k) != ((void*)0) && ((on) = ((({ static const struct xref_assert _xref __attribute__ ( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 1405, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "k", }; static const struct xref * const xref_p_158 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((k) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (k); }), ({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void *)0)), (XREFT_ASSERT), 1405, "ospf6d/ospf6_neighbor.c", __func__ , }, .expr = "(k)->data != NULL", }; static const struct xref * const xref_p_159 __attribute__((used, section("xref_array" ))) = &(_xref.xref); if (__builtin_expect(((k)->data != ((void*)0)) ? 0 : 1, 0)) do { _zlog_assert_failed(&_xref , ((void*)0)); } while ((k)->data != ((void*)0)); }), (k)-> data)), 1); (k) = ((k) ? ((k)->next) : ((void*)0)), ((on) = ((void*)0))) { |
1406 | if (router_id == on->router_id) |
1407 | (*showfunc)(vty, on, json, uj); |
1408 | } |
1409 | |
1410 | if (uj) |
1411 | vty_json(vty, json); |
1412 | |
1413 | return CMD_SUCCESS0; |
1414 | } |
1415 | |
1416 | DEFUN(show_ipv6_ospf6_neighbor_one, show_ipv6_ospf6_neighbor_one_cmd,static int show_ipv6_ospf6_neighbor_one(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_one_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor A.B.C.D [json]" , .func = show_ipv6_ospf6_neighbor_one, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Specify Router-ID as IPv4 address notation\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_one_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1421, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor_one", }, }; static const struct xref * const xref_p_160 __attribute__((used, section("xref_array" ))) = &(show_ipv6_ospf6_neighbor_one_cmd.xref); static int show_ipv6_ospf6_neighbor_one(const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__ ((unused))) |
1417 | "show ipv6 ospf6 [vrf <NAME|all>] neighbor A.B.C.D [json]",static int show_ipv6_ospf6_neighbor_one(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_one_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor A.B.C.D [json]" , .func = show_ipv6_ospf6_neighbor_one, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Specify Router-ID as IPv4 address notation\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_one_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1421, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor_one", }, }; static const struct xref * const xref_p_160 __attribute__((used, section("xref_array" ))) = &(show_ipv6_ospf6_neighbor_one_cmd.xref); static int show_ipv6_ospf6_neighbor_one(const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__ ((unused))) |
1418 | SHOW_STR IP6_STR OSPF6_STR VRF_CMD_HELP_STRstatic int show_ipv6_ospf6_neighbor_one(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_one_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor A.B.C.D [json]" , .func = show_ipv6_ospf6_neighbor_one, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Specify Router-ID as IPv4 address notation\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_one_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1421, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor_one", }, }; static const struct xref * const xref_p_160 __attribute__((used, section("xref_array" ))) = &(show_ipv6_ospf6_neighbor_one_cmd.xref); static int show_ipv6_ospf6_neighbor_one(const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__ ((unused))) |
1419 | "All VRFs\n"static int show_ipv6_ospf6_neighbor_one(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_one_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor A.B.C.D [json]" , .func = show_ipv6_ospf6_neighbor_one, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Specify Router-ID as IPv4 address notation\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_one_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1421, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor_one", }, }; static const struct xref * const xref_p_160 __attribute__((used, section("xref_array" ))) = &(show_ipv6_ospf6_neighbor_one_cmd.xref); static int show_ipv6_ospf6_neighbor_one(const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__ ((unused))) |
1420 | "Neighbor list\n"static int show_ipv6_ospf6_neighbor_one(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_one_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor A.B.C.D [json]" , .func = show_ipv6_ospf6_neighbor_one, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Specify Router-ID as IPv4 address notation\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_one_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1421, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor_one", }, }; static const struct xref * const xref_p_160 __attribute__((used, section("xref_array" ))) = &(show_ipv6_ospf6_neighbor_one_cmd.xref); static int show_ipv6_ospf6_neighbor_one(const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__ ((unused))) |
1421 | "Specify Router-ID as IPv4 address notation\n" JSON_STR)static int show_ipv6_ospf6_neighbor_one(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element show_ipv6_ospf6_neighbor_one_cmd = { .string = "show ipv6 ospf6 [vrf <NAME|all>] neighbor A.B.C.D [json]" , .func = show_ipv6_ospf6_neighbor_one, .doc = "Show running system information\n" "IPv6 Information\n" "Open Shortest Path First (OSPF) for IPv6\n" "Specify the VRF\nThe VRF name\n" "All VRFs\n" "Neighbor list\n" "Specify Router-ID as IPv4 address notation\n" "JavaScript Object Notation\n" , .attr = 0, .daemon = 0, .name = "show_ipv6_ospf6_neighbor_one_cmd" , .xref = { (((void*)0)), (XREFT_DEFUN), 1421, "ospf6d/ospf6_neighbor.c" , "show_ipv6_ospf6_neighbor_one", }, }; static const struct xref * const xref_p_160 __attribute__((used, section("xref_array" ))) = &(show_ipv6_ospf6_neighbor_one_cmd.xref); static int show_ipv6_ospf6_neighbor_one(const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__ ((unused))) |
1422 | { |
1423 | int idx_ipv4 = 4; |
1424 | struct ospf6 *ospf6; |
1425 | struct listnode *node; |
1426 | const char *vrf_name = NULL((void*)0); |
1427 | bool_Bool all_vrf = false0; |
1428 | int idx_vrf = 0; |
1429 | bool_Bool uj = use_json(argc, argv); |
1430 | |
1431 | OSPF6_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf)do { if (argv_find(argv, argc, "vrf", &idx_vrf)) { vrf_name = argv[idx_vrf + 1]->arg; all_vrf = (!strcmp((vrf_name), ( "all"))); } else { vrf_name = vrf_get_default_name(); } } while (0); |
1432 | if (idx_vrf > 0) |
1433 | idx_ipv4 += 2; |
1434 | |
1435 | for (ALL_LIST_ELEMENTS_RO(om6->ospf6, node, ospf6)(node) = ((om6->ospf6) ? ((om6->ospf6)->head) : ((void *)0)), ((ospf6) = ((void*)0)); (node) != ((void*)0) && ((ospf6) = ((({ static const struct xref_assert _xref __attribute__ ( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 1435, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "node", }; static const struct xref * const xref_p_161 __attribute__((used, section("xref_array"))) = & (_xref.xref); if (__builtin_expect((node) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while (node); }), ({ static const struct xref_assert _xref __attribute__( (used)) = { .xref = { (((void*)0)), (XREFT_ASSERT), 1435, "ospf6d/ospf6_neighbor.c" , __func__, }, .expr = "(node)->data != NULL", }; static const struct xref * const xref_p_162 __attribute__((used, section( "xref_array"))) = &(_xref.xref); if (__builtin_expect(((node )->data != ((void*)0)) ? 0 : 1, 0)) do { _zlog_assert_failed (&_xref, ((void*)0)); } while ((node)->data != ((void* )0)); }), (node)->data)), 1); (node) = ((node) ? ((node)-> next) : ((void*)0)), ((ospf6) = ((void*)0))) { |
1436 | if (all_vrf || strcmp(ospf6->name, vrf_name) == 0) { |
1437 | ospf6_neighbor_show_common(vty, argc, argv, ospf6, |
1438 | idx_ipv4, uj); |
1439 | |
1440 | if (!all_vrf) |
1441 | break; |
1442 | } |
1443 | } |
1444 | |
1445 | OSPF6_CMD_CHECK_VRF(uj, all_vrf, ospf6)do { if (uj == 0 && all_vrf == 0 && ospf6 == ( (void*)0)) { vty_out(vty, "%% OSPFv3 instance not found\n"); return 0; } } while (0); |
1446 | |
1447 | return CMD_SUCCESS0; |
1448 | } |
1449 | |
1450 | void ospf6_neighbor_init(void) |
1451 | { |
1452 | install_element(VIEW_NODE, &show_ipv6_ospf6_neighbor_cmd)do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1452, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &show_ipv6_ospf6_neighbor_cmd, .node_type = VIEW_NODE, } ; static const struct xref * const xref_p_163 __attribute__(( used, section("xref_array"))) = &(_xref.xref); _install_element (VIEW_NODE, &show_ipv6_ospf6_neighbor_cmd); } while (0); |
1453 | install_element(VIEW_NODE, &show_ipv6_ospf6_neighbor_one_cmd)do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1453, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &show_ipv6_ospf6_neighbor_one_cmd, .node_type = VIEW_NODE , }; static const struct xref * const xref_p_164 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); _install_element (VIEW_NODE, &show_ipv6_ospf6_neighbor_one_cmd); } while ( 0); |
1454 | |
1455 | install_element(INTERFACE_NODE, &ipv6_ospf6_p2xp_neigh_cmd)do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1455, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &ipv6_ospf6_p2xp_neigh_cmd, .node_type = INTERFACE_NODE, }; static const struct xref * const xref_p_165 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); _install_element (INTERFACE_NODE, &ipv6_ospf6_p2xp_neigh_cmd); } while (0); |
1456 | install_element(INTERFACE_NODE, &ipv6_ospf6_p2xp_neigh_cost_cmd)do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1456, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &ipv6_ospf6_p2xp_neigh_cost_cmd, .node_type = INTERFACE_NODE , }; static const struct xref * const xref_p_166 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); _install_element (INTERFACE_NODE, &ipv6_ospf6_p2xp_neigh_cost_cmd); } while (0); |
1457 | install_element(INTERFACE_NODE,do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1458, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &ipv6_ospf6_p2xp_neigh_poll_interval_cmd, .node_type = INTERFACE_NODE , }; static const struct xref * const xref_p_167 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); _install_element (INTERFACE_NODE, &ipv6_ospf6_p2xp_neigh_poll_interval_cmd ); } while (0) |
1458 | &ipv6_ospf6_p2xp_neigh_poll_interval_cmd)do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1458, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &ipv6_ospf6_p2xp_neigh_poll_interval_cmd, .node_type = INTERFACE_NODE , }; static const struct xref * const xref_p_167 __attribute__ ((used, section("xref_array"))) = &(_xref.xref); _install_element (INTERFACE_NODE, &ipv6_ospf6_p2xp_neigh_poll_interval_cmd ); } while (0); |
1459 | } |
1460 | |
1461 | DEFUN(debug_ospf6_neighbor, debug_ospf6_neighbor_cmd,static int debug_ospf6_neighbor(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element debug_ospf6_neighbor_cmd = { .string = "debug ospf6 neighbor [<state|event>]" , .func = debug_ospf6_neighbor, .doc = "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n" "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n" , .attr = 0, .daemon = 0, .name = "debug_ospf6_neighbor_cmd", .xref = { (((void*)0)), (XREFT_DEFUN), 1465, "ospf6d/ospf6_neighbor.c" , "debug_ospf6_neighbor", }, }; static const struct xref * const xref_p_168 __attribute__((used, section("xref_array"))) = & (debug_ospf6_neighbor_cmd.xref); static int debug_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1462 | "debug ospf6 neighbor [<state|event>]",static int debug_ospf6_neighbor(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element debug_ospf6_neighbor_cmd = { .string = "debug ospf6 neighbor [<state|event>]" , .func = debug_ospf6_neighbor, .doc = "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n" "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n" , .attr = 0, .daemon = 0, .name = "debug_ospf6_neighbor_cmd", .xref = { (((void*)0)), (XREFT_DEFUN), 1465, "ospf6d/ospf6_neighbor.c" , "debug_ospf6_neighbor", }, }; static const struct xref * const xref_p_168 __attribute__((used, section("xref_array"))) = & (debug_ospf6_neighbor_cmd.xref); static int debug_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1463 | DEBUG_STR OSPF6_STR "Debug OSPFv3 Neighbor\n"static int debug_ospf6_neighbor(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element debug_ospf6_neighbor_cmd = { .string = "debug ospf6 neighbor [<state|event>]" , .func = debug_ospf6_neighbor, .doc = "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n" "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n" , .attr = 0, .daemon = 0, .name = "debug_ospf6_neighbor_cmd", .xref = { (((void*)0)), (XREFT_DEFUN), 1465, "ospf6d/ospf6_neighbor.c" , "debug_ospf6_neighbor", }, }; static const struct xref * const xref_p_168 __attribute__((used, section("xref_array"))) = & (debug_ospf6_neighbor_cmd.xref); static int debug_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1464 | "Debug OSPFv3 Neighbor State Change\n"static int debug_ospf6_neighbor(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element debug_ospf6_neighbor_cmd = { .string = "debug ospf6 neighbor [<state|event>]" , .func = debug_ospf6_neighbor, .doc = "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n" "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n" , .attr = 0, .daemon = 0, .name = "debug_ospf6_neighbor_cmd", .xref = { (((void*)0)), (XREFT_DEFUN), 1465, "ospf6d/ospf6_neighbor.c" , "debug_ospf6_neighbor", }, }; static const struct xref * const xref_p_168 __attribute__((used, section("xref_array"))) = & (debug_ospf6_neighbor_cmd.xref); static int debug_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1465 | "Debug OSPFv3 Neighbor Event\n")static int debug_ospf6_neighbor(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element debug_ospf6_neighbor_cmd = { .string = "debug ospf6 neighbor [<state|event>]" , .func = debug_ospf6_neighbor, .doc = "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n" "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n" , .attr = 0, .daemon = 0, .name = "debug_ospf6_neighbor_cmd", .xref = { (((void*)0)), (XREFT_DEFUN), 1465, "ospf6d/ospf6_neighbor.c" , "debug_ospf6_neighbor", }, }; static const struct xref * const xref_p_168 __attribute__((used, section("xref_array"))) = & (debug_ospf6_neighbor_cmd.xref); static int debug_ospf6_neighbor (const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused )), struct cmd_token *argv[] __attribute__((unused))) |
1466 | { |
1467 | int idx_type = 3; |
1468 | unsigned char level = 0; |
1469 | |
1470 | if (argc == 4) { |
1471 | if (!strncmp(argv[idx_type]->arg, "s", 1)) |
1472 | level = OSPF6_DEBUG_NEIGHBOR_STATE0x01; |
1473 | else if (!strncmp(argv[idx_type]->arg, "e", 1)) |
1474 | level = OSPF6_DEBUG_NEIGHBOR_EVENT0x02; |
1475 | } else |
1476 | level = OSPF6_DEBUG_NEIGHBOR_STATE0x01 | OSPF6_DEBUG_NEIGHBOR_EVENT0x02; |
1477 | |
1478 | OSPF6_DEBUG_NEIGHBOR_ON(level)(conf_debug_ospf6_neighbor |= (level)); |
1479 | return CMD_SUCCESS0; |
1480 | } |
1481 | |
1482 | |
1483 | DEFUN(no_debug_ospf6_neighbor, no_debug_ospf6_neighbor_cmd,static int no_debug_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element no_debug_ospf6_neighbor_cmd = { .string = "no debug ospf6 neighbor [<state|event>]" , .func = no_debug_ospf6_neighbor, .doc = "Negate a command or set its defaults\n" "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n" "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n", .attr = 0, .daemon = 0, .name = "no_debug_ospf6_neighbor_cmd", .xref = { (((void*)0)), (XREFT_DEFUN ), 1487, "ospf6d/ospf6_neighbor.c", "no_debug_ospf6_neighbor" , }, }; static const struct xref * const xref_p_169 __attribute__ ((used, section("xref_array"))) = &(no_debug_ospf6_neighbor_cmd .xref); static int no_debug_ospf6_neighbor(const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__((unused))) |
1484 | "no debug ospf6 neighbor [<state|event>]",static int no_debug_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element no_debug_ospf6_neighbor_cmd = { .string = "no debug ospf6 neighbor [<state|event>]" , .func = no_debug_ospf6_neighbor, .doc = "Negate a command or set its defaults\n" "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n" "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n", .attr = 0, .daemon = 0, .name = "no_debug_ospf6_neighbor_cmd", .xref = { (((void*)0)), (XREFT_DEFUN ), 1487, "ospf6d/ospf6_neighbor.c", "no_debug_ospf6_neighbor" , }, }; static const struct xref * const xref_p_169 __attribute__ ((used, section("xref_array"))) = &(no_debug_ospf6_neighbor_cmd .xref); static int no_debug_ospf6_neighbor(const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__((unused))) |
1485 | NO_STR DEBUG_STR OSPF6_STR "Debug OSPFv3 Neighbor\n"static int no_debug_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element no_debug_ospf6_neighbor_cmd = { .string = "no debug ospf6 neighbor [<state|event>]" , .func = no_debug_ospf6_neighbor, .doc = "Negate a command or set its defaults\n" "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n" "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n", .attr = 0, .daemon = 0, .name = "no_debug_ospf6_neighbor_cmd", .xref = { (((void*)0)), (XREFT_DEFUN ), 1487, "ospf6d/ospf6_neighbor.c", "no_debug_ospf6_neighbor" , }, }; static const struct xref * const xref_p_169 __attribute__ ((used, section("xref_array"))) = &(no_debug_ospf6_neighbor_cmd .xref); static int no_debug_ospf6_neighbor(const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__((unused))) |
1486 | "Debug OSPFv3 Neighbor State Change\n"static int no_debug_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element no_debug_ospf6_neighbor_cmd = { .string = "no debug ospf6 neighbor [<state|event>]" , .func = no_debug_ospf6_neighbor, .doc = "Negate a command or set its defaults\n" "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n" "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n", .attr = 0, .daemon = 0, .name = "no_debug_ospf6_neighbor_cmd", .xref = { (((void*)0)), (XREFT_DEFUN ), 1487, "ospf6d/ospf6_neighbor.c", "no_debug_ospf6_neighbor" , }, }; static const struct xref * const xref_p_169 __attribute__ ((used, section("xref_array"))) = &(no_debug_ospf6_neighbor_cmd .xref); static int no_debug_ospf6_neighbor(const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__((unused))) |
1487 | "Debug OSPFv3 Neighbor Event\n")static int no_debug_ospf6_neighbor(const struct cmd_element * , struct vty *, int, struct cmd_token *[]); static const struct cmd_element no_debug_ospf6_neighbor_cmd = { .string = "no debug ospf6 neighbor [<state|event>]" , .func = no_debug_ospf6_neighbor, .doc = "Negate a command or set its defaults\n" "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n" "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n", .attr = 0, .daemon = 0, .name = "no_debug_ospf6_neighbor_cmd", .xref = { (((void*)0)), (XREFT_DEFUN ), 1487, "ospf6d/ospf6_neighbor.c", "no_debug_ospf6_neighbor" , }, }; static const struct xref * const xref_p_169 __attribute__ ((used, section("xref_array"))) = &(no_debug_ospf6_neighbor_cmd .xref); static int no_debug_ospf6_neighbor(const struct cmd_element *self __attribute__((unused)), struct vty *vty __attribute__ ((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__((unused))) |
1488 | { |
1489 | int idx_type = 4; |
1490 | unsigned char level = 0; |
1491 | |
1492 | if (argc == 5) { |
1493 | if (!strncmp(argv[idx_type]->arg, "s", 1)) |
1494 | level = OSPF6_DEBUG_NEIGHBOR_STATE0x01; |
1495 | if (!strncmp(argv[idx_type]->arg, "e", 1)) |
1496 | level = OSPF6_DEBUG_NEIGHBOR_EVENT0x02; |
1497 | } else |
1498 | level = OSPF6_DEBUG_NEIGHBOR_STATE0x01 | OSPF6_DEBUG_NEIGHBOR_EVENT0x02; |
1499 | |
1500 | OSPF6_DEBUG_NEIGHBOR_OFF(level)(conf_debug_ospf6_neighbor &= ~(level)); |
1501 | return CMD_SUCCESS0; |
1502 | } |
1503 | |
1504 | |
1505 | DEFUN(no_debug_ospf6, no_debug_ospf6_cmd, "no debug ospf6",static int no_debug_ospf6(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element no_debug_ospf6_cmd = { .string = "no debug ospf6", .func = no_debug_ospf6 , .doc = "Negate a command or set its defaults\n" "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n", .attr = 0, .daemon = 0, .name = "no_debug_ospf6_cmd", .xref = { (((void*)0)), ( XREFT_DEFUN), 1506, "ospf6d/ospf6_neighbor.c", "no_debug_ospf6" , }, }; static const struct xref * const xref_p_170 __attribute__ ((used, section("xref_array"))) = &(no_debug_ospf6_cmd.xref ); static int no_debug_ospf6(const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__ ((unused))) |
1506 | NO_STR DEBUG_STR OSPF6_STR)static int no_debug_ospf6(const struct cmd_element *, struct vty *, int, struct cmd_token *[]); static const struct cmd_element no_debug_ospf6_cmd = { .string = "no debug ospf6", .func = no_debug_ospf6 , .doc = "Negate a command or set its defaults\n" "Debugging functions\n" "Open Shortest Path First (OSPF) for IPv6\n", .attr = 0, .daemon = 0, .name = "no_debug_ospf6_cmd", .xref = { (((void*)0)), ( XREFT_DEFUN), 1506, "ospf6d/ospf6_neighbor.c", "no_debug_ospf6" , }, }; static const struct xref * const xref_p_170 __attribute__ ((used, section("xref_array"))) = &(no_debug_ospf6_cmd.xref ); static int no_debug_ospf6(const struct cmd_element *self __attribute__ ((unused)), struct vty *vty __attribute__((unused)), int argc __attribute__((unused)), struct cmd_token *argv[] __attribute__ ((unused))) |
1507 | { |
1508 | unsigned int i; |
1509 | |
1510 | OSPF6_DEBUG_ABR_OFF()(conf_debug_ospf6_abr = 0); |
1511 | OSPF6_DEBUG_ASBR_OFF()(conf_debug_ospf6_asbr = 0); |
1512 | OSPF6_DEBUG_BROUTER_OFF()(conf_debug_ospf6_brouter &= ~0x01); |
1513 | OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_OFF()do { conf_debug_ospf6_brouter_specific_router_id = 0; conf_debug_ospf6_brouter &= ~0x02; } while (0); |
1514 | OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_OFF()do { conf_debug_ospf6_brouter_specific_area_id = 0; conf_debug_ospf6_brouter &= ~0x04; } while (0); |
1515 | OSPF6_DEBUG_FLOODING_OFF()(conf_debug_ospf6_flooding = 0); |
1516 | OSPF6_DEBUG_INTERFACE_OFF()(conf_debug_ospf6_interface = 0); |
1517 | |
1518 | ospf6_lsa_debug_set_all(false0); |
1519 | |
1520 | for (i = 0; i < 6; i++) |
1521 | OSPF6_DEBUG_MESSAGE_OFF(i, OSPF6_DEBUG_NEIGHBOR_STATE |(conf_debug_ospf6_message[i] &= ~(0x01 | 0x02)) |
1522 | OSPF6_DEBUG_NEIGHBOR_EVENT)(conf_debug_ospf6_message[i] &= ~(0x01 | 0x02)); |
1523 | |
1524 | OSPF6_DEBUG_NEIGHBOR_OFF(OSPF6_DEBUG_NEIGHBOR_STATE |(conf_debug_ospf6_neighbor &= ~(0x01 | 0x02)) |
1525 | OSPF6_DEBUG_NEIGHBOR_EVENT)(conf_debug_ospf6_neighbor &= ~(0x01 | 0x02)); |
1526 | OSPF6_DEBUG_ROUTE_OFF(OSPF6_DEBUG_ROUTE_TABLE)(conf_debug_ospf6_route &= ~(0x01)); |
1527 | OSPF6_DEBUG_ROUTE_OFF(OSPF6_DEBUG_ROUTE_INTRA)(conf_debug_ospf6_route &= ~(0x02)); |
1528 | OSPF6_DEBUG_ROUTE_OFF(OSPF6_DEBUG_ROUTE_INTER)(conf_debug_ospf6_route &= ~(0x04)); |
1529 | OSPF6_DEBUG_ROUTE_OFF(OSPF6_DEBUG_ROUTE_MEMORY)(conf_debug_ospf6_route &= ~(0x08)); |
1530 | OSPF6_DEBUG_SPF_OFF(OSPF6_DEBUG_SPF_PROCESS)(conf_debug_ospf6_spf &= ~(0x01)); |
1531 | OSPF6_DEBUG_SPF_OFF(OSPF6_DEBUG_SPF_TIME)(conf_debug_ospf6_spf &= ~(0x02)); |
1532 | OSPF6_DEBUG_SPF_OFF(OSPF6_DEBUG_SPF_DATABASE)(conf_debug_ospf6_spf &= ~(0x04)); |
1533 | OSPF6_DEBUG_ZEBRA_OFF(OSPF6_DEBUG_ZEBRA_SEND | OSPF6_DEBUG_ZEBRA_RECV)(conf_debug_ospf6_zebra &= ~(0x01 | 0x02)); |
1534 | |
1535 | return CMD_SUCCESS0; |
1536 | } |
1537 | |
1538 | int config_write_ospf6_debug_neighbor(struct vty *vty) |
1539 | { |
1540 | if (IS_OSPF6_DEBUG_NEIGHBOR(STATE)(conf_debug_ospf6_neighbor & 0x01) && IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
1541 | vty_out(vty, "debug ospf6 neighbor\n"); |
1542 | else if (IS_OSPF6_DEBUG_NEIGHBOR(STATE)(conf_debug_ospf6_neighbor & 0x01)) |
1543 | vty_out(vty, "debug ospf6 neighbor state\n"); |
1544 | else if (IS_OSPF6_DEBUG_NEIGHBOR(EVENT)(conf_debug_ospf6_neighbor & 0x02)) |
1545 | vty_out(vty, "debug ospf6 neighbor event\n"); |
1546 | return 0; |
1547 | } |
1548 | |
1549 | int config_write_ospf6_p2xp_neighbor(struct vty *vty, struct ospf6_interface *oi) |
1550 | { |
1551 | struct ospf6_if_p2xp_neighcfg *p2xp_cfg; |
1552 | |
1553 | frr_each (ospf6_if_p2xp_neighcfgs, &oi->p2xp_neighs, p2xp_cfg)for (p2xp_cfg = ospf6_if_p2xp_neighcfgs_first(&oi->p2xp_neighs ); p2xp_cfg; p2xp_cfg = ospf6_if_p2xp_neighcfgs_next(&oi-> p2xp_neighs, p2xp_cfg)) { |
1554 | vty_out(vty, " ipv6 ospf6 neighbor %pI6\n", &p2xp_cfg->addr); |
1555 | |
1556 | if (p2xp_cfg->poll_interval) |
1557 | vty_out(vty, |
1558 | " ipv6 ospf6 neighbor %pI6 poll-interval %u\n", |
1559 | &p2xp_cfg->addr, p2xp_cfg->poll_interval); |
1560 | |
1561 | if (p2xp_cfg->cfg_cost) |
1562 | vty_out(vty, " ipv6 ospf6 neighbor %pI6 cost %u\n", |
1563 | &p2xp_cfg->addr, p2xp_cfg->cost); |
1564 | } |
1565 | return 0; |
1566 | } |
1567 | |
1568 | void install_element_ospf6_debug_neighbor(void) |
1569 | { |
1570 | install_element(ENABLE_NODE, &debug_ospf6_neighbor_cmd)do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1570, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &debug_ospf6_neighbor_cmd, .node_type = ENABLE_NODE, }; static const struct xref * const xref_p_171 __attribute__((used, section ("xref_array"))) = &(_xref.xref); _install_element(ENABLE_NODE , &debug_ospf6_neighbor_cmd); } while (0); |
1571 | install_element(ENABLE_NODE, &no_debug_ospf6_neighbor_cmd)do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1571, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &no_debug_ospf6_neighbor_cmd, .node_type = ENABLE_NODE, } ; static const struct xref * const xref_p_172 __attribute__(( used, section("xref_array"))) = &(_xref.xref); _install_element (ENABLE_NODE, &no_debug_ospf6_neighbor_cmd); } while (0); |
1572 | install_element(ENABLE_NODE, &no_debug_ospf6_cmd)do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1572, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &no_debug_ospf6_cmd, .node_type = ENABLE_NODE, }; static const struct xref * const xref_p_173 __attribute__((used, section ("xref_array"))) = &(_xref.xref); _install_element(ENABLE_NODE , &no_debug_ospf6_cmd); } while (0); |
1573 | install_element(CONFIG_NODE, &debug_ospf6_neighbor_cmd)do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1573, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &debug_ospf6_neighbor_cmd, .node_type = CONFIG_NODE, }; static const struct xref * const xref_p_174 __attribute__((used, section ("xref_array"))) = &(_xref.xref); _install_element(CONFIG_NODE , &debug_ospf6_neighbor_cmd); } while (0); |
1574 | install_element(CONFIG_NODE, &no_debug_ospf6_neighbor_cmd)do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1574, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &no_debug_ospf6_neighbor_cmd, .node_type = CONFIG_NODE, } ; static const struct xref * const xref_p_175 __attribute__(( used, section("xref_array"))) = &(_xref.xref); _install_element (CONFIG_NODE, &no_debug_ospf6_neighbor_cmd); } while (0); |
1575 | install_element(CONFIG_NODE, &no_debug_ospf6_cmd)do { static const struct xref_install_element _xref __attribute__ ((used)) = { .xref = { (((void*)0)), (XREFT_INSTALL_ELEMENT), 1575, "ospf6d/ospf6_neighbor.c", __func__, }, .cmd_element = &no_debug_ospf6_cmd, .node_type = CONFIG_NODE, }; static const struct xref * const xref_p_176 __attribute__((used, section ("xref_array"))) = &(_xref.xref); _install_element(CONFIG_NODE , &no_debug_ospf6_cmd); } while (0); |
1576 | } |