]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib, mgmtd: move common header to lib
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 16 Nov 2023 19:31:52 +0000 (20:31 +0100)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 17 Nov 2023 10:27:03 +0000 (11:27 +0100)
The common header included from lib and other daemons should be located
in lib, not in mgmt directory.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
12 files changed:
lib/mgmt_be_client.h
lib/mgmt_defines.h [new file with mode: 0644]
lib/mgmt_fe_client.h
lib/subdir.am
mgmtd/mgmt.h
mgmtd/mgmt_be_adapter.h
mgmtd/mgmt_defines.h [deleted file]
mgmtd/mgmt_ds.h
mgmtd/mgmt_fe_adapter.h
mgmtd/mgmt_txn.h
mgmtd/subdir.am
redhat/frr.spec.in

index 051c908a378a470dd02a6e284f8e91fa31e1386e..3af87a73cd9209b8daddaad5a3a1d3c3c974ff4c 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 #include "northbound.h"
 #include "mgmt_pb.h"
-#include "mgmtd/mgmt_defines.h"
+#include "mgmt_defines.h"
 
 /***************************************************************
  * Constants
diff --git a/lib/mgmt_defines.h b/lib/mgmt_defines.h
new file mode 100644 (file)
index 0000000..3b7f8f1
--- /dev/null
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * MGMTD public defines.
+ *
+ * Copyright (C) 2021  Vmware, Inc.
+ *                    Pushpasis Sarkar <spushpasis@vmware.com>
+ */
+
+#ifndef _FRR_MGMTD_DEFINES_H
+#define _FRR_MGMTD_DEFINES_H
+
+#include "yang.h"
+
+#define MGMTD_CLIENT_NAME_MAX_LEN 32
+
+#define MGMTD_MAX_XPATH_LEN XPATH_MAXLEN
+
+#define MGMTD_MAX_YANG_VALUE_LEN YANG_VALUE_MAXLEN
+
+#define MGMTD_MAX_NUM_XPATH_REG 128
+
+#define MGMTD_MAX_NUM_DATA_REQ_IN_BATCH 32
+#define MGMTD_MAX_NUM_DATA_REPLY_IN_BATCH 8
+
+enum mgmt_result {
+       MGMTD_SUCCESS = 0,
+       MGMTD_INVALID_PARAM,
+       MGMTD_INTERNAL_ERROR,
+       MGMTD_NO_CFG_CHANGES,
+       MGMTD_DS_LOCK_FAILED,
+       MGMTD_DS_UNLOCK_FAILED,
+       MGMTD_UNKNOWN_FAILURE
+};
+
+#endif /* _FRR_MGMTD_DEFINES_H */
index 349b7e4cf4154ebba9451c298f06894e3474b39e..d770748f239fc6b0c93c8be17beca7745039e127 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 
 #include "mgmt_pb.h"
 #include "frrevent.h"
