mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Initial commit on integrated BIRD
New data types net_addr and variants (in lib/net.h) describing network addresses (prefix/pxlen). Modifications of FIB structures to handle these data types and changing everything to use these data types instead of prefix/pxlen pairs where possible. The commit is WiP, some protocols are not yet updated (BGP, Kernel), and the code contains some temporary scaffolding. Comments are welcome.
This commit is contained in:
@@ -22,7 +22,7 @@ ospf_pkt_fill_hdr(struct ospf_iface *ifa, void *buf, u8 h_type)
|
||||
|
||||
pkt->version = ospf_get_version(p);
|
||||
pkt->type = h_type;
|
||||
pkt->length = htons(ospf_pkt_maxsize(ifa));
|
||||
pkt->length = htons(ospf_pkt_maxsize(p, ifa));
|
||||
pkt->routerid = htonl(p->router_id);
|
||||
pkt->areaid = htonl(ifa->oa->areaid);
|
||||
pkt->checksum = 0;
|
||||
@@ -31,9 +31,9 @@ ospf_pkt_fill_hdr(struct ospf_iface *ifa, void *buf, u8 h_type)
|
||||
}
|
||||
|
||||
uint
|
||||
ospf_pkt_maxsize(struct ospf_iface *ifa)
|
||||
ospf_pkt_maxsize(struct ospf_proto *p, struct ospf_iface *ifa)
|
||||
{
|
||||
uint headers = SIZE_OF_IP_HEADER;
|
||||
uint headers = ospf_is_v2(p) ? IP4_HEADER_LENGTH : IP6_HEADER_LENGTH;
|
||||
|
||||
/* Relevant just for OSPFv2 */
|
||||
if (ifa->autype == OSPF_AUTH_CRYPT)
|
||||
|
Reference in New Issue
Block a user