Skip to content

Commit

Permalink
isisd: split northbound callbacks into multiple files
Browse files Browse the repository at this point in the history
Rearrange the isisd northbound callbacks as following:
* isis_nb.h: prototypes of all northbound callbacks.
* isis_nb.c: definition of all northbound callbacks and their
  associated YANG data paths.
* isis_nb_config.c: implementation of YANG configuration nodes.
* isis_nb_state.c: implementation of YANG state nodes.
* isis_nb_notifications.c: implementation of YANG notifications.

This should help to keep to code more organized and easier to
maintain.

No behavior changes intended.

Signed-off-by: Renato Westphal <[email protected]>
  • Loading branch information
rwestphal committed Oct 30, 2019
1 parent 37cdb6e commit 2a1c520
Show file tree
Hide file tree
Showing 17 changed files with 4,503 additions and 4,108 deletions.
15 changes: 15 additions & 0 deletions isisd/isis_adjacency.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "isisd/isis_mt.h"
#include "isisd/isis_tlvs.h"
#include "isisd/fabricd.h"
#include "isisd/isis_nb.h"

extern struct isis *isis;

Expand Down Expand Up @@ -375,6 +376,20 @@ void isis_adj_print(struct isis_adjacency *adj)
return;
}

const char *isis_adj_yang_state(enum isis_adj_state state)
{
switch (state) {
case ISIS_ADJ_DOWN:
return "down";
case ISIS_ADJ_UP:
return "up";
case ISIS_ADJ_INITIALIZING:
return "init";
default:
return "failed";
}
}

int isis_adj_expire(struct thread *thread)
{
struct isis_adjacency *adj;
Expand Down
1 change: 1 addition & 0 deletions isisd/isis_adjacency.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ DECLARE_HOOK(isis_adj_state_change_hook, (struct isis_adjacency *adj), (adj))
void isis_adj_state_change(struct isis_adjacency *adj,
enum isis_adj_state state, const char *reason);
void isis_adj_print(struct isis_adjacency *adj);
const char *isis_adj_yang_state(enum isis_adj_state state);
int isis_adj_expire(struct thread *thread);
void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
char detail);
Expand Down
1 change: 1 addition & 0 deletions isisd/isis_circuit.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include "isisd/isis_mt.h"
#include "isisd/isis_errors.h"
#include "isisd/isis_tx_queue.h"
#include "isisd/isis_nb.h"

DEFINE_QOBJ_TYPE(isis_circuit)

Expand Down
2 changes: 1 addition & 1 deletion isisd/isis_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "yang.h"
#include "lib/linklist.h"
#include "isisd/isisd.h"
#include "isisd/isis_cli.h"
#include "isisd/isis_nb.h"
#include "isisd/isis_misc.h"
#include "isisd/isis_circuit.h"
#include "isisd/isis_csm.h"
Expand Down
127 changes: 0 additions & 127 deletions isisd/isis_cli.h

This file was deleted.

1 change: 1 addition & 0 deletions isisd/isis_lsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "isisd/isis_te.h"
#include "isisd/fabricd.h"
#include "isisd/isis_tx_queue.h"
#include "isisd/isis_nb.h"

static int lsp_refresh(struct thread *thread);
static int lsp_l1_refresh_pseudo(struct thread *thread);
Expand Down
1 change: 1 addition & 0 deletions isisd/isis_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "isisd/isis_lsp.h"
#include "isisd/isis_mt.h"
#include "isisd/fabricd.h"
#include "isisd/isis_nb.h"

/* Default configuration file name */
#define ISISD_DEFAULT_CONFIG "isisd.conf"
Expand Down
Loading

0 comments on commit 2a1c520

Please sign in to comment.