Re: [hackers] [slstatus][PATCH] Add FreeBSD support for netspeeds, entropy and ip components

2019-02-05 Thread Michael Buch
Hey,
Thanks for reviewing!

As far as I know, similar to OpenBSD, in FreeBSD entropy is not a stat
that's useful (or readily available) since both use prng schemes that
deal with low available entropy. [1] There is a way to inspect whether
the random device is properly seeded or will block. But that wouldn't
be the same as what slstatus does for Linux.

1: https://lists.freebsd.org/pipermail/freebsd-questions/2008-April/173086.html

Thanks,
Michael


Am Di., 5. Feb. 2019 um 08:36 Uhr schrieb Aaron Marcher :
>
> Hi Michael,
>
> the entropy function on OpenBSD is kind of a easter egg. Could you look
> into "really" porting it to FreeBSD?
> Thank you very much for your motivation of porting slstatus to FreeBSD.
> I merged the other patches already.
>
> Cheers!
> Aaron
>
> --
> Web: https://drkhsh.at/ or http://drkhsh5rv6pnahas.onion/
> Gopher: gopher://drkhsh.at or gopher://drkhsh5rv6pnahas.onion
> GPG: 0x7A65E38D55BE96FE
> Fingerprint: 4688 907C 8720 3318 0D9F AFDE 7A65 E38D 55BE 96FE
>



Re: [hackers] [slstatus][PATCH] Add FreeBSD support for netspeeds, entropy and ip components

2019-02-05 Thread Aaron Marcher

Hi Michael,

the entropy function on OpenBSD is kind of a easter egg. Could you look 
into "really" porting it to FreeBSD?
Thank you very much for your motivation of porting slstatus to FreeBSD.  
I merged the other patches already.


Cheers!
Aaron

--
Web: https://drkhsh.at/ or http://drkhsh5rv6pnahas.onion/
Gopher: gopher://drkhsh.at or gopher://drkhsh5rv6pnahas.onion
GPG: 0x7A65E38D55BE96FE
Fingerprint: 4688 907C 8720 3318 0D9F AFDE 7A65 E38D 55BE 96FE



[hackers] [slstatus][PATCH] Add FreeBSD support for netspeeds, entropy and ip components

2019-01-30 Thread Michael Buch
---
 Includes trivial changes to ifdefs and includes

 components/entropy.c   | 2 +-
 components/ip.c| 3 +++
 components/netspeeds.c | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/components/entropy.c b/components/entropy.c
index 4033ffd..2a485de 100644
--- a/components/entropy.c
+++ b/components/entropy.c
@@ -17,7 +17,7 @@
 
return bprintf("%ju", num);
}
-#elif defined(__OpenBSD__)
+#elif defined(__OpenBSD__) | defined(__FreeBSD__)
const char *
entropy(void)
{
diff --git a/components/ip.c b/components/ip.c
index a7b1bfd..70724eb 100644
--- a/components/ip.c
+++ b/components/ip.c
@@ -6,6 +6,9 @@
 #if defined(__OpenBSD__)
#include 
#include 
+#elif defined(__FreeBSD__)
+   #include 
+   #include 
 #endif
 
 #include "../util.h"
diff --git a/components/netspeeds.c b/components/netspeeds.c
index 02c030e..0029177 100644
--- a/components/netspeeds.c
+++ b/components/netspeeds.c
@@ -58,7 +58,7 @@
return fmt_human((txbytes - oldtxbytes) * 1000 / interval,
 1024);
}
-#elif defined(__OpenBSD__)
+#elif defined(__OpenBSD__) | defined(__FreeBSD__)
#include 
#include 
#include 
-- 
2.7.4