diff options
Diffstat (limited to 'ospf6d/ospf6_lsa.h')
-rw-r--r-- | ospf6d/ospf6_lsa.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/ospf6d/ospf6_lsa.h b/ospf6d/ospf6_lsa.h index c9ac27d..4fc2f0d 100644 --- a/ospf6d/ospf6_lsa.h +++ b/ospf6d/ospf6_lsa.h @@ -87,10 +87,21 @@ struct ospf6_lsa_header { uint16_t length; /* LSA length */ }; -#define OSPF6_LSA_HEADER_END(h) ((caddr_t)(h) + sizeof(struct ospf6_lsa_header)) -#define OSPF6_LSA_SIZE(h) (ntohs(((struct ospf6_lsa_header *)(h))->length)) -#define OSPF6_LSA_END(h) \ - ((caddr_t)(h) + ntohs(((struct ospf6_lsa_header *)(h))->length)) +static inline char *ospf6_lsa_header_end(struct ospf6_lsa_header *header) +{ + return (char *)header + sizeof(struct ospf6_lsa_header); +} + +static inline char *ospf6_lsa_end(struct ospf6_lsa_header *header) +{ + return (char *)header + ntohs(header->length); +} + +static inline uint16_t ospf6_lsa_size(struct ospf6_lsa_header *header) +{ + return ntohs(header->length); +} + #define OSPF6_LSA_IS_TYPE(t, L) \ ((L)->header->type == htons(OSPF6_LSTYPE_##t) ? 1 : 0) #define OSPF6_LSA_IS_SAME(L1, L2) \ |