-#include "mgmtd/mgmt_defines.h"
+#include "mgmt_defines.h"
 
 /***************************************************************
  * Macros
index 0c718d12aa5e72d6c5c09a3754ddd5155da2fbcd..c4ddb87c1f423115437c9bf1abafa9810e38e206 100644 (file)
@@ -253,6 +253,7 @@ pkginclude_HEADERS += \
        lib/memory.h \
        lib/mgmt.pb-c.h \
        lib/mgmt_be_client.h \
+       lib/mgmt_defines.h \
        lib/mgmt_fe_client.h \
        lib/mgmt_msg.h \
        lib/mgmt_pb.h \
index d89d76f5d55161c32da75fbf79b92eac6cf7813c..019465980d3c75f36e90d58e7f693b27d26a2f9b 100644 (file)
@@ -13,9 +13,9 @@
 #include "vrf.h"
 #include "defaults.h"
 #include "stream.h"
+#include "mgmt_defines.h"
 
 #include "mgmtd/mgmt_memory.h"
-#include "mgmtd/mgmt_defines.h"
 #include "mgmtd/mgmt_history.h"
 #include "mgmtd/mgmt_txn.h"
 #include "mgmtd/mgmt_ds.h"
index c4ec06093d97cdbeecae07a391f38e12ec169888..c7041a794029a1cba564cef0cd7bec672543f13c 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "mgmt_be_client.h"
 #include "mgmt_msg.h"
-#include "mgmtd/mgmt_defines.h"
+#include "mgmt_defines.h"
 #include "mgmtd/mgmt_ds.h"
 
 #define MGMTD_BE_CONN_INIT_DELAY_MSEC 50
diff --git a/mgmtd/mgmt_defines.h b/mgmtd/mgmt_defines.h
deleted file mode 100644 (file)
index 40fa670..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * MGMTD public defines.
- *
- * Copyright (C) 2021  Vmware, Inc.
- *                    Pushpasis Sarkar <spushpasis@vmware.com>
- */
-
-#ifndef _FRR_MGMTD_DEFINES_H
-#define _FRR_MGMTD_DEFINES_H
-
-#include "yang.h"
-
-#define MGMTD_CLIENT_NAME_MAX_LEN 32
-
-#define MGMTD_MAX_XPATH_LEN XPATH_MAXLEN
-
-#define MGMTD_MAX_YANG_VALUE_LEN YANG_VALUE_MAXLEN
-
-#define MGMTD_MAX_NUM_XPATH_REG 128
-
-#define MGMTD_MAX_NUM_DATA_REQ_IN_BATCH 32
-#define MGMTD_MAX_NUM_DATA_REPLY_IN_BATCH 8
-
-enum mgmt_result {
-       MGMTD_SUCCESS = 0,
-       MGMTD_INVALID_PARAM,
-       MGMTD_INTERNAL_ERROR,
-       MGMTD_NO_CFG_CHANGES,
-       MGMTD_DS_LOCK_FAILED,
-       MGMTD_DS_UNLOCK_FAILED,
-       MGMTD_UNKNOWN_FAILURE
-};
-
-enum mgmt_fe_event {
-       MGMTD_FE_SERVER = 1,
-       MGMTD_FE_CONN_READ,
-       MGMTD_FE_CONN_WRITE,
-       MGMTD_FE_PROC_MSG
-};
-
-enum mgmt_be_event {
-       MGMTD_BE_SERVER = 1,
-       MGMTD_BE_CONN_INIT,
-       MGMTD_BE_CONN_READ,
-       MGMTD_BE_CONN_WRITE,
-       MGMTD_BE_PROC_MSG,
-       MGMTD_BE_SCHED_CFG_PREPARE,
-       MGMTD_BE_RESCHED_CFG_PREPARE,
-       MGMTD_BE_SCHED_CFG_APPLY,
-       MGMTD_BE_RESCHED_CFG_APPLY,
-};
-
-#define MGMTD_TXN_ID_NONE 0
-
-#define MGMTD_TXN_BATCH_ID_NONE 0
-
-#endif /* _FRR_MGMTD_DEFINES_H */
index 1cf4816027c3369909b360de8d0b12f497f15369..ca08e37dac638f5ac4484d2deccc267917a85657 100644 (file)
@@ -11,8 +11,8 @@
 
 #include "mgmt_fe_client.h"
 #include "northbound.h"
+#include "mgmt_defines.h"
 
-#include "mgmtd/mgmt_defines.h"
 #include "mgmtd/mgmt_be_adapter.h"
 #include "mgmtd/mgmt_fe_adapter.h"
 
index d2991ec1dbd0cc5df43e34f0681f07d0faa61c04..1560916c85b4cfcfe4451598053040e4fbe4b49b 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "mgmt_fe_client.h"
 #include "mgmt_msg.h"
-#include "mgmtd/mgmt_defines.h"
+#include "mgmt_defines.h"
 
 struct mgmt_fe_client_adapter;
 struct mgmt_master;
index 8ca7e70cab6d89d1793b8d240cd27ac17203a461..982ab7c33349ee88fafaea712bb1c0f4f6b50d92 100644 (file)
@@ -26,6 +26,8 @@
 #define MGMTD_TXN_CLEANUP_DELAY_MSEC 100
 #define MGMTD_TXN_CLEANUP_DELAY_USEC 10
 
+#define MGMTD_TXN_ID_NONE 0
+
 /*
  * The following definition enables local validation of config
  * on the MGMTD process by loading client-defined NB callbacks
index 67b45d5bd9bb334eb0966b8c1618d694a5a33747..89a6596f49f2b12b44b6d663216ba745a2203576 100644 (file)
@@ -33,11 +33,6 @@ mgmtd_libmgmtd_a_SOURCES = \
        mgmtd/mgmt_vty.c \
        # end
 
-mgmtdheaderdir = $(pkgincludedir)/mgmtd
-mgmtdheader_HEADERS = \
-       mgmtd/mgmt_defines.h \
-       # end
-
 noinst_HEADERS += \
        mgmtd/mgmt.h \
        mgmtd/mgmt_be_adapter.h \
index 9351283b10b83ad1c1c2f430deddffe919107a22..63fde7dd6ade6518d638afcfef3eedae7464a866 100644 (file)
@@ -779,8 +779,6 @@ sed -i 's/ -M rpki//' %{_sysconfdir}/frr/daemons
 %{_libdir}/lib*.so
 %dir %{_includedir}/%{name}
 %{_includedir}/%{name}/*.h
-%dir %{_includedir}/%{name}/mgmtd
-%{_includedir}/%{name}/mgmtd/*.h
 %dir %{_includedir}/%{name}/ospfd
 %{_includedir}/%{name}/ospfd/*.h
 %if %{with_bfdd}