mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
ospf6: Applying clang-format
Applying clang-format to the original commits. Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
This commit is contained in:
parent
5a31132472
commit
f83a824bbd
File diff suppressed because it is too large
Load diff
|
@ -52,13 +52,14 @@ DEFINE_HOOK(ospf6_neighbor_change,
|
|||
unsigned char conf_debug_ospf6_neighbor = 0;
|
||||
|
||||
const char *const ospf6_neighbor_state_str[] = {
|
||||
"None", "Down", "Attempt", "Init", "Twoway",
|
||||
"ExStart", "ExChange", "Loading", "Full", NULL};
|
||||
"None", "Down", "Attempt", "Init", "Twoway",
|
||||
"ExStart", "ExChange", "Loading", "Full", NULL
|
||||
};
|
||||
|
||||
const char *const ospf6_neighbor_event_str[] = {
|
||||
"NoEvent", "HelloReceived", "2-WayReceived", "NegotiationDone",
|
||||
"ExchangeDone", "LoadingDone", "AdjOK?", "SeqNumberMismatch",
|
||||
"BadLSReq", "1-WayReceived", "InactivityTimer",
|
||||
"NoEvent", "HelloReceived", "2-WayReceived", "NegotiationDone",
|
||||
"ExchangeDone", "LoadingDone", "AdjOK?", "SeqNumberMismatch",
|
||||
"BadLSReq", "1-WayReceived", "InactivityTimer",
|
||||
};
|
||||
|
||||
int ospf6_neighbor_cmp(void *va, void *vb)
|
||||
|
@ -129,8 +130,7 @@ struct ospf6_neighbor *ospf6_neighbor_create(uint32_t router_id,
|
|||
|
||||
on = XCALLOC(MTYPE_OSPF6_NEIGHBOR, sizeof(struct ospf6_neighbor));
|
||||
inet_ntop(AF_INET, &router_id, buf, sizeof(buf));
|
||||
snprintf(on->name, sizeof(on->name), "%s%%%s", buf,
|
||||
oi->interface->name);
|
||||
snprintf(on->name, sizeof(on->name), "%s%%%s", buf, oi->interface->name);
|
||||
on->ospf6_if = oi;
|
||||
on->state = OSPF6_NEIGHBOR_DOWN;
|
||||
on->state_change = 0;
|
||||
|
@ -203,8 +203,8 @@ void ospf6_neighbor_lladdr_set(struct ospf6_neighbor *on,
|
|||
|
||||
memcpy(&on->linklocal_addr, addr, sizeof(struct in6_addr));
|
||||
|
||||
if (on->ospf6_if->type == OSPF_IFTYPE_POINTOPOINT
|
||||
|| on->ospf6_if->type == OSPF_IFTYPE_POINTOMULTIPOINT) {
|
||||
if (on->ospf6_if->type == OSPF_IFTYPE_POINTOPOINT ||
|
||||
on->ospf6_if->type == OSPF_IFTYPE_POINTOMULTIPOINT) {
|
||||
uint32_t prev_cost = ospf6_neighbor_cost(on);
|
||||
|
||||
p2xp_neigh_refresh(on, prev_cost);
|
||||
|
@ -227,31 +227,28 @@ static void ospf6_neighbor_state_change(uint8_t next_state,
|
|||
|
||||
/* log */
|
||||
if (IS_OSPF6_DEBUG_NEIGHBOR(STATE)) {
|
||||
zlog_debug(
|
||||
"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));
|
||||
zlog_debug("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));
|
||||
}
|
||||
|
||||
/* Optionally notify about adjacency changes */
|
||||
if (CHECK_FLAG(on->ospf6_if->area->ospf6->config_flags,
|
||||
OSPF6_LOG_ADJACENCY_CHANGES)
|
||||
&& (CHECK_FLAG(on->ospf6_if->area->ospf6->config_flags,
|
||||
OSPF6_LOG_ADJACENCY_DETAIL)
|
||||
|| (next_state == OSPF6_NEIGHBOR_FULL)
|
||||
|| (next_state < prev_state)))
|
||||
zlog_notice(
|
||||
"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));
|
||||
OSPF6_LOG_ADJACENCY_CHANGES) &&
|
||||
(CHECK_FLAG(on->ospf6_if->area->ospf6->config_flags,
|
||||
OSPF6_LOG_ADJACENCY_DETAIL) ||
|
||||
(next_state == OSPF6_NEIGHBOR_FULL) || (next_state < prev_state)))
|
||||
zlog_notice("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));
|
||||
|
||||
if (prev_state == OSPF6_NEIGHBOR_FULL
|
||||
|| next_state == OSPF6_NEIGHBOR_FULL) {
|
||||
if (prev_state == OSPF6_NEIGHBOR_FULL ||
|
||||
next_state == OSPF6_NEIGHBOR_FULL) {
|
||||
if (!OSPF6_GR_IS_ACTIVE_HELPER(on)) {
|
||||
OSPF6_ROUTER_LSA_SCHEDULE(on->ospf6_if->area);
|
||||
if (on->ospf6_if->state == OSPF6_INTERFACE_DR) {
|
||||
|
@ -264,12 +261,11 @@ static void ospf6_neighbor_state_change(uint8_t next_state,
|
|||
on->ospf6_if->area->intra_prefix_originate = 1;
|
||||
|
||||
if (!OSPF6_GR_IS_ACTIVE_HELPER(on))
|
||||
OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(
|
||||
on->ospf6_if->area);
|
||||
OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(on->ospf6_if->area);
|
||||
|
||||
if ((prev_state == OSPF6_NEIGHBOR_LOADING
|
||||
|| prev_state == OSPF6_NEIGHBOR_EXCHANGE)
|
||||
&& next_state == OSPF6_NEIGHBOR_FULL) {
|
||||
if ((prev_state == OSPF6_NEIGHBOR_LOADING ||
|
||||
prev_state == OSPF6_NEIGHBOR_EXCHANGE) &&
|
||||
next_state == OSPF6_NEIGHBOR_FULL) {
|
||||
OSPF6_AS_EXTERN_LSA_SCHEDULE(on->ospf6_if);
|
||||
on->ospf6_if->area->full_nbrs++;
|
||||
}
|
||||
|
@ -278,10 +274,10 @@ static void ospf6_neighbor_state_change(uint8_t next_state,
|
|||
on->ospf6_if->area->full_nbrs--;
|
||||
}
|
||||
|
||||
if ((prev_state == OSPF6_NEIGHBOR_EXCHANGE
|
||||
|| prev_state == OSPF6_NEIGHBOR_LOADING)
|
||||
&& (next_state != OSPF6_NEIGHBOR_EXCHANGE
|
||||
&& next_state != OSPF6_NEIGHBOR_LOADING))
|
||||
if ((prev_state == OSPF6_NEIGHBOR_EXCHANGE ||
|
||||
prev_state == OSPF6_NEIGHBOR_LOADING) &&
|
||||
(next_state != OSPF6_NEIGHBOR_EXCHANGE &&
|
||||
next_state != OSPF6_NEIGHBOR_LOADING))
|
||||
ospf6_maxage_remove(on->ospf6_if->area->ospf6);
|
||||
|
||||
hook_call(ospf6_neighbor_change, on, next_state, prev_state);
|
||||
|
@ -291,14 +287,14 @@ static void ospf6_neighbor_state_change(uint8_t next_state,
|
|||
/* RFC2328 section 10.4 */
|
||||
static int need_adjacency(struct ospf6_neighbor *on)
|
||||
{
|
||||
if (on->ospf6_if->state == OSPF6_INTERFACE_POINTTOPOINT
|
||||
|| on->ospf6_if->state == OSPF6_INTERFACE_POINTTOMULTIPOINT
|
||||
|| on->ospf6_if->state == OSPF6_INTERFACE_DR
|
||||
|| on->ospf6_if->state == OSPF6_INTERFACE_BDR)
|
||||
if (on->ospf6_if->state == OSPF6_INTERFACE_POINTTOPOINT ||
|
||||
on->ospf6_if->state == OSPF6_INTERFACE_POINTTOMULTIPOINT ||
|
||||
on->ospf6_if->state == OSPF6_INTERFACE_DR ||
|
||||
on->ospf6_if->state == OSPF6_INTERFACE_BDR)
|
||||
return 1;
|
||||
|
||||
if (on->ospf6_if->drouter == on->router_id
|
||||
|| on->ospf6_if->bdrouter == on->router_id)
|
||||
if (on->ospf6_if->drouter == on->router_id ||
|
||||
on->ospf6_if->bdrouter == on->router_id)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
@ -452,13 +448,12 @@ void exchange_done(struct event *thread)
|
|||
/* Check loading state. */
|
||||
void ospf6_check_nbr_loading(struct ospf6_neighbor *on)
|
||||
{
|
||||
|
||||
/* RFC2328 Section 10.9: When the neighbor responds to these requests
|
||||
with the proper Link State Update packet(s), the Link state request
|
||||
list is truncated and a new Link State Request packet is sent.
|
||||
*/
|
||||
if ((on->state == OSPF6_NEIGHBOR_LOADING)
|
||||
|| (on->state == OSPF6_NEIGHBOR_EXCHANGE)) {
|
||||
if ((on->state == OSPF6_NEIGHBOR_LOADING) ||
|
||||
(on->state == OSPF6_NEIGHBOR_EXCHANGE)) {
|
||||
if (on->request_list->count == 0)
|
||||
event_add_event(master, loading_done, on, 0,
|
||||
&on->event_loading_done);
|
||||
|
@ -617,9 +612,8 @@ void inactivity_timer(struct event *thread)
|
|||
on->drouter = on->prev_drouter = 0;
|
||||
on->bdrouter = on->prev_bdrouter = 0;
|
||||
|
||||
ospf6_neighbor_state_change(
|
||||
OSPF6_NEIGHBOR_DOWN, on,
|
||||
OSPF6_NEIGHBOR_EVENT_INACTIVITY_TIMER);
|
||||
ospf6_neighbor_state_change(OSPF6_NEIGHBOR_DOWN, on,
|
||||
OSPF6_NEIGHBOR_EVENT_INACTIVITY_TIMER);
|
||||
event_add_event(master, neighbor_change, on->ospf6_if, 0, NULL);
|
||||
|
||||
listnode_delete(on->ospf6_if->neighbor_list, on);
|
||||
|
@ -627,9 +621,8 @@ void inactivity_timer(struct event *thread)
|
|||
|
||||
} else {
|
||||
if (IS_DEBUG_OSPF6_GR)
|
||||
zlog_debug(
|
||||
"%s, Acting as HELPER for this neighbour, So restart the dead timer.",
|
||||
__PRETTY_FUNCTION__);
|
||||
zlog_debug("%s, Acting as HELPER for this neighbour, So restart the dead timer.",
|
||||
__PRETTY_FUNCTION__);
|
||||
|
||||
event_add_timer(master, inactivity_timer, on,
|
||||
on->ospf6_if->dead_interval,
|
||||
|
@ -711,14 +704,10 @@ static void p2xp_neigh_refresh(struct ospf6_neighbor *on, uint32_t prev_cost)
|
|||
#include "ospf6d/ospf6_neighbor_clippy.c"
|
||||
#endif
|
||||
|
||||
DEFPY (ipv6_ospf6_p2xp_neigh,
|
||||
ipv6_ospf6_p2xp_neigh_cmd,
|
||||
"[no] ipv6 ospf6 neighbor X:X::X:X",
|
||||
NO_STR
|
||||
IP6_STR
|
||||
OSPF6_STR
|
||||
"Configure static neighbor\n"
|
||||
"Neighbor link-local address\n")
|
||||
DEFPY(ipv6_ospf6_p2xp_neigh, ipv6_ospf6_p2xp_neigh_cmd,
|
||||
"[no] ipv6 ospf6 neighbor X:X::X:X",
|
||||
NO_STR IP6_STR OSPF6_STR "Configure static neighbor\n"
|
||||
"Neighbor link-local address\n")
|
||||
{
|
||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||
struct ospf6_interface *oi = ifp->info;
|
||||
|
@ -756,20 +745,17 @@ DEFPY (ipv6_ospf6_p2xp_neigh,
|
|||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
DEFPY (ipv6_ospf6_p2xp_neigh_cost,
|
||||
ipv6_ospf6_p2xp_neigh_cost_cmd,
|
||||
"[no] ipv6 ospf6 neighbor X:X::X:X cost (1-65535)",
|
||||
NO_STR
|
||||
IP6_STR
|
||||
OSPF6_STR
|
||||
"Configure static neighbor\n"
|
||||
"Neighbor link-local address\n"
|
||||
"Outgoing metric for this neighbor\n"
|
||||
"Outgoing metric for this neighbor\n")
|
||||
DEFPY(ipv6_ospf6_p2xp_neigh_cost, ipv6_ospf6_p2xp_neigh_cost_cmd,
|
||||
"[no] ipv6 ospf6 neighbor X:X::X:X cost (1-65535)",
|
||||
NO_STR IP6_STR OSPF6_STR "Configure static neighbor\n"
|
||||
"Neighbor link-local address\n"
|
||||
"Outgoing metric for this neighbor\n"
|
||||
"Outgoing metric for this neighbor\n")
|
||||
{
|
||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||
struct ospf6_interface *oi = ifp->info;
|
||||
struct ospf6_if_p2xp_neighcfg *p2xp_cfg;
|
||||
uint32_t prev_cost;
|
||||
|
||||
if (!oi) {
|
||||
if (no)
|
||||
|
@ -779,7 +765,6 @@ DEFPY (ipv6_ospf6_p2xp_neigh_cost,
|
|||
|
||||
p2xp_cfg = ospf6_if_p2xp_get(oi, &neighbor);
|
||||
|
||||
uint32_t prev_cost;
|
||||
if (p2xp_cfg->active)
|
||||
prev_cost = ospf6_neighbor_cost(p2xp_cfg->active);
|
||||
|
||||
|
@ -800,15 +785,15 @@ static void p2xp_unicast_hello_send(struct event *event);
|
|||
|
||||
static void p2xp_unicast_hello_sched(struct ospf6_if_p2xp_neighcfg *p2xp_cfg)
|
||||
{
|
||||
if (!p2xp_cfg->poll_interval
|
||||
|| (p2xp_cfg->ospf6_if->state != OSPF6_INTERFACE_POINTTOMULTIPOINT
|
||||
&& p2xp_cfg->ospf6_if->state != OSPF6_INTERFACE_POINTTOPOINT))
|
||||
if (!p2xp_cfg->poll_interval ||
|
||||
(p2xp_cfg->ospf6_if->state != OSPF6_INTERFACE_POINTTOMULTIPOINT &&
|
||||
p2xp_cfg->ospf6_if->state != OSPF6_INTERFACE_POINTTOPOINT))
|
||||
/* state check covers DOWN state too */
|
||||
EVENT_OFF(p2xp_cfg->t_unicast_hello);
|
||||
else
|
||||
event_add_timer(master, p2xp_unicast_hello_send, p2xp_cfg,
|
||||
p2xp_cfg->poll_interval,
|
||||
&p2xp_cfg->t_unicast_hello);
|
||||
p2xp_cfg->poll_interval,
|
||||
&p2xp_cfg->t_unicast_hello);
|
||||
}
|
||||
|
||||
void ospf6_if_p2xp_up(struct ospf6_interface *oi)
|
||||
|
@ -824,8 +809,8 @@ static void p2xp_unicast_hello_send(struct event *event)
|
|||
struct ospf6_if_p2xp_neighcfg *p2xp_cfg = EVENT_ARG(event);
|
||||
struct ospf6_interface *oi = p2xp_cfg->ospf6_if;
|
||||
|
||||
if (oi->state != OSPF6_INTERFACE_POINTTOPOINT
|
||||
&& oi->state != OSPF6_INTERFACE_POINTTOMULTIPOINT)
|
||||
if (oi->state != OSPF6_INTERFACE_POINTTOPOINT &&
|
||||
oi->state != OSPF6_INTERFACE_POINTTOMULTIPOINT)
|
||||
return;
|
||||
|
||||
p2xp_unicast_hello_sched(p2xp_cfg);
|
||||
|
@ -836,16 +821,13 @@ static void p2xp_unicast_hello_send(struct event *event)
|
|||
ospf6_hello_send_addr(oi, &p2xp_cfg->addr);
|
||||
}
|
||||
|
||||
DEFPY (ipv6_ospf6_p2xp_neigh_poll_interval,
|
||||
ipv6_ospf6_p2xp_neigh_poll_interval_cmd,
|
||||
"[no] ipv6 ospf6 neighbor X:X::X:X poll-interval (1-65535)",
|
||||
NO_STR
|
||||
IP6_STR
|
||||
OSPF6_STR
|
||||
"Configure static neighbor\n"
|
||||
"Neighbor link-local address\n"
|
||||
"Send unicast hellos to neighbor when down\n"
|
||||
"Unicast hello interval when down (seconds)\n")
|
||||
DEFPY(ipv6_ospf6_p2xp_neigh_poll_interval,
|
||||
ipv6_ospf6_p2xp_neigh_poll_interval_cmd,
|
||||
"[no] ipv6 ospf6 neighbor X:X::X:X poll-interval (1-65535)",
|
||||
NO_STR IP6_STR OSPF6_STR "Configure static neighbor\n"
|
||||
"Neighbor link-local address\n"
|
||||
"Send unicast hellos to neighbor when down\n"
|
||||
"Unicast hello interval when down (seconds)\n")
|
||||
{
|
||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||
struct ospf6_interface *oi = ifp->info;
|
||||
|
@ -888,8 +870,8 @@ static void ospf6_neighbor_show(struct vty *vty, struct ospf6_neighbor *on,
|
|||
/* Dead time */
|
||||
h = m = s = 0;
|
||||
if (on->inactivity_timer) {
|
||||
s = monotime_until(&on->inactivity_timer->u.sands, NULL)
|
||||
/ 1000000LL;
|
||||
s = monotime_until(&on->inactivity_timer->u.sands, NULL) /
|
||||
1000000LL;
|
||||
h = s / 3600;
|
||||
s -= h * 3600;
|
||||
m = s / 60;
|
||||
|
@ -932,9 +914,9 @@ static void ospf6_neighbor_show(struct vty *vty, struct ospf6_neighbor *on,
|
|||
json_object_string_add(json_route, "duration", duration);
|
||||
json_object_string_add(json_route, "interfaceName",
|
||||
on->ospf6_if->interface->name);
|
||||
json_object_string_add(
|
||||
json_route, "interfaceState",
|
||||
ospf6_interface_state_str[on->ospf6_if->state]);
|
||||
json_object_string_add(json_route, "interfaceState",
|
||||
ospf6_interface_state_str
|
||||
[on->ospf6_if->state]);
|
||||
|
||||
json_object_array_add(json_array, json_route);
|
||||
} else
|
||||
|
@ -979,9 +961,9 @@ static void ospf6_neighbor_show_drchoice(struct vty *vty,
|
|||
json_object_string_add(json_route, "bdRouter", bdrouter);
|
||||
json_object_string_add(json_route, "interfaceName",
|
||||
on->ospf6_if->interface->name);
|
||||
json_object_string_add(
|
||||
json_route, "interfaceState",
|
||||
ospf6_interface_state_str[on->ospf6_if->state]);
|
||||
json_object_string_add(json_route, "interfaceState",
|
||||
ospf6_interface_state_str
|
||||
[on->ospf6_if->state]);
|
||||
|
||||
json_object_array_add(json_array, json_route);
|
||||
} else
|
||||
|
@ -1036,9 +1018,8 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
|
|||
(CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_IBIT)
|
||||
? "Initial "
|
||||
: ""),
|
||||
(CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT)
|
||||
? "More"
|
||||
: ""),
|
||||
(CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT) ? "More"
|
||||
: ""),
|
||||
(CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT)
|
||||
? "Master"
|
||||
: "Slave"));
|
||||
|
@ -1052,8 +1033,8 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
|
|||
json_object_int_add(json_neighbor, "summaryListCount",
|
||||
on->summary_list->count);
|
||||
for (ALL_LSDB(on->summary_list, lsa, lsanext))
|
||||
json_object_array_add(
|
||||
json_array, json_object_new_string(lsa->name));
|
||||
json_object_array_add(json_array,
|
||||
json_object_new_string(lsa->name));
|
||||
json_object_object_add(json_neighbor, "summaryListLsa",
|
||||
json_array);
|
||||
|
||||
|
@ -1061,8 +1042,8 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
|
|||
json_object_int_add(json_neighbor, "requestListCount",
|
||||
on->request_list->count);
|
||||
for (ALL_LSDB(on->request_list, lsa, lsanext))
|
||||
json_object_array_add(
|
||||
json_array, json_object_new_string(lsa->name));
|
||||
json_object_array_add(json_array,
|
||||
json_object_new_string(lsa->name));
|
||||
json_object_object_add(json_neighbor, "requestListLsa",
|
||||
json_array);
|
||||
|
||||
|
@ -1070,8 +1051,8 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
|
|||
json_object_int_add(json_neighbor, "reTransListCount",
|
||||
on->retrans_list->count);
|
||||
for (ALL_LSDB(on->retrans_list, lsa, lsanext))
|
||||
json_object_array_add(
|
||||
json_array, json_object_new_string(lsa->name));
|
||||
json_object_array_add(json_array,
|
||||
json_object_new_string(lsa->name));
|
||||
json_object_object_add(json_neighbor, "reTransListLsa",
|
||||
json_array);
|
||||
|
||||
|
@ -1084,14 +1065,14 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
|
|||
on->dbdesc_list->count);
|
||||
json_object_string_add(json_neighbor, "pendingLsaDbDescTime",
|
||||
duration);
|
||||
json_object_string_add(
|
||||
json_neighbor, "dbDescSendThread",
|
||||
(event_is_scheduled(on->thread_send_dbdesc) ? "on"
|
||||
: "off"));
|
||||
json_object_string_add(json_neighbor, "dbDescSendThread",
|
||||
(event_is_scheduled(on->thread_send_dbdesc)
|
||||
? "on"
|
||||
: "off"));
|
||||
json_array = json_object_new_array();
|
||||
for (ALL_LSDB(on->dbdesc_list, lsa, lsanext))
|
||||
json_object_array_add(
|
||||
json_array, json_object_new_string(lsa->name));
|
||||
json_object_array_add(json_array,
|
||||
json_object_new_string(lsa->name));
|
||||
json_object_object_add(json_neighbor, "pendingLsaDbDesc",
|
||||
json_array);
|
||||
|
||||
|
@ -1103,35 +1084,35 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
|
|||
on->request_list->count);
|
||||
json_object_string_add(json_neighbor, "pendingLsaLsReqTime",
|
||||
duration);
|
||||
json_object_string_add(
|
||||
json_neighbor, "lsReqSendThread",
|
||||
(event_is_scheduled(on->thread_send_lsreq) ? "on"
|
||||
: "off"));
|
||||
json_object_string_add(json_neighbor, "lsReqSendThread",
|
||||
(event_is_scheduled(on->thread_send_lsreq)
|
||||
? "on"
|
||||
: "off"));
|
||||
json_array = json_object_new_array();
|
||||
for (ALL_LSDB(on->request_list, lsa, lsanext))
|
||||
json_object_array_add(
|
||||
json_array, json_object_new_string(lsa->name));
|
||||
json_object_array_add(json_array,
|
||||
json_object_new_string(lsa->name));
|
||||
json_object_object_add(json_neighbor, "pendingLsaLsReq",
|
||||
json_array);
|
||||
|
||||
|
||||
timerclear(&res);
|
||||
if (event_is_scheduled(on->thread_send_lsupdate))
|
||||
timersub(&on->thread_send_lsupdate->u.sands, &now,
|
||||
&res);
|
||||
timersub(&on->thread_send_lsupdate->u.sands, &now, &res);
|
||||
timerstring(&res, duration, sizeof(duration));
|
||||
json_object_int_add(json_neighbor, "pendingLsaLsUpdateCount",
|
||||
on->lsupdate_list->count);
|
||||
json_object_string_add(json_neighbor, "pendingLsaLsUpdateTime",
|
||||
duration);
|
||||
json_object_string_add(
|
||||
json_neighbor, "lsUpdateSendThread",
|
||||
(event_is_scheduled(on->thread_send_lsupdate) ? "on"
|
||||
: "off"));
|
||||
json_object_string_add(json_neighbor, "lsUpdateSendThread",
|
||||
(event_is_scheduled(
|
||||
on->thread_send_lsupdate)
|
||||
? "on"
|
||||
: "off"));
|
||||
json_array = json_object_new_array();
|
||||
for (ALL_LSDB(on->lsupdate_list, lsa, lsanext))
|
||||
json_object_array_add(
|
||||
json_array, json_object_new_string(lsa->name));
|
||||
json_object_array_add(json_array,
|
||||
json_object_new_string(lsa->name));
|
||||
json_object_object_add(json_neighbor, "pendingLsaLsUpdate",
|
||||
json_array);
|
||||
|
||||
|
@ -1143,14 +1124,14 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
|
|||
on->lsack_list->count);
|
||||
json_object_string_add(json_neighbor, "pendingLsaLsAckTime",
|
||||
duration);
|
||||
json_object_string_add(
|
||||
json_neighbor, "lsAckSendThread",
|
||||
(event_is_scheduled(on->thread_send_lsack) ? "on"
|
||||
: "off"));
|
||||
json_object_string_add(json_neighbor, "lsAckSendThread",
|
||||
(event_is_scheduled(on->thread_send_lsack)
|
||||
? "on"
|
||||
: "off"));
|
||||
json_array = json_object_new_array();
|
||||
for (ALL_LSDB(on->lsack_list, lsa, lsanext))
|
||||
json_object_array_add(
|
||||
json_array, json_object_new_string(lsa->name));
|
||||
json_object_array_add(json_array,
|
||||
json_object_new_string(lsa->name));
|
||||
json_object_object_add(json_neighbor, "pendingLsaLsAck",
|
||||
json_array);
|
||||
|
||||
|
@ -1159,36 +1140,36 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
|
|||
if (on->auth_present == true) {
|
||||
json_object_string_add(json_neighbor, "authStatus",
|
||||
"enabled");
|
||||
json_object_int_add(
|
||||
json_neighbor, "recvdHelloHigherSeqNo",
|
||||
on->seqnum_h[OSPF6_MESSAGE_TYPE_HELLO]);
|
||||
json_object_int_add(
|
||||
json_neighbor, "recvdHelloLowerSeqNo",
|
||||
on->seqnum_l[OSPF6_MESSAGE_TYPE_HELLO]);
|
||||
json_object_int_add(
|
||||
json_neighbor, "recvdDBDescHigherSeqNo",
|
||||
on->seqnum_h[OSPF6_MESSAGE_TYPE_DBDESC]);
|
||||
json_object_int_add(
|
||||
json_neighbor, "recvdDBDescLowerSeqNo",
|
||||
on->seqnum_l[OSPF6_MESSAGE_TYPE_DBDESC]);
|
||||
json_object_int_add(
|
||||
json_neighbor, "recvdLSReqHigherSeqNo",
|
||||
on->seqnum_h[OSPF6_MESSAGE_TYPE_LSREQ]);
|
||||
json_object_int_add(
|
||||
json_neighbor, "recvdLSReqLowerSeqNo",
|
||||
on->seqnum_l[OSPF6_MESSAGE_TYPE_LSREQ]);
|
||||
json_object_int_add(
|
||||
json_neighbor, "recvdLSUpdHigherSeqNo",
|
||||
on->seqnum_h[OSPF6_MESSAGE_TYPE_LSUPDATE]);
|
||||
json_object_int_add(
|
||||
json_neighbor, "recvdLSUpdLowerSeqNo",
|
||||
on->seqnum_l[OSPF6_MESSAGE_TYPE_LSUPDATE]);
|
||||
json_object_int_add(
|
||||
json_neighbor, "recvdLSAckHigherSeqNo",
|
||||
on->seqnum_h[OSPF6_MESSAGE_TYPE_LSACK]);
|
||||
json_object_int_add(
|
||||
json_neighbor, "recvdLSAckLowerSeqNo",
|
||||
on->seqnum_l[OSPF6_MESSAGE_TYPE_LSACK]);
|
||||
json_object_int_add(json_neighbor,
|
||||
"recvdHelloHigherSeqNo",
|
||||
on->seqnum_h[OSPF6_MESSAGE_TYPE_HELLO]);
|
||||
json_object_int_add(json_neighbor,
|
||||
"recvdHelloLowerSeqNo",
|
||||
on->seqnum_l[OSPF6_MESSAGE_TYPE_HELLO]);
|
||||
json_object_int_add(json_neighbor,
|
||||
"recvdDBDescHigherSeqNo",
|
||||
on->seqnum_h[OSPF6_MESSAGE_TYPE_DBDESC]);
|
||||
json_object_int_add(json_neighbor,
|
||||
"recvdDBDescLowerSeqNo",
|
||||
on->seqnum_l[OSPF6_MESSAGE_TYPE_DBDESC]);
|
||||
json_object_int_add(json_neighbor,
|
||||
"recvdLSReqHigherSeqNo",
|
||||
on->seqnum_h[OSPF6_MESSAGE_TYPE_LSREQ]);
|
||||
json_object_int_add(json_neighbor,
|
||||
"recvdLSReqLowerSeqNo",
|
||||
on->seqnum_l[OSPF6_MESSAGE_TYPE_LSREQ]);
|
||||
json_object_int_add(json_neighbor,
|
||||
"recvdLSUpdHigherSeqNo",
|
||||
on->seqnum_h[OSPF6_MESSAGE_TYPE_LSUPDATE]);
|
||||
json_object_int_add(json_neighbor,
|
||||
"recvdLSUpdLowerSeqNo",
|
||||
on->seqnum_l[OSPF6_MESSAGE_TYPE_LSUPDATE]);
|
||||
json_object_int_add(json_neighbor,
|
||||
"recvdLSAckHigherSeqNo",
|
||||
on->seqnum_h[OSPF6_MESSAGE_TYPE_LSACK]);
|
||||
json_object_int_add(json_neighbor,
|
||||
"recvdLSAckLowerSeqNo",
|
||||
on->seqnum_l[OSPF6_MESSAGE_TYPE_LSACK]);
|
||||
} else
|
||||
json_object_string_add(json_neighbor, "authStatus",
|
||||
"disabled");
|
||||
|
@ -1210,9 +1191,8 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
|
|||
(CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_IBIT)
|
||||
? "Initial "
|
||||
: ""),
|
||||
(CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT)
|
||||
? "More "
|
||||
: ""),
|
||||
(CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MBIT) ? "More "
|
||||
: ""),
|
||||
(CHECK_FLAG(on->dbdesc_bits, OSPF6_DBDESC_MSBIT)
|
||||
? "Master"
|
||||
: "Slave"),
|
||||
|
@ -1259,8 +1239,7 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
|
|||
|
||||
timerclear(&res);
|
||||
if (event_is_scheduled(on->thread_send_lsupdate))
|
||||
timersub(&on->thread_send_lsupdate->u.sands, &now,
|
||||
&res);
|
||||
timersub(&on->thread_send_lsupdate->u.sands, &now, &res);
|
||||
timerstring(&res, duration, sizeof(duration));
|
||||
vty_out(vty,
|
||||
" %d Pending LSAs for LSUpdate in Time %s [thread %s]\n",
|
||||
|
@ -1400,8 +1379,7 @@ DEFUN(show_ipv6_ospf6_neighbor, show_ipv6_ospf6_neighbor_cmd,
|
|||
|
||||
static int ospf6_neighbor_show_common(struct vty *vty, int argc,
|
||||
struct cmd_token **argv,
|
||||
struct ospf6 *ospf6, int idx_ipv4,
|
||||
bool uj)
|
||||
struct ospf6 *ospf6, int idx_ipv4, bool uj)
|
||||
{
|
||||
struct ospf6_neighbor *on;
|
||||
struct ospf6_interface *oi;
|
||||
|
@ -1480,14 +1458,11 @@ void ospf6_neighbor_init(void)
|
|||
&ipv6_ospf6_p2xp_neigh_poll_interval_cmd);
|
||||
}
|
||||
|
||||
DEFUN (debug_ospf6_neighbor,
|
||||
debug_ospf6_neighbor_cmd,
|
||||
"debug ospf6 neighbor [<state|event>]",
|
||||
DEBUG_STR
|
||||
OSPF6_STR
|
||||
"Debug OSPFv3 Neighbor\n"
|
||||
"Debug OSPFv3 Neighbor State Change\n"
|
||||
"Debug OSPFv3 Neighbor Event\n")
|
||||
DEFUN(debug_ospf6_neighbor, debug_ospf6_neighbor_cmd,
|
||||
"debug ospf6 neighbor [<state|event>]",
|
||||
DEBUG_STR OSPF6_STR "Debug OSPFv3 Neighbor\n"
|
||||
"Debug OSPFv3 Neighbor State Change\n"
|
||||
"Debug OSPFv3 Neighbor Event\n")
|
||||
{
|
||||
int idx_type = 3;
|
||||
unsigned char level = 0;
|
||||
|
@ -1505,15 +1480,11 @@ DEFUN (debug_ospf6_neighbor,
|
|||
}
|
||||
|
||||
|
||||
DEFUN (no_debug_ospf6_neighbor,
|
||||
no_debug_ospf6_neighbor_cmd,
|
||||
"no debug ospf6 neighbor [<state|event>]",
|
||||
NO_STR
|
||||
DEBUG_STR
|
||||
OSPF6_STR
|
||||
"Debug OSPFv3 Neighbor\n"
|
||||
"Debug OSPFv3 Neighbor State Change\n"
|
||||
"Debug OSPFv3 Neighbor Event\n")
|
||||
DEFUN(no_debug_ospf6_neighbor, no_debug_ospf6_neighbor_cmd,
|
||||
"no debug ospf6 neighbor [<state|event>]",
|
||||
NO_STR DEBUG_STR OSPF6_STR "Debug OSPFv3 Neighbor\n"
|
||||
"Debug OSPFv3 Neighbor State Change\n"
|
||||
"Debug OSPFv3 Neighbor Event\n")
|
||||
{
|
||||
int idx_type = 4;
|
||||
unsigned char level = 0;
|
||||
|
@ -1531,12 +1502,8 @@ DEFUN (no_debug_ospf6_neighbor,
|
|||
}
|
||||
|
||||
|
||||
DEFUN (no_debug_ospf6,
|
||||
no_debug_ospf6_cmd,
|
||||
"no debug ospf6",
|
||||
NO_STR
|
||||
DEBUG_STR
|
||||
OSPF6_STR)
|
||||
DEFUN(no_debug_ospf6, no_debug_ospf6_cmd, "no debug ospf6",
|
||||
NO_STR DEBUG_STR OSPF6_STR)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -1551,12 +1518,11 @@ DEFUN (no_debug_ospf6,
|
|||
ospf6_lsa_debug_set_all(false);
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
OSPF6_DEBUG_MESSAGE_OFF(i,
|
||||
OSPF6_DEBUG_NEIGHBOR_STATE
|
||||
| OSPF6_DEBUG_NEIGHBOR_EVENT);
|
||||
OSPF6_DEBUG_MESSAGE_OFF(i, OSPF6_DEBUG_NEIGHBOR_STATE |
|
||||
OSPF6_DEBUG_NEIGHBOR_EVENT);
|
||||
|
||||
OSPF6_DEBUG_NEIGHBOR_OFF(OSPF6_DEBUG_NEIGHBOR_STATE
|
||||
| OSPF6_DEBUG_NEIGHBOR_EVENT);
|
||||
OSPF6_DEBUG_NEIGHBOR_OFF(OSPF6_DEBUG_NEIGHBOR_STATE |
|
||||
OSPF6_DEBUG_NEIGHBOR_EVENT);
|
||||
OSPF6_DEBUG_ROUTE_OFF(OSPF6_DEBUG_ROUTE_TABLE);
|
||||
OSPF6_DEBUG_ROUTE_OFF(OSPF6_DEBUG_ROUTE_INTRA);
|
||||
OSPF6_DEBUG_ROUTE_OFF(OSPF6_DEBUG_ROUTE_INTER);
|
||||
|
@ -1580,8 +1546,7 @@ int config_write_ospf6_debug_neighbor(struct vty *vty)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int config_write_ospf6_p2xp_neighbor(struct vty *vty,
|
||||
struct ospf6_interface *oi)
|
||||
int config_write_ospf6_p2xp_neighbor(struct vty *vty, struct ospf6_interface *oi)
|
||||
{
|
||||
struct ospf6_if_p2xp_neighcfg *p2xp_cfg;
|
||||
|
||||
|
|
Loading…
Reference in a new issue