# $Id$
+2006-11-30
+ * Added $entropy_avail, $entropy_poolsize and $entropy_bar
+ for the crypto freaks.
+
2006-11-28
* Rearrange retry attempts in pop3 and imap code, removing sleep()
calls which cause the whole process to sleep, not just the thread.
else Text to show if any of the above are not true
+ entropy_avail
+ Current entropy available for crypto freaks
+
+
+ entropy_bar (height),(width)
+ Normalized bar of available entropy for crypto freaks
+
+
+ entropy_poolsize
+ Total size of system entropy pool for crypto freaks
+
+
exec command
Executes a shell command and displays the output in conky. warn-
ing: this takes a lot more resources than other variables. I'd
Text to show if any of the above are not true
.TP
+\fB\*(T<\fBentropy_avail\fR\*(T>\fR
+Current entropy available for crypto freaks
+
+.TP
+\fB\*(T<\fBentropy_bar\fR\*(T>\fR \*(T<\fB(height),(width)\fR\*(T>
+Normalized bar of available entropy for crypto freaks
+
+.TP
+\fB\*(T<\fBentropy_poolsize\fR\*(T>\fR
+Total size of system entropy pool for crypto freaks
+
+.TP
\fB\*(T<\fBexec\fR\*(T>\fR \*(T<\fBcommand\fR\*(T>
Executes a shell command and displays the output in conky. warning: this takes a lot more resources than other variables. I'd recommend coding wanted behaviour in C and posting a patch.
<varlistentry>
<term>
+ <command><option>entropy_avail</option></command>
+ </term>
+ <listitem>
+ Current entropy available for crypto freaks
+ <para></para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term>
+ <command><option>entropy_bar</option></command>
+ <option>(height),(width)</option>
+ </term>
+ <listitem>
+ Normalized bar of available entropy for crypto freaks
+ <para></para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term>
+ <command><option>entropy_poolsize</option></command>
+ </term>
+ <listitem>
+ Total size of system entropy pool for crypto freaks
+ <para></para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+ <term>
<command><option>exec</option></command>
<option>command</option>
</term>
if (NEED(INFO_TCP_PORT_MONITOR))
update_tcp_port_monitor_collection( info.p_tcp_port_monitor_collection );
#endif
+ if (NEED(INFO_ENTROPY))
+ update_entropy();
}
int round_to_int(float f)
#ifdef HDDTEMP
OBJ_hddtemp,
#endif
+ OBJ_entropy_avail,
+ OBJ_entropy_poolsize,
+ OBJ_entropy_bar
};
struct text_object {
free(objs[i].data.hddtemp.addr);
break;
#endif
+ case OBJ_entropy_avail:
+ case OBJ_entropy_poolsize:
+ case OBJ_entropy_bar:
+ break;
}
}
free(objs);
}
END
#endif
+ OBJ(entropy_avail, INFO_ENTROPY) END
+ OBJ(entropy_poolsize, INFO_ENTROPY) END
+ OBJ(entropy_bar, INFO_ENTROPY)
+ (void) scan_bar(arg, &obj->a, &obj->b);
+ END
+
{
char buf[256];
ERR("unknown variable %s", s);
iconv_selected = 0;
}
#endif
+ OBJ(entropy_avail)
+ {
+ snprintf(p, p_max_size, "%d", cur->entropy.entropy_avail);
+ }
+ OBJ(entropy_poolsize)
+ {
+ snprintf(p, p_max_size, "%d", cur->entropy.poolsize);
+ }
+ OBJ(entropy_bar)
+ {
+ double entropy_perc;
+ entropy_perc = (double)cur->entropy.entropy_avail /
+ (double)cur->entropy.poolsize;
+ new_bar(p,obj->a,obj->b,(int)(entropy_perc * 255.0f));
+ }
+
break;
}
};
#endif
+void update_entropy();
+struct entropy_s {
+ unsigned int entropy_avail;
+ unsigned int poolsize;
+};
+
#ifdef TCP_PORT_MONITOR
#include "libtcp-portmon.h"
#define MIN_PORT_MONITORS_DEFAULT 16
#ifdef XMMS2
INFO_XMMS2 = 22,
#endif
+ INFO_ENTROPY = 23,
};
tcp_port_monitor_collection_t * p_tcp_port_monitor_collection;
#endif
short kflags; /* kernel settings, see enum KFLAG */
+ struct entropy_s entropy;
};
enum {
#endif
+void update_entropy (void)
+{
+ /* mirrorbox: can you do anything equivalent in freebsd? -drphibes. */
+}
+
/* empty stub so conky links */
void
free_all_processes(void)
return;
}
+
+void update_entropy (void)
+{
+ static int rep;
+ const char *entropy_avail = "/proc/sys/kernel/random/entropy_avail";
+ const char *entropy_poolsize = "/proc/sys/kernel/random/poolsize";
+ FILE *fp1, *fp2;
+
+ info.entropy.entropy_avail=0;
+ info.entropy.poolsize=0;
+
+ if ( ((fp1 = open_file (entropy_avail, &rep))==NULL) ||
+ ((fp2 = open_file (entropy_poolsize, &rep))==NULL) )
+ return;
+
+ fscanf (fp1, "%u", &info.entropy.entropy_avail);
+ fscanf (fp2, "%u", &info.entropy.poolsize);
+
+ fclose (fp1);
+ fclose (fp2);
+}
return;
}
+
+void update_entropy (void)
+{
+}