argus-3.0.0.rc.1 FreeBSD compile problems

Robin Gruyters r.gruyters at yirdis.nl
Wed Jun 7 16:11:59 EDT 2006


On Wed, Jun 07, 2006 at 03:26:43PM -0400, Carter Bullard wrote:
> OK, so I'm now making mistakes on the mistakes!!!!!!!!!
> 
> The correct answer is "EXTRACT_64BITS".  I'm making the
> mistake of creating the patches on my Mac OS X machine
> which is of course big endian, which is not the right kind of machine
> to do little_endian related code work, and to boot, I'm looking
> at an older version of code to try to find the macro, so
> really stupid.   The best thing to do is ignore my suggestions,
> and just see what the compiler barfs on ;o)
> 
> Very sorry for the inconvenience, and I think that this is right now !!
> 
Hahaha, no worries, got it working. Needed to change to "EXTRACT_64BITS".
Anyway, here is the correct patch. (see attachment)

Regards,

Robin

> 
> On Jun 7, 2006, at 3:12 PM, Carter Bullard wrote:
> 
> >Oooooops, its "EXTRACT_64BIT".
> >Not my day, sorry.
> >Carter
> >
> >On Jun 7, 2006, at 2:13 PM, Carter Bullard wrote:
> >
> >>Ooooops, that should be "EXTRACT_64BITS".
> >>Carter
> >>
> >>On Jun 7, 2006, at 2:11 PM, Carter Bullard wrote:
> >>
> >>>Hey Robin,
> >>>So, FreeBSD doesn't have byteswap.h nor does it support bswap_64?
> >>>Hmmm, disappointing.   So try this just to see if we can get it  
> >>>to compile.
> >>>You'll have to make this type of patch to the clients as well.
> >>>
> >>>Apply this patch to argus_util.c
> >>>*** ./argus_util.c   2006-06-07 14:26:49.000000000 -0400
> >>>--- ./argus_util.c    2006-06-07 14:25:43.000000000 -0400
> >>>***************
> >>>*** 129,134 ****
> >>>--- 129,144 ----
> >>>  void ArgusPrintHex (const u_char *, u_int);
> >>>
> >>>  #if defined(_LITTLE_ENDIAN)
> >>>+ #if defined(__FreeBSD__)
> >>>+ #include <extract.h>
> >>>+ #if !defined(ntohll)
> >>>+ #define ntohll(x) EXTRACT_64(&x)
> >>>+ #define htonll(x) EXTRACT_64(&x)
> >>>+ #else
> >>>+ #define ntohll(x) x
> >>>+ #define htonll(x) x
> >>>+ #endif
> >>>+ #else
> >>>  #include <byteswap.h>
> >>>  #if !defined(ntohll)
> >>>  #define ntohll(x) bswap_64(x)
> >>>***************
> >>>*** 138,143 ****
> >>>--- 148,154 ----
> >>>  #define htonll(x) x
> >>>  #endif
> >>>  #endif
> >>>+ #endif
> >>>
> >>>  void ArgusNtoH (struct ArgusRecord *);
> >>>  void ArgusHtoN (struct ArgusRecord *);
> >>>
> >>>Carter
> >>>
> >>>
> 
-------------- next part --------------
--- argus_util.c.orig	Thu Jun  1 18:38:05 2006
+++ argus_util.c	Wed Jun  7 22:08:48 2006
@@ -129,6 +129,16 @@
 void ArgusPrintHex (const u_char *, u_int);
 
 #if defined(_LITTLE_ENDIAN)
+#if defined(__FreeBSD__)
+#include <extract.h>
+#if !defined(ntohll)
+#define ntohll(x) EXTRACT_64BITS(&x)
+#define htonll(x) EXTRACT_64BITS(&x)
+#else
+#define ntohll(x) x
+#define htonll(x) x
+#endif
+#else
 #include <byteswap.h>
 #if !defined(ntohll)
 #define ntohll(x) bswap_64(x)
@@ -136,6 +146,7 @@
 #else
 #define ntohll(x) x
 #define htonll(x) x
+#endif
 #endif
 #endif
 


More information about the argus mailing list