Bug 1835 - The getpeername() socket function is unimplemented.
The getpeername() socket function is unimplemented.
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: network
pre-release
PC Windows
: P5 enhancement
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-12 21:22 UTC by Tom Goff
Modified: 2016-02-26 00:49 UTC (History)
2 users (show)

See Also:


Attachments
possible implementation (9.07 KB, patch)
2014-01-12 21:22 UTC, Tom Goff
Details | Diff
possible implementation (8.85 KB, patch)
2015-01-23 13:17 UTC, Tom Goff
Details | Diff
possible implementation (14.79 KB, patch)
2015-01-23 19:11 UTC, Tom Goff
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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