]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
vradlog() -> fr_vlog(), radlog() -> fr_log()
authorAlan T. DeKok <aland@freeradius.org>
Tue, 17 Jan 2017 20:05:42 +0000 (15:05 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 17 Jan 2017 20:17:02 +0000 (15:17 -0500)
As they are now library functions, not server-side functions

13 files changed:
src/include/fr_log.h
src/include/log.h
src/lib/log.c
src/main/conffile.c
src/main/connection.c
src/main/listen.c
src/main/log.c
src/main/radmin.c
src/modules/rlm_krb5/rlm_krb5.c
src/modules/rlm_lua/aux.c
src/modules/rlm_perl/rlm_perl.c
src/modules/rlm_python/rlm_python.c
src/modules/rlm_ruby/rlm_ruby.c

index 3737739e69dd9b823b443ad157b0e7a361f78e83..aad0791000658c0e834bf116482fe84938ad33d6 100644 (file)
@@ -109,9 +109,9 @@ typedef struct fr_log_t {
 
 extern fr_log_t default_log;
 
-int    vradlog(fr_log_t const *log, log_type_t lvl, char const *fmt, va_list ap)
+int    fr_vlog(fr_log_t const *log, log_type_t lvl, char const *fmt, va_list ap)
        CC_HINT(format (printf, 3, 0)) CC_HINT(nonnull (1,3));
-int    radlog(fr_log_t const *log, log_type_t lvl, char const *fmt, ...)
+int    fr_log(fr_log_t const *log, log_type_t lvl, char const *fmt, ...)
        CC_HINT(format (printf, 3, 4)) CC_HINT(nonnull (1,3));
 
 #endif /* _FR_LOG_H */
index 985f218949a8bbfa45b911254664e26e77d42861..a899cf33bf1e18f5f13022903e786208470a3c43 100644 (file)
@@ -79,9 +79,9 @@ void  radlog_fatal(char const *fmt, ...) CC_HINT(format (printf, 1, 2)) CC_HINT(n
 #endif
 
 #ifdef LOG_PREFIX_ARGS
-#  define _RADLOG(_l, _f, ...) radlog(&default_log, _l, LOG_PREFIX _f, LOG_PREFIX_ARGS, ## __VA_ARGS__)
+#  define _RADLOG(_l, _f, ...) fr_log(&default_log, _l, LOG_PREFIX _f, LOG_PREFIX_ARGS, ## __VA_ARGS__)
 #else
-#  define _RADLOG(_l, _f, ...) radlog(&default_log, _l, LOG_PREFIX _f, ## __VA_ARGS__)
+#  define _RADLOG(_l, _f, ...) fr_log(&default_log, _l, LOG_PREFIX _f, ## __VA_ARGS__)
 #endif
 
 /** @name Log global messages
index 5cd57e32b4a055c09aa8db023ed478bc85e206ec..cfd81d6142f932de6d828a4e6b544618ec08d685 100644 (file)
@@ -469,7 +469,7 @@ fr_log_t default_log = {
  * @param msg  with printf style substitution tokens.
  * @param ap   Substitution arguments.
  */
-int vradlog(fr_log_t const *log, log_type_t type, char const *msg, va_list ap)
+int fr_vlog(fr_log_t const *log, log_type_t type, char const *msg, va_list ap)
 {
        uint8_t         *p;
        char            buffer[10240];  /* The largest config item size, then extra for prefixes and suffixes */
@@ -669,7 +669,7 @@ int vradlog(fr_log_t const *log, log_type_t type, char const *msg, va_list ap)
  * @param msg  with printf style substitution tokens.
  * @param ...  Substitution arguments.
  */
-int radlog(fr_log_t const *log, log_type_t type, char const *msg, ...)
+int fr_log(fr_log_t const *log, log_type_t type, char const *msg, ...)
 {
        va_list ap;
        int r = 0;
@@ -680,7 +680,7 @@ int radlog(fr_log_t const *log, log_type_t type, char const *msg, ...)
         *      Non-debug message, or debugging is enabled.  Log it.
         */
        if (((type & L_DBG) == 0) || (fr_debug_lvl > 0)) {
-               r = vradlog(log, type, msg, ap);
+               r = fr_vlog(log, type, msg, ap);
        }
        va_end(ap);
 
index b9ac04a57ebc19f3a5e211a3f4f8363bbfdaa0df..d99b2f721b50ca97f26f05e29a90787393e8a944 100644 (file)
@@ -4330,7 +4330,7 @@ void cf_log_warn(CONF_SECTION const *cs, char const *fmt, ...)
        va_list ap;
 
        va_start(ap, fmt);
-       if (cs) vradlog(&default_log, L_WARN, fmt, ap);
+       if (cs) fr_vlog(&default_log, L_WARN, fmt, ap);
        va_end(ap);
 }
 
@@ -4339,7 +4339,7 @@ void cf_log_info(CONF_SECTION const *cs, char const *fmt, ...)
        va_list ap;
 
        va_start(ap, fmt);
-       if ((rad_debug_lvl > 1) && cs) vradlog(&default_log, L_DBG, fmt, ap);
+       if ((rad_debug_lvl > 1) && cs) fr_vlog(&default_log, L_DBG, fmt, ap);
        va_end(ap);
 }
 
index d30cc91d3aa4f16f6c1fc3f6f511ebd989e7410a..6cccf0d08d341971d80521c499565f88368465b3 100644 (file)
@@ -970,7 +970,7 @@ fr_connection_pool_t *fr_connection_pool_init(TALLOC_CTX *ctx,
        pool = talloc_zero(NULL, fr_connection_pool_t);
        if (!pool) {
                /* Simply using ERROR here results in a null pointer dereference */
-               radlog(&default_log, L_ERR, "%s: Out of memory", __FUNCTION__);
+               fr_log(&default_log, L_ERR, "%s: Out of memory", __FUNCTION__);
                return NULL;
        }
 
index 4718fc68ecea9639a7939b98e8f15018e724eb0c..149d6e1e5116ef0d434c26216f35759f468e85a5 100644 (file)
@@ -411,7 +411,7 @@ RADCLIENT *client_listener_find(rad_listen_t *listener,
 
                listener->print(listener, name, sizeof(name));
 
-               radlog(&default_log, L_ERR, "Ignoring request to %s from unknown client %s port %d"
+               fr_log(&default_log, L_ERR, "Ignoring request to %s from unknown client %s port %d"
 #ifdef WITH_TCP
                       " proto %s"
 #endif
index 4b06d52dce64e4e8255d4a14e9e0eee588aadeb3..ee68940ece5d44329c573b7c77b00af4c5772e7e 100644 (file)
@@ -318,7 +318,7 @@ static int radlog_always(fr_log_t const *log, log_type_t type, char const *msg,
        int r;
 
        va_start(ap, msg);
-       r = vradlog(log, type, msg, ap);
+       r = fr_vlog(log, type, msg, ap);
        va_end(ap);
 
        return r;
@@ -411,7 +411,7 @@ void vradlog_request(log_type_t type, log_lvl_t lvl, REQUEST *request, char cons
                /*
                 *      If we're debugging to a file, then use that.
                 *
-                *      @todo: have vradlog() take a fr_log_t*, so
+                *      @todo: have fr_vlog() take a fr_log_t*, so
                 *      that we can cache the opened descriptor, and
                 *      we don't need to re-open it on every log
                 *      message.
@@ -732,7 +732,7 @@ void radlog_hex(fr_log_t const *log, log_type_t type, log_lvl_t lvl, uint8_t con
                if ((i + len) > data_len) len = data_len - i;
 
                for (p = buffer, j = 0; j < len; j++, p += 3) sprintf(p, "%02x ", data[i + j]);
-               radlog(log, type, "%04x: %s", (int)i, buffer);
+               fr_log(log, type, "%04x: %s", (int)i, buffer);
        }
 }
 
@@ -744,7 +744,7 @@ void radlog_fatal(char const *fmt, ...)
        va_list ap;
 
        va_start(ap, fmt);
-       vradlog(&default_log, L_ERR, fmt, ap);
+       fr_vlog(&default_log, L_ERR, fmt, ap);
        va_end(ap);
 
        fr_exit_now(1);
index 15935ecc5d994579e87367777d6762f4154bf120..a5ba34c9eccbb4c093c5dd68732b2a96af6f6295 100644 (file)
@@ -836,7 +836,7 @@ int main(int argc, char **argv)
                 *      If required, log commands to a radmin log file.
                 */
                if (radmin_log.dst == L_DST_FILES) {
-                       radlog(&radmin_log, L_INFO, "%s", line);
+                       fr_log(&radmin_log, L_INFO, "%s", line);
                }
 
        retry:
index 2581c844e303b5f63a3b2fae6572b634ae1c3d54..b00ed5ee6ed839f9166b1d091da5d3d6526e92fc 100644 (file)
@@ -91,7 +91,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
  *     rlm_krb5 was not built as threadsafe
  */
 #else
-               radlog(&default_log, L_WARN, "libkrb5 is not threadsafe, recompile it with thread support enabled ("
+               fr_log(&default_log, L_WARN, "libkrb5 is not threadsafe, recompile it with thread support enabled ("
 #  ifdef HEIMDAL_KRB5
                       "--enable-pthread-support"
 #  else
index 009acfe74aa010c1d1ff03151abc6b96c2194b9b..9564893c54c9c09b1dbc32e89f7876998ca249dc 100644 (file)
@@ -146,21 +146,21 @@ int aux_jit_funcs_register(rlm_lua_t const *inst, lua_State *L)
                                L_DBG_WARN2 = 19,\
                                L_DBG_ERR2 = 20\
                        } log_type_t;\
-                       int radlog(log_type_t lvl, char const *fmt, ...);\
+                       int fr_log(log_type_t lvl, char const *fmt, ...);\
                        ]]\
                fr_srv = ffi.load(\"freeradius-server\")\
                fr = ffi.load(\"freeradius-lua\")\
                debug = function(msg)\
-                  fr_srv.radlog(16, \"%s\", msg)\
+                  fr_srv.fr_fr_log(16, \"%s\", msg)\
                end\
                info = function(msg)\
-                  fr_srv.radlog(3, \"%s\", msg)\
+                  fr_srv.fr_log(3, \"%s\", msg)\
                end\
                warn = function(msg)\
-                  fr_srv.radlog(5, \"%s\", msg)\
+                  fr_srv.fr_log(5, \"%s\", msg)\
                end\
                error = function(msg)\
-                  fr_srv.radlog(4, \"%s\", msg)\
+                  fr_srv.fr_log(4, \"%s\", msg)\
                end\
                ") != 0) {
                ERROR("rlm_lua (%s): Failed setting up FFI: %s", inst->xlat_name,
index e3c1ef83d5e57d59372a233b01beecbe204e3009..06e5d65cd0490e4082b607f5c5647cb8c50a6a0d 100644 (file)
@@ -273,9 +273,9 @@ static PerlInterpreter *rlm_perl_clone(PerlInterpreter *perl, pthread_key_t *key
 #endif
 
 /*
- *     This is wrapper for radlog
+ *     This is wrapper for fr_log
  *     Now users can call radiusd::radlog(level,msg) wich is the same
- *     as calling radlog from C code.
+ *     as calling fr_log from C code.
  */
 static XS(XS_radiusd_radlog)
 {
@@ -293,7 +293,7 @@ static XS(XS_radiusd_radlog)
                 *      Because 'msg' is a 'char *', we don't want '%s', etc.
                 *      in it to give us printf-style vulnerabilities.
                 */
-               radlog(&default_log, level, "rlm_perl: %s", msg);
+               fr_log(&default_log, level, "rlm_perl: %s", msg);
        }
        XSRETURN_NO;
 }
index 371eb8cce366fa3047d91b55292241f89e5b0884..f647e288448d1c58caf8b24b5f4e3d168be465ee 100644 (file)
@@ -170,7 +170,7 @@ fr_thread_local_setup(rbtree_t *, local_thread_state)       /* macro */
  *     radiusd Python functions
  */
 
-/** Allow radlog to be called from python
+/** Allow fr_log to be called from python
  *
  */
 static PyObject *mod_radlog(UNUSED PyObject *module, PyObject *args)
@@ -182,7 +182,7 @@ static PyObject *mod_radlog(UNUSED PyObject *module, PyObject *args)
                return NULL;
        }
 
-       radlog(&default_log, status, "%s", msg);
+       fr_log(&default_log, status, "%s", msg);
        Py_INCREF(Py_None);
 
        return Py_None;
index 66e701e6909106372df8885a350ee46bc1937f1a..b421a6fece0835703d6d543f85362700d608feda 100644 (file)
@@ -90,14 +90,14 @@ static const CONF_PARSER module_config[] = {
  * radiusd Ruby functions
  */
 
-/* radlog wrapper */
+/* fr_log wrapper */
 
 static VALUE radlog_rb(UNUSED VALUE self, VALUE msg_type, VALUE rb_msg) {
        int status;
        char *msg;
        status = FIX2INT(msg_type);
        msg = StringValuePtr(rb_msg);
-       radlog(&default_log, status, "%s", msg);
+       fr_log(&default_log, status, "%s", msg);
        return Qnil;
 }