UHD  003.001.002
vrt_if_packet.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_UHD_TRANSPORT_VRT_IF_PACKET_HPP
19 #define INCLUDED_UHD_TRANSPORT_VRT_IF_PACKET_HPP
20 
21 #include <uhd/config.hpp>
22 #include <boost/cstdint.hpp>
23 #include <cstddef> //size_t
24 
25 namespace uhd{ namespace transport{
26 
27 namespace vrt{
28 
30  static const size_t max_if_hdr_words32 = 7; //hdr+sid+cid+tsi+tsf
31 
38  //packet type (pack only supports data)
40  PACKET_TYPE_DATA = 0x0,
41  PACKET_TYPE_EXTENSION = 0x1,
42  PACKET_TYPE_CONTEXT = 0x2
43  } packet_type;
44 
45  //size fields
46  size_t num_payload_words32; //required in pack, derived in unpack
47  size_t num_header_words32; //derived in pack, derived in unpack
48  size_t num_packet_words32; //derived in pack, required in unpack
49 
50  //header fields
51  size_t packet_count;
52  bool sob, eob;
53 
54  //optional fields
55  bool has_sid; boost::uint32_t sid;
56  bool has_cid; boost::uint64_t cid;
57  bool has_tsi; boost::uint32_t tsi;
58  bool has_tsf; boost::uint64_t tsf;
59  bool has_tlr; boost::uint32_t tlr;
60  };
61 
68  boost::uint32_t *packet_buff,
69  if_packet_info_t &if_packet_info
70  );
71 
78  const boost::uint32_t *packet_buff,
79  if_packet_info_t &if_packet_info
80  );
81 
88  boost::uint32_t *packet_buff,
89  if_packet_info_t &if_packet_info
90  );
91 
98  const boost::uint32_t *packet_buff,
99  if_packet_info_t &if_packet_info
100  );
101 
102 } //namespace vrt
103 
104 }} //namespace
105 
106 #endif /* INCLUDED_UHD_TRANSPORT_VRT_IF_PACKET_HPP */
boost::uint32_t tlr
Definition: vrt_if_packet.hpp:59
Definition: vrt_if_packet.hpp:37
boost::uint32_t tsi
Definition: vrt_if_packet.hpp:57
size_t num_packet_words32
Definition: vrt_if_packet.hpp:48
UHD_API void if_hdr_pack_le(boost::uint32_t *packet_buff, if_packet_info_t &if_packet_info)
packet_type_t
Definition: vrt_if_packet.hpp:39
boost::uint64_t tsf
Definition: vrt_if_packet.hpp:58
bool has_cid
Definition: vrt_if_packet.hpp:56
UHD_API void if_hdr_unpack_be(const boost::uint32_t *packet_buff, if_packet_info_t &if_packet_info)
UHD_API void if_hdr_pack_be(boost::uint32_t *packet_buff, if_packet_info_t &if_packet_info)
#define UHD_API
Definition: config.hpp:76
Definition: convert.hpp:28
UHD_API void if_hdr_unpack_le(const boost::uint32_t *packet_buff, if_packet_info_t &if_packet_info)
size_t packet_count
Definition: vrt_if_packet.hpp:51
size_t num_payload_words32
Definition: vrt_if_packet.hpp:46
size_t num_header_words32
Definition: vrt_if_packet.hpp:47
bool sob
Definition: vrt_if_packet.hpp:52
boost::uint32_t sid
Definition: vrt_if_packet.hpp:55