Imitate a writer IP

4 posts / 0 new
Last post
Offline
Last seen: 3 years 4 months ago
Joined: 11/12/2020
Posts: 2
Imitate a writer IP

Hello, I have a Java HTTP server which writes some sample on request.

I want the SampleInfo to look as if it was sent from a requesters ip.

Correct me if I am wrong, I figured I need to use "write_w_params" and set the WriteParams_t.identity.writer_guid.value to the value I am interested in, specifically its first four bytes.

Ideally I would like the received SampleInfo on the other side to look as if I used "write" which fills it automatically and only change these four bytes, but I can't figure out how to initialize the WriteParams_t that way.

Any help will be appreciated.

Howard's picture
Offline
Last seen: 23 hours 58 min ago
Joined: 11/29/2012
Posts: 565

Sorry, what is your usecase?  Not what you want to do at the DDS level, but what you're trying to do at the application level.

"write_w_params" is not specificallly designed to support what you think it does...

Offline
Last seen: 3 years 4 months ago
Joined: 11/12/2020
Posts: 2

Hmm I see.

I have an existing DDS system and I want to allow some external entities interact with it with HTTP through my service. What my service does is translate every HTTP request to some specific DDS sample and writes it. My existing DDS system uses SampleInfo to determine the sender IP (which is currently my service) but I would like it to know who requested it with my service, mainly for logging and security monitoring.

I can handle it with setting a field on the applicative message but it is much less ideal and will require some rewrite on the existing DDS system, I would rather write it in a way that only affects my service.

Howard's picture
Offline
Last seen: 23 hours 58 min ago
Joined: 11/29/2012
Posts: 565

So, for normal topics Writer's GUID is used internally to know who sent what with sequence numbers to know what's missing.  While there are use cases in which an app want to control that, it's not for general use.

However, there is probably something that you can set using "write_w_params()" that would support your use case...that would be the parameter, related_sample_identity.

The related_sample_identity isn't used by DDS by normal Topics automatically, so you can "appropriate" it for your own use.  However, it is used by DDS for the Topics that it creates under the Connext Request/Reply API, so you won't be able to use it for Request/Reply.