afs-supervisor: Improve name of supervisor api
authorJosé Bollo <jose.bollo@iot.bzh>
Tue, 13 Feb 2018 11:18:49 +0000 (12:18 +0100)
committerJosé Bollo <jose.bollo@iot.bzh>
Tue, 13 Feb 2018 11:18:49 +0000 (12:18 +0100)
Change-Id: Id0b43cecb91fa0a405c07f63d4f8c2f026c8a70c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afb-supervision.c
src/afs-supervision.h
src/afs-supervisor.c

index 6812e00..ecdcbf2 100644 (file)
@@ -49,7 +49,7 @@
 extern struct afb_config *main_config;
 
 /* api and apiset name */
-static const char supervision_apiname[] = AFS_SURPERVISION_APINAME;
+static const char supervision_apiname[] = AFS_SURPERVISION_APINAME_INTERNAL;
 
 /* path of the supervision socket */
 static const char supervisor_socket_path[] = AFS_SURPERVISION_SOCKET;
index d33b04d..6fc2023 100644 (file)
@@ -45,4 +45,4 @@ struct afs_supervision_initiator
        char extra[27];         /**< zero terminated extra computed here to be 64-37 */
 };
 
-#define AFS_SURPERVISION_APINAME "$"
+#define AFS_SURPERVISION_APINAME_INTERNAL "$"
index 32bd995..8d76832 100644 (file)
@@ -63,7 +63,8 @@ struct supervised
 };
 
 /* api and apiset name */
-static const char supervision_apiname[] = AFS_SURPERVISION_APINAME;
+static const char supervision_apiname[] = AFS_SURPERVISION_APINAME_INTERNAL;
+static const char supervisor_apiname[] = "supervisor";
 
 /* the main apiset */
 struct afb_apiset *main_apiset;
@@ -269,14 +270,14 @@ static int init(const char *spec)
        /* TODO check that value */
 
        /* create the apisets */
-       main_apiset = afb_apiset_create(supervision_apiname, 0);
+       main_apiset = afb_apiset_create(supervisor_apiname, 0);
        if (!main_apiset) {
-               ERROR("Can't create supervision's apiset");
+               ERROR("Can't create supervisor's apiset");
                return -1;
        }
        empty_apiset = afb_apiset_create(supervision_apiname, 0);
        if (!empty_apiset) {
-               ERROR("Can't create supervised apiset");
+               ERROR("Can't create supervision apiset");
                return -1;
        }
 
@@ -525,7 +526,7 @@ static const struct afb_verb_v2 _afb_verbs_v2_supervision[] = {
 };
 
 static const struct afb_binding_v2 _afb_binding_v2_supervision = {
-    .api = supervision_apiname,
+    .api = supervisor_apiname,
     .specification = NULL,
     .info = NULL,
     .verbs = _afb_verbs_v2_supervision,