From 1109f49dfe39d8723b2379a5f1686b4cece6b7f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
Date: Fri, 3 Jun 2016 12:23:15 +0200
Subject: [PATCH 02/25] IFP: new header file that contains interface
 definitions

To be shared across tools and libs.
---
 Makefile.am                        |  1 +
 src/responder/ifp/ifp_components.h |  5 +----
 src/responder/ifp/ifp_domains.h    |  5 +----
 src/responder/ifp/ifp_groups.h     |  5 +----
 src/responder/ifp/ifp_iface.h      | 40 ++++++++++++++++++++++++++++++++++++++
 src/responder/ifp/ifp_private.h    |  4 +---
 src/responder/ifp/ifp_users.h      |  5 +----
 7 files changed, 46 insertions(+), 19 deletions(-)
 create mode 100644 src/responder/ifp/ifp_iface.h

diff --git a/Makefile.am b/Makefile.am
index 648e58c885d6ddf56ba7d7cffd55c7a2c52f814e..1e97803f0a415d1cbfd3126d97e6a3d1d1ac6d2a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -605,6 +605,7 @@ dist_noinst_HEADERS = \
     src/responder/autofs/autofs_private.h \
     src/responder/ssh/sshsrv_private.h \
     src/responder/ifp/ifp_iface_generated.h \
+    src/responder/ifp/ifp_iface.h \
     src/responder/ifp/ifp_private.h \
     src/responder/ifp/ifp_domains.h \
     src/responder/ifp/ifp_components.h \
diff --git a/src/responder/ifp/ifp_components.h b/src/responder/ifp/ifp_components.h
index e7734252900f2d7f1f6e573ad573c2ffaa36c60f..7ccac7fa50c72d12dc92b4ba6782141afa38aa33 100644
--- a/src/responder/ifp/ifp_components.h
+++ b/src/responder/ifp/ifp_components.h
@@ -21,12 +21,9 @@
 #ifndef _IFP_COMPONENTS_H_
 #define _IFP_COMPONENTS_H_
 
-#include "responder/ifp/ifp_iface_generated.h"
+#include "responder/ifp/ifp_iface.h"
 #include "responder/ifp/ifp_private.h"
 
-#define IFP_PATH_COMPONENTS IFP_PATH "/Components"
-#define IFP_PATH_COMPONENTS_TREE IFP_PATH_COMPONENTS SBUS_SUBTREE_SUFFIX
-
 /* org.freedesktop.sssd.infopipe */
 
 int ifp_list_components(struct sbus_request *dbus_req, void *data);
diff --git a/src/responder/ifp/ifp_domains.h b/src/responder/ifp/ifp_domains.h
index 216740f13bb0c302d8189e57ed8a0598a4f91063..966851b3b9a6a8f365b1010cfdee779322f04615 100644
--- a/src/responder/ifp/ifp_domains.h
+++ b/src/responder/ifp/ifp_domains.h
@@ -22,12 +22,9 @@
 #ifndef IFP_DOMAINS_H_
 #define IFP_DOMAINS_H_
 
-#include "responder/ifp/ifp_iface_generated.h"
+#include "responder/ifp/ifp_iface.h"
 #include "responder/ifp/ifp_private.h"
 
-#define IFP_PATH_DOMAINS IFP_PATH "/Domains"
-#define IFP_PATH_DOMAINS_TREE IFP_PATH_DOMAINS SBUS_SUBTREE_SUFFIX
-
 /* org.freedesktop.sssd.infopipe */
 
 int ifp_list_domains(struct sbus_request *dbus_req,
diff --git a/src/responder/ifp/ifp_groups.h b/src/responder/ifp/ifp_groups.h
index 09c5a1c88d7f8df3c6917e62ba3e7224b990edfc..4cfabb9d70df92cda02de02cd1dcf7cc5b071ba8 100644
--- a/src/responder/ifp/ifp_groups.h
+++ b/src/responder/ifp/ifp_groups.h
@@ -21,12 +21,9 @@
 #ifndef IFP_GROUPS_H_
 #define IFP_GROUPS_H_
 
-#include "responder/ifp/ifp_iface_generated.h"
+#include "responder/ifp/ifp_iface.h"
 #include "responder/ifp/ifp_private.h"
 
-#define IFP_PATH_GROUPS "/org/freedesktop/sssd/infopipe/Groups"
-#define IFP_PATH_GROUPS_TREE IFP_PATH_GROUPS SBUS_SUBTREE_SUFFIX
-
 /* Utility functions */
 
 char * ifp_groups_build_path_from_msg(TALLOC_CTX *mem_ctx,
diff --git a/src/responder/ifp/ifp_iface.h b/src/responder/ifp/ifp_iface.h
new file mode 100644
index 0000000000000000000000000000000000000000..06b3795440a5ce153ce1b262c8d73a15eb4268d0
--- /dev/null
+++ b/src/responder/ifp/ifp_iface.h
@@ -0,0 +1,40 @@
+/*
+    Authors:
+        Pavel Březina <pbrezina@redhat.com>
+
+    Copyright (C) 2016 Red Hat
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _IFP_IFACE_H_
+#define _IFP_IFACE_H_
+
+#include "responder/ifp/ifp_iface_generated.h"
+
+#define IFP_PATH "/org/freedesktop/sssd/infopipe"
+
+#define IFP_PATH_DOMAINS IFP_PATH "/Domains"
+#define IFP_PATH_DOMAINS_TREE IFP_PATH_DOMAINS SBUS_SUBTREE_SUFFIX
+
+#define IFP_PATH_COMPONENTS IFP_PATH "/Components"
+#define IFP_PATH_COMPONENTS_TREE IFP_PATH_COMPONENTS SBUS_SUBTREE_SUFFIX
+
+#define IFP_PATH_GROUPS IFP_PATH "/Groups"
+#define IFP_PATH_GROUPS_TREE IFP_PATH_GROUPS SBUS_SUBTREE_SUFFIX
+
+#define IFP_PATH_USERS IFP_PATH "/Users"
+#define IFP_PATH_USERS_TREE IFP_PATH_USERS SBUS_SUBTREE_SUFFIX
+
+#endif /* _IFP_IFACE_H_ */
diff --git a/src/responder/ifp/ifp_private.h b/src/responder/ifp/ifp_private.h
index 24e60df48f6525348cecee7f31bc69751b287108..17e3703b4a842766f9069280c310278932c6d4b0 100644
--- a/src/responder/ifp/ifp_private.h
+++ b/src/responder/ifp/ifp_private.h
@@ -27,9 +27,7 @@
 #include "responder/common/responder.h"
 #include "responder/common/negcache.h"
 #include "providers/data_provider.h"
-#include "responder/ifp/ifp_iface_generated.h"
-
-#define IFP_PATH "/org/freedesktop/sssd/infopipe"
+#include "responder/ifp/ifp_iface.h"
 
 struct sysbus_ctx {
     struct sbus_connection *conn;
diff --git a/src/responder/ifp/ifp_users.h b/src/responder/ifp/ifp_users.h
index 471c3fb019c7cd0858b2928969b045091f370446..99114fe9562f237204b3121ae3fe1f29dbc256a8 100644
--- a/src/responder/ifp/ifp_users.h
+++ b/src/responder/ifp/ifp_users.h
@@ -21,12 +21,9 @@
 #ifndef IFP_USERS_H_
 #define IFP_USERS_H_
 
-#include "responder/ifp/ifp_iface_generated.h"
+#include "responder/ifp/ifp_iface.h"
 #include "responder/ifp/ifp_private.h"
 
-#define IFP_PATH_USERS "/org/freedesktop/sssd/infopipe/Users"
-#define IFP_PATH_USERS_TREE IFP_PATH_USERS SBUS_SUBTREE_SUFFIX
-
 /* Utility functions */
 
 char * ifp_users_build_path_from_msg(TALLOC_CTX *mem_ctx,
-- 
2.1.0

