diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2016-09-12 09:02:39 -0300 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-09-23 09:31:13 -0400 | 
| commit | be0dba358f7cd40ae27f012409734786a13d5ce4 (patch) | |
| tree | 698d02bc1c5227cb5e43686d94ee19a42203dfd7 /zebra/rt_netlink.c | |
| parent | ce54994727bf237e0f89168d6818b04ea79f090d (diff) | |
mpls: add null driver
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/rt_netlink.c')
| -rw-r--r-- | zebra/rt_netlink.c | 78 | 
1 files changed, 2 insertions, 76 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 07d2923028..95c8892979 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -2805,7 +2805,7 @@ kernel_neigh_update (int add, int ifindex, uint32_t addr, char *lla, int llalen)  /*   * MPLS label forwarding table change via netlink interface.   */ -static int +int  netlink_mpls_multipath (int cmd, zebra_lsp_t *lsp)  {    mpls_lse_t lse; @@ -2977,7 +2977,7 @@ netlink_mpls_multipath (int cmd, zebra_lsp_t *lsp)  /*   * Handle failure in LSP install, clear flags for NHLFE.   */ -static inline void +void  clear_nhlfe_installed (zebra_lsp_t *lsp)  {    zebra_nhlfe_t *nhlfe; @@ -2994,80 +2994,6 @@ clear_nhlfe_installed (zebra_lsp_t *lsp)      }  } -/* - * Install Label Forwarding entry into the kernel. - */ -int -kernel_add_lsp (zebra_lsp_t *lsp) -{ -  int ret; - -  if (!lsp || !lsp->best_nhlfe) // unexpected -    return -1; - -  UNSET_FLAG (lsp->flags, LSP_FLAG_CHANGED); -  ret = netlink_mpls_multipath (RTM_NEWROUTE, lsp); -  if (!ret) -    SET_FLAG (lsp->flags, LSP_FLAG_INSTALLED); -  else -    clear_nhlfe_installed (lsp); - -  return ret; -} - -/* - * Update Label Forwarding entry in the kernel. This means that the Label - * forwarding entry is already installed and needs an update - either a new - * path is to be added, an installed path has changed (e.g., outgoing label) - * or an installed path (but not all paths) has to be removed. - * TODO: Performs a DEL followed by ADD now, need to change to REPLACE. Note - * that REPLACE was originally implemented for IPv4 nexthops but removed as - * it was not functioning when moving from swap to PHP as that was signaled - * through the metric field (before kernel-MPLS). This shouldn't be an issue - * any longer, so REPLACE can be reintroduced. - */ -int -kernel_upd_lsp (zebra_lsp_t *lsp) -{ -  int ret; - -  if (!lsp || !lsp->best_nhlfe) // unexpected -    return -1; - -  UNSET_FLAG (lsp->flags, LSP_FLAG_CHANGED); - -  /* First issue a DEL and clear the installed flag. */ -  netlink_mpls_multipath (RTM_DELROUTE, lsp); -  UNSET_FLAG (lsp->flags, LSP_FLAG_INSTALLED); - -  /* Then issue an ADD. */ -  ret = netlink_mpls_multipath (RTM_NEWROUTE, lsp); -  if (!ret) -    SET_FLAG (lsp->flags, LSP_FLAG_INSTALLED); -  else -    clear_nhlfe_installed (lsp); - -  return ret; -} - -/* - * Delete Label Forwarding entry from the kernel. - */ -int -kernel_del_lsp (zebra_lsp_t *lsp) -{ -  if (!lsp) // unexpected -    return -1; - -  if (CHECK_FLAG (lsp->flags, LSP_FLAG_INSTALLED)) -    { -      netlink_mpls_multipath (RTM_DELROUTE, lsp); -      UNSET_FLAG (lsp->flags, LSP_FLAG_INSTALLED); -    } - -  return 0; -} -  extern struct thread_master *master;  /* Kernel route reflection. */  | 
