summaryrefslogtreecommitdiffstats
path: root/zebra/label_manager.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* zebra: expose label-manager util-funcsPat Ruddy2021-01-051-0/+11
| | | | | | | Revert "zebra: unexpose label-manager util-funcs as static" This reverts commit d3d9639d9a2251aa519b5399706ce816982001a1. Signed-off-by: Pat Ruddy <pat@voltanet.io>
* zebra: unexpose label-manager util-funcs as staticHiroki Shirokura2020-12-101-15/+0
| | | | | | | | | | | | | | | Following functions which is a piece of label-maanager implementation isn't called from out side of its file. And all lines of label-manager are coded on zebra/label_manager.c at this time. So these functions should be unexposed. Functions: - create_label_chunk - assign_label_chunk - delete_label_chunk - release_label_chunk Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* zebra,ldpd: use zapi client session id in LM apisMark Stapp2020-04-161-26/+27
| | | | | | | | Use the zapi client session id in the label manager apis; use the client struct directly in some code. Assign a session id to ldpd's sync LM zapi session. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: use the current project name (FRRouting)Lou Berger2020-03-251-1/+1
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* zebra: label manager refactorEmanuele Di Pascale2019-07-101-6/+52
| | | | | | | | | | | | | | | | | | in order to both streamline the code and allow users to define their own specialized versions of the LM api handlers, define hooks for the 4 main primitives offered by the label manager (i.e. connect, disconnect, get_chunk and release_chunk), and have the existing code be run in response to a hook_call. Additionally, have the responses to the requesting daemon be callable from an external API. Note that the proxy version of the label manager was a source of issues and hardly used in practice. With the new hooks, users with more complex requirements can simply plug in their own code to handle label distribution remotely, so there is no longer a reason to maintain this code. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* lib, zebra: support label chunk requests for SRGBEmanuele Di Pascale2019-07-101-1/+2
| | | | | | | | | | | | | | | | For SRGB, we need to support chunk requests starting at a specific point in the label space, rather than just asking for any sufficiently large chunk. To this purpose, we extend the label manager api to request a chunk with a base value; if the base is set to 0, the label manager will behave as it currently does, i.e. fetching the first free chunk big enough to satisfy the request. update all the existing calls to get chunks from the label manager so that they use MPLS_LABEL_BASE_ANY as the base for the requested chunk Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* add cplusplus guards to all zebra headersEmanuele Di Pascale2019-03-251-0/+8
| | | | Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* lib, zebra: fix formatting and styleFredi Raspall2018-05-081-1/+1
| | | | Signed-off-by: Fredi Raspall <fredi@voltanet.io>
* zebra: fix broken label manager proxy mode.Fredi Raspall2018-04-271-1/+1
| | | | | | | | | | | | | | In a prior refactor, label manager proxy functionality was broken in two places: 1) in function relay_response_back(), "dst" stream was accidentally replaced by "src". 2) in zread_relay_label_manager_request(), src was set to point to a global struct stream *ibuf that was not used/initialized anywhere. Signed-off-by: Fredi Raspall <fredi@voltanet.io>
* zebra: use hooks for client lifecycle callbacksQuentin Young2018-04-231-1/+1
| | | | | | | | | zserv.c was using hardcoded callbacks to clean up various components when a client disconnected. Ergo zserv.c had to know about all these unrelated components that it should not care about. We have hooks now, let's use the proper thing instead. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: clean up zapi organizationQuentin Young2018-04-231-0/+2
| | | | | | | | | | | | | zserv.c has become something of a dumping ground for everything vaguely related to ZAPI and really needs some love. This change splits out the code fo building and consuming ZAPI messages into a separate source file, leaving the actual session and client lifecycle code in zserv.c. Unfortunately since the #include situation in Zebra has not been paid much attention I was forced to fix the headers in a lot of other source files. This is a net improvement overall though. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: add the handling of table ids from remote daemonsPhilippe Guibert2018-03-291-1/+1
| | | | | | | | | This commit is connecting the table manager with remote daemons by handling the queries. As the function is similar in many points with label allocator, a function has been renamed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-7/+8
| | | | | | | | | | | | | | | | | | | | | | 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>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-4/+5
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge branch 'stable/3.0'David Lamparter2017-05-181-1/+1
|\ | | | | | | | | | | | | | | Conflicts: ldpd/lde.c zebra/label_manager.c Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * lm: Make relay label manager asyncßingen2017-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid blocking zebra when it's acting as a proxy for an external label manager. Besides: Fix get chunk reconnection. Socket was still being destroyed on failure, so next attempt would never work. Filter out unwanted messages in lm sync sock. Until LDE client sends ZEBRA_LABEL_MANAGER_CONNECT message, zserv doesn't know which kind of client it is, so it might enqueue unwanted messages like interface add, interface up, etc. Changes in this commit discard those messages in the client side in case they arrive before the expected response. Change function name for zclient_connect in label manager to avoid confusion with zclient one. Signed-off-by: ßingen <bingen@voltanet.io>
* | *: 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>
* Implement generic label managerßingen2017-03-201-0/+74
Label Manager allows to share MPLS label space among different daemons. Each daemon can request a chunk of consecutive labels and release it if it doesn't need them anymore. Label Manager stores the daemon protocol and instance to identify the owner client. It uses them to perform garbage collection, releasing all label chunks from a client when it gets disconnected or reconnected. Additionally, every client can request that the chunk is never garbage collected. In that case client has the responsibility to release non-used labels. Zebra can host the label manager itself (if no -l param is provided) or connect to an external one using zserv/zclient (providing its address with -l param). Client code is in lib/zclient.c, but currently only LDP is using it. TODO: Allow for custom ranges requests, i.e., specify the start label besides the chunk. TODO: Release labels from LDP. Signed-off-by: Bingen Eguzkitza <bingen@voltanet.io>