diff options
author | Johnathan Corgan | 2009-10-21 14:20:15 -0700 |
---|---|---|
committer | Johnathan Corgan | 2009-10-21 14:20:15 -0700 |
commit | 8e003a402af2993f978620741fdf195ac9bf7834 (patch) | |
tree | 17bc885b8e32b3b29f78d9ae0817c88c581d87f2 /gruel/src/include | |
parent | 3f60c94858810b605c2f8a343375c57c78a660dc (diff) | |
parent | 2875cf23fcb5d38866a42327cafa2b43abe2fbf4 (diff) | |
download | gnuradio-8e003a402af2993f978620741fdf195ac9bf7834.tar.gz gnuradio-8e003a402af2993f978620741fdf195ac9bf7834.tar.bz2 gnuradio-8e003a402af2993f978620741fdf195ac9bf7834.zip |
Merge branch 'vrt' of http://gnuradio.org/git/jblum
Merge fix: added GRUEL_INCLUDES to vrt Makefile
Merge fix: added missing include in gr-vrt
* 'vrt' of http://gnuradio.org/git/jblum:
query the model number from the host
fix so all handlers get called on event
simplfied the code while i was looking at it
added access methods for gps stuff
added access methods and parsing for caldiv if context
use existing utility method
reading the lo back and storing it
use the new htonll and vrt types to send cal and lo freqs
checking for if context packets and setting up the payload pointer and size
Reading 64 bit freq out of chunk of context packet.
copied over vrt context and type headers, updated bits.h as well
Dump IF-Context packets in hex.
use gruel/inet.h instead of arap/inet.h
fix white space
made rxdspno a parameter for: start/stop streaming, and quadradio32fc
Diffstat (limited to 'gruel/src/include')
-rw-r--r-- | gruel/src/include/gruel/inet.h.in | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/gruel/src/include/gruel/inet.h.in b/gruel/src/include/gruel/inet.h.in index a98d83e9c..7ac01eb56 100644 --- a/gruel/src/include/gruel/inet.h.in +++ b/gruel/src/include/gruel/inet.h.in @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008, 2009 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,35 @@ #ifndef INCLUDED_INET_H #define INCLUDED_INET_H +#include <stdint.h> + +#if 1 /* missing htonll or ntohll */ +#if @GR_ARCH_BIGENDIAN@ /* GR_ARCH_BIGENDIAN */ +// Nothing to do... +static inline uint64_t htonll(uint64_t x){ return x;} +static inline uint64_t ntohll(uint64_t x){ return x;} +#else +#if @GR_HAVE_BYTESWAP@ /* GR_HAVE_BYTESWAP */ +#include <byteswap.h> +#else + +static inline uint64_t +bswap_64(uint64_t x) +{ + return ((x & 0x00000000000000ffull) << 56) | ((x & 0x000000000000ff00ull) << 40) | + ((x & 0x0000000000ff0000ull) << 24) | ((x & 0x00000000ff000000ull) << 8) | + ((x & 0x000000ff00000000ull) >> 8) | ((x & 0x0000ff0000000000ull) >> 24) | + ((x & 0x00ff000000000000ull) >> 40) | ((x & 0xff00000000000000ull) >> 56); +} + +#endif /* GR_HAVE_BYTESWAP */ + +static inline uint64_t htonll(uint64_t x){ return bswap_64(x);} +static inline uint64_t ntohll(uint64_t x){ return bswap_64(x);} + +#endif /* GR_ARCH_BIGENDIAN */ +#endif /* missing htonll or ntohll */ + #if @GR_HAVE_ARPA_INET@ /* GR_HAVE_ARPA_INET */ #include <arpa/inet.h> #elif @GR_HAVE_NETINET_IN@ /* GR_HAVE_NETINET_IN */ @@ -61,8 +90,10 @@ static inline uint16_t ntohs(uint16_t x){ return bswap_16(x); } static inline uint8_t ntohx(uint8_t x){ return x; } static inline uint16_t ntohx(uint16_t x){ return ntohs(x); } static inline uint32_t ntohx(uint32_t x){ return ntohl(x); } +static inline uint64_t ntohx(uint64_t x){ return ntohll(x);} static inline uint8_t htonx(uint8_t x){ return x; } static inline uint16_t htonx(uint16_t x){ return htons(x); } static inline uint32_t htonx(uint32_t x){ return htonl(x); } +static inline uint64_t htonx(uint64_t x){ return htonll(x);} #endif /* INCLUDED_INET_H */ |