return CMD_SUCCESS;
}
-DEFPY (debug_ospf_gr,
- debug_ospf_gr_cmd,
- "[no$no] debug ospf graceful-restart helper",
- NO_STR
- DEBUG_STR OSPF_STR
- "Gracefull restart\n"
- "Helper Information\n")
+DEFPY(debug_ospf_gr, debug_ospf_gr_cmd, "[no$no] debug ospf graceful-restart",
+ NO_STR DEBUG_STR OSPF_STR "OSPF Graceful Restart\n")
{
if (vty->node == CONFIG_NODE)
- CONF_DEBUG_ON(gr, GR_HELPER);
+ CONF_DEBUG_ON(gr, GR);
if (!no)
- TERM_DEBUG_ON(gr, GR_HELPER);
+ TERM_DEBUG_ON(gr, GR);
else
- TERM_DEBUG_OFF(gr, GR_HELPER);
+ TERM_DEBUG_OFF(gr, GR);
return CMD_SUCCESS;
}
if (IS_DEBUG_OSPF(ldp_sync, LDP_SYNC) == OSPF_DEBUG_LDP_SYNC)
vty_out(vty, " OSPF ldp-sync debugging is on\n");
- /* Show debug status for GR helper. */
- if (IS_DEBUG_OSPF(gr, GR_HELPER) == OSPF_DEBUG_GR_HELPER)
- vty_out(vty, " OSPF Graceful Restart Helper debugging is on\n");
+ /* Show debug status for GR. */
+ if (IS_DEBUG_OSPF(gr, GR) == OSPF_DEBUG_GR)
+ vty_out(vty, " OSPF Graceful Restart debugging is on\n");
if (IS_DEBUG_OSPF(bfd, BFD_LIB) == OSPF_DEBUG_BFD_LIB)
vty_out(vty,
write = 1;
}
- /* debug ospf gr helper */
- if (IS_CONF_DEBUG_OSPF(gr, GR_HELPER) == OSPF_DEBUG_GR_HELPER) {
- vty_out(vty, "debug ospf%s graceful-restart helper\n", str);
+ /* debug ospf gr */
+ if (IS_CONF_DEBUG_OSPF(gr, GR) == OSPF_DEBUG_GR) {
+ vty_out(vty, "debug ospf%s graceful-restart\n", str);
write = 1;
}
*/
void ospf_gr_helper_instance_init(struct ospf *ospf)
{
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s, GR Helper init.", __func__);
ospf->is_helper_supported = OSPF_GR_FALSE;
*/
void ospf_gr_helper_instance_stop(struct ospf *ospf)
{
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s, GR helper deinit.", __func__);
ospf_enable_rtr_hash_destroy(ospf);
{
int rc;
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s, GR Helper init.", __func__);
rc = ospf_register_opaque_functab(
*/
void ospf_gr_helper_stop(void)
{
-
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s, GR helper deinit.", __func__);
ospf_delete_opaque_functab(OSPF_OPAQUE_LINK_LSA, OPAQUE_TYPE_GRACE_LSA);
/* Check LSA len */
if (lsa->size <= OSPF_LSA_HEADER_SIZE) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s: Malformed packet: Invalid LSA len:%d",
__func__, length);
return OSPF_GR_FAILURE;
/* Check TLV len against overall LSA */
if (sum + TLV_SIZE(tlvh) > length) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s: Malformed packet: Invalid TLV len:%u",
__func__, TLV_SIZE(tlvh));
return OSPF_GR_FAILURE;
sum += TLV_SIZE(tlvh);
break;
default:
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, Malformed packet.Invalid TLV type:%d",
__func__, ntohs(tlvh->type));
ret = ospf_extract_grace_lsa_fields(lsa, &grace_interval, &restart_addr,
&restart_reason);
if (ret != OSPF_GR_SUCCESS) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s, Wrong Grace LSA packet.", __func__);
return OSPF_GR_NOT_HELPER;
}
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, Grace LSA received from %pI4, grace interval:%u, restart reason:%s",
__func__, &restart_addr, grace_interval,
restarter = ospf_nbr_lookup_by_addr(oi->nbrs, &restart_addr);
if (!restarter) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, Restarter is not a nbr(%pI4) for this router.",
__func__, &restart_addr);
lookup.advRtrAddr.s_addr = restarter->router_id.s_addr;
if (!hash_lookup(ospf->enable_rtr_list, &lookup)) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, HELPER support is disabled, So not a HELPER",
__func__);
* became a adjacency.
*/
if (!IS_NBR_STATE_FULL(restarter)) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, This Neighbour %pI4 is not in FULL state.",
__func__, &restarter->src);
*/
if (ospf->only_planned_restart
&& !OSPF_GR_IS_PLANNED_RESTART(restart_reason)) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, Router supports only planned restarts but received the GRACE LSA for an unplanned restart.",
__func__);
*/
if (ospf->strict_lsa_check && !ospf_ls_retransmit_isempty(restarter)
&& ospf_check_change_in_rxmt_list(restarter)) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, Changed LSA in Rxmt list. So not Helper.",
__func__);
/*LSA age must be less than the grace period */
if (ntohs(lsa->data->ls_age) >= grace_interval) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, Grace LSA age(%d) is more than the grace interval(%d)",
__func__, lsa->data->ls_age, grace_interval);
*/
actual_grace_interval = grace_interval;
if (grace_interval > ospf->supported_grace_time) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, Received grace period %d is larger than supported grace %d",
__func__, grace_interval,
if (ospf->active_restarter_cnt > 0)
ospf->active_restarter_cnt--;
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, Router is already acting as a HELPER for this nbr,so restart the grace timer",
__func__);
} else {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, This Router becomes a HELPER for the neighbour %pI4",
__func__, &restarter->src);
/* Increment the active restarter count */
ospf->active_restarter_cnt++;
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s, Grace timer started.interval:%d", __func__,
actual_grace_interval);
if (!ospf->strict_lsa_check)
return;
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s: Topo change detected due to LSA[%s]", __func__,
dump_lsa_key(lsa));
if (!OSPF_GR_IS_ACTIVE_HELPER(nbr))
return;
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s, Exiting from HELPER support to %pI4, due to %s",
__func__, &nbr->src, ospf_exit_reason2str(reason));
* If no, bring down the neighbour.
*/
if (reason != OSPF_GR_HELPER_COMPLETED) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, Failed GR exit, so bringing down the neighbour",
__func__);
ret = ospf_extract_grace_lsa_fields(lsa, &graceInterval, &restartAddr,
&restartReason);
if (ret != OSPF_GR_SUCCESS) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s, Wrong Grace LSA packet.", __func__);
return;
}
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug("%s, GraceLSA received for neighbour %pI4", __func__,
&restartAddr);
restarter = ospf_nbr_lookup_by_addr(oi->nbrs, &restartAddr);
if (!restarter) {
- if (IS_DEBUG_OSPF_GR_HELPER)
+ if (IS_DEBUG_OSPF_GR)
zlog_debug(
"%s, Restarter is not a neighbour for this router.",
__func__);