[Ns-bugs] [Bug 742] New: Implementation of SO_BINDTODEVICE
code@nsnam.ece.gatech.edu
code at nsnam.ece.gatech.edu
Tue Nov 17 07:08:03 PST 2009
http://www.nsnam.org/bugzilla/show_bug.cgi?id=742
Summary: Implementation of SO_BINDTODEVICE
Product: ns-3
Version: pre-release
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P5
Component: internet-stack
AssignedTo: ns-bugs at isi.edu
ReportedBy: zarhan at cc.hut.fi
CC: tomh at tomh.org
Estimated Hours: 0.0
Created an attachment (id=657)
--> (http://www.nsnam.org/bugzilla/attachment.cgi?id=657)
Patch to allow bindsockopts
As per discussion at
http://groups.google.com/group/ns-3-users/browse_thread/thread/013eb49c1ad77436
Here's first draft version of getting SO_BINDTODEVICE to work. It currently
works only on UDP sockets, and only on sending side.
TODO: Receiving side
TCP sockets
RAW sockets
(?).
However, while patch is not that complicated, it affects lots of files, as it
changes the so far pretty unused uint32_t oif in RouteOutput to Ptr<NetDevice>
instead - and as a consequence, every inherited routing protocol and all
methods that have called RouteOutput in it's previous format.
For now, Static and Global Routing protocols actually utilize the new oif
information. Thus, the provided example works, but right now socket doesn't
check if arrived packet came in on right interface. As it stands, the patch
shouldn't BREAK anything, it's just that the added functionality isn't yet
quite complete...
Since there's a lot of changes throughout the tree (node, internet-stack and
routing), I'm hoping that this can be merged relatively quickly so I don't have
to keep recreating the diffs against newer snapshots of ns-3-dev...
The beef is in socket.cc where two methods have been added for binding a device
and checking the value. You can release the binding by binding to zero. Example
illustrates the workings quite well.
CCing Tom due to him participating in the thread on mailing list.
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Ns-bugs
mailing list