blob: 90cb9c2104581ba975eabe59940ccfc99fd1238f [file] [log] [blame]
/* -*- c++ -*- */
/*
* Copyright 2014 <+YOU OR YOUR COMPANY+>.
*
* This 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.
*
* This software 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 software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gnuradio/io_signature.h>
#include "wireshark_sink_impl.h"
#include "gsm/gsmtap.h"
namespace gr {
namespace gsm {
void wireshark_sink_impl::send_to_wireshark(pmt::pmt_t msg)
{
pmt::pmt_t header_blob = pmt::car(msg);
gsmtap_hdr * header = (gsmtap_hdr *)pmt::blob_data(header_blob); //GSMTAP header
pmt::pmt_t message = pmt::cdr(msg);
uint8_t * message_elements = (uint8_t *)pmt::blob_data(message);
size_t message_len=pmt::blob_length(message); //message content
//place for implementation of sending gsm messages to wireshark
}
wireshark_sink::sptr
wireshark_sink::make()
{
return gnuradio::get_initial_sptr
(new wireshark_sink_impl());
}
/*
* The private constructor
*/
wireshark_sink_impl::wireshark_sink_impl()
: gr::block("wireshark_sink",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(0, 0, 0))
{
message_port_register_in(pmt::mp("msgs"));
set_msg_handler(pmt::mp("msgs"), boost::bind(&wireshark_sink_impl::send_to_wireshark, this, _1));
}
/*
* Our virtual destructor.
*/
wireshark_sink_impl::~wireshark_sink_impl()
{
}
} /* namespace gsm */
} /* namespace gr */