- const char *api; /* api name for the binding */
- const char *specification; /* textual openAPIv3 specification of the binding */
- const struct afb_verb_v2 *verbs; /* array of descriptions of verbs terminated by a NULL name */
+ const char *api; /* api name for the binding */
+ const char *specification; /* textual openAPIv3 specification of the binding */
+ const char *info; /* some info about the api, can be NULL */
+ const struct afb_verb_v2 *verbs; /* array of descriptions of verbs terminated by a NULL name */
int (*preinit)(); /* callback at load of the binding */
int (*init)(); /* callback for starting the service */
void (*onevent)(const char *event, struct json_object *object); /* callback for handling events */
int (*preinit)(); /* callback at load of the binding */
int (*init)(); /* callback for starting the service */
void (*onevent)(const char *event, struct json_object *object); /* callback for handling events */
{
const char *verb; /* name of the verb */
void (*callback)(struct afb_req req); /* callback function implementing the verb */
{
const char *verb; /* name of the verb */
void (*callback)(struct afb_req req); /* callback function implementing the verb */
- - AFB_SESSION_NONE : no flag, synonym to 0
- - AFB_SESSION_LOA_0 : Requires the LOA to be 0 or more, synonym to 0 or AFB_SESSION_NONE
- - AFB_SESSION_LOA_1 : Requires the LOA to be 1 or more
- - AFB_SESSION_LOA_2 : Requires the LOA to be 2 or more
- - AFB_SESSION_LOA_3 : Requires the LOA to be 3 or more
- - AFB_SESSION_CHECK : Requires the token to be set and valid
- - AFB_SESSION_REFRESH : Implies a token refresh
- - AFB_SESSION_CLOSE : Implies cloing the session
+- AFB_SESSION_NONE : no flag, synonym to 0
+- AFB_SESSION_LOA_0 : Requires the LOA to be 0 or more, synonym to 0 or AFB_SESSION_NONE
+- AFB_SESSION_LOA_1 : Requires the LOA to be 1 or more
+- AFB_SESSION_LOA_2 : Requires the LOA to be 2 or more
+- AFB_SESSION_LOA_3 : Requires the LOA to be 3 or more
+- AFB_SESSION_CHECK : Requires the token to be set and valid
+- AFB_SESSION_REFRESH : Implies a token refresh
+- AFB_SESSION_CLOSE : Implies cloing the session
### struct afb_auth and enum afb_auth_type
The structure **afb_auth** is used within verb description to
### struct afb_auth and enum afb_auth_type
The structure **afb_auth** is used within verb description to
-set security requirements. The interpretation of the structure
-depends on the value of the field **type**.
+set security requirements.
+The interpretation of the structure depends on the value of the field **type**.
- afb_auth_No = 0, /** never authorized, no data */
- afb_auth_Token, /** authorized if token valid, no data */
- afb_auth_LOA, /** authorized if LOA greater than data 'loa' */
- afb_auth_Permission, /** authorized if permission 'text' is granted */
- afb_auth_Or, /** authorized if 'first' or 'next' is authorized */
- afb_auth_And, /** authorized if 'first' and 'next' are authorized */
- afb_auth_Not, /** authorized if 'first' is not authorized */
- afb_auth_Yes /** always authorized, no data */
+ afb_auth_No = 0, /** never authorized, no data */
+ afb_auth_Token, /** authorized if token valid, no data */
+ afb_auth_LOA, /** authorized if LOA greater than data 'loa' */
+ afb_auth_Permission, /** authorized if permission 'text' is granted */
+ afb_auth_Or, /** authorized if 'first' or 'next' is authorized */
+ afb_auth_And, /** authorized if 'first' and 'next' are authorized */
+ afb_auth_Not, /** authorized if 'first' is not authorized */
+ afb_auth_Yes /** always authorized, no data */
- { .type = afb_auth_Permission, .text = "urn:AGL:permission:monitor:public:set" },
- { .type = afb_auth_Permission, .text = "urn:AGL:permission:monitor:public:get" },
- { .type = afb_auth_Or, .first = &_afb_auths_v2_monitor[1], .next = &_afb_auths_v2_monitor[0] }
+ { .type = afb_auth_Permission, .text = "urn:AGL:permission:monitor:public:set" },
+ { .type = afb_auth_Permission, .text = "urn:AGL:permission:monitor:public:get" },
+ { .type = afb_auth_Or, .first = &_afb_auths_v2_monitor[1], .next = &_afb_auths_v2_monitor[0] }
-not be used. Instead, you should use the macros
-**AFB\_ERROR**, **AFB\_WARNING**, **AFB\_NOTICE**,
-**AFB\_INFO**, **AFB\_DEBUG**
+not be used.
+Instead, you should use the macros:
+
+- **AFB\_ERROR**
+- **AFB\_WARNING**
+- **AFB\_NOTICE**
+- **AFB\_INFO**
+- **AFB\_DEBUG**
*
* The 'callback' receives 3 arguments:
* 1. 'closure' the user defined closure pointer 'callback_closure',
*
* The 'callback' receives 3 arguments:
* 1. 'closure' the user defined closure pointer 'callback_closure',
- const char *api,
- const char *verb,
- struct json_object *args,
- void (*callback)(void*closure, int iserror, struct json_object *result),
- void *callback_closure);
+ const char *api,
+ const char *verb,
+ struct json_object *args,
+ void (*callback)(void*closure, int status, struct json_object *result),
+ void *callback_closure);
* @param args The arguments to pass to the method
* @param result Where to store the result - should call json_object_put on it -
*
* @param args The arguments to pass to the method
* @param result Where to store the result - should call json_object_put on it -
*
- const char *api,
- const char *verb,
- struct json_object *args,
- struct json_object **result);
+ const char *api,
+ const char *verb,
+ struct json_object *args,
+ struct json_object **result);
* This call is made in the context of the request 'req'.
* On completion, the function 'callback' is invoked with the
* 'closure' given at call and two other parameters: 'iserror' and 'result'.
* This call is made in the context of the request 'req'.
* On completion, the function 'callback' is invoked with the
* 'closure' given at call and two other parameters: 'iserror' and 'result'.
- void (*callback)(void *closure, int iserror, struct json_object *result),
+ void (*callback)(void *closure, int status, struct json_object *result),
void *closure);
/*
* Makes a call to the method of name 'api' / 'verb' with the object 'args'.
* This call is made in the context of the request 'req'.
* This call is synchronous, it waits untill completion of the request.
void *closure);
/*
* Makes a call to the method of name 'api' / 'verb' with the object 'args'.
* This call is made in the context of the request 'req'.
* This call is synchronous, it waits untill completion of the request.
* The object pointed by 'result' is filled and must be released by the caller
* after its use by calling 'json_object_put'.
*
* The object pointed by 'result' is filled and must be released by the caller
* after its use by calling 'json_object_put'.
*
-not be used. Instead, you should use the macros
-**AFB_REQ_ERROR**, **AFB_REQ_WARNING**, **AFB_REQ_NOTICE**,
-**AFB_REQ_INFO**, **AFB_REQ_DEBUG**
+not be used.
+Instead, you should use the macros:
+
+- **AFB_REQ_ERROR**
+- **AFB_REQ_WARNING**
+- **AFB_REQ_NOTICE**
+- **AFB_REQ_INFO**
+- **AFB_REQ_DEBUG**
void afb_req_verbose(struct afb_req req, int level, const char *file, int line, const char * func, const char *fmt, ...);
```
void afb_req_verbose(struct afb_req req, int level, const char *file, int line, const char * func, const char *fmt, ...);
```