[Openais] Re: Request for API change

Steven Dake sdake at mvista.com
Fri Jul 9 17:10:35 PDT 2004


On Fri, 2004-07-09 at 16:44, Sabharwal, Atul wrote:
> Hi Steve,
> 
> Syslog is an app which needs to know the source IP from which the packet
> came.
> In the delivery function handler, could you pass the socket descriptor
> so that
> The app can do a getpeername to find the peer IP address. This is needed
> for
> Logging.

This is not really possible in a secure way with the gmi, because gmi
may recover a lost message from a processor other then itself and
remulticast it (as though it were from the original node).  This could
be done insecurely by sending with every message the s_addr of the
originator of the message.

> 
> On the same lines, the poll handler routines setup with dispatch call
> has
> A data field. Since, the app has to do a read to actually get the data,
> I think this field is redundant. So, should be dropped.
> 

The data field is not meant to contain the data of the message.  It
instead is used to contain context information about the connection. 
For example, in ais it is used to maintain the information about a
connection for every library connection between API calls securely.

Hence it may not be immediately useful for all applications (in fact
even in openais it is not always used), but is definately useful for
some.

> What do you think ? Is there an alternate way ( like some global )
> through
> Which I can get the IP address of host sending the multicast message ?
> 

There is another approach which can be used without alot of changes to
gmi.  In the iovector gmi_mcast'ed, the sin_addr.s_addr could be stored
(as the source of the message).  This is fairly simple by adding another
iovector at the end of your iovector and storing your ip address in that
field.

The variable stored after the call to gmi_init in the "bound_to"
parameter contains the IP you would want to store in the packet.

Regards
-steve

> Regards,
> 
> Atul
> 
> -------------------------------------------------------------
> P.S:  All opinions are my personal opinion(s) & responsibility and do
> not represent the view of my employer ( Intel Corporation ).
> 




More information about the Openais mailing list