Skip to content

Commit 2a1c520

Browse files
committed
isisd: split northbound callbacks into multiple files
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]>
1 parent 37cdb6e commit 2a1c520

17 files changed

+4503
-4108
lines changed

isisd/isis_adjacency.c

+15
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include "isisd/isis_mt.h"
4949
#include "isisd/isis_tlvs.h"
5050
#include "isisd/fabricd.h"
51+
#include "isisd/isis_nb.h"
5152

5253
extern struct isis *isis;
5354

@@ -375,6 +376,20 @@ void isis_adj_print(struct isis_adjacency *adj)
375376
return;
376377
}
377378

379+
const char *isis_adj_yang_state(enum isis_adj_state state)
380+
{
381+
switch (state) {
382+
case ISIS_ADJ_DOWN:
383+
return "down";
384+
case ISIS_ADJ_UP:
385+
return "up";
386+
case ISIS_ADJ_INITIALIZING:
387+
return "init";
388+
default:
389+
return "failed";
390+
}
391+
}
392+
378393
int isis_adj_expire(struct thread *thread)
379394
{
380395
struct isis_adjacency *adj;

isisd/isis_adjacency.h

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ DECLARE_HOOK(isis_adj_state_change_hook, (struct isis_adjacency *adj), (adj))
121121
void isis_adj_state_change(struct isis_adjacency *adj,
122122
enum isis_adj_state state, const char *reason);
123123
void isis_adj_print(struct isis_adjacency *adj);
124+
const char *isis_adj_yang_state(enum isis_adj_state state);
124125
int isis_adj_expire(struct thread *thread);
125126
void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
126127
char detail);

isisd/isis_circuit.c

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#include "isisd/isis_mt.h"
5959
#include "isisd/isis_errors.h"
6060
#include "isisd/isis_tx_queue.h"
61+
#include "isisd/isis_nb.h"
6162

6263
DEFINE_QOBJ_TYPE(isis_circuit)
6364

isisd/isis_cli.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "yang.h"
3333
#include "lib/linklist.h"
3434
#include "isisd/isisd.h"
35-
#include "isisd/isis_cli.h"
35+
#include "isisd/isis_nb.h"
3636
#include "isisd/isis_misc.h"
3737
#include "isisd/isis_circuit.h"
3838
#include "isisd/isis_csm.h"

isisd/isis_cli.h

-127
This file was deleted.

isisd/isis_lsp.c

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#include "isisd/isis_te.h"
5858
#include "isisd/fabricd.h"
5959
#include "isisd/isis_tx_queue.h"
60+
#include "isisd/isis_nb.h"
6061

6162
static int lsp_refresh(struct thread *thread);
6263
static int lsp_l1_refresh_pseudo(struct thread *thread);

isisd/isis_main.c

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#include "isisd/isis_lsp.h"
5858
#include "isisd/isis_mt.h"
5959
#include "isisd/fabricd.h"
60+
#include "isisd/isis_nb.h"
6061

6162
/* Default configuration file name */
6263
#define ISISD_DEFAULT_CONFIG "isisd.conf"

0 commit comments

Comments
 (0)