diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-01-24 22:34:33 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-01-24 22:45:27 +0100 |
commit | 5a50a98980a3554b66cedda6992ece4063a0e85a (patch) | |
tree | d8ff938c5b9712ca7788256aab3fff96f98ad7ac /proto/ospf/lsalib.h | |
parent | 3e60932a289e55e212dec1cbaf3bca44b2bbaeb8 (diff) |
OSPF: Opaque LSAs and Router Information LSA
Add support for OSPFv2 Opaque LSAs (RFC 5250) and for Router Information
LSA (RFC 7770). The second part is here mainly for testing opaque LSAs.
Diffstat (limited to 'proto/ospf/lsalib.h')
-rw-r--r-- | proto/ospf/lsalib.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/proto/ospf/lsalib.h b/proto/ospf/lsalib.h index fca7faec..af8901ce 100644 --- a/proto/ospf/lsalib.h +++ b/proto/ospf/lsalib.h @@ -36,16 +36,21 @@ struct ospf_lsa_rt_walk { }; -void lsa_get_type_domain_(u32 itype, struct ospf_iface *ifa, u32 *otype, u32 *domain); +void lsa_get_type_domain_(u32 type, u32 id, struct ospf_iface *ifa, u32 *otype, u32 *domain); static inline void lsa_get_type_domain(struct ospf_lsa_header *lsa, struct ospf_iface *ifa, u32 *otype, u32 *domain) -{ lsa_get_type_domain_(lsa->type_raw, ifa, otype, domain); } +{ lsa_get_type_domain_(lsa->type_raw, lsa->id, ifa, otype, domain); } static inline u32 lsa_get_etype(struct ospf_lsa_header *h, struct ospf_proto *p) { return ospf_is_v2(p) ? (h->type_raw & LSA_T_V2_MASK) : h->type_raw; } +/* Assuming OSPFv2 - All U-bit LSAs are mapped to Opaque LSAs */ +static inline int lsa_is_opaque(u32 type) +{ return !!(type & LSA_UBIT); } +u32 lsa_get_opaque_type(u32 type); int lsa_flooding_allowed(u32 type, u32 domain, struct ospf_iface *ifa); +int lsa_is_acceptable(u32 type, struct ospf_neighbor *n, struct ospf_proto *p); void lsa_generate_checksum(struct ospf_lsa_header *lsa, const u8 *body); u16 lsa_verify_checksum(const void *lsa_n, int lsa_len); |