summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/Makefile.am1
-rw-r--r--config/grc_vrt.m450
-rw-r--r--configure.ac1
-rw-r--r--vrt/.gitignore3
-rw-r--r--vrt/Makefile.am29
-rw-r--r--vrt/apps/.gitignore5
-rw-r--r--vrt/apps/Makefile.am18
-rw-r--r--vrt/include/Makefile.am23
-rw-r--r--vrt/include/vrt/Makefile.am31
-rw-r--r--vrt/include/vrt/bits.h270
-rw-r--r--vrt/include/vrt/copiers.h49
-rw-r--r--vrt/include/vrt/expanded_header.h125
-rw-r--r--vrt/include/vrt/expanded_if_context_section.h118
-rw-r--r--vrt/include/vrt/rx.h93
-rw-r--r--vrt/include/vrt/rx_packet_handler.h62
-rw-r--r--vrt/include/vrt/types.h191
-rw-r--r--vrt/lib/.gitignore4
-rw-r--r--vrt/lib/Makefile.am55
-rw-r--r--vrt/lib/copiers.cc71
-rw-r--r--vrt/lib/data_handler.cc32
-rw-r--r--vrt/lib/data_handler.h47
-rw-r--r--vrt/lib/expanded_header.cc195
-rw-r--r--vrt/lib/expanded_header_pack_switch_body.h272
-rw-r--r--vrt/lib/expanded_header_unpack_switch_body.h320
-rw-r--r--vrt/lib/expanded_if_context_section.cc493
-rwxr-xr-xvrt/lib/gen_pack_switch_body.py79
-rwxr-xr-xvrt/lib/gen_unpack_switch_body.py85
-rw-r--r--vrt/lib/header_utils.cc260
-rw-r--r--vrt/lib/header_utils.h51
-rw-r--r--vrt/lib/rx.cc124
-rw-r--r--vrt/lib/rx_packet_handler.cc41
-rw-r--r--vrt/lib/socket_rx_buffer.cc176
-rw-r--r--vrt/lib/socket_rx_buffer.h95
-rw-r--r--vrt/vrt.pc.in11
34 files changed, 0 insertions, 3480 deletions
diff --git a/config/Makefile.am b/config/Makefile.am
index 959b8f014..4dc7216f1 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -70,7 +70,6 @@ m4macros = \
grc_gr_video_sdl.m4 \
grc_gr_wxgui.m4 \
grc_gruel.m4 \
- grc_vrt.m4 \
gr_check_createfilemapping.m4 \
gr_check_mc4020.m4 \
gr_check_shm_open.m4 \
diff --git a/config/grc_vrt.m4 b/config/grc_vrt.m4
deleted file mode 100644
index 63b0a5e35..000000000
--- a/config/grc_vrt.m4
+++ /dev/null
@@ -1,50 +0,0 @@
-dnl Copyright 2008,2009 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GNU Radio
-dnl
-dnl GNU Radio is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3, or (at your option)
-dnl any later version.
-dnl
-dnl GNU Radio is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with GNU Radio; see the file COPYING. If not, write to
-dnl the Free Software Foundation, Inc., 51 Franklin Street,
-dnl Boston, MA 02110-1301, USA.
-
-AC_DEFUN([GRC_VRT],[
- GRC_ENABLE(vrt)
-
- dnl If execution gets to here, $passed will be:
- dnl with : if the --with code didn't error out
- dnl yes : if the --enable code passed muster and all dependencies are met
- dnl no : otherwise
- if test $passed = yes; then
- AC_CHECK_HEADERS(arpa/inet.h sys/socket.h)
- fi
- if test $passed != with; then
- dnl how and where to find INCLUDES and LA
- VRT_INCLUDES="-I\${abs_top_srcdir}/vrt/include"
- VRT_LA="\${abs_top_builddir}/vrt/lib/libvrt.la"
- fi
-
- dnl Include the vrt INCLUDES and LA
- AC_SUBST(VRT_INCLUDES)
- AC_SUBST(VRT_LA)
-
- AC_CONFIG_FILES([
- vrt/Makefile
- vrt/vrt.pc
- vrt/include/Makefile
- vrt/include/vrt/Makefile
- vrt/lib/Makefile
- vrt/apps/Makefile
- ])
-
- GRC_BUILD_CONDITIONAL(vrt)
-])
diff --git a/configure.ac b/configure.ac
index 4ec2644ee..3c23c55e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -340,7 +340,6 @@ GRC_GCELL
GRC_GNURADIO_CORE
GRC_USRP
GRC_USRP2
-GRC_VRT
GRC_GR_USRP dnl this must come after GRC_USRP
GRC_GR_USRP2
GRC_GR_GCELL dnl this must come after GRC_GCELL and GRC_GNURADIO_CORE
diff --git a/vrt/.gitignore b/vrt/.gitignore
deleted file mode 100644
index 8d802d8ff..000000000
--- a/vrt/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-vrt.pc
diff --git a/vrt/Makefile.am b/vrt/Makefile.am
deleted file mode 100644
index 791b8d65c..000000000
--- a/vrt/Makefile.am
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# Copyright 2008,2009 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = vrt.pc
-
-EXTRA_DIST = \
- vrt.pc.in
-
-SUBDIRS = include lib apps
diff --git a/vrt/apps/.gitignore b/vrt/apps/.gitignore
deleted file mode 100644
index dab7a7fd6..000000000
--- a/vrt/apps/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-Makefile
-Makefile.in
-.deps
-.libs
-
diff --git a/vrt/apps/Makefile.am b/vrt/apps/Makefile.am
deleted file mode 100644
index 45772055b..000000000
--- a/vrt/apps/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright 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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-include $(top_srcdir)/Makefile.common
diff --git a/vrt/include/Makefile.am b/vrt/include/Makefile.am
deleted file mode 100644
index 3ce6a8f32..000000000
--- a/vrt/include/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Copyright 2009 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = vrt
diff --git a/vrt/include/vrt/Makefile.am b/vrt/include/vrt/Makefile.am
deleted file mode 100644
index eec3c9b7b..000000000
--- a/vrt/include/vrt/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# 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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-include $(top_srcdir)/Makefile.common
-
-INCLUDES =
-
-vrtincludedir = $(includedir)/vrt
-
-vrtinclude_HEADERS = \
- bits.h \
- copiers.h \
- expanded_header.h \
- expanded_if_context_section.h \
- rx.h \
- rx_packet_handler.h \
- types.h
diff --git a/vrt/include/vrt/bits.h b/vrt/include/vrt/bits.h
deleted file mode 100644
index 3454d05a0..000000000
--- a/vrt/include/vrt/bits.h
+++ /dev/null
@@ -1,270 +0,0 @@
-/* -*- c -*- */
-/*
- * Copyright 2009,2010 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-#ifndef INCLUDED_VRT_BITS_H
-#define INCLUDED_VRT_BITS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*!
- * \brief Definitions of bit and fields in VRT packets
- *
- * See "ANSI/VITA 49.0, VRT Standard" for details
- */
-
-#include <stdint.h>
-#include <vrt/types.h>
-
-// ------------------------------------------------------------------------
-// Common VRT header info
-// ------------------------------------------------------------------------
-
-/* VRT Header bits */
-
-#define VRTH_PT_MASK (0xf << 28)
-#define VRTH_PT_IF_DATA_NO_SID (0x0 << 28) // IF-Data, no stream id
-#define VRTH_PT_IF_DATA_WITH_SID (0x1 << 28) // IF-Data, w/ stream id
-#define VRTH_PT_EXT_DATA_NO_SID (0x2 << 28)
-#define VRTH_PT_EXT_DATA_WITH_SID (0x3 << 28)
-#define VRTH_PT_IF_CONTEXT (0x4 << 28)
-#define VRTH_PT_EXT_CONTEXT (0x5 << 28)
-
-#define VRTH_HAS_CLASSID (1 << 27)
-#define VRTH_HAS_TRAILER (1 << 26) // Data pkts only
-#define VRTH_START_OF_BURST (1 << 25) // Data (Tx) pkts only
-#define VRTH_END_OF_BURST (1 << 24) // Data (Tx) pkts only
-#define VRTH_TSM (1 << 24) // Context pkts only
-
-#define VRTH_TSI_MASK (0x3 << 22)
-#define VRTH_TSI_NONE (0x0 << 22)
-#define VRTH_TSI_UTC (0x1 << 22)
-#define VRTH_TSI_GPS (0x2 << 22)
-#define VRTH_TSI_OTHER (0x3 << 22)
-
-#define VRTH_TSF_MASK (0x3 << 20)
-#define VRTH_TSF_NONE (0x0 << 20)
-#define VRTH_TSF_SAMPLE_CNT (0x1 << 20)
-#define VRTH_TSF_REAL_TIME_PS (0x2 << 20)
-#define VRTH_TSF_FREE_RUNNING (0x3 << 20)
-
-#define VRTH_PKT_CNT_SHIFT 16
-#define VRTH_PKT_CNT_MASK (0xf << 16)
-
-#define VRTH_PKT_SIZE_MASK 0xffff
-
-
-static inline int
-vrth_pkt_cnt(uint32_t h)
-{
- return (h & VRTH_PKT_CNT_MASK) >> 16;
-}
-
-static inline int
-vrth_pkt_size(uint32_t h)
-{
- return h & VRTH_PKT_SIZE_MASK;
-}
-
-/*
- * Trailer bits
- */
-#define TR_E (1 << 8)
-
-#define TR_ENABLE(x) ((x) << 20)
-#define TR_STATE(x) ((x) << 8)
-
-// Use these with TR_ENABLE and TR_STATE
-#define TR_CAL_TIME (1 << 11)
-#define TR_VALID_DATA (1 << 10)
-#define TR_REF_LOCK (1 << 9)
-#define TR_AGC (1 << 8)
-#define TR_DETECTED_SIG (1 << 7)
-#define TR_SPECTRAL_INVERSION (1 << 6)
-#define TR_OVER_RANGE (1 << 5)
-#define TR_SAMPLE_LOSS (1 << 4)
-#define TR_USER_3 (1 << 3)
-#define TR_USER_2 (1 << 2)
-#define TR_USER_1 (1 << 1)
-#define TR_USER_0 (1 << 0)
-
-// ------------------------------------------------------------------------
-// IF-Context packets
-// ------------------------------------------------------------------------
-
-// ------------------------------------------------------------------------
-// Context Indicator field bits (Table 7.1.5.1-1)
-
-#define CI_CHANGE_INDICATOR (1 << 31)
-#define CI_REF_POINT_ID (1 << 30)
-#define CI_BANDWIDTH (1 << 29)
-#define CI_IF_REF_FREQ (1 << 28)
-#define CI_RF_REF_FREQ (1 << 27)
-#define CI_RF_REF_FREQ_OFFSET (1 << 26)
-#define CI_IF_BAND_OFFSET (1 << 25)
-#define CI_REF_LEVEL (1 << 24)
-#define CI_GAIN (1 << 23)
-#define CI_OVER_RANGE_COUNT (1 << 22)
-#define CI_SAMPLE_RATE (1 << 21)
-#define CI_TIMESTAMP_ADJ (1 << 20)
-#define CI_TIMESTAMP_CAL_TIME (1 << 19)
-#define CI_TEMPERATURE (1 << 18)
-#define CI_DEVICE_ID (1 << 17)
-#define CI_STATE_AND_EVENT_IND (1 << 16)
-#define CI_PAYLOAD_FMT (1 << 15)
-#define CI_FORMATTED_GPS (1 << 14)
-#define CI_FORMATTED_INS (1 << 13)
-#define CI_ECEF_EPHEMERIS (1 << 12)
-#define CI_REL_EPHEMERIS (1 << 11)
-#define CI_EPHEMERIS_REF_ID (1 << 10)
-#define CI_GPS_ASCII (1 << 9)
-#define CI_CNTX_ASSOC_LISTS (1 << 8)
-#define CI_RESERVED_7 (1 << 7)
-#define CI_RESERVED_6 (1 << 6)
-#define CI_RESERVED_5 (1 << 5)
-#define CI_RESERVED_4 (1 << 4)
-#define CI_RESERVED_3 (1 << 3)
-#define CI_RESERVED_2 (1 << 2)
-#define CI_RESERVED_1 (1 << 1)
-#define CI_RESERVED_0 (1 << 0)
-
-
-// ------------------------------------------------------------------------
-// Types that may be in the Context Section
-
-
-typedef struct {
- uint32_t hi; // most significant 32-bits
- uint32_t lo; // least significant 32-bits
-} vrt_frac_secs_t;
-
-static inline uint64_t
-get_frac_secs(const vrt_frac_secs_t *fs)
-{
- return (((uint64_t)fs->hi) << 32) | fs->lo;
-}
-
-static inline void
-put_frac_secs(vrt_frac_secs_t *fs, uint64_t x)
-{
- fs->hi = (x >> 32);
- fs->lo = x;
-}
-
-//! See VITA-49.0 section 7.1.5.19
-
-typedef struct vrt_formatted_gps_tag {
- uint32_t tsi_tsf_manuf_oui;
- uint32_t integer_secs; // timestamp of position fix
- vrt_frac_secs_t fractional_secs; // timestamp of position fix
- vrt_angle_t latitude; // degrees Q10.22
- vrt_angle_t longitude; // degrees Q10.22
- vrt_distance_t altitude; // meters Q27.5
- vrt_velocity_t speed_over_ground; // meters/s Q16.16
- vrt_angle_t heading_angle; // degrees Q10.22
- vrt_angle_t track_angle; // degrees Q10.22
- vrt_angle_t magnetic_variation; // degrees Q10.22
-} vrt_formatted_gps_t;
-
-/*!
- * \brief GPS Unknown value indicator
- *
- * May be used in: latitude, longitude, altitude, speed_over_ground,
- * heading_angle, track_angle, and magnetic_variation fields.
- */
-#define VRT_GPS_UNKNOWN_VALUE 0x7fffffff
-
-
-
-//! Data Packet Payload Format Field 7.1.5.18
-
-typedef struct {
- uint32_t word0;
- uint32_t word1;
-} vrt_payload_fmt_t;
-
-#define DF0_PACKED (1 << 31)
-#define DF0_REAL_CMPLX_TYPE_MASK (0x3 << 29)
-#define DF0_REAL_CMPLX_TYPE_REAL (0 << 29)
-#define DF0_REAL_CMPLX_TYPE_CMPLX_CART (1 << 29)
-#define DF0_REAL_CMPLX_TYPE_CMPLX_POLAR (2 << 29)
-#define DF0_REAL_CMPLX_TYPE_RESERVED (3 << 29)
-#define DF0_ITEM_FMT_MASK (0x1f << 24)
-#define DF0_ITEM_FMT_SIGNED_FIXED_POINT (0x00 << 24)
-// lots more we're not using
-#define DF0_ITEM_FMT_IEEE_FLOAT (0x0e << 24)
-#define DF0_ITEM_FMT_IEEE_DOUBLE (0x0f << 24)
-#define DF0_ITEM_FMT_UNSIGNED_FIXED_POINT (0x10 << 24)
-// lots more we're not using
-#define DF0_SAMPLE_COMPONENT_REPEATING (1 << 23)
-#define DF0_EVENT_TAG_SIZE_SHIFT 20
-#define DF0_EVENT_TAG_SIZE_MASK (0x7 << 20)
-#define DF0_CHANNEL_TAG_SIZE_SHIFT 16
-#define DF0_CHANNEL_TAG_SIZE_MASK (0xf << 16)
-#define DF0_RESERVED_SHIFT 12
-#define DF0_RESERVED_MASK (0xf << 12)
-#define DF0_ITEM_PACKING_FIELD_SIZE_SHIFT 6
-#define DF0_ITEM_PACKING_FIELD_SIZE_MASK (0x3f << 6)
-#define DF0_DATA_ITEM_SIZE_SHIFT 0
-#define DF0_DATA_ITEM_SIZE_MASK (0x3f << 0)
-
-#define DF1_REPEAT_COUNT_SHIFT 16
-#define DF1_REPEAT_COUNT_MASK (0xffff << 16)
-#define DF1_VECTOR_SIZE_SHIFT 0
-#define DF1_VECTOR_SIZE_MASK (0xffff << 0)
-
-
-// Composite values
-
-// 16-bit I & Q, no events, no channel tags
-#define DF0_16_BIT_IQ \
- (0 \
- | DF0_REAL_CMPLX_TYPE_CMPLX_CART \
- | DF0_ITEM_FMT_SIGNED_FIXED_POINT \
- | (15 << DF0_ITEM_PACKING_FIELD_SIZE_SHIFT) \
- | (15 << DF0_DATA_ITEM_SIZE_SHIFT))
-
-// Vector of length 1
-#define DF1_VECTOR_1 (0 << DF1_VECTOR_SIZE_SHIFT)
-
-// Vector of length 4
-#define DF1_VECTOR_4 (3 << DF1_VECTOR_SIZE_SHIFT)
-
-
-//! ECEF Ephemeris Field 7.1.5.21
-
-typedef struct {
- uint32_t tsi_tsf_manuf_oui;
- uint32_t integer_secs; // timestamp of position fix
- vrt_frac_secs_t fractional_secs; // timestamp of position fix
- vrt_distance_t position_x; // meters Q27.5
- vrt_distance_t position_y; // meters Q27.5
- vrt_distance_t position_z; // meters Q27.5
- vrt_angle_t attitude_alpha; // degrees Q10.22
- vrt_angle_t attitude_beta; // degrees Q10.22
- vrt_angle_t attitude_phi; // degrees Q10.22
- vrt_velocity_t velocity_dx; // meters/s Q16.16
- vrt_velocity_t velocity_dy; // meters/s Q16.16
- vrt_velocity_t velocity_dz; // meters/s Q16.16
-} vrt_ephemeris_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* INCLUDED_VRT_BITS_H */
diff --git a/vrt/include/vrt/copiers.h b/vrt/include/vrt/copiers.h
deleted file mode 100644
index 990538c42..000000000
--- a/vrt/include/vrt/copiers.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2009 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_VRT_COPIERS_H
-#define INCLUDED_VRT_COPIERS_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <complex>
-
-namespace vrt {
-
- /*!
- * \brief Copy and convert from net format to host format
- */
- void
- copy_net_16sc_to_host_16sc(size_t nitems,
- const uint32_t *items,
- std::complex<int16_t> *host_items);
-
-
- /*!
- * \brief Copy and convert from net format to host format mapping [-32768, 32767] -> [1.0, +1.0)
- */
- void
- copy_net_16sc_to_host_32fc(size_t nitems,
- const uint32_t *items,
- std::complex<float> *host_items);
-};
-
-#endif /* INCLUDED_VRT_COPIERS_H */
diff --git a/vrt/include/vrt/expanded_header.h b/vrt/include/vrt/expanded_header.h
deleted file mode 100644
index 8ff750859..000000000
--- a/vrt/include/vrt/expanded_header.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2009 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_VRT_EXPANDED_HEADER_H
-#define INCLUDED_VRT_EXPANDED_HEADER_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include <vrt/bits.h>
-#include <iosfwd>
-
-namespace vrt {
-
- static const size_t HEADER_MAX_N32_BIT_WORDS = 7;
- static const size_t TRAILER_MAX_N32_BIT_WORDS = 1;
-
- /*!
- * \brief All headers and trailer for VRT IF-Data, Extension-Data,
- * IF-Context and Extension-Context packets.
- *
- * There are fields allocated for each possible header. Their content may
- * or may not be valid. Check the header field to confirm their validity.
- * All values are in host-endian format.
- */
- struct expanded_header {
- uint32_t header; // first word of all packets
- uint32_t stream_id; // optional stream identifier
- uint64_t class_id; // optional class identifier
- uint32_t integer_secs; // optional integer seconds timestamp
- uint64_t fractional_secs; // optional fractional seconds timestamp
- uint32_t trailer; // optional trailer (only possible in data pkts)
-
- expanded_header()
- : header(0) /*, stream_id(0), class_id(0),
- integer_secs(0), fractional_secs(0), trailer(0)*/ {}
-
-
- int pkt_type() const {
- return (header & VRTH_PT_MASK) >> 28;
- }
-
- int pkt_cnt() const { return vrth_pkt_cnt(header); }
- size_t pkt_size() const { return vrth_pkt_size(header); }
-
-
- // packet type predicates
- bool if_data_p() const { return s_if_data[pkt_type()]; }
- bool ext_data_p() const { return s_ext_data[pkt_type()]; }
- bool if_context_p() const { return (header & VRTH_PT_MASK) == VRTH_PT_IF_CONTEXT; }
- bool ext_context_p() const { return (header & VRTH_PT_MASK) == VRTH_PT_EXT_CONTEXT; }
-
- bool data_p() const { return s_data[pkt_type()]; } // if_data_p() || ext_data_p()
- bool context_p() const { return s_context[pkt_type()]; } // if_context_p() || ext_context_p()
-
- // optional info predicates
- bool stream_id_p() const { return s_stream_id[pkt_type()]; }
- bool class_id_p() const { return (header & VRTH_HAS_CLASSID) != 0; }
- bool integer_secs_p() const { return (header & VRTH_TSI_MASK) != 0; }
- bool fractional_secs_p() const { return (header & VRTH_TSF_MASK) != 0; }
- bool trailer_p() const { return (header & VRTH_HAS_TRAILER) != 0 && data_p(); }
-
-
- /*!
- * \brief Given contents of expanded_header, fill in the words of
- * the corresponding vrt packet header and trailer.
- *
- * This method only fills the buffers with header and trailer
- * information. The actual handling of the separate header,
- * payload, trailer buffers is up to the caller.
- */
- static void pack(const expanded_header *hdr, // in
- size_t n32_bit_words_payload, // in
- uint32_t *header, // out
- size_t *n32_bit_words_header, // out
- uint32_t *trailer, // out
- size_t *n32_bit_words_trailer);// out
-
- /*!
- * \brief unpack vrt packet header into expanded_header, start of
- * payload and len of payload
- */
- static bool unpack(const uint32_t *packet, // in
- size_t n32_bit_words_packet, // in
- expanded_header *hdr, // out
- const uint32_t **payload, // out
- size_t *n32_bit_words_payload); // out
-
- /*!
- * Write a written representation to the given \p port.
- */
- void write(std::ostream &port) const;
-
-
- private:
- static unsigned char s_if_data[16];
- static unsigned char s_ext_data[16];
- static unsigned char s_data[16];
- static unsigned char s_context[16];
- static unsigned char s_stream_id[16];
-
- };
-
- std::ostream& operator<<(std::ostream &os, const expanded_header &obj);
-
-}; // vrt
-
-
-#endif /* INCLUDED_VRT_EXPANDED_HEADER_H */
diff --git a/vrt/include/vrt/expanded_if_context_section.h b/vrt/include/vrt/expanded_if_context_section.h
deleted file mode 100644
index f3ba65765..000000000
--- a/vrt/include/vrt/expanded_if_context_section.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2010 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_VRT_EXPANDED_IF_CONTEXT_SECTION_H
-#define INCLUDED_VRT_EXPANDED_IF_CONTEXT_SECTION_H
-
-/*!
- * Expanded (unpacked) version of Context Section, defined in VRT section 7.1.5
- */
-
-#include <stdint.h>
-#include <stddef.h>
-#include <vrt/bits.h>
-#include <string>
-#include <vector>
-#include <iosfwd>
-
-
-namespace vrt {
-
- //! Expanded GPS ASCII field
- struct exp_gps_ascii {
- uint32_t manuf_oui; // GSP/INS Manufacturer OUI
- std::string ascii;
- };
-
- //! Expanded Context Association Lists
- struct exp_context_assocs {
- std::vector<uint32_t> source; // stream-ids
- std::vector<uint32_t> system; // stream-ids
- std::vector<uint32_t> vector_comp; // stream-ids
- std::vector<uint32_t> async_channel;// stream-ids
- std::vector<uint32_t> async_tag; // channel tags
- };
-
- /*!
- * \brief Expanded (unpacked) version of the contents of an
- * IF-Context packet's Context Section, as defined in VRT section 7.1.5
- *
- * There are fields allocated for each possible field. Their
- * content may or may not be valid. Check the context_indicator
- * field to determinte their validity. If the associated CI_* bit
- * is set the corresponding field is valid.
- *
- * All values are in host-endian format.
- */
- struct expanded_if_context_section {
- uint32_t context_indicator; //< 7.1.5.1
- // 7.1.5.2 (no field)
- uint32_t ref_point_id; //< 7.1.5.3
- vrt_hertz_t bandwidth; //< 7.1.5.4
- vrt_hertz_t if_ref_freq; //< 7.1.5.5
- vrt_hertz_t rf_ref_freq; //< 7.1.5.6
- vrt_hertz_t rf_ref_freq_offset; //< 7.1.5.7
- vrt_hertz_t if_band_offset; //< 7.1.5.8
- vrt_db_t ref_level; //< 7.1.5.9 (dBm)
- vrt_gain_t gain; //< 7.1.5.10
- uint32_t over_range_count; //< 7.1.5.11
- vrt_hertz_t sample_rate; //< 7.1.5.12
- int64_t timestamp_adj; //< 7.1.5.13 (picoseconds)
- uint32_t timestamp_cal_time; //< 7.1.5.14 (TSI seconds)
- vrt_temp_t temperature; //< 7.1.5.15
- uint32_t device_id[2]; //< 7.1.5.16 (0: OUI; 1: dev code)
- uint32_t state_and_event_ind; //< 7.1.5.17
- vrt_payload_fmt_t payload_fmt; //< 7.1.5.18
- vrt_formatted_gps_t formatted_gps; //< 7.1.5.19
- vrt_formatted_gps_t formatted_ins; //< 7.1.5.20
- vrt_ephemeris_t ecef_ephemeris; //< 7.1.5.21
- vrt_ephemeris_t rel_ephemeris; //< 7.1.5.22
- int32_t ephemeris_ref_id; //< 7.1.5.23
- exp_gps_ascii gps_ascii; //< 7.1.5.24
- exp_context_assocs cntx_assoc_lists;//< 7.1.5.25
-
- // Reset struct, empty all containers.
- void clear();
-
- /*!
- * \brief Unpack IF Context section into expanded_if_context_section
- *
- * \param[in] context_section points to the context section of the raw IF Context pkt.
- * \param[in] n32_bit_words is the length of the context_section.
- * \param[out] cntx holds the result of unpacking the information found in context_section.
- *
- * \Returns true iff context_section is successfully parsed.
- */
- static bool unpack(const uint32_t *context_section, // in
- size_t n32_bit_words, // in
- expanded_if_context_section *cntx); // out
-
- /*!
- * Write a written representation to the given \p port.
- */
- void write(std::ostream &port) const;
-
- };
-
- std::ostream& operator<<(std::ostream &os, const expanded_if_context_section &obj);
-
-}; // namespace vrt
-
-#endif /* INCLUDED_VRT_EXPANDED_IF_CONTEXT_SECTION_H */
diff --git a/vrt/include/vrt/rx.h b/vrt/include/vrt/rx.h
deleted file mode 100644
index ff3ce85fb..000000000
--- a/vrt/include/vrt/rx.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2009 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_VRT_RX_H
-#define INCLUDED_VRT_RX_H
-
-#include <boost/shared_ptr.hpp>
-#include <boost/utility.hpp>
-#include <vrt/rx_packet_handler.h>
-
-namespace vrt {
-
- class socket_rx_buffer;
-
- /*!
- * Relatively low-level interface to receive VRT packets over a datagram socket.
- *
- * (We'll refactor this if/when we use a non-UDP transport.)
- * No VRT control issues are addressed here.
- */
- class rx : boost::noncopyable
- {
- int d_socket_fd;
- socket_rx_buffer *d_srb;
-
- public:
- /*!
- * Shared pointer to this class
- */
- typedef boost::shared_ptr<rx> sptr;
-
- /*!
- * \brief Static function to return an instance of rx as a shared pointer.
- *
- * \param socket_fd file descriptor that data grams will be received from.
- * It is assumed that some higher-level control software
- * opened the appropriate UDP socket for us. This object
- * assumes management of the socket's lifetime. The
- * socket will be closed when our destructor fires.
- *
- * \param rx_bufsize is a hint as to the number of bytes of memory
- * to allocate for received ethernet frames (0 -> reasonable default)
- */
- static sptr make(int socket_fd, size_t rx_bufsize = 0);
-
- /*!
- * \param socket_fd file descriptor that data grams will be received from.
- * It is assumed that some higher-level control software
- * opened the appropriate UDP socket for us. This object
- * assumes management of the socket's lifetime. The
- * socket will be closed when our destructor fires.
- *
- * \param rx_bufsize is a hint as to the number of bytes of memory
- * to allocate for received ethernet frames (0 -> reasonable default)
- */
- rx(int socket_fd, size_t rx_bufsize = 0);
- ~rx();
-
- /*!
- * \brief Receive packets from the given socket file descriptor.
- *
- * \p handler will be invoked for all available packets.
- * Unless \p dont_wait is true, this function blocks until at
- * least one packet has been processed.
- */
- bool rx_packets(rx_packet_handler *handler, bool dont_wait = false);
-
- /*
- * \returns the socket_fd. Useful for select or poll.
- */
- int socket_fd() const { return d_socket_fd; }
- };
-
-}
-
-#endif /* INCLUDED_VRT_RX_H */
diff --git a/vrt/include/vrt/rx_packet_handler.h b/vrt/include/vrt/rx_packet_handler.h
deleted file mode 100644
index ad3407813..000000000
--- a/vrt/include/vrt/rx_packet_handler.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2009 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_VRT_RX_PACKET_HANDLER_H
-#define INCLUDED_VRT_RX_PACKET_HANDLER_H
-
-#include <vrt/expanded_header.h>
-#include <stddef.h>
-
-namespace vrt {
-
- /*!
- * \brief Abstract function object called to handle received VRT packets.
- *
- * An object derived from this class is passed to vrt_rx_udp::rx_packets
- * to process the received packets.
- */
- class rx_packet_handler {
- public:
- virtual ~rx_packet_handler();
-
- /*!
- * \param payload points to the first 32-bit word of the payload field.
- * \param n32_bit_words is the number of 32-bit words in the payload field.
- * \param hdr is the expanded version of the mandatory and optional header fields (& trailer).
- *
- * \p payload points to the raw payload section of the packet received off
- * the wire. The data is network-endian (aka big-endian) 32-bit integers.
- *
- * This is the general purpose, low level interface and relies on other
- * functions to handle all required endian-swapping and format conversion
- * of the payload. \sa FIXME.
- *
- * \returns true if the object wants to be called again with new data;
- * false if no additional data is wanted.
- */
- virtual bool operator()(const uint32_t *payload,
- size_t n32_bit_words,
- const expanded_header *hdr);
- };
-
-}; // vrt
-
-
-#endif /* INCLUDED_VRT_RX_PACKET_HANDLER_H */
diff --git a/vrt/include/vrt/types.h b/vrt/include/vrt/types.h
deleted file mode 100644
index 606d7c9fe..000000000
--- a/vrt/include/vrt/types.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/* -*- c -*- */
-/*
- * Copyright 2009,2010 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-#ifndef INCLUDED_VRT_TYPES_H
-#define INCLUDED_VRT_TYPES_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-
-/* macros for dealing with fixed point numbers */
-#define _FXPT_C(_type, _x, _rp) ((_type)((_x)*(1LL << _rp)))
-#define _FXPT_TO_INT(_x, _one) (((_x) + ((_one)/2))/(_one))
-#define _FXPT_TO_DOUBLE(_x, _one) ((double)(_x) * (1.0/(_one)))
-
-/*
- * The VRT Distance type (meters)
- */
-typedef int32_t vrt_distance_t;
-#define VRT_DISTANCE_RP 5
-#define VRT_DISTANCE_C(_x) _FXPT_C(vrt_distance_t, _x, VRT_DISTANCE_RP)
-
-static inline vrt_distance_t
-double_to_vrt_distance(double num){
- return VRT_DISTANCE_C(num);
-}
-
-static inline int32_t
-vrt_distance_round_to_int(vrt_distance_t fx){
- return _FXPT_TO_INT(fx, VRT_DISTANCE_C(1));
-}
-
-static inline double
-vrt_distance_to_double(vrt_distance_t fx){
- return _FXPT_TO_DOUBLE(fx, VRT_DISTANCE_C(1));
-}
-
-/*
- * The VRT Velocity type (meters/second)
- */
-typedef int32_t vrt_velocity_t;
-#define VRT_VELOCITY_RP 16
-#define VRT_VELOCITY_C(_x) _FXPT_C(vrt_velocity_t, _x, VRT_VELOCITY_RP)
-
-static inline vrt_velocity_t
-double_to_vrt_velocity(double num){
- return VRT_VELOCITY_C(num);
-}
-
-static inline int32_t
-vrt_velocity_round_to_int(vrt_velocity_t fx){
- return _FXPT_TO_INT(fx, VRT_VELOCITY_C(1));
-}
-
-static inline double
-vrt_velocity_to_double(vrt_velocity_t fx){
- return _FXPT_TO_DOUBLE(fx, VRT_VELOCITY_C(1));
-}
-
-/*
- * The VRT Angle type (degrees)
- */
-typedef int32_t vrt_angle_t;
-#define VRT_ANGLE_RP 22
-#define VRT_ANGLE_C(_x) _FXPT_C(vrt_angle_t, _x, VRT_ANGLE_RP)
-
-static inline vrt_angle_t
-double_to_vrt_angle(double num){
- return VRT_ANGLE_C(num);
-}
-
-static inline int16_t
-vrt_angle_round_to_int(vrt_angle_t fx){
- return _FXPT_TO_INT(fx, VRT_ANGLE_C(1));
-}
-
-static inline double
-vrt_angle_to_double(vrt_angle_t fx){
- return _FXPT_TO_DOUBLE(fx, VRT_ANGLE_C(1));
-}
-
-/*
- * The VRT Hertz type
- */
-typedef int64_t vrt_hertz_t;
-#define VRT_HERTZ_RP 20
-#define VRT_HERTZ_C(_x) _FXPT_C(vrt_hertz_t, _x, VRT_HERTZ_RP)
-
-static inline vrt_hertz_t
-double_to_vrt_hertz(double num){
- return VRT_HERTZ_C(num);
-}
-
-static inline int64_t
-vrt_hertz_round_to_int(vrt_hertz_t fx){
- return _FXPT_TO_INT(fx, VRT_HERTZ_C(1));
-}
-
-static inline double
-vrt_hertz_to_double(vrt_hertz_t fx){
- return _FXPT_TO_DOUBLE(fx, VRT_HERTZ_C(1));
-}
-
-/*
- * The VRT dB (& dBm) type
- */
-typedef int16_t vrt_db_t;
-#define VRT_DB_RP 7
-#define VRT_DB_C(_x) _FXPT_C(vrt_db_t, _x, VRT_DB_RP)
-
-static inline vrt_db_t
-double_to_vrt_db(double num){
- return VRT_DB_C(num);
-}
-
-static inline int16_t
-vrt_db_round_to_int(vrt_db_t fx){
- return _FXPT_TO_INT(fx, VRT_DB_C(1));
-}
-
-static inline double
-vrt_db_to_double(vrt_db_t fx){
- return _FXPT_TO_DOUBLE(fx, VRT_DB_C(1));
-}
-
-/*
- * The VRT Temperature type (Celsius)
- */
-typedef int16_t vrt_temp_t;
-#define VRT_TEMP_RP 6
-#define VRT_TEMP_C(_x) _FXPT_C(vrt_temp_t, _x, VRT_TEMP_RP)
-
-static inline vrt_temp_t
-double_to_vrt_temp(double num){
- return VRT_TEMP_C(num);
-}
-
-static inline int16_t
-vrt_temp_round_to_int(vrt_temp_t fx){
- return _FXPT_TO_INT(fx, VRT_TEMP_C(1));
-}
-
-static inline double
-vrt_temp_to_double(vrt_temp_t fx){
- return _FXPT_TO_DOUBLE(fx, VRT_TEMP_C(1));
-}
-
-/*
- * The VRT Gain type (7.1.5.10 Gain -- two Q10.6 dB fields)
- */
-typedef uint32_t vrt_gain_t;
-
-static inline uint32_t
-vrt_make_gain(vrt_db_t stage1, vrt_db_t stage2)
-{
- return (((uint32_t) stage2) << 16) | (stage1 & 0xffff);
-}
-
-static inline vrt_db_t
-vrt_gain_stage1(uint32_t field)
-{
- return (vrt_db_t)(field & 0xffff);
-}
-
-static inline vrt_db_t
-vrt_gain_stage2(uint32_t field)
-{
- return (vrt_db_t)((field >> 16) & 0xffff);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* INCLUDED_VRT_TYPES_H */
diff --git a/vrt/lib/.gitignore b/vrt/lib/.gitignore
deleted file mode 100644
index 02b052397..000000000
--- a/vrt/lib/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-Makefile
-Makefile.in
-.deps
-.libs
diff --git a/vrt/lib/Makefile.am b/vrt/lib/Makefile.am
deleted file mode 100644
index ef2110876..000000000
--- a/vrt/lib/Makefile.am
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# Copyright 2007,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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-include $(top_srcdir)/Makefile.common
-
-AM_CPPFLAGS = \
- $(VRT_INCLUDES) \
- $(BOOST_CPPFLAGS) \
- $(CPPUNIT_INCLUDES) \
- $(GRUEL_INCLUDES)
-
-bin_PROGRAMS =
-
-lib_LTLIBRARIES = \
- libvrt.la
-
-libvrt_la_SOURCES = \
- copiers.cc \
- data_handler.cc \
- expanded_header.cc \
- expanded_if_context_section.cc \
- header_utils.cc \
- rx.cc \
- rx_packet_handler.cc \
- socket_rx_buffer.cc
-
-libvrt_la_LIBADD =
-
-libvrt_la_LDFLAGS = $(LTVERSIONFLAGS)
-
-# Private headers not needed for above the API development
-noinst_HEADERS = \
- data_handler.h \
- expanded_header_unpack_switch_body.h \
- expanded_header_pack_switch_body.h \
- header_utils.h \
- socket_rx_buffer.h
-
-EXTRA_DIST = \
- gen_unpack_switch_body.py \
- gen_pack_switch_body.py
diff --git a/vrt/lib/copiers.cc b/vrt/lib/copiers.cc
deleted file mode 100644
index ddf82abcf..000000000
--- a/vrt/lib/copiers.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2009 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <vrt/copiers.h>
-#include <arpa/inet.h>
-#include <assert.h>
-#include <string.h>
-
-namespace vrt {
-
- void
- copy_net_16sc_to_host_16sc(size_t nitems,
- const uint32_t *items,
- std::complex<int16_t> *host_items)
- {
-#ifdef WORDS_BIGENDIAN
-
- assert(sizeof(items[0]) == sizeof(host_items[0]));
- memcpy(host_items, items, nitems * sizeof(items[0]));
-
-#else
-
- // FIXME SIMD welcome here
-
- for (size_t i = 0; i < nitems; i++){
- uint32_t t = ntohl(items[i]);
- //printf("%9d\n", items[i]);
- host_items[i] = std::complex<int16_t>((t >> 16), t & 0xffff);
- }
-
-#endif
- }
-
- void
- copy_net_16sc_to_host_32fc(size_t nitems,
- const uint32_t *items,
- std::complex<float> *host_items)
- {
- // FIXME SIMD welcome here
-
- for (size_t i = 0; i < nitems; i++){
- uint32_t t = ntohl(items[i]);
- int16_t re = (t >> 16) & 0xffff;
- int16_t im = (t & 0xffff);
- host_items[i] = std::complex<float>(re * 1.0/32768, im * 1.0/32768);
- }
- }
-
-};
-
diff --git a/vrt/lib/data_handler.cc b/vrt/lib/data_handler.cc
deleted file mode 100644
index 7d1f73a9a..000000000
--- a/vrt/lib/data_handler.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,2009 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "data_handler.h"
-
-namespace vrt {
-
- data_handler::~data_handler()
- {
- // default nop destructor
- }
-
-}
-
diff --git a/vrt/lib/data_handler.h b/vrt/lib/data_handler.h
deleted file mode 100644
index cbae9a714..000000000
--- a/vrt/lib/data_handler.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,2009,2010 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_VRT_DATA_HANDLER_H
-#define INCLUDED_VRT_DATA_HANDLER_H
-
-#include <stdint.h>
-#include <stddef.h>
-
-namespace vrt {
-
- /*!
- * \brief Abstract function object called to handle received data blocks.
- */
- class data_handler
- {
- public:
-
- /*!
- * \param base points to the beginning of the data.
- * \param len is the length of the data in bytes.
- * \returns true if it wants to be called again, else false.
- */
- virtual bool operator()(const void *base, size_t len) = 0;
- virtual ~data_handler();
- };
-
-} // namespace vrt
-
-#endif /* INCLUDED_VRT_DATA_HANDLER_H */
diff --git a/vrt/lib/expanded_header.cc b/vrt/lib/expanded_header.cc
deleted file mode 100644
index ab5e3a34e..000000000
--- a/vrt/lib/expanded_header.cc
+++ /dev/null
@@ -1,195 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2009 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <vrt/expanded_header.h>
-//#include <gruel/inet.h>
-#include <arpa/inet.h>
-#include <boost/format.hpp>
-#include "header_utils.h"
-
-using boost::format;
-using boost::io::group;
-
-
-namespace vrt {
-
- using namespace detail;
-
- // lookup tables indexed by packet type
- unsigned char expanded_header::s_if_data[16] = {
- 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
-
- unsigned char expanded_header::s_ext_data[16] = {
- 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
-
- unsigned char expanded_header::s_data[16] = {
- 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
-
- unsigned char expanded_header::s_context[16] = {
- 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
-
- unsigned char expanded_header::s_stream_id[16] = {
- 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
-
-
- // dispatch codeword bits
- static const int HAS_STREAM_ID = 1 << 0;
- static const int HAS_CLASS_ID = 1 << 1;
- static const int HAS_INTEGER_SECS = 1 << 2;
- static const int HAS_FRACTIONAL_SECS = 1 << 3;
- static const int HAS_TRAILER = 1 << 4;
-
- static int
- compute_codeword(const expanded_header &h)
- {
- int cw = 0;
- if (h.stream_id_p()) cw |= HAS_STREAM_ID;
- if (h.class_id_p()) cw |= HAS_CLASS_ID;
- if (h.integer_secs_p()) cw |= HAS_INTEGER_SECS;
- if (h.fractional_secs_p()) cw |= HAS_FRACTIONAL_SECS;
- if (h.trailer_p()) cw |= HAS_TRAILER;
- return cw;
- }
-
- void expanded_header::pack(const expanded_header *h, // in
- size_t n32_bit_words_payload, // in
- uint32_t *header, // out
- size_t *n32_bit_words_header, // out
- uint32_t *trailer, // out
- size_t *n32_bit_words_trailer) // out
- {
- int cw = compute_codeword(*h);
- //fills in the header (except word0), header length, trailer, trailer length
- switch (cw & 0x1f){
-#include "expanded_header_pack_switch_body.h"
- }
- //fill in the header word 0 with the calculated length
- size_t n32_bit_words_packet = *n32_bit_words_header + n32_bit_words_payload + *n32_bit_words_trailer;
- header[0] = htonl((h->header & ~VRTH_PKT_SIZE_MASK) | (n32_bit_words_packet & VRTH_PKT_SIZE_MASK));
- }
-
- bool
- expanded_header::unpack(const uint32_t *packet, // in
- size_t n32_bit_words_packet, // in
- expanded_header *h, // out
- const uint32_t **payload, // out
- size_t *n32_bit_words_payload) // out
- {
- size_t n32_bit_words_header = 0;
- size_t n32_bit_words_trailer = 0;
- size_t len = n32_bit_words_packet;
- const uint32_t *p = packet;
-
- *payload = 0;
- *n32_bit_words_payload = 0;
-
- // printf("unpack: n32_bit_words_packet = %zd\n", n32_bit_words_packet);
-
- if (len < 1){ // must have at least the header word
- h->header = 0;
- return false;
- }
-
- h->header = ntohl(p[0]);
-
- if (h->pkt_size() > len)
- return false; // VRT header says packet is bigger than what we've got
-
- len = h->pkt_size(); // valid length of packet
-
- int cw = compute_codeword(*h);
- switch (cw & 0x1f){
-#include "expanded_header_unpack_switch_body.h"
- }
-
- if (n32_bit_words_header + n32_bit_words_trailer > len)
- return false; // negative payload len
-
- *payload = p + n32_bit_words_header;
- *n32_bit_words_payload = len - (n32_bit_words_header + n32_bit_words_trailer);
-
- // printf("unpack: hdr = 0x%08x, cw = 0x%02x, n32_bit_words_header = %d, n32_bit_words_trailer = %d\n",
- // h->header, cw, n32_bit_words_header, n32_bit_words_trailer);
-
- return true;
- }
-
- std::string
- pkt_type_name(const vrt::expanded_header *hdr)
- {
- if (hdr->if_data_p())
- return "IF-Data";
- if (hdr->ext_data_p())
- return "Ext-Data";
- if (hdr->if_context_p())
- return "IF-Context";
- if (hdr->ext_context_p())
- return "Ext-Context";
- else
- return "<unknown pkt type>";
- }
-
- void
- expanded_header::write(std::ostream &port) const
- {
- port << format("%s:\n") % pkt_type_name(this);
- if (1){
- wr_name(port, "header");
- wr_header(port, header);
- }
-
- if (stream_id_p()){
- wr_name(port, "stream_id");
- wr_uint32_hex(port, stream_id);
- }
-
- if (class_id_p()){
- wr_name(port, "class_id");
- port << format("0x%016llx\n") % class_id;
- }
-
- if (integer_secs_p()){
- wr_name(port, "int secs");
- //port << format("%10d\n") % integer_secs;
- wr_int_secs(port, integer_secs);
- }
-
- if (fractional_secs_p()){
- wr_name(port, "frac secs");
- port << format("%10d\n") % fractional_secs;
- }
- }
-
- std::ostream& operator<<(std::ostream &os, const expanded_header &obj)
- {
- obj.write(os);
- return os;
- }
-
-}; // vrt
diff --git a/vrt/lib/expanded_header_pack_switch_body.h b/vrt/lib/expanded_header_pack_switch_body.h
deleted file mode 100644
index ca6e14989..000000000
--- a/vrt/lib/expanded_header_pack_switch_body.h
+++ /dev/null
@@ -1,272 +0,0 @@
- case 0:
- *n32_bit_words_header = 1;
- *n32_bit_words_trailer = 0;
- break;
-
- case 1:
- header[1] = htonl(h->stream_id);
- *n32_bit_words_header = 2;
- *n32_bit_words_trailer = 0;
- break;
-
- case 2:
- header[1] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[2] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- *n32_bit_words_header = 3;
- *n32_bit_words_trailer = 0;
- break;
-
- case 3:
- header[1] = htonl(h->stream_id);
- header[2] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- *n32_bit_words_header = 4;
- *n32_bit_words_trailer = 0;
- break;
-
- case 4:
- header[1] = htonl(h->integer_secs);
- *n32_bit_words_header = 2;
- *n32_bit_words_trailer = 0;
- break;
-
- case 5:
- header[1] = htonl(h->stream_id);
- header[2] = htonl(h->integer_secs);
- *n32_bit_words_header = 3;
- *n32_bit_words_trailer = 0;
- break;
-
- case 6:
- header[1] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[2] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[3] = htonl(h->integer_secs);
- *n32_bit_words_header = 4;
- *n32_bit_words_trailer = 0;
- break;
-
- case 7:
- header[1] = htonl(h->stream_id);
- header[2] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[4] = htonl(h->integer_secs);
- *n32_bit_words_header = 5;
- *n32_bit_words_trailer = 0;
- break;
-
- case 8:
- header[1] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[2] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 3;
- *n32_bit_words_trailer = 0;
- break;
-
- case 9:
- header[1] = htonl(h->stream_id);
- header[2] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 4;
- *n32_bit_words_trailer = 0;
- break;
-
- case 10:
- header[1] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[2] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[4] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 5;
- *n32_bit_words_trailer = 0;
- break;
-
- case 11:
- header[1] = htonl(h->stream_id);
- header[2] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[4] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[5] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 6;
- *n32_bit_words_trailer = 0;
- break;
-
- case 12:
- header[1] = htonl(h->integer_secs);
- header[2] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 4;
- *n32_bit_words_trailer = 0;
- break;
-
- case 13:
- header[1] = htonl(h->stream_id);
- header[2] = htonl(h->integer_secs);
- header[3] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[4] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 5;
- *n32_bit_words_trailer = 0;
- break;
-
- case 14:
- header[1] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[2] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[3] = htonl(h->integer_secs);
- header[4] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[5] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 6;
- *n32_bit_words_trailer = 0;
- break;
-
- case 15:
- header[1] = htonl(h->stream_id);
- header[2] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[4] = htonl(h->integer_secs);
- header[5] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[6] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 7;
- *n32_bit_words_trailer = 0;
- break;
-
- case 16:
- *n32_bit_words_header = 1;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 17:
- header[1] = htonl(h->stream_id);
- *n32_bit_words_header = 2;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 18:
- header[1] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[2] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- *n32_bit_words_header = 3;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 19:
- header[1] = htonl(h->stream_id);
- header[2] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- *n32_bit_words_header = 4;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 20:
- header[1] = htonl(h->integer_secs);
- *n32_bit_words_header = 2;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 21:
- header[1] = htonl(h->stream_id);
- header[2] = htonl(h->integer_secs);
- *n32_bit_words_header = 3;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 22:
- header[1] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[2] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[3] = htonl(h->integer_secs);
- *n32_bit_words_header = 4;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 23:
- header[1] = htonl(h->stream_id);
- header[2] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[4] = htonl(h->integer_secs);
- *n32_bit_words_header = 5;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 24:
- header[1] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[2] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 3;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 25:
- header[1] = htonl(h->stream_id);
- header[2] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 4;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 26:
- header[1] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[2] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[4] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 5;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 27:
- header[1] = htonl(h->stream_id);
- header[2] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[4] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[5] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 6;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 28:
- header[1] = htonl(h->integer_secs);
- header[2] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 4;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 29:
- header[1] = htonl(h->stream_id);
- header[2] = htonl(h->integer_secs);
- header[3] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[4] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 5;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 30:
- header[1] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[2] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[3] = htonl(h->integer_secs);
- header[4] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[5] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 6;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
- case 31:
- header[1] = htonl(h->stream_id);
- header[2] = htonl((uint32_t)((h->class_id >> 32) & 0xffffffff));
- header[3] = htonl((uint32_t)((h->class_id >> 0) & 0xffffffff));
- header[4] = htonl(h->integer_secs);
- header[5] = htonl((uint32_t)((h->fractional_secs >> 32) & 0xffffffff));
- header[6] = htonl((uint32_t)((h->fractional_secs >> 0) & 0xffffffff));
- *n32_bit_words_header = 7;
- trailer[0] = htonl(h->trailer);
- *n32_bit_words_trailer = 1;
- break;
-
diff --git a/vrt/lib/expanded_header_unpack_switch_body.h b/vrt/lib/expanded_header_unpack_switch_body.h
deleted file mode 100644
index 6bfaf3799..000000000
--- a/vrt/lib/expanded_header_unpack_switch_body.h
+++ /dev/null
@@ -1,320 +0,0 @@
- case 0:
- h->stream_id = 0;
- h->class_id = 0;
- h->integer_secs = 0;
- h->fractional_secs = 0;
- n32_bit_words_header = 1;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 1:
- h->stream_id = ntohl(p[1]);
- h->class_id = 0;
- h->integer_secs = 0;
- h->fractional_secs = 0;
- n32_bit_words_header = 2;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 2:
- h->stream_id = 0;
- h->class_id = ((uint64_t)(ntohl(p[1])) << 32) | ntohl(p[2]);
- h->integer_secs = 0;
- h->fractional_secs = 0;
- n32_bit_words_header = 3;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 3:
- h->stream_id = ntohl(p[1]);
- h->class_id = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- h->integer_secs = 0;
- h->fractional_secs = 0;
- n32_bit_words_header = 4;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 4:
- h->stream_id = 0;
- h->class_id = 0;
- h->integer_secs = ntohl(p[1]);
- h->fractional_secs = 0;
- n32_bit_words_header = 2;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 5:
- h->stream_id = ntohl(p[1]);
- h->class_id = 0;
- h->integer_secs = ntohl(p[2]);
- h->fractional_secs = 0;
- n32_bit_words_header = 3;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 6:
- h->stream_id = 0;
- h->class_id = ((uint64_t)(ntohl(p[1])) << 32) | ntohl(p[2]);
- h->integer_secs = ntohl(p[3]);
- h->fractional_secs = 0;
- n32_bit_words_header = 4;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 7:
- h->stream_id = ntohl(p[1]);
- h->class_id = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- h->integer_secs = ntohl(p[4]);
- h->fractional_secs = 0;
- n32_bit_words_header = 5;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 8:
- h->stream_id = 0;
- h->class_id = 0;
- h->integer_secs = 0;
- h->fractional_secs = ((uint64_t)(ntohl(p[1])) << 32) | ntohl(p[2]);
- n32_bit_words_header = 3;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 9:
- h->stream_id = ntohl(p[1]);
- h->class_id = 0;
- h->integer_secs = 0;
- h->fractional_secs = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- n32_bit_words_header = 4;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 10:
- h->stream_id = 0;
- h->class_id = ((uint64_t)(ntohl(p[1])) << 32) | ntohl(p[2]);
- h->integer_secs = 0;
- h->fractional_secs = ((uint64_t)(ntohl(p[3])) << 32) | ntohl(p[4]);
- n32_bit_words_header = 5;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 11:
- h->stream_id = ntohl(p[1]);
- h->class_id = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- h->integer_secs = 0;
- h->fractional_secs = ((uint64_t)(ntohl(p[4])) << 32) | ntohl(p[5]);
- n32_bit_words_header = 6;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 12:
- h->stream_id = 0;
- h->class_id = 0;
- h->integer_secs = ntohl(p[1]);
- h->fractional_secs = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- n32_bit_words_header = 4;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 13:
- h->stream_id = ntohl(p[1]);
- h->class_id = 0;
- h->integer_secs = ntohl(p[2]);
- h->fractional_secs = ((uint64_t)(ntohl(p[3])) << 32) | ntohl(p[4]);
- n32_bit_words_header = 5;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 14:
- h->stream_id = 0;
- h->class_id = ((uint64_t)(ntohl(p[1])) << 32) | ntohl(p[2]);
- h->integer_secs = ntohl(p[3]);
- h->fractional_secs = ((uint64_t)(ntohl(p[4])) << 32) | ntohl(p[5]);
- n32_bit_words_header = 6;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 15:
- h->stream_id = ntohl(p[1]);
- h->class_id = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- h->integer_secs = ntohl(p[4]);
- h->fractional_secs = ((uint64_t)(ntohl(p[5])) << 32) | ntohl(p[6]);
- n32_bit_words_header = 7;
- h->trailer = 0;
- n32_bit_words_trailer = 0;
- break;
-
- case 16:
- h->stream_id = 0;
- h->class_id = 0;
- h->integer_secs = 0;
- h->fractional_secs = 0;
- n32_bit_words_header = 1;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 17:
- h->stream_id = ntohl(p[1]);
- h->class_id = 0;
- h->integer_secs = 0;
- h->fractional_secs = 0;
- n32_bit_words_header = 2;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 18:
- h->stream_id = 0;
- h->class_id = ((uint64_t)(ntohl(p[1])) << 32) | ntohl(p[2]);
- h->integer_secs = 0;
- h->fractional_secs = 0;
- n32_bit_words_header = 3;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 19:
- h->stream_id = ntohl(p[1]);
- h->class_id = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- h->integer_secs = 0;
- h->fractional_secs = 0;
- n32_bit_words_header = 4;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 20:
- h->stream_id = 0;
- h->class_id = 0;
- h->integer_secs = ntohl(p[1]);
- h->fractional_secs = 0;
- n32_bit_words_header = 2;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 21:
- h->stream_id = ntohl(p[1]);
- h->class_id = 0;
- h->integer_secs = ntohl(p[2]);
- h->fractional_secs = 0;
- n32_bit_words_header = 3;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 22:
- h->stream_id = 0;
- h->class_id = ((uint64_t)(ntohl(p[1])) << 32) | ntohl(p[2]);
- h->integer_secs = ntohl(p[3]);
- h->fractional_secs = 0;
- n32_bit_words_header = 4;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 23:
- h->stream_id = ntohl(p[1]);
- h->class_id = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- h->integer_secs = ntohl(p[4]);
- h->fractional_secs = 0;
- n32_bit_words_header = 5;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 24:
- h->stream_id = 0;
- h->class_id = 0;
- h->integer_secs = 0;
- h->fractional_secs = ((uint64_t)(ntohl(p[1])) << 32) | ntohl(p[2]);
- n32_bit_words_header = 3;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 25:
- h->stream_id = ntohl(p[1]);
- h->class_id = 0;
- h->integer_secs = 0;
- h->fractional_secs = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- n32_bit_words_header = 4;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 26:
- h->stream_id = 0;
- h->class_id = ((uint64_t)(ntohl(p[1])) << 32) | ntohl(p[2]);
- h->integer_secs = 0;
- h->fractional_secs = ((uint64_t)(ntohl(p[3])) << 32) | ntohl(p[4]);
- n32_bit_words_header = 5;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 27:
- h->stream_id = ntohl(p[1]);
- h->class_id = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- h->integer_secs = 0;
- h->fractional_secs = ((uint64_t)(ntohl(p[4])) << 32) | ntohl(p[5]);
- n32_bit_words_header = 6;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 28:
- h->stream_id = 0;
- h->class_id = 0;
- h->integer_secs = ntohl(p[1]);
- h->fractional_secs = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- n32_bit_words_header = 4;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 29:
- h->stream_id = ntohl(p[1]);
- h->class_id = 0;
- h->integer_secs = ntohl(p[2]);
- h->fractional_secs = ((uint64_t)(ntohl(p[3])) << 32) | ntohl(p[4]);
- n32_bit_words_header = 5;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 30:
- h->stream_id = 0;
- h->class_id = ((uint64_t)(ntohl(p[1])) << 32) | ntohl(p[2]);
- h->integer_secs = ntohl(p[3]);
- h->fractional_secs = ((uint64_t)(ntohl(p[4])) << 32) | ntohl(p[5]);
- n32_bit_words_header = 6;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
- case 31:
- h->stream_id = ntohl(p[1]);
- h->class_id = ((uint64_t)(ntohl(p[2])) << 32) | ntohl(p[3]);
- h->integer_secs = ntohl(p[4]);
- h->fractional_secs = ((uint64_t)(ntohl(p[5])) << 32) | ntohl(p[6]);
- n32_bit_words_header = 7;
- h->trailer = ntohl(p[len-1]);
- n32_bit_words_trailer = 1;
- break;
-
diff --git a/vrt/lib/expanded_if_context_section.cc b/vrt/lib/expanded_if_context_section.cc
deleted file mode 100644
index 3f1cda4b4..000000000
--- a/vrt/lib/expanded_if_context_section.cc
+++ /dev/null
@@ -1,493 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2010 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <vrt/expanded_if_context_section.h>
-#include <string.h>
-//#include <gruel/inet.h>
-#include <arpa/inet.h>
-#include <boost/format.hpp>
-#include "header_utils.h"
-
-using boost::format;
-using boost::io::group;
-
-
-namespace vrt
-{
- using namespace detail;
-
- void
- expanded_if_context_section::clear()
- {
- context_indicator = 0;
- ref_point_id = 0;
- bandwidth = 0;
- if_ref_freq = 0;
- rf_ref_freq = 0;
- rf_ref_freq_offset = 0;
- if_band_offset = 0;
- ref_level = 0;
- gain = 0;
- over_range_count = 0;
- sample_rate = 0;
- timestamp_adj = 0;
- timestamp_cal_time = 0;
- temperature = 0;
- device_id[0] = 0;
- device_id[1] = 0;
- state_and_event_ind = 0;
- memset(&payload_fmt, 0, sizeof(payload_fmt));
- memset(&formatted_gps, 0, sizeof(formatted_gps));
- memset(&formatted_ins, 0, sizeof(formatted_ins));
- memset(&ecef_ephemeris, 0, sizeof(ecef_ephemeris));
- memset(&rel_ephemeris, 0, sizeof(rel_ephemeris));
- ephemeris_ref_id = 0;
- gps_ascii.manuf_oui = 0;
- gps_ascii.ascii.clear();
- cntx_assoc_lists.source.clear();
- cntx_assoc_lists.system.clear();
- cntx_assoc_lists.vector_comp.clear();
- cntx_assoc_lists.async_channel.clear();
- cntx_assoc_lists.async_tag.clear();
- }
-
- struct unpack_info {
- const uint32_t *p;
- const size_t nwords;
- size_t i;
-
- unpack_info(const uint32_t *p_, size_t nwords_)
- : p(p_), nwords(nwords_), i(0) {}
-
- bool consumed_all()
- {
- return nwords - i == 0;
- }
-
- bool ensure(size_t n)
- {
- return (nwords - i) >= n;
- }
-
- bool get_int32(int32_t &x)
- {
- if (!ensure(1))
- return false;
- x = ntohl(p[i++]);
- return true;
- }
-
- bool get_uint32(uint32_t &x)
- {
- if (!ensure(1))
- return false;
- x = ntohl(p[i++]);
- return true;
- }
-
- bool get_hertz(vrt_hertz_t &x)
- {
- if (!ensure(2))
- return false;
-
- uint32_t hi = ntohl(p[i++]);
- uint32_t lo = ntohl(p[i++]);
- x = ((int64_t) hi) << 32 | lo;
- return true;
- }
-
- bool get_db(vrt_db_t &x)
- {
- if (!ensure(1))
- return false;
- x = ntohl(p[i++]);
- return true;
- }
-
- bool get_gain(vrt_gain_t &x)
- {
- if (!ensure(1))
- return false;
- x = ntohl(p[i++]);
- return true;
- }
-
- bool get_int64(int64_t &x)
- {
- if (!ensure(2))
- return false;
-
- uint32_t hi = ntohl(p[i++]);
- uint32_t lo = ntohl(p[i++]);
- x = ((int64_t) hi) << 32 | lo;
- return true;
- }
-
- bool get_temp(vrt_temp_t &x)
- {
- if (!ensure(1))
- return false;
- x = ntohl(p[i++]) & 0xffff;
- return true;
- }
-
- bool get_nwords(uint32_t *x, unsigned int nw)
- {
- if (!ensure(nw))
- return false;
-
- for (unsigned int j = 0; j < nw; j++)
- x[j] = ntohl(p[i++]);
-
- return true;
- }
-
- bool get_nwords_vector(std::vector<uint32_t> &x, unsigned int nw)
- {
- if (!ensure(nw))
- return false;
- x.resize(nw);
- return get_nwords(&x[0], nw);
- }
-
- bool get_formatted_gps(vrt_formatted_gps_t &x)
- {
- return get_nwords((uint32_t *) &x, 11);
- }
-
- bool get_ephemeris(vrt_ephemeris_t &x)
- {
- return get_nwords((uint32_t *) &x, 13);
- }
-
- bool get_gps_ascii(exp_gps_ascii &x)
- {
- uint32_t manuf_oui;
- uint32_t nw;
-
- if (!get_uint32(manuf_oui) || !get_uint32(nw))
- return false;
-
- if (!ensure(nw))
- return false;
-
- const char *s = (const char *)&p[i];
- size_t nbytes = strnlen(s, nw * sizeof(uint32_t));
- x.manuf_oui = manuf_oui;
- x.ascii = std::string(s, nbytes);
- i += nw;
- return true;
- }
-
- bool get_cntx_assoc_lists(exp_context_assocs &x)
- {
- uint32_t w0;
- uint32_t w1;
-
- if (!get_uint32(w0) || !get_uint32(w1))
- return false;
-
- uint32_t source_list_size = (w0 >> 16) & 0x1ff;
- uint32_t system_list_size = w0 & 0x1ff;
- uint32_t vector_comp_list_size = (w1 >> 16) & 0xffff;
- uint32_t async_channel_list_size = w1 & 0x7fff;
- bool a_bit = (w1 & 0x8000) != 0;
- uint32_t async_tag_list_size = a_bit ? async_channel_list_size : 0;
-
- return (true
- && get_nwords_vector(x.source, source_list_size)
- && get_nwords_vector(x.system, system_list_size)
- && get_nwords_vector(x.vector_comp, vector_comp_list_size)
- && get_nwords_vector(x.async_channel, async_channel_list_size)
- && get_nwords_vector(x.async_tag, async_tag_list_size));
- }
-
- };
-
- bool
- expanded_if_context_section::unpack(const uint32_t *context_section, // in
- size_t n32_bit_words, // in
- expanded_if_context_section *e) // out
- {
- unpack_info u(context_section, n32_bit_words);
- e->clear();
-
- if (!u.get_uint32(e->context_indicator))
- return false;
- uint32_t cif = e->context_indicator;
-
- if (cif & CI_REF_POINT_ID)
- if (!u.get_uint32(e->ref_point_id))
- return false;
-
- if (cif & CI_BANDWIDTH)
- if (!u.get_hertz(e->bandwidth))
- return false;
-
- if (cif & CI_IF_REF_FREQ)
- if (!u.get_hertz(e->if_ref_freq))
- return false;
-
- if (cif & CI_RF_REF_FREQ)
- if (!u.get_hertz(e->rf_ref_freq))
- return false;
-
- if (cif & CI_RF_REF_FREQ_OFFSET)
- if (!u.get_hertz(e->rf_ref_freq_offset))
- return false;
-
- if (cif & CI_IF_BAND_OFFSET)
- if (!u.get_hertz(e->if_band_offset))
- return false;
-
- if (cif & CI_REF_LEVEL)
- if (!u.get_db(e->ref_level))
- return false;
-
- if (cif & CI_GAIN)
- if (!u.get_gain(e->gain))
- return false;
-
- if (cif & CI_OVER_RANGE_COUNT)
- if (!u.get_uint32(e->over_range_count))
- return false;
-
- if (cif & CI_SAMPLE_RATE)
- if (!u.get_hertz(e->sample_rate))
- return false;
-
- if (cif & CI_TIMESTAMP_ADJ)
- if (!u.get_int64(e->timestamp_adj))
- return false;
-
- if (cif & CI_TIMESTAMP_CAL_TIME)
- if (!u.get_uint32(e->timestamp_cal_time))
- return false;
-
- if (cif & CI_TEMPERATURE)
- if (!u.get_temp(e->temperature))
- return false;
-
- if (cif & CI_DEVICE_ID)
- if (!u.get_uint32(e->device_id[0]) || !u.get_uint32(e->device_id[1]))
- return false;
-
- if (cif & CI_STATE_AND_EVENT_IND)
- if (!u.get_uint32(e->state_and_event_ind))
- return false;
-
- if (cif & CI_PAYLOAD_FMT)
- if (!u.get_uint32(e->payload_fmt.word0) || !u.get_uint32(e->payload_fmt.word1))
- return false;
-
- if (cif & CI_FORMATTED_GPS)
- if (!u.get_formatted_gps(e->formatted_gps))
- return false;
-
- if (cif & CI_FORMATTED_INS)
- if (!u.get_formatted_gps(e->formatted_ins))
- return false;
-
- if (cif & CI_ECEF_EPHEMERIS)
- if (!u.get_ephemeris(e->ecef_ephemeris))
- return false;
-
- if (cif & CI_REL_EPHEMERIS)
- if (!u.get_ephemeris(e->rel_ephemeris))
- return false;
-
- if (cif & CI_EPHEMERIS_REF_ID)
- if (!u.get_int32(e->ephemeris_ref_id))
- return false;
-
- if (cif & CI_GPS_ASCII)
- if (!u.get_gps_ascii(e->gps_ascii))
- return false;
-
- if (cif & CI_CNTX_ASSOC_LISTS)
- if (!u.get_cntx_assoc_lists(e->cntx_assoc_lists))
- return false;
-
- return u.consumed_all();
- }
-
- static void
- wr_cntx_list(std::ostream &os, const std::string &name, const std::vector<uint32_t> &v)
- {
- if (v.empty())
- return;
-
- wr_name(os, " " + name);
- for (size_t j = 0; j < v.size(); j++)
- os << format("%#x ") % v[j];
- os << std::endl;
- }
-
- static void
- wr_cntx_assoc_lists(std::ostream &os, const exp_context_assocs &x)
- {
- os << std::endl;
- wr_cntx_list(os, "source", x.source);
- wr_cntx_list(os, "system", x.system);
- wr_cntx_list(os, "vector", x.vector_comp);
- wr_cntx_list(os, "async_chan", x.async_channel);
- wr_cntx_list(os, "async_tag", x.async_tag);
- }
-
- void
- expanded_if_context_section::write(std::ostream &os) const
- {
- uint32_t cif = context_indicator;
-
- if (cif & CI_REF_POINT_ID){
- wr_name(os, "ref_point_id");
- wr_uint32_hex(os, ref_point_id);
- }
-
- if (cif & CI_BANDWIDTH){
- wr_name(os, "bandwidth");
- wr_hertz(os, bandwidth);
- }
-
- if (cif & CI_IF_REF_FREQ){
- wr_name(os, "if_ref_freq");
- wr_hertz(os, if_ref_freq);
- }
-
- if (cif & CI_RF_REF_FREQ){
- wr_name(os, "rf_ref_freq");
- wr_hertz(os, rf_ref_freq);
- }
-
- if (cif & CI_RF_REF_FREQ_OFFSET){
- wr_name(os, "rf_ref_freq_offset");
- wr_hertz(os, rf_ref_freq_offset);
- }
-
- if (cif & CI_IF_BAND_OFFSET){
- wr_name(os, "if_band_offset");
- wr_hertz(os, if_band_offset);
- }
-
- if (cif & CI_REF_LEVEL){
- wr_name(os, "ref_level");
- wr_dbm(os, ref_level);
- }
-
- if (cif & CI_GAIN){
- wr_name(os, "gain stage1");
- wr_db(os, vrt_gain_stage1(gain));
- wr_name(os, "gain stage2");
- wr_db(os, vrt_gain_stage2(gain));
- }
-
- if (cif & CI_OVER_RANGE_COUNT){
- wr_name(os, "over_range_count");
- wr_uint32_dec(os, over_range_count);
- }
-
- if (cif & CI_SAMPLE_RATE){
- wr_name(os, "sample_rate");
- wr_hertz(os, sample_rate);
- }
-
- if (cif & CI_TIMESTAMP_ADJ){
- wr_name(os, "timestamp_adj");
- os << format("%10d ps\n") % timestamp_adj;
- }
-
- if (cif & CI_TIMESTAMP_CAL_TIME){
- wr_name(os, "timestamp_cal_time");
- wr_int_secs(os, timestamp_cal_time);
- }
-
- if (cif & CI_TEMPERATURE){
- wr_name(os, "temperature");
- wr_temp(os, temperature);
- }
-
- if (cif & CI_DEVICE_ID){
- wr_name(os, "manuf_oui");
- wr_uint32_hex(os, device_id[0] & 0x00ffffff);
- wr_name(os, "device_code");
- wr_uint32_hex(os, device_id[1] & 0xffff);
- }
-
- if (cif & CI_STATE_AND_EVENT_IND){
- wr_name(os, "state_and_event_ind");
- wr_uint32_hex(os, state_and_event_ind);
- }
-
- if (cif & CI_PAYLOAD_FMT){
- wr_name(os, "payload_fmt");
- wr_payload_fmt(os, payload_fmt);
- }
-
- if (cif & CI_FORMATTED_GPS){
- wr_name(os, "formatted_gps");
- wr_formatted_gps(os, formatted_gps);
- }
-
- if (cif & CI_FORMATTED_INS){
- wr_name(os, "formatted_ins");
- wr_formatted_gps(os, formatted_ins);
- }
-
- if (cif & CI_ECEF_EPHEMERIS){
- wr_name(os, "ecef_ephemeris");
- os << "<NOT IMPLEMENTED>\n";
- // wr_ephemeris(os, ecef_ephemeris);
- }
-
- if (cif & CI_REL_EPHEMERIS){
- wr_name(os, "rel_ephemeris");
- os << "<NOT IMPLEMENTED>\n";
- // wr_ephemeris(os, rel_ephemeris);
- }
-
- if (cif & CI_EPHEMERIS_REF_ID){
- wr_name(os, "epemeris_ref_id");
- wr_uint32_hex(os, ephemeris_ref_id);
- }
-
- if (cif & CI_GPS_ASCII){
- wr_name(os, "gps_ascii");
- os << "<NOT IMPLEMENTED>\n";
- // wr_gps_ascii(os, gps_ascii);
- }
-
- if (cif & CI_CNTX_ASSOC_LISTS){
- wr_name(os, "cntx_assoc_lists");
- wr_cntx_assoc_lists(os, cntx_assoc_lists);
- }
-
- }
-
- std::ostream& operator<<(std::ostream &os, const expanded_if_context_section &obj)
- {
- obj.write(os);
- return os;
- }
-
-}; // namespace vrt
diff --git a/vrt/lib/gen_pack_switch_body.py b/vrt/lib/gen_pack_switch_body.py
deleted file mode 100755
index 6c7cd01b3..000000000
--- a/vrt/lib/gen_pack_switch_body.py
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-import sys
-
-# dispatch codeword bits
-HAS_STREAM_ID = 1 << 0;
-HAS_CLASS_ID = 1 << 1;
-HAS_INTEGER_SECS = 1 << 2;
-HAS_FRACTIONAL_SECS = 1 << 3;
-HAS_TRAILER = 1 << 4;
-
-def do_case(f, cw):
-
- def do32(name, mask, index):
- if cw & mask:
- f.write(" header[%d] = htonl(h->%s);\n" % (index, name))
- return 1
- return 0
-
- def do64(name, mask, index):
- if cw & mask:
- f.write(" header[%d] = htonl((uint32_t)((h->%s >> 32) & 0xffffffff));\n" % (index, name))
- f.write(" header[%d] = htonl((uint32_t)((h->%s >> 0) & 0xffffffff));\n" % (index+1, name))
- return 2
- return 0
-
- def dolength(index):
- f.write(" *n32_bit_words_header = %d;\n"%index)
-
- def dotrailer(name, mask):
- if cw & mask:
- f.write(" trailer[%d] = htonl(h->%s);\n" % (0, name))
- f.write(" *n32_bit_words_trailer = 1;\n")
- return 1
- else:
- f.write(" *n32_bit_words_trailer = 0;\n")
- return 0
-
- f.write(" case %d:\n" % (cw,))
-
- index = 1
- index += do32("stream_id", HAS_STREAM_ID, index)
- index += do64("class_id", HAS_CLASS_ID, index)
- index += do32("integer_secs", HAS_INTEGER_SECS, index)
- index += do64("fractional_secs", HAS_FRACTIONAL_SECS, index)
- dolength(index)
- dotrailer("trailer", HAS_TRAILER)
-
- f.write(" break;\n\n")
-
-
-def main():
- f = sys.stdout
-
- for cw in range(32):
- do_case(f, cw)
-
-
-if __name__ == '__main__':
- main()
diff --git a/vrt/lib/gen_unpack_switch_body.py b/vrt/lib/gen_unpack_switch_body.py
deleted file mode 100755
index d13e490b7..000000000
--- a/vrt/lib/gen_unpack_switch_body.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-import sys
-
-# dispatch codeword bits
-HAS_STREAM_ID = 1 << 0;
-HAS_CLASS_ID = 1 << 1;
-HAS_INTEGER_SECS = 1 << 2;
-HAS_FRACTIONAL_SECS = 1 << 3;
-HAS_TRAILER = 1 << 4;
-
-def do_case(f, cw):
-
- def do32(name, mask, index):
- f.write(" ")
- if cw & mask:
- f.write("h->%s = ntohl(p[%d]);\n" % (name, index))
- return 1
- else:
- f.write("h->%s = 0;\n" % (name,))
- return 0
-
- def do64(name, mask, index):
- f.write(" ")
- if cw & mask:
- f.write("h->%s = ((uint64_t)(ntohl(p[%d])) << 32) | ntohl(p[%d]);\n" % (name, index, index+1))
- return 2
- else:
- f.write("h->%s = 0;\n" % (name,))
- return 0
-
- def dolength(index):
- f.write(" n32_bit_words_header = %d;\n"%index)
-
- def dotrailer(name, mask):
- if cw & mask:
- f.write(" h->%s = ntohl(p[len-1]);\n" % (name,))
- f.write(" n32_bit_words_trailer = 1;\n")
- return 1
- else:
- f.write(" h->%s = 0;\n" % (name,))
- f.write(" n32_bit_words_trailer = 0;\n")
- return 0
-
- f.write(" case %d:\n" % (cw,))
-
- index = 1
- index += do32("stream_id", HAS_STREAM_ID, index)
- index += do64("class_id", HAS_CLASS_ID, index)
- index += do32("integer_secs", HAS_INTEGER_SECS, index)
- index += do64("fractional_secs", HAS_FRACTIONAL_SECS, index)
- dolength(index)
- dotrailer("trailer", HAS_TRAILER)
-
- f.write(" break;\n\n")
-
-
-def main():
- f = sys.stdout
-
- for cw in range(32):
- do_case(f, cw)
-
-
-if __name__ == '__main__':
- main()
diff --git a/vrt/lib/header_utils.cc b/vrt/lib/header_utils.cc
deleted file mode 100644
index 0f7ac315d..000000000
--- a/vrt/lib/header_utils.cc
+++ /dev/null
@@ -1,260 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2010 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "header_utils.h"
-#include <vrt/bits.h>
-#include <ostream>
-#include <time.h>
-#include <boost/format.hpp>
-
-using boost::format;
-using boost::io::group;
-
-namespace vrt
-{
- namespace detail {
-
- void wr_header(std::ostream &os, uint32_t x)
- {
- os << format("%#10x") % x;
-
- uint32_t t = (x >> 22) & 0x3;
- switch(t){
- case 0x0: os << " TSI=NONE"; break;
- case 0x1: os << " TSI=UTC"; break;
- case 0x2: os << " TSI=GPS"; break;
- case 0x3: os << " TSI=OTHER"; break;
- }
-
- t = (x >> 20) & 0x3;
- switch(t){
- case 0x0: os << " TSF=NONE"; break;
- case 0x1: os << " TSF=SAMPLE_CNT";break;
- case 0x2: os << " TSI=PICOSECS"; break;
- case 0x3: os << " TSI=FREE_RUN"; break;
- }
-
- uint32_t pt = x & VRTH_PT_MASK;
- if (pt == VRTH_PT_IF_CONTEXT || pt == VRTH_PT_EXT_CONTEXT){
- if (x & VRTH_TSM)
- os << " TSM=GENERAL";
- else
- os << " TSM=EXACT";
- }
- else if (0
- || pt == VRTH_PT_IF_DATA_WITH_SID
- || pt == VRTH_PT_IF_DATA_NO_SID
- || pt == VRTH_PT_EXT_DATA_WITH_SID
- || pt == VRTH_PT_EXT_DATA_NO_SID){
- if (x & VRTH_START_OF_BURST)
- os << " SOB";
- if (x & VRTH_END_OF_BURST)
- os << " EOB";
- }
-
- os << std::endl;
- }
-
- void wr_int_secs(std::ostream &os, uint32_t secs)
- {
- os << format("%10d") % secs;
-
- time_t t = secs;
- struct tm r;
-
- if (gmtime_r(&t, &r)){
- // ISO 8601 date + time
- os << format(" %04d-%02d-%02d %02d:%02d:%02dZ")
- % (r.tm_year + 1900) % (r.tm_mon + 1) % r.tm_mday
- % r.tm_hour % r.tm_min % r.tm_sec;
- }
-
- os << std::endl;
- }
-
- void wr_name(std::ostream &os, const std::string &x)
- {
- os << format(" %-21s ") % (x + ":");
- }
-
- void wr_uint32_hex(std::ostream &os, uint32_t x)
- {
- os << format("%#10x") % x;
- os << std::endl;
- }
-
- void wr_uint32_dec(std::ostream &os, uint32_t x)
- {
- os << format("%12d") % x;
- os << std::endl;
- }
-
- void wr_hertz(std::ostream &os, vrt_hertz_t x)
- {
- os << format("%12g Hz") % vrt_hertz_to_double(x);
- os << std::endl;
- }
-
- void wr_dbm(std::ostream &os, vrt_db_t x)
- {
- os << format("%10g dBm") % vrt_db_to_double(x);
- os << std::endl;
- }
-
- void wr_db(std::ostream &os, vrt_db_t x)
- {
- os << format("%10g dB") % vrt_db_to_double(x);
- os << std::endl;
- }
-
- void wr_temp(std::ostream &os, vrt_temp_t x)
- {
- os << format("%10g C") % vrt_temp_to_double(x);
- os << std::endl;
- }
-
- void wr_angle(std::ostream &os, vrt_angle_t x)
- {
- if (x == VRT_GPS_UNKNOWN_VALUE)
- os << " UNKNOWN";
- else
- os << format("%10g deg") % vrt_angle_to_double(x);
-
- os << std::endl;
- }
-
- void wr_distance(std::ostream &os, vrt_distance_t x)
- {
- if (x == VRT_GPS_UNKNOWN_VALUE)
- os << " UNKNOWN";
- else
- os << format("%10g m") % vrt_distance_to_double(x);
-
- os << std::endl;
- }
-
- void wr_velocity(std::ostream &os, vrt_velocity_t x)
- {
- if (x == VRT_GPS_UNKNOWN_VALUE)
- os << " UNKNOWN";
- else
- os << format("%10g m/s") % vrt_velocity_to_double(x);
-
- os << std::endl;
- }
-
- void wr_payload_fmt(std::ostream &os, vrt_payload_fmt_t f)
- {
- if (f.word0 & DF0_PACKED)
- os << " Packed";
-
- switch (f.word0 & DF0_REAL_CMPLX_TYPE_MASK){
- case DF0_REAL_CMPLX_TYPE_REAL: os << " Real"; break;
- case DF0_REAL_CMPLX_TYPE_CMPLX_CART: os << " Cmplx"; break;
- case DF0_REAL_CMPLX_TYPE_CMPLX_POLAR: os << " Polar"; break;
- case DF0_REAL_CMPLX_TYPE_RESERVED: os << " Reserved"; break;
- }
-
- switch(f.word0 & DF0_ITEM_FMT_MASK){
- case DF0_ITEM_FMT_SIGNED_FIXED_POINT: os << " S-Fixed"; break;
- case DF0_ITEM_FMT_UNSIGNED_FIXED_POINT: os << " U-Fixed"; break;
- case DF0_ITEM_FMT_IEEE_FLOAT: os << " float"; break;
- case DF0_ITEM_FMT_IEEE_DOUBLE: os << " double"; break;
- default:
- os << format(" ItemFmt=%#x") % ((f.word0 & DF0_ITEM_FMT_MASK) >> 24);
- break;
- }
-
- if (f.word0 & DF0_SAMPLE_COMPONENT_REPEATING)
- os << " SampleCompRpt";
-
- uint32_t t = (f.word0 & DF0_EVENT_TAG_SIZE_MASK) >> DF0_EVENT_TAG_SIZE_SHIFT;
- if (t != 0)
- os << format(" EvtTagSize=%d") % t;
-
- t = (f.word0 & DF0_CHANNEL_TAG_SIZE_MASK) >> DF0_CHANNEL_TAG_SIZE_SHIFT;
- if (t != 0)
- os << format(" ChanTagSize=%d") % t;
-
- t = (f.word0 & DF0_ITEM_PACKING_FIELD_SIZE_MASK) >> DF0_ITEM_PACKING_FIELD_SIZE_SHIFT;
- os << format(" FieldSize=%d") % (t + 1);
-
- t = (f.word0 & DF0_DATA_ITEM_SIZE_MASK) >> DF0_DATA_ITEM_SIZE_SHIFT;
- os << format(" ItemSize=%d") % (t + 1);
-
- t = (f.word1 & DF1_REPEAT_COUNT_MASK) >> DF1_REPEAT_COUNT_SHIFT;
- os << format(" RptCnt=%d") % (t + 1);
-
- t = (f.word1 & DF1_VECTOR_SIZE_MASK) >> DF1_VECTOR_SIZE_SHIFT;
- os << format(" VectSize=%d") % (t + 1);
-
- os << std::endl;
- }
-
- void wr_formatted_gps(std::ostream &os,
- const vrt_formatted_gps_t &x)
- {
- uint32_t t = (x.tsi_tsf_manuf_oui >> 26) & 0x3;
- switch(t){
- case 0x0: os << " TSI=UNDEF"; break;
- case 0x1: os << " TSI=UTC"; break;
- case 0x2: os << " TSI=GPS"; break;
- case 0x3: os << " TSI=OTHER"; break;
- }
-
- t = (x.tsi_tsf_manuf_oui >> 24) & 0x3;
- switch(t){
- case 0x0: os << " TSF=UNDEF"; break;
- case 0x1: os << " TSF=SAMPLE_CNT";break;
- case 0x2: os << " TSI=PICOSECS"; break;
- case 0x3: os << " TSI=FREE_RUN"; break;
- }
-
- t = x.tsi_tsf_manuf_oui & 0x00ffffff;
- os << format(" manuf_oui=%#x\n") % t;
-
- wr_name(os, " fix int secs");
- //os << format("%10d\n") % x.integer_secs;
- wr_int_secs(os, x.integer_secs);
-
- wr_name(os, " fix frac secs");
- os << format("%10d\n") % get_frac_secs(&x.fractional_secs);
-
- wr_name(os, " latitude");
- wr_angle(os, x.latitude);
- wr_name(os, " longitude");
- wr_angle(os, x.longitude);
- wr_name(os, " altitude");
- wr_distance(os, x.altitude);
- wr_name(os, " speed_over_ground");
- wr_velocity(os, x.speed_over_ground);
- wr_name(os, " heading_angle");
- wr_angle(os, x.heading_angle);
- wr_name(os, " track_angle");
- wr_angle(os, x.track_angle);
- wr_name(os, " magnetic_variation");
- wr_angle(os, x.magnetic_variation);
-
- os << std::endl;
- }
-
- };
-};
diff --git a/vrt/lib/header_utils.h b/vrt/lib/header_utils.h
deleted file mode 100644
index 0d006ffdc..000000000
--- a/vrt/lib/header_utils.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2010 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_VRT_HEADER_UTILS_H
-#define INCLUDED_VRT_HEADER_UTILS_H
-
-#include <iosfwd>
-#include <string>
-#include <stdint.h>
-#include <vrt/bits.h>
-
-namespace vrt
-{
- namespace detail {
-
- void wr_header(std::ostream &os, uint32_t x);
- void wr_name(std::ostream &os, const std::string &x);
- void wr_int_secs(std::ostream &os, uint32_t secs);
- void wr_uint32_hex(std::ostream &os, uint32_t x);
- void wr_uint32_dec(std::ostream &os, uint32_t x);
- void wr_hertz(std::ostream &os, vrt_hertz_t x);
- void wr_dbm(std::ostream &os, vrt_db_t x);
- void wr_db(std::ostream &os, vrt_db_t x);
- void wr_temp(std::ostream &os, vrt_temp_t x);
- void wr_angle(std::ostream &os, vrt_angle_t x);
- void wr_distance(std::ostream &os, vrt_distance_t x);
- void wr_velocity(std::ostream &os, vrt_velocity_t x);
- void wr_payload_fmt(std::ostream &os, vrt_payload_fmt_t f);
- void wr_formatted_gps(std::ostream &os,
- const vrt_formatted_gps_t &x);
- };
-};
-
-#endif /* INCLUDED_VRT_HEADER_UTILS_H */
diff --git a/vrt/lib/rx.cc b/vrt/lib/rx.cc
deleted file mode 100644
index f44077568..000000000
--- a/vrt/lib/rx.cc
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2009,2010 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <vrt/rx.h>
-#include <vrt/expanded_header.h>
-#include "socket_rx_buffer.h"
-#include "data_handler.h"
-#include <unistd.h>
-#include <stdio.h>
-#include <stdexcept>
-
-static void
-print_words(FILE *fp, size_t offset, const uint32_t *buf, size_t n)
-{
- size_t i;
- for (i = 0; i < n; i++){
- if (i % 4 == 0){
- fprintf(fp, "%04zx:", i);
- }
-
- putc(' ', fp);
- fprintf(fp, "%08x", buf[i]);
- if (i % 4 == 3)
- putc('\n', fp);
- }
-
- putc('\n', fp);
-}
-
-
-
-namespace vrt {
-
- rx::sptr
- rx::make(int socket_fd, size_t rx_bufsize)
- {
- return sptr(new rx(socket_fd, rx_bufsize));
- }
-
- rx::rx(int socket_fd, size_t rx_bufsize)
- : d_socket_fd(socket_fd),
- d_srb(new socket_rx_buffer(socket_fd, rx_bufsize))
- {
- }
-
- rx::~rx()
- {
- delete d_srb;
- ::close(d_socket_fd);
- }
-
-
- class vrt_data_handler : public data_handler
- {
- rx_packet_handler *d_handler;
-
- public:
- vrt_data_handler(rx_packet_handler *handler)
- : d_handler(handler){}
-
- ~vrt_data_handler();
-
- bool operator()(const void *base, size_t len);
- };
-
- vrt_data_handler::~vrt_data_handler(){}
-
- // N.B., There may be more than 1 VRT packet in a frame (usually IF-Context packets)
- bool
- vrt_data_handler::operator()(const void *base, size_t len)
- {
- const uint32_t *word_base = (const uint32_t *) base;
- size_t word_len = len/(sizeof(uint32_t));
-
- bool want_more = true;
- while (word_len > 0 && want_more){
- const uint32_t *payload;
- size_t n32_bit_words;
- expanded_header hdr;
- if (!expanded_header::unpack(word_base, word_len,
- &hdr, &payload, &n32_bit_words)){
- if (1){
- fprintf(stderr, "vrt_data_handler: malformed VRT packet!\n");
- print_words(stderr, 0, word_base, word_len);
- }
- return true;
- }
- want_more = (*d_handler)(payload, n32_bit_words, &hdr);
- word_base += hdr.pkt_size();
- word_len -= hdr.pkt_size();
- }
- return want_more;
- }
-
-
- bool
- rx::rx_packets(rx_packet_handler *handler, bool dont_wait)
- {
- vrt_data_handler h(handler);
- socket_rx_buffer::result r = d_srb->rx_frames(&h, dont_wait ? 0 : -1);
- return r == socket_rx_buffer::EB_OK || r == socket_rx_buffer::EB_WOULD_BLOCK;
- }
-
-}; // vrt
diff --git a/vrt/lib/rx_packet_handler.cc b/vrt/lib/rx_packet_handler.cc
deleted file mode 100644
index 11f90278d..000000000
--- a/vrt/lib/rx_packet_handler.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2009 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <vrt/rx_packet_handler.h>
-
-namespace vrt {
-
- rx_packet_handler::~rx_packet_handler(){}
-
- // default operator is a NOP
- bool
- rx_packet_handler::operator()(const uint32_t *payload,
- size_t n32_bit_words,
- const expanded_header *hdr)
- {
- return true;
- }
-
-
-}; // vrt
diff --git a/vrt/lib/socket_rx_buffer.cc b/vrt/lib/socket_rx_buffer.cc
deleted file mode 100644
index f6fa05c10..000000000
--- a/vrt/lib/socket_rx_buffer.cc
+++ /dev/null
@@ -1,176 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,2009,2010 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "socket_rx_buffer.h"
-#include "data_handler.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <iostream>
-#include <stdexcept>
-#include <cstdio>
-
-
-#define SOCKET_RX_BUFFER_DEBUG 1 // define to 0 or 1
-#if SOCKET_RX_BUFFER_DEBUG
-#define DEBUG_LOG(x) ::write(2, (x), 1)
-#else
-#define DEBUG_LOG(X)
-#endif
-
-#define DEFAULT_MEM_SIZE 62.5e6 // ~0.5s @ 125 MB/s
-#define MAX_MEM_SIZE 1000e6 // ~10.00s @ 100 MB/s.
-#define RX_BUF_ALIGNMENT 16 // 16-byte aligned for SIMD (must be power-of-2)
-
-namespace vrt {
-
- const unsigned int socket_rx_buffer::MAX_PKTLEN = 8192;
-
- socket_rx_buffer::socket_rx_buffer(int socket_fd, size_t rx_bufsize)
- : d_fd(socket_fd)
- {
- if (rx_bufsize == 0)
- rx_bufsize = (size_t)DEFAULT_MEM_SIZE;
- else
- rx_bufsize = std::min((size_t)MAX_MEM_SIZE, rx_bufsize);
-
- if (!open(rx_bufsize)){
- throw std::runtime_error("socket_rx_buffer::open failed");
- }
- }
-
- socket_rx_buffer::~socket_rx_buffer()
- {
- close();
- }
-
- bool
- socket_rx_buffer::open(size_t buflen)
- {
- // Increase socket buffer if possible
-
- int rcvbuf_size = buflen;
-
-#if defined(SO_RCVBUFFORCE)
- // If we've got CAP_NET_ADMIN or root, this will allow the
- // rmem_max limit to be overridden
- if (setsockopt(d_fd, SOL_SOCKET, SO_RCVBUFFORCE,
- &rcvbuf_size, sizeof(rcvbuf_size)) == 0){
- return true;
- }
- else {
- if (errno != EPERM)
- perror("setsockopt(SO_RCVBUFFORCE)");
- }
-#endif
-
- // Try to set it. On linux trying for too large of a value
- // doesn't return an error...
- if (setsockopt(d_fd, SOL_SOCKET, SO_RCVBUF,
- &rcvbuf_size, sizeof(rcvbuf_size)) != 0){
- perror("setsockopt(SO_RCVBUF)");
- }
-
- // See how big it actually is
- int cursize = 0;
- socklen_t optlen;
- optlen = sizeof(cursize);
- if (getsockopt(d_fd, SOL_SOCKET, SO_RCVBUF,
- &cursize, &optlen) != 0){
- perror("getsockopt");
- return false;
- }
-
- // fprintf(stderr, "after: getsockopt(SO_RCVBUF) = %d\n", cursize);
-
- // If we don't get what we asked for, treat it as an error.
- // Otherwise the radio's probably not going to work reliably anyway.
- if (cursize < (int) buflen){
- fprintf(stderr,
-"socket_rx_buffer: failed to allocate socket receive buffer of size %zd.\n",
- buflen);
- fprintf(stderr,
-"To fix this, please increase the maximum allowed using:\n\n");
- fprintf(stderr,
- " $ sudo sysctl -w net.core.rmem_max=%zd\n\n", buflen);
- fprintf(stderr,
-"and/or edit /etc/sysctl.conf: net.core.rmem_max=%zd\n\n", buflen);
- return false;
- }
-
- return true;
- }
-
- bool
- socket_rx_buffer::close()
- {
- return true;
- }
-
- socket_rx_buffer::result
- socket_rx_buffer::rx_frames(data_handler *f, int timeout_in_ms)
- {
- unsigned char unaligned[MAX_PKTLEN + RX_BUF_ALIGNMENT];
- unsigned char *buf = (unsigned char *)
- (((intptr_t)unaligned + RX_BUF_ALIGNMENT) & -RX_BUF_ALIGNMENT);
-
- bool dont_wait = timeout_in_ms == 0; // FIXME treating timeout as 0 or inf
- int flags = dont_wait ? MSG_DONTWAIT : 0;
-
- ssize_t rr = recv(d_fd, buf, MAX_PKTLEN, flags);
- if (rr == -1){ // error?
- if (errno == EAGAIN){ // non-blocking, nothing there
- return EB_WOULD_BLOCK;
- }
- perror("rx_frames: recv");
- return EB_ERROR;
- }
-
- // Got first packet. Call handler
-
- bool want_more = (*f)(buf, rr);
- if (!want_more)
- return EB_OK;
-
- // Now do as many as we can without blocking
-
- while (1){
- rr = recv(d_fd, buf, MAX_PKTLEN, MSG_DONTWAIT);
- if (rr == -1){ // error?
- if (errno == EAGAIN) // non-blocking, nothing there
- return EB_OK; // return OK; we've processed >= 1 packets
- perror("rx_frames: recv");
- return EB_ERROR;
- }
-
- want_more = (*f)(buf, rr);
- if (!want_more)
- break;
- }
- return EB_OK;
- }
-
-} // namespace vrt
diff --git a/vrt/lib/socket_rx_buffer.h b/vrt/lib/socket_rx_buffer.h
deleted file mode 100644
index ef80fac43..000000000
--- a/vrt/lib/socket_rx_buffer.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,2009,2010 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_VRT_SOCKET_RX_BUFFER_H
-#define INCLUDED_VRT_SOCKET_RX_BUFFER_H
-
-#include <boost/utility.hpp>
-#include <vector>
-#include <memory>
-#include <stdint.h>
-
-namespace vrt {
-
- class data_handler;
-
- /*!
- * \brief high-performance interface to receive datagrams
- *
- * On many systems it should be possible to implement this on top of libpcap
- *
- * \internal
- */
- class socket_rx_buffer : boost::noncopyable
- {
-
- int d_fd; // socket file descriptor
-
- bool open(size_t buflen);
- bool close();
-
- public:
-
- enum result {
- EB_OK, //< everything's fine
- EB_ERROR, //< A non-recoverable error occurred
- EB_WOULD_BLOCK, //< A timeout of 0 was specified and nothing was ready
- EB_TIMED_OUT, //< The timeout expired before anything was ready
- };
-
- static const unsigned int MAX_PKTLEN;
-
- /*!
- * \param socket_fd file descriptor that corresponds to a socket
- * \param rx_bufsize is a hint as to the number of bytes of memory
- * to allocate for received ethernet frames (0 -> reasonable default)
- */
- socket_rx_buffer(int socket_fd, size_t rx_bufsize = 0);
- ~socket_rx_buffer();
-
- /*!
- * \brief Call \p f for each frame in the receive buffer.
- * \param f is the frame data handler
- * \param timeout (in ms) controls behavior when there are no frames to read
- *
- * If \p timeout is 0, rx_frames will not wait for frames if none are
- * available, and f will not be invoked. If \p timeout is -1 (the
- * default), rx_frames will block indefinitely until frames are
- * available. If \p timeout is positive, it indicates the number of
- * milliseconds to wait for a frame to become available. Once the
- * timeout has expired, rx_frames will return, f never having been
- * invoked.
- *
- * \p f will be called on each frame that is available.
- * \p f returns a bool. If false, return from rx_frames now even
- * though more frames may be available; if true, continue if
- * more frames are ready.
- *
- * \returns EB_OK if at least one frame was received
- * \returns EB_WOULD_BLOCK if \p timeout is 0 and the call would have blocked
- * \returns EB_TIMED_OUT if timeout occurred
- * \returns EB_ERROR if there was an unrecoverable error.
- */
- result rx_frames(data_handler *f, int timeout=-1);
- };
-
-}; // namespace vrt
-
-#endif /* INCLUDED_VRT_SOCKET_RX_BUFFER_H */
diff --git a/vrt/vrt.pc.in b/vrt/vrt.pc.in
deleted file mode 100644
index af9892943..000000000
--- a/vrt/vrt.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: vrt
-Description: Host implementation of Virtual Radio Transport (VITA-49)
-Requires:
-Version: @LIBVER@
-Libs: -L${libdir} -lvrt
-Cflags: -I${includedir}