[Ns-developers] Summer of Code nsc/ns-3 integration status, week 07
fw at strlen.de
Sun Jun 15 03:30:55 PDT 2008
Mathieu Lacage <mathieu.lacage at sophia.inria.fr> wrote:
> > Maybe we can talk about this on irc after tomorrows ns-3 irc meeting.
> > I'd also be interested in hearing about opinions on what I should work
> > next. Personally I think it would be best to first add getpeername
> > to nsc (to add the SocketRxAddressTag),
> > but perhaps I've missed something more obvious/beneficial.
> Looks like you have already done the above.
Yes. I've added setsockname/getpeername methods to the INetStreamSocket
class in nsc. All stacks in nsc support these methods.
The only thing I am not happy with is the user-visible API, it is
virtual int getpeername(void *addrspace, size_t *addrs_len, int *port)
which is both very very ugly and not really extensible towards non AF_INET
protocols (which might not be a problem, though).
addrspace points to a buffer (of addrs_len bytes) to hold the peer ip address.
The nsc stack glue code will then copy the peer IP (in network byte
order) to addrspace, update addrs_len with the address length and set
*port to the peers port number (getsockname works the same way).
The only alternative i see is to add 'struct nsc_sockaddr',
'nsc_sockaddr_in', etc. and use pointers to these structures to exchange
the data. Note that Sam hasn't reviewed this yet, so it might be that
this API is changed again.
As Mathieu already mentioned i'm now trying to build an object hierarchy
that represents the sysctl tree to allow the ns-3 side to 'discover' the
More information about the Ns-developers