]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/radius/radiusclient/lib/log.c
Added RADIUS suppport.
[ppp.git] / pppd / plugins / radius / radiusclient / lib / log.c
diff --git a/pppd/plugins/radius/radiusclient/lib/log.c b/pppd/plugins/radius/radiusclient/lib/log.c
new file mode 100644 (file)
index 0000000..9e922a3
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * $Id: log.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ *
+ * Copyright (C) 1995,1996,1997 Lars Fenneberg
+ *
+ * See the file COPYRIGHT for the respective terms and conditions. 
+ * If the file is missing contact me at lf@elemental.net 
+ * and I'll send you a copy.
+ *
+ */
+
+#include <config.h>
+#include <includes.h>
+#include <radiusclient.h>
+
+/*
+ * Function: rc_openlog
+ *
+ * Purpose: open log
+ *
+ * Arguments: identification string
+ *
+ * Returns: nothing
+ *
+ */
+
+void rc_openlog(char *ident)
+{
+       openlog(ident, LOG_PID, RC_LOG_FACILITY);
+}
+
+/*
+ * Function: rc_log
+ *
+ * Purpose: log information
+ *
+ * Arguments: priority (just like syslog), rest like printf
+ *
+ * Returns: nothing
+ *
+ */
+
+void rc_log(int prio, const char *format, ...)
+{
+       char buff[1024];
+       va_list ap;
+                                    
+       va_start(ap,format);
+    vsnprintf(buff, sizeof(buff), format, ap);
+    va_end(ap);
+                                                            
+       syslog(prio, "%s", buff);
+}