summaryrefslogtreecommitdiff
path: root/lib/ipaddr.h
AgeCommit message (Collapse)Author
2022-01-27vrrpd: use ipaddr_is_zero when neededIgor Ryzhov
Replace custom implementation or call to ipaddr_isset with a call to ipaddr_is_zero. ipaddr_isset is not fully correct, because it's fine to have some non-zero bytes at the end of the struct in case of IPv4 and the function doesn't allow that. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-19bgpd: replace custom union gw_addr with struct ipaddrIgor Ryzhov
BGP EVPN custom `union gw_addr` is basically the same thing as a common `struct ipaddr` but it lacks the address family which is needed in some cases. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-08-07lib, zebra: Add SR-TE policy infrastructure to zebraSebastien Merle
For the sake of Segment Routing (SR) and Traffic Engineering (TE) Policies there's a need for additional infrastructure within zebra. The infrastructure in this PR is supposed to manage such policies in terms of installing binding SIDs and LSPs. Also it is capable of managing MPLS labels using the label manager, keeping track of nexthops (for resolving labels) and notifying interested parties about changes of a policy/LSP state. Further it enables a route map mechanism for BGP and SR-TE colors such that learned BGP routes can be mapped onto SR-TE Policies. This PR does not introduce any usable features by now, it is just infrastructure for other upcoming PRs which will introduce 'pathd', a new SR-TE daemon. Co-authored-by: Renato Westphal <renato@opensourcerouting.org> Co-authored-by: GalaxyGorilla <sascha@netdef.org> Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-08-07lib: add generic struct ipaddr comparison functionSebastien Merle
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-08-03lib,zebra,bgpd: Fix for nexthop as IPv4 mapped IPv6 addressKaushik
Added a macro to validate the v4 mapped v6 address. Modified bgp receive & send updates for v4 mapped v6 address as nexthop and installing it as recursive nexthop in RIB. Minor change in fpm while sending the routes for nexthop as v4 mapped v6 address. Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-07-14lib: add %pIA for struct ipaddr *David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-14lib/ipaddr: match constants to AF_*David Lamparter
No reason not to do this really. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-27zebra,lib: use const in more apisMark Stapp
Use const with some args to ipaddr, zebra vxlan, mpls lsp, and nexthop apis; add some extra checks to some nexthop-related apis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-26lib: fix ipaddr_issetQuentin Young
Meaning inverted by mistake Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-09lib: add ipaddr_isset()Quentin Young
Compare ip address against 0 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-07-17lib: use const in ipaddr2strMark Stapp
Use const more Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-05-17vrrpd, lib: style fixesQuentin Young
Fixup: * Blank lines after declarations * Trailing whitespace * Braces and parentheses Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17lib: add sizing macro to ipaddr.hQuentin Young
Useful for getting the size of the relevant data in the `ip` field of struct ipaddr. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-11lib: add extern "C" {} blocks to all libfrr headersRenato Westphal
These are necessary to use functions defined in these headers from C++. Signed-off-by: David Lamparter <equinox@diac24.net> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-05-08zebra: remote RMAC for EVPN ipv6 hosts should be programmed against the ipv4 ↵Mitesh Kanjariya
nexthop For ipv6 host, the next hop is conevrted to ipv6 mapped address. However, the remote rmac should still be programmed with the ipv4 address. This is how the entries will look in the kernel for ipv6 hosts routing. vrf routing table: ipv6 -> ipv6_mapped remote vtep on l3vni SVI neigh table: ipv6_mapped remote vtep -> remote RMAC bridge fdb: remote rmac -> ipv4 vtep tunnel Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-06Merge branch 'master' of https://github.com/frrouting/frr into ↵vivek
evpn-ipv6-tenant-routing Conflicts: zebra/zserv.c
2018-03-01lib, zebra: Fix warningsvivek
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-02-28*: EVPN symmetric routing for IPv6 tenant routesvivek
Implement support for EVPN symmetric routing for IPv6 routes. The next hop for EVPN routes is the IP address of the remote VTEP which is only an IPv4 address. This means that for IPv6 symmetric routing, there will be IPv6 destinations with IPv4 next hops. To make this work, the IPv4 next hops are converted into IPv4-mapped IPv6 addresses. As part of support, ensure that "L3" route-targets are not announced with IPv6 link-local addresses so that they won't be installed in the routing table. Signed-off-by: Vivek Venkatraman vivek@cumulusnetworks.com Reviewed-by: Mitesh Kanjariya mitesh@cumulusnetworks.com Reviewed-by: Donald Sharp sharpd@cumulusnetworks.com
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-10lib: Remove typedef from ipaddrDonald Sharp
The ipaddr_t type was conflicting with code on omnios. Remove the typedef Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-25lib: Define generic IP address structurevivek
Define an IP address structure which is a union of an IPv4 and IPv6 address. This is for subsequent use in EVPN. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>