summaryrefslogtreecommitdiffstats
path: root/zebra/rt.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* zebra: Add `enum dp_req_result` to lsp install/deletesDonald Sharp2018-05-301-3/+3
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Add a result from dataplane requestDonald Sharp2018-05-301-3/+11
| | | | | | | | | | Add a bit of code to allow return of data plane request messages. Add the ability to pass the result back to callers of kernel_route_rib. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Rename SOUTHBOUND_XXX to DP_XXXDonald Sharp2018-05-301-7/+7
| | | | | | | The SOUTHBOUND_XXX enum was named a bit poorly. Let's use a bit better name for what we are trying to do. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-8/+6
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* zebra: ipv6 operations stick to namespacePhilippe Guibert2018-02-271-1/+2
| | | | | | All ipv6 operations stick to namespace. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* zebra: Modify southbound interface to pass `struct route_node`Donald Sharp2018-01-241-3/+5
| | | | | | | | | The route_node that we are working on is going to be interesting to the kernel_route_rib_pass_fail. So I am setting up the code to allow me to pass it. This will be done in a subsuquent commit. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Add one-shot thread to recheck speedDonald Sharp2018-01-111-0/+1
| | | | | | | | | | | | | | | | | | There are certain interfaces that when brought up and we receive the netlink notification about it, the speed of the interface is not set correctly. This creates a one-shot thread that will wait 15 seconds and then requery the speed and if it is different it will renotify the running daemons. The kernel should notify us on speed changes, unfortunately this is not done currently via a netlink message as you would think. As I understand it there is some in-fighting about the proper way to approach this issue and due to the way the kernel release cycle works we are a ways off from getting this fixed. This is a `hack` to make us work correctly while we wait for the true answer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #1546 from pguibert6WIND/issue__1537Donald Sharp2017-12-141-0/+2
|\ | | | | Issue 1537
| * zebra: ipv6 addressing uses netlink socket instead of standard ioctlPhilippe Guibert2017-12-131-0/+2
| | | | | | | | | | | | | | It is possible to configure IPv6 addresses from interfaces by using netlink socket, intead of using standard sockets. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | zebra: Make zserv.h the true api for zapi northboundDonald Sharp2017-12-131-0/+14
|/ | | | | | | | zserv.c had a grab bag of function declarations that did not belong in it. Move those to where they better belong. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Fix lsp add/del from kernel using SETFLAGDonald Sharp2017-11-291-3/+17
| | | | | | | Setup a interface such that the add/del of lsp's from the kernel can have a callback for success/failure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Implement call back for route install/delete success/failDonald Sharp2017-11-291-2/+30
| | | | | | | | | | | | | | | | | When a route is installed or deleted into the kernel allow a callback mechanism to handle the success/failure of the kernel call. This separation is to allow us to do these things: 1) In the future create a true pthread to handle route install/deletes. This way we can schedule these events in a smarter fashion 2) Allow us to use a common southbound api for route install and deletion. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Note about functionality in rt.hDonald Sharp2017-11-161-0/+11
| | | | | | | | | When we are modifying the kernel there could be multiple modules/hooks involved in this process. As such let the caller set the appropriate flags for success/failure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, pimd, zebra: Allow pim to set pimregX into appropriate vrfDonald Sharp2017-07-241-1/+2
| | | | | | | | | The pimregX devices when created by the kernel are put into the default vrf. When pim gets the callback that the device exists, check to see if it is a pimregX device and if so move it into the appropriate vrf. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Allow S,G lookup to use RTNL_FAMILY_IPMRDonald Sharp2017-07-241-1/+1
| | | | | | | | | This current implementation unfortunately must ask the kernel for all mroutes because vrf's do not have the ability to request a single mroute at this time. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-26/+27
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd, zebra: Support for sticky MACsvivek2017-07-121-1/+2
| | | | | | | | | | | | | | | Implement support for sticky (static) MACs. This includes the following: - Recognize MAC is static (using NUD_NOARP flag) and inform BGP - Construct MAC mobility extended community for sticky MACs as per RFC 7432 section 15.2 - Inform to zebra that remote MAC is sticky, where appropriate - Install sticky MACs into the kernel with the right flag - Appropriate handling in route selection Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: MAC and Neighbor (ARP/ND) handlingvivek2017-07-121-0/+10
| | | | | | | | | | | | | | | | | | | Implement handling of MACs and Neighbors (ARP/ND entries) in zebra: - MAC and Neighbor database handlers - Read MACs and Neighbors from the kernel, when needed and create entries in zebra's MAC and Neighbor databases. - Handle add/update/delete notifications from the kernel for MACs and Neighbors and update zebra's database appropriately - Inform locally learnt MACs and Neighbors to client - Handle MACIP add/delete from client and install appriporiate entries into the kernel - Since Neighbor entries will be installed on an SVI, implement the needed mappings NOTE: kernel interface is only implemented for Linux/netlink Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: VNI and VTEP handlingvivek2017-07-121-0/+5
| | | | | | | | | | | | | Implement fundamental handling for VNIs and VTEPs: - Handle EVPN enable/disable by client (advertise-all-vni) - Create/update/delete VNIs based on VxLAN interface events and inform client - Handle VTEP add/delete from client and install into kernel - New debug command for VxLAN/EVPN - kernel interface (Linux/netlink only) Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Refactor 'struct rib' to be 'struct route_entry'Donald Sharp2017-06-011-1/+1
| | | | | | | | | | The 'struct rib' data structure is missnamed. It really is a 'struct route_entry' as part of the 'struct route_node'. We have 1 'struct route_entry' per route src. As such 1 route node can have multiple route entries if multiple protocols attempt to install the same route. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: add srcdest support to ribChristian Franke2017-01-301-1/+2
| | | | | | | Add srcdest support to the zebra rib and to the kernel and redistribution interfaces. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* zebra: Allow the collection of sg stats on more platforms.Donald Sharp2017-01-181-0/+1
| | | | | | | | The code to collect the sg stats was written for linux. Abstract the call to allow it to work on all platforms. I have not implemented the call for non-linux systems. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: kernel interface simplificationTimo Teräs2016-10-181-7/+1
| | | | | | | | | | [DL: picked out from: "atomic FIB updates"] This simplifies the OS-specific route update API into a single entry point, kernel_route_rib(), which dispatches the various operations internally. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* zebra: check at startup if the kernel supports MPLSRenato Westphal2016-09-231-1/+1
| | | | | | | | Replace all HAVE_MPLS #ifdef's by a run-time check if MPLS is supported by the kernel or not. This way we don't need to create multiple packages for each OS distribution. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* mpls: add support to the OpenBSD kernelRenato Westphal2016-09-231-0/+1
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Quagga: Install label forwarding entries for statically configured LSPsvivek2016-09-231-0/+6
| | | | | | | | | | | | | Install the statically configured LSPs into the FIB (kernel). This is done using the new attributes and definitions for MPLS in the kernel - RTA_VIA, RTA_NEWDST and AF_MPLS. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-4804 Reviewed By: CCR-3088 Testing Done: Manual in SE-1
* zebra: remove unused code from zebra netlinkChristian Franke2016-09-091-4/+1
|
* zebra: create an abstraction layer for netlink_neigh_update()Renato Westphal2016-08-081-0/+1
| | | | | | | | | | | We shouldn't have platform-agnostic code (e.g. zebra/interface.c) calling platform-specific functions (e.g. netlink_neigh_update). This commit introduces the kernel_neigh_update() function, which then has to be implemented by all supported platforms. Currently only Linux implements this function, which is only used by the RTADV code. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: remove kernel_delete_ipv6_old()David Lamparter2016-05-261-2/+0
| | | | | | | | | | | The only user of this was rib_bogus_ipv6(), which was removed in the previous commit. Good riddance. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Greg Troxel <gdt@ir.bbn.com> Acked-by: Feng Lu <lu.feng@6wind.com> Acked-by: Paul Jakma <paul@jakma.org> (cherry picked from commit 51bdebad99fe813d1b7104543b352f0e39b1c8dc)
* Zebra: Implement route replace for IPv6vivek2015-11-191-0/+1
| | | | | | | | | | | | | | | | | | Zebra currently performs a delete followed by add when a route needs to be modified. Change this to use the replace semantics of netlink so that the operation can possibly be atomic. Note: This patch handles IPv6 routes, IPv4 already performs a replace. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com> Ticket: CM-5597 Reviewed By: CCR-3407 Testing Done: Manual testing of various scearnios (Vivek, Satish) Note: This is an import of patch zebra-ipv6-route-replace.patch from 2.5-br.
* Zebra: Implement route replace semantics.Donald Sharp2015-06-111-0/+1
| | | | | | | | Zebra currently performs a delete followed by add when a route needs to be modified. Change this to use the replace semantics of netlink so that the operation can possibly be atomic. Note: Only implemented for IPv4 currently.
* [zebra/solaris] Interface state fixups for Solaris.paul2006-01-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-01-25 Paul Jakma <paul.jakma@sun.com> * (general) More solaris PF_ROUTE hacks. The IFF_UP mangling for solaris was incomplete on the PF_ROUTE side. fix it. This changeset generally uglifies things. For some future work I'd like to see the state changes seperated out from the details of the code. Differences between systems might then be slightly easier to implement without convoluted hacks. Changes should be specific to Solaris mostly, however also tested on FreeBSD 6. * if_ioctl_solaris.c: (interface_list_ioctl) ignore ~IFF_UP interfaces, we'll hear about them when/if interface goes up through NEWADDR. Update flags explicitely at end of it to kick mangling. * ioctl_solaris.c: (if_mangle_up) removed to interface.c, in kind. (lifreq_set_name) more convenient to take the string, than the ifp. (if_get_flags_direct) new convenience function, returns the actual flags. Used during bootstrap in if_ioctl_solaris.c to peek at flags of logical interfaces to see whether or not to ignore them. (if_get_flags) ENXIO means it's gone, poke out IFF_UP and kick flags update. (if_{un,}set_flags) flags argument should be 64bit. * ioctl.{c,h}: flags argument should be 64bit. * interface.h: Add a 'primary_state' flag to struct zebra_if on SUNOS_5. Export if_flags_update. * interface.c: (if_flags_mangle) moved over in kind from ioctl_solaris.c. Nasty kludge to try get IFF_UP right, as much as is possible. Also keep track of the actual IFF_UP value for the primary interface, so we can know when the ifp must be deleted. (if_flags_update) Take a new interface flags value, apply it to the interface, and take whatever actions are required due to flag transitions. (if_refresh) flag state change logic is moved out to previous. Just call if_get_flags, which will end up using previous to effect the update of flags. (if_flag_dump_vty) IFF_IPV{4,6} aren't interesting, VIRTUAL and NOXMIT are though. * kernel_socket.c: (ifm_read) Down->Down transitions shouldn't create ifp, for non-IFANNOUNCE systems. Use if_flags_update to update flags. flag transition logic is now handled automatically through if_flags_update. (ifam_read) Better to call if_refresh *after* adding connected addresses, as connected count affects IFF_UP on IFF_UP-mangled systems. On Solaris, Up->Down due to DELADDR means we need to delete the ifp - the IFINFO might already have been and gone. * rt.h: include other dependent headers.
* [zebra] Fix mistake in previous commit and further compile warnings/errors.paul2005-11-241-0/+3
| | | | | | | | | | | | | | | | | 2005-11-24 Paul Jakma <paul.jakma@sun.com> * kernel_socket.h: New header for functions exported to sysctl methods. * kernel_socket.c: include previous. Remove static qualifier from couple of functions which are used by sysctl methods, incorrectly added in previous commit. Add a workaround for a bogus gcc warning to the RTA_ macros. * Makefile.am: Add kernel_socket.h to noinst_HEADERS * if_sysctl.c: include rt.h and kernel_socket.h and remove redundant prototypes. * rtread_sysctl.c: ditto. (route_read) fix mismatch of return values. * {rt,zserv,rib}.h: Include lib headers depended on.
* 2005-06-28 Paul Jakma <paul.jakma@sun.com>paul2005-06-281-9/+9
| | | | | | | * (global) Extern and static'ification, with related fixups of declarations, ensuring files include their own headers, etc. if_ioctl.c: (interface_info_ioctl) fix obvious arg mis-order in list loop
* Initial revisionpaul2002-12-131-0/+40