struct ospf6_router_lsa *rtr_lsa;
if (lsa != NULL && OSPF6_LSA_IS_TYPE(ROUTER, lsa)) {
- rtr_lsa = (struct ospf6_router_lsa
- *)((caddr_t)lsa->header
- + sizeof(struct ospf6_lsa_header));
+ rtr_lsa = lsa_after_header(lsa->header);
if (!OSPF6_OPT_ISSET(rtr_lsa->options, OSPF6_OPT_R)) {
return OSPF6_IS_STUB_ROUTER;
char buf[128], options[32];
json_object *json_arr = NULL;
- network_lsa =
- (struct ospf6_network_lsa *)((caddr_t)lsa->header
- + sizeof(struct ospf6_lsa_header));
+ network_lsa = lsa_after_header(lsa->header);
ospf6_options_printbuf(network_lsa->options, options, sizeof(options));
if (use_json)
json_object *json_arr = NULL;
char prefix_string[133];
- link_lsa = (struct ospf6_link_lsa *)((caddr_t)lsa->header
- + sizeof(struct ospf6_lsa_header));
+ link_lsa = lsa_after_header(lsa->header);
ospf6_options_printbuf(link_lsa->options, options, sizeof(options));
inet_ntop(AF_INET6, &link_lsa->linklocal_addr, buf, sizeof(buf));
char tbuf[16];
if (lsa) {
- intra_prefix_lsa =
- (struct ospf6_intra_prefix_lsa
- *)((caddr_t)lsa->header
- + sizeof(struct ospf6_lsa_header));
+ intra_prefix_lsa = lsa_after_header(lsa->header);
prefixnum = ntohs(intra_prefix_lsa->prefix_num);
if ((pos + 1) > prefixnum)
json_object *json_arr = NULL;
char prefix_string[133];
- intra_prefix_lsa = (struct ospf6_intra_prefix_lsa
- *)((caddr_t)lsa->header
- + sizeof(struct ospf6_lsa_header));
+ intra_prefix_lsa = lsa_after_header(lsa->header);
prefixnum = ntohs(intra_prefix_lsa->prefix_num);
}
}
- link_lsa = (struct ospf6_link_lsa
- *)((caddr_t)lsa->header
- + sizeof(struct ospf6_lsa_header));
+ link_lsa = lsa_after_header(lsa->header);
prefix_num = (unsigned short)ntohl(link_lsa->prefix_num);
start = (char *)link_lsa + sizeof(struct ospf6_link_lsa);