1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

show cipher in /tcp

This commit is contained in:
psyc://psyced.org/~lynX 2009-03-03 03:17:24 +01:00
parent 9dd8518761
commit 43bd8835f7
5 changed files with 39 additions and 18 deletions

View file

@ -43,6 +43,10 @@
#include <storage.h>
#include <url.h>
#if __EFUN_DEFINED__(tls_query_connection_info)
# include <sys/tls.h>
#endif
inherit NET_PATH "group/master";
inherit NET_PATH "lastlog";
@ -319,7 +323,6 @@ qDescription(source, vars, profile, itsme) {
dv["_agent_design"] = v("layout");
}
#if __EFUN_DEFINED__(tls_query_connection_info)
# include <sys/tls.h>
if (interactive(ME) && tls_query_connection_state(ME)) {
array(mixed) tls = tls_query_connection_info(ME);

View file

@ -11,6 +11,10 @@
#include <net.h>
#include <misc.h>
#if __EFUN_DEFINED__(tls_query_connection_info)
# include <sys/tls.h>
#endif
//#define NO_INHERIT // virtual ain't workin' .. but leavin it out neither
#include <text.h>
@ -20,6 +24,7 @@ static int smaller_object_name(object a, object b) {
list_sockets(guy, flags) {
array(object) u;
array(mixed) tls;
mapping uv;
string list, name, host, ip, idle, email, scheme, agent, layout;
int i, skip = 0;
@ -48,7 +53,7 @@ list_sockets(guy, flags) {
host = uv["forwarded"];
unless (host) host = uv["host"];
ip = uv["ip"];
#ifdef _flag_log_hosts
#if 1 //def _flag_log_hosts // realtime inspection isn't logging
unless (host) host = query_ip_name(o);
unless(ip) ip = query_ip_number(o);
#endif
@ -58,7 +63,6 @@ list_sockets(guy, flags) {
else if (idle = uv["idleTime"]) idle = timedelta(idle);
if (boss(o)) name += "*";
if (uv["visibility"] == "off") name = "°"+name;
list += sprintf(T("_list_user_technical_person",
"\n%4.4s%s %s %s %s (%s) <%s> %s"),
// scheme ? (layout && scheme=="ht" ?
@ -82,9 +86,12 @@ list_sockets(guy, flags) {
}
else {
name = o->qName();
#if __EFUN_DEFINED__(tls_query_connection_info)
tls = interactive(o) && tls_query_connection_info(o);
#endif
if (name? flags & SOCKET_LIST_GHOST : flags & SOCKET_LIST_LINK)
list += sprintf(T("_list_user_technical_ghost",
"\n%s %s %O %s (%s)"),
"\n%s %s %O %s (%s) %s %s"),
#if __EFUN_DEFINED__(tls_query_connection_state)
interactive(o) &&
tls_query_connection_state(o) ? "!" : " ",
@ -93,13 +100,23 @@ list_sockets(guy, flags) {
#endif
(name && to_string(name)) || "",
o,
#ifdef _flag_log_hosts
#if 1 //def _flag_log_hosts // realtime inspection isn't logging
query_ip_name(o) || "",
query_ip_number(o) || ""
query_ip_number(o) || "",
#else
"", ""
"", "",
#endif
);
#if __EFUN_DEFINED__(tls_query_connection_info)
tls ? intp(tls[TLS_PROT]) ?
TLS_PROT_NAME(tls[TLS_PROT]) :
tls[TLS_PROT] : "",
tls ? intp(tls[TLS_CIPHER]) ?
TLS_CIPHER_NAME(tls[TLS_CIPHER]) :
tls[TLS_CIPHER] : ""
#else
"", ""
#endif
);
else skip++;
}
}