X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=include%2Fafb%2Fafb-plugin.h;h=cad55fbe85d19180ffb6b88e83edc8081b5fe4cc;hb=18439204034fca982b3b65c2d581f80a9ee62f56;hp=6f5cd08c67c3b30486c79494a81659c6e9e87868;hpb=be4e0e2d3855ccbd3b683bfe6cc4c7f9d3254314;p=src%2Fapp-framework-binder.git diff --git a/include/afb/afb-plugin.h b/include/afb/afb-plugin.h index 6f5cd08c..cad55fbe 100644 --- a/include/afb/afb-plugin.h +++ b/include/afb/afb-plugin.h @@ -51,16 +51,16 @@ enum AFB_plugin_version }; /* - * Enum for Session/Token/Authentication middleware. + * Enum for Session/Token/Assurance middleware. * This enumeration is valid for plugins of type 1 */ enum AFB_session_v1 { AFB_SESSION_NONE = 0, /* no session and no authentification required */ - AFB_SESSION_CREATE = 1, /* requires authentification and first call of the session */ + AFB_SESSION_CREATE = 1, /* obsolete */ AFB_SESSION_CLOSE = 2, /* closes the session after authentification */ AFB_SESSION_RENEW = 4, /* refreshes the token after authentification */ - AFB_SESSION_CHECK = 8, /* enforce authentification */ + AFB_SESSION_CHECK = 8, /* Requires token authentification */ AFB_SESSION_LOA_GE = 16, /* check that the LOA is greater or equal to the given value */ AFB_SESSION_LOA_LE = 32, /* check that the LOA is lesser or equal to the given value */ @@ -213,6 +213,7 @@ static inline struct sd_bus *afb_daemon_get_system_bus(struct afb_daemon daemon) * 'file' and 'line' are indicators of position of the code in source files. * 'daemon' MUST be the daemon given in interface when activating the plugin. */ +static inline void afb_daemon_verbose(struct afb_daemon daemon, int level, const char *file, int line, const char *fmt, ...) __attribute__((format(printf, 5, 6))); static inline void afb_daemon_verbose(struct afb_daemon daemon, int level, const char *file, int line, const char *fmt, ...) { va_list args; @@ -222,9 +223,18 @@ static inline void afb_daemon_verbose(struct afb_daemon daemon, int level, const } #if !defined(NO_PLUGIN_VERBOSE_MACRO) -# define ERROR(itf,...) do{if(itf->verbosity>=0)afb_daemon_verbose(itf->daemon,3,__FILE__,__LINE__,__VA_ARGS__);}while(0) -# define WARNING(itf,...) do{if(itf->verbosity>=1)afb_daemon_verbose(itf->daemon,4,__FILE__,__LINE__,__VA_ARGS__);}while(0) -# define NOTICE(itf,...) do{if(itf->verbosity>=1)afb_daemon_verbose(itf->daemon,5,__FILE__,__LINE__,__VA_ARGS__);}while(0) -# define INFO(itf,...) do{if(itf->verbosity>=2)afb_daemon_verbose(itf->daemon,6,__FILE__,__LINE__,__VA_ARGS__);}while(0) -# define DEBUG(itf,...) do{if(itf->verbosity>=3)afb_daemon_verbose(itf->daemon,7,__FILE__,__LINE__,__VA_ARGS__);}while(0) +# if !defined(NO_PLUGIN_FILE_LINE_INDICATION) +# define ERROR(itf,...) do{if(itf->verbosity>=0)afb_daemon_verbose(itf->daemon,3,__FILE__,__LINE__,__VA_ARGS__);}while(0) +# define WARNING(itf,...) do{if(itf->verbosity>=1)afb_daemon_verbose(itf->daemon,4,__FILE__,__LINE__,__VA_ARGS__);}while(0) +# define NOTICE(itf,...) do{if(itf->verbosity>=1)afb_daemon_verbose(itf->daemon,5,__FILE__,__LINE__,__VA_ARGS__);}while(0) +# define INFO(itf,...) do{if(itf->verbosity>=2)afb_daemon_verbose(itf->daemon,6,__FILE__,__LINE__,__VA_ARGS__);}while(0) +# define DEBUG(itf,...) do{if(itf->verbosity>=3)afb_daemon_verbose(itf->daemon,7,__FILE__,__LINE__,__VA_ARGS__);}while(0) +# else +# define ERROR(itf,...) do{if(itf->verbosity>=0)afb_daemon_verbose(itf->daemon,3,NULL,0,__VA_ARGS__);}while(0) +# define WARNING(itf,...) do{if(itf->verbosity>=1)afb_daemon_verbose(itf->daemon,4,NULL,0,__VA_ARGS__);}while(0) +# define NOTICE(itf,...) do{if(itf->verbosity>=1)afb_daemon_verbose(itf->daemon,5,NULL,0,__VA_ARGS__);}while(0) +# define INFO(itf,...) do{if(itf->verbosity>=2)afb_daemon_verbose(itf->daemon,6,NULL,0,__VA_ARGS__);}while(0) +# define DEBUG(itf,...) do{if(itf->verbosity>=3)afb_daemon_verbose(itf->daemon,7,NULL,0,__VA_ARGS__);}while(0) +# endif #endif +