22 #ifndef GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H 23 #define GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H 25 #include <boost/thread.hpp> 26 #include <gnuradio/sync_block.h> 27 #include <arpa/inet.h> 28 #include <net/ethernet.h> 30 #include <netinet/if_ether.h> 33 #include <sys/ioctl.h> 34 #if GNURADIO_USES_STD_POINTERS 37 #include <boost/shared_ptr.hpp> 43 #if GNURADIO_USES_STD_POINTERS 44 typedef std::shared_ptr<Gr_Complex_Ip_Packet_Source> sptr;
46 typedef boost::shared_ptr<Gr_Complex_Ip_Packet_Source> sptr;
48 static sptr make(std::string src_device,
49 const std::string &origin_address,
52 int n_baseband_channels,
53 const std::string &wire_sample_type,
57 const std::string &origin_address,
60 int n_baseband_channels,
61 const std::string &wire_sample_type,
73 int work(
int noutput_items,
74 gr_vector_const_void_star &input_items,
75 gr_vector_void_star &output_items);
78 void demux_samples(
const gr_vector_void_star &output_items,
int num_samples_readed);
79 void my_pcap_loop_thread(pcap_t *pcap_handle);
80 void pcap_callback(u_char *args,
const struct pcap_pkthdr *pkthdr,
const u_char *packet);
81 static void static_pcap_callback(u_char *args,
const struct pcap_pkthdr *pkthdr,
const u_char *packet);
88 boost::thread *d_pcap_thread;
90 struct sockaddr_in si_me
93 std::string d_src_device;
94 std::string d_origin_address;
103 int d_udp_payload_size;
104 int d_n_baseband_channels;
105 int d_wire_sample_type;
106 int d_bytes_per_sample;
111 #endif // GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H