-1

Currently I read some data using boost udp socket. I created socket like this

read_socket = new udp::socket(read_socket_service, udp_listener_endpoint);

where

boost::asio::io_service read_socket_service();
udp::endpoint udp_listener_endpoint(some_ip, some_port);

Then I take data

 read_socket->receive_from(boost::asio::buffer(*buffer), senderEndpoint);

where

udp::endpoint senderEndpoint;
buffer = std::make_unique<std::array<char, 100>>;

This method works if communication between packet generator and packet receiver is solved using UDP.
However now I have real device which communicates using SOME/IP protocol. I see in Wireshark some packets movement from device to my application environment, but I completely don't know how to get data from those packets.
When I use boost udp it shows me connection was established but buffer is still empty.
I found something like this https://github.com/GENIVI/vsomeip and icluded this into my project but I really don't know how to use it because documentation even don't indicates how to connect to th specific IP.
Or maybe int this case I shouldn't use any IP and port?

rainbow
  • 1,161
  • 3
  • 14
  • 29
  • What is your question? – user253751 Sep 24 '20 at 16:09
  • Question is in the title: how to read data from SOME/IP protocol in C++. I will be grateful for any advice that can help - not only pure code. Link to tutorial, anything. – rainbow Sep 24 '20 at 19:04
  • That question is too broad, the answer is: find a library or implement the protocol yourself. – user253751 Sep 24 '20 at 19:19
  • OK. Then I will narrow it: do you know any library that can be used in this case? I would like to avoid implementation of this protocol. – rainbow Sep 24 '20 at 23:17
  • Questions asking for libraries are off-topic on Stack Overflow. – user253751 Sep 25 '20 at 09:35
  • You realize that there is some middleware including a service discovery part with publish/subscribe used? And SomeIP actually is transmitted over TCP or UDP? – kesselhaus Sep 25 '20 at 21:41
  • @kesselhaus Isn't SomeIP a middleware? AFAIK its name is abbreviation of "Scalable service-Oriented MiddlewarE over IP". As a middleware I understand some "mediation" application between two others (like Corba, ODBC). But here we talk about data traveling through network. Is this SomeIP some kind of casing for data? – rainbow Sep 26 '20 at 00:42
  • In AUTOSAR Classic (CP), there are SoAd (SocketAdapter) and the Sd (ServiceDiscovery). But I'm not sure about AUTOSAR Adaptive, since this is supposed to be a SOA based architecture. But my understanding in CP is, that Sd is used as publish/subscribe method to bind a service to an underlying IP/port. Also, the setup/configuration is more static (system description) compared to other non-automotive systems with full Internet. – kesselhaus Oct 09 '20 at 13:46

1 Answers1

0

One of the possible solution is use of libtins library
It allows you to extract raw UDP data from network traffic.
Here is more detailed tutorial: libtins sniffing tutorial
Of course later you will have to extract data from such package. This may be more complex work than reading it because all data must be decoded form binary.
Here is Some/IP documentation: AUTOSAR Some/IP

I hope in the future this will give some starting point to somebody.

rainbow
  • 1,161
  • 3
  • 14
  • 29
  • 1
    Your link is rather old, here are the R19-11 spec links: `https://www.autosar.org/fileadmin/user_upload/standards/foundation/19-11/AUTOSAR_PRS_SOMEIPProtocol.pdf` and `https://www.autosar.org/fileadmin/user_upload/standards/foundation/19-11/AUTOSAR_PRS_SOMEIPServiceDiscoveryProtocol.pdf` – kesselhaus Oct 09 '20 at 13:52