*/
#include <stdio.h>
+#ifdef ANDROID
+#include <android/log.h>
+#else
#include <syslog.h>
+#endif
#include <stdarg.h>
#include <stdlib.h>
#include <signal.h>
exit(1);
if (use_syslog) {
+#ifndef ANDROID
openlog("openconnect", LOG_PID, LOG_DAEMON);
+#endif
vpninfo->progress = syslog_progress;
}
}
}
+#ifdef ANDROID
+void syslog_progress(void *_vpninfo, int level, const char *fmt, ...)
+{
+ static int l[4] = {
+ ANDROID_LOG_ERROR, /* PRG_ERR */
+ ANDROID_LOG_INFO, /* PRG_INFO */
+ ANDROID_LOG_DEBUG, /* PRG_DEBUG */
+ ANDROID_LOG_DEBUG /* PRG_TRACE */
+ };
+ va_list args;
+
+ if (verbose >= level) {
+ va_start(args, fmt);
+ __android_log_vprint(l[level], "openconnect", fmt, args);
+ va_end(args);
+ }
+}
+#else /* !ANDROID */
void syslog_progress(void *_vpninfo, int level, const char *fmt, ...)
{
int priority = level ? LOG_INFO : LOG_NOTICE;
va_end(args);
}
}
-
+#endif
struct accepted_cert {
struct accepted_cert *next;
<UL>
<LI><B>OpenConnect HEAD</B><BR>
<UL>
+ <LI>Add logging support for Android, in place of standard <TT>syslog()</TT>.</LI>
<LI>Switch back to using TLSv1, but without extensions.</LI>
<LI>Make TPM support optional, dependent on OpenSSL ENGINE support.</LI>
</UL><BR>
<hr>
<address>David Woodhouse <<A HREF="mailto:dwmw2@infradead.org">dwmw2@infradead.org</A>></address>
<!-- hhmts start -->
-Last modified: Fri Jul 15 10:20:37 PDT 2011
+Last modified: Fri Jul 15 10:47:38 PDT 2011
<!-- hhmts end -->
</body> </html>