summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_gr_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_gr_helper.c')
-rw-r--r--ospf6d/ospf6_gr_helper.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/ospf6d/ospf6_gr_helper.c b/ospf6d/ospf6_gr_helper.c
index f0e5d3a1..da8b829c 100644
--- a/ospf6d/ospf6_gr_helper.c
+++ b/ospf6d/ospf6_gr_helper.c
@@ -32,6 +32,7 @@
#include "ospf6_neighbor.h"
#include "ospf6_intra.h"
#include "ospf6d.h"
+#include "ospf6_tlv.h"
#include "ospf6_gr.h"
#include "lib/json.h"
#include "ospf6d/ospf6_gr_helper_clippy.c"
@@ -129,8 +130,8 @@ static int ospf6_extract_grace_lsa_fields(struct ospf6_lsa *lsa,
{
struct ospf6_lsa_header *lsah = NULL;
struct tlv_header *tlvh = NULL;
- struct grace_tlv_graceperiod *gracePeriod;
- struct grace_tlv_restart_reason *grReason;
+ struct tlv_grace_period *gracePeriod;
+ struct tlv_grace_restart_reason *grReason;
uint16_t length = 0;
int sum = 0;
@@ -144,9 +145,8 @@ static int ospf6_extract_grace_lsa_fields(struct ospf6_lsa *lsa,
length = ntohs(lsah->length) - OSPF6_LSA_HEADER_SIZE;
- for (tlvh = TLV_HDR_TOP(lsah); sum < length && tlvh;
+ for (tlvh = lsdesc_start(lsah); sum < length && tlvh;
tlvh = TLV_HDR_NEXT(tlvh)) {
-
/* Check TLV len against overall LSA */
if (sum + TLV_SIZE(tlvh) > length) {
if (IS_DEBUG_OSPF6_GR)
@@ -157,8 +157,8 @@ static int ospf6_extract_grace_lsa_fields(struct ospf6_lsa *lsa,
}
switch (ntohs(tlvh->type)) {
- case GRACE_PERIOD_TYPE:
- gracePeriod = (struct grace_tlv_graceperiod *)tlvh;
+ case TLV_GRACE_PERIOD_TYPE:
+ gracePeriod = (struct tlv_grace_period *)tlvh;
*interval = ntohl(gracePeriod->interval);
sum += TLV_SIZE(tlvh);
@@ -167,8 +167,8 @@ static int ospf6_extract_grace_lsa_fields(struct ospf6_lsa *lsa,
|| *interval < OSPF6_MIN_GRACE_INTERVAL)
return OSPF6_FAILURE;
break;
- case RESTART_REASON_TYPE:
- grReason = (struct grace_tlv_restart_reason *)tlvh;
+ case TLV_GRACE_RESTART_REASON_TYPE:
+ grReason = (struct tlv_grace_restart_reason *)tlvh;
*reason = grReason->reason;
sum += TLV_SIZE(tlvh);
@@ -1218,8 +1218,8 @@ static int ospf6_grace_lsa_show_info(struct vty *vty, struct ospf6_lsa *lsa,
{
struct ospf6_lsa_header *lsah = NULL;
struct tlv_header *tlvh = NULL;
- struct grace_tlv_graceperiod *gracePeriod;
- struct grace_tlv_restart_reason *grReason;
+ struct tlv_grace_period *gracePeriod;
+ struct tlv_grace_restart_reason *grReason;
uint16_t length = 0;
int sum = 0;
@@ -1240,9 +1240,8 @@ static int ospf6_grace_lsa_show_info(struct vty *vty, struct ospf6_lsa *lsa,
zlog_debug(" TLV info:");
}
- for (tlvh = TLV_HDR_TOP(lsah); sum < length && tlvh;
+ for (tlvh = lsdesc_start(lsah); sum < length && tlvh;
tlvh = TLV_HDR_NEXT(tlvh)) {
-
/* Check TLV len */
if (sum + TLV_SIZE(tlvh) > length) {
if (vty)
@@ -1255,8 +1254,8 @@ static int ospf6_grace_lsa_show_info(struct vty *vty, struct ospf6_lsa *lsa,
}
switch (ntohs(tlvh->type)) {
- case GRACE_PERIOD_TYPE:
- gracePeriod = (struct grace_tlv_graceperiod *)tlvh;
+ case TLV_GRACE_PERIOD_TYPE:
+ gracePeriod = (struct tlv_grace_period *)tlvh;
sum += TLV_SIZE(tlvh);
if (vty) {
@@ -1272,8 +1271,8 @@ static int ospf6_grace_lsa_show_info(struct vty *vty, struct ospf6_lsa *lsa,
ntohl(gracePeriod->interval));
}
break;
- case RESTART_REASON_TYPE:
- grReason = (struct grace_tlv_restart_reason *)tlvh;
+ case TLV_GRACE_RESTART_REASON_TYPE:
+ grReason = (struct tlv_grace_restart_reason *)tlvh;
sum += TLV_SIZE(tlvh);
if (vty) {
if (use_json)