summaryrefslogtreecommitdiffstats
path: root/proto/ospf/packet.h
diff options
context:
space:
mode:
Diffstat (limited to 'proto/ospf/packet.h')
-rw-r--r--proto/ospf/packet.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/proto/ospf/packet.h b/proto/ospf/packet.h
index 1c74a70..c0185b9 100644
--- a/proto/ospf/packet.h
+++ b/proto/ospf/packet.h
@@ -21,4 +21,17 @@ void ospf_send_to(struct ospf_iface *ifa, ip_addr ip);
static inline void * ospf_tx_buffer(struct ospf_iface *ifa) { return ifa->sk->tbuf; }
+static inline unsigned
+ospf_pkt_bufsize(struct ospf_iface *ifa)
+{
+#ifdef OSPFv2
+ unsigned headers = (ifa->autype == OSPF_AUTH_CRYPT) ? OSPF_AUTH_CRYPT_SIZE : 0;
+#else
+ unsigned headers = 0;
+#endif
+
+ return ifa->sk->tbsize - headers;
+}
+
+
#endif /* _BIRD_OSPF_PACKET_H_ */