]>
git.proxmox.com Git - mirror_frr.git/blob - mgmtd/mgmt.c
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * FRR Management Daemon (MGMTD) program
5 * Copyright (C) 2021 Vmware, Inc.
10 #include "mgmtd/mgmt.h"
11 #include "mgmtd/mgmt_be_server.h"
12 #include "mgmtd/mgmt_be_adapter.h"
13 #include "mgmtd/mgmt_fe_server.h"
14 #include "mgmtd/mgmt_fe_adapter.h"
15 #include "mgmtd/mgmt_ds.h"
16 #include "mgmtd/mgmt_history.h"
17 #include "mgmtd/mgmt_memory.h"
24 /* MGMTD process wide configuration. */
25 static struct mgmt_master mgmt_master
;
27 /* MGMTD process wide configuration pointer to export. */
28 struct mgmt_master
*mm
;
30 void mgmt_master_init(struct thread_master
*master
, const int buffer_size
)
32 memset(&mgmt_master
, 0, sizeof(struct mgmt_master
));
36 mm
->terminating
= false;
37 mm
->socket_buffer
= buffer_size
;
38 mm
->perf_stats_en
= true;
45 * Allocates some vital data structures used by peer commands in
50 /* Initialize datastores */
53 /* Initialize history */
56 /* Initialize MGMTD Transaction module */
57 mgmt_txn_init(mm
, mm
->master
);
59 /* Initialize the MGMTD Backend Adapter Module */
60 mgmt_be_adapter_init(mm
->master
);
62 /* Initialize the MGMTD Frontend Adapter Module */
63 mgmt_fe_adapter_init(mm
->master
, mm
);
65 /* Start the MGMTD Backend Server for clients to connect */
66 mgmt_be_server_init(mm
->master
);
68 /* Start the MGMTD Frontend Server for clients to connect */
69 mgmt_fe_server_init(mm
->master
);
71 /* MGMTD VTY commands installation. */
75 void mgmt_terminate(void)
77 mgmt_fe_server_destroy();
78 mgmt_fe_adapter_destroy();
79 mgmt_be_server_destroy();
80 mgmt_be_adapter_destroy();
82 mgmt_history_destroy();