Bug 1835

Summary: The getpeername() socket function is unimplemented.
Product: ns-3 Reporter: Tom Goff <tgoff>
Component: networkAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: enhancement CC: tomh, tommaso.pecorella
Priority: P5    
Version: pre-release   
Hardware: PC   
OS: Windows   
Attachments: possible implementation
possible implementation
possible implementation

Description Tom Goff 2014-01-12 21:22:44 UTC
Created attachment 1761 [details]
possible implementation

The attached patch adds a GetPeerName() socket method.
Comment 1 Tom Goff 2015-01-23 13:17:26 UTC
Created attachment 1950 [details]
possible implementation

An updated patch is attached.
Comment 2 Tom Henderson 2015-01-23 13:46:10 UTC
(In reply to Tom Goff from comment #1)
> Created attachment 1950 [details]
> possible implementation
> 
> An updated patch is attached.

Tom, has this been tested in your environment; are there any issues or do you think it is good to go?
Comment 3 Tom Goff 2015-01-23 19:11:42 UTC
Created attachment 1951 [details]
possible implementation

The previous version was a little premature.

This version fixes some issues and adds some testing.

Note that this patch makes socket error codes (m_errno) mutable; another approach would be to make GetPeerName() non-const.
Comment 4 Tommaso Pecorella 2016-01-25 14:04:55 UTC
shall we commit this ?

Errno being mutable seems to be reasonable, also because it should be a global variable rather than a per-socket one.
Comment 5 Tom Henderson 2016-02-26 00:49:29 UTC
merged in changeset 11925:323918f8bcee