(ip_info->netmask6 && ip_info->addr) ? " + " : "",
ip_info->netmask6 ? : "",
ssl_compr ? " + " : "", ssl_compr ? : "",
+ ssl_state,
vpninfo->proto->udp_protocol ? : "UDP", udp_compr ? " + " : "", udp_compr ? : "",
dtls_state);
+ if (vpninfo->auth_expiration != 0)
+ vpn_progress(vpninfo, PRG_INFO, _("Session authentication will expire at %s"),
+ ctime(&vpninfo->auth_expiration));
}
+ static void print_connection_stats(void *_vpninfo, const struct oc_stats *stats)
+ {
+ struct openconnect_info *vpninfo = _vpninfo;
+ int saved_loglevel = vpninfo->verbose;
+
+ /* XX: print even if loglevel would otherwise suppress */
+ openconnect_set_loglevel(vpninfo, PRG_INFO);
+
+ print_connection_info(vpninfo);
+ vpn_progress(vpninfo, PRG_INFO,
+ _("RX: %ld packets (%ld B); TX: %ld packets (%ld B)\n"),
+ stats->rx_pkts, stats->rx_bytes, stats->tx_pkts, stats->tx_bytes);
+
+ if (vpninfo->ssl_fd != -1)
+ vpn_progress(vpninfo, PRG_INFO, _("SSL ciphersuite: %s\n"), openconnect_get_cstp_cipher(vpninfo));
+ if (vpninfo->dtls_state == DTLS_CONNECTED)
+ vpn_progress(vpninfo, PRG_INFO, _("%s ciphersuite: %s\n"),
+ vpninfo->proto->udp_protocol ? : "UDP", openconnect_get_dtls_cipher(vpninfo));
+ if (vpninfo->ssl_times.last_rekey && vpninfo->ssl_times.rekey)
+ vpn_progress(vpninfo, PRG_INFO, _("Next SSL rekey in %ld seconds\n"),
+ time(NULL) - vpninfo->ssl_times.last_rekey + vpninfo->ssl_times.rekey);
+ if (vpninfo->dtls_times.last_rekey && vpninfo->dtls_times.rekey)
+ vpn_progress(vpninfo, PRG_INFO, _("Next %s rekey in %ld seconds\n"),
+ vpninfo->proto->udp_protocol ? : "UDP",
+ time(NULL) - vpninfo->ssl_times.last_rekey + vpninfo->ssl_times.rekey);
+ if (vpninfo->trojan_interval && vpninfo->last_trojan)
+ vpn_progress(vpninfo, PRG_INFO, _("Next Trojan invocation in %ld seconds\n"),
+ time(NULL) - vpninfo->last_trojan + vpninfo->trojan_interval);
+
+ /* XX: restore loglevel */
+ openconnect_set_loglevel(vpninfo, saved_loglevel);
+ }
+
#ifndef _WIN32
static FILE *background_self(struct openconnect_info *vpninfo, char *pidfile) {
FILE *fp = NULL;