summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_lsa.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:56:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:56:23 +0000
commitc15d6efd40655f717841d00839a43df1ead5cb26 (patch)
tree35d579f9a19170e2b39085669ca92533c2d161b4 /ospf6d/ospf6_lsa.h
parentAdding upstream version 10.0.1. (diff)
downloadfrr-upstream.tar.xz
frr-upstream.zip
Adding upstream version 10.1.upstream/10.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ospf6d/ospf6_lsa.h')
-rw-r--r--ospf6d/ospf6_lsa.h19
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) \