diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2021-05-09 14:51:39 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2021-05-09 14:51:39 +0200 |
commit | 1647923bd8d2f8e53337365abc5be7e343aa570c (patch) | |
tree | 72f34e15257ca9a9fbe2d4041bf2bb210076e32c /proto/ospf/ospf.h | |
parent | 255722e0fcf251c101ff5bec92f1867edf841daa (diff) |
OSPF: Minor refactoring of packet sending code
Common behavior for LSupd and delayed LSack moved to ospf_send_to_iface()
and other minor changes.
Diffstat (limited to 'proto/ospf/ospf.h')
-rw-r--r-- | proto/ospf/ospf.h | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h index db55aa6a..aa7d937e 100644 --- a/proto/ospf/ospf.h +++ b/proto/ospf/ospf.h @@ -1056,22 +1056,13 @@ int ospf_rx_hook(sock * sk, uint size); void ospf_err_hook(sock * sk, int err); void ospf_verr_hook(sock *sk, int err); void ospf_send_to(struct ospf_iface *ifa, ip_addr ip); -void ospf_send_to_agt(struct ospf_iface *ifa, u8 state); -void ospf_send_to_bdr(struct ospf_iface *ifa); - -static inline uint ospf_pkt_maxsize(struct ospf_iface *ifa) -{ return ifa->tx_length - ifa->tx_hdrlen; } +void ospf_send_to_iface(struct ospf_iface *ifa); static inline void ospf_send_to_all(struct ospf_iface *ifa) { ospf_send_to(ifa, ifa->all_routers); } -static inline void ospf_send_to_des(struct ospf_iface *ifa) -{ - if (ipa_nonzero(ifa->des_routers)) - ospf_send_to(ifa, ifa->des_routers); - else - ospf_send_to_bdr(ifa); -} +static inline uint ospf_pkt_maxsize(struct ospf_iface *ifa) +{ return ifa->tx_length - ifa->tx_hdrlen; } #ifndef PARSER #define DROP(DSC,VAL) do { err_dsc = DSC; err_val = VAL; goto drop; } while(0) |