diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-06-30 20:12:59 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-06-30 21:30:41 +0200 |
commit | 1a2ad348f660b150265f6df759a07de8a2b6de2f (patch) | |
tree | d64846d56a79178a34e865440b3b87d970c13fd4 /proto/ospf/lsalib.h | |
parent | 8a68316eb96be1fecf91ca395f3321aa99997ad2 (diff) |
OSPF: Support for graceful restart
Implement OSPFv2 (RFC 3623) and OSPFv3 (RFC 5187) graceful restart,
for both restarting and helper sides. Graceful restart is initiated
by 'graceful down' command.
Diffstat (limited to 'proto/ospf/lsalib.h')
-rw-r--r-- | proto/ospf/lsalib.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/proto/ospf/lsalib.h b/proto/ospf/lsalib.h index af8901ce..eca138d7 100644 --- a/proto/ospf/lsalib.h +++ b/proto/ospf/lsalib.h @@ -44,10 +44,7 @@ static inline void lsa_get_type_domain(struct ospf_lsa_header *lsa, struct ospf_ 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); } - +int lsa_is_opaque(u32 type); 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); @@ -58,6 +55,16 @@ u16 lsa_verify_checksum(const void *lsa_n, int lsa_len); #define CMP_SAME 0 #define CMP_OLDER -1 int lsa_comp(struct ospf_lsa_header *l1, struct ospf_lsa_header *l2); + +struct ospf_tlv * lsa_get_tlv(struct top_hash_entry *en, uint type); + +static inline u32 +lsa_get_tlv_u32(struct top_hash_entry *en, uint type) +{ + struct ospf_tlv *tlv = lsa_get_tlv(en, type); + return (tlv && (tlv->length == 4)) ? tlv->data[0] : 0; +} + void lsa_walk_rt_init(struct ospf_proto *po, struct top_hash_entry *act, struct ospf_lsa_rt_walk *rt); int lsa_walk_rt(struct ospf_lsa_rt_walk *rt); void lsa_parse_sum_net(struct top_hash_entry *en, int ospf2, int af, net_addr *net, u8 *pxopts, u32 *metric); |