Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(763)

Unified Diff: src/node/socket.cc

Issue 40059: add SocketRecvIfTag and SetIfIndex in socket.cc
Patch Set: Created 14 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/node/socket.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/node/socket.cc
===================================================================
--- a/src/node/socket.cc
+++ b/src/node/socket.cc
@@ -173,6 +173,12 @@
return p->GetSize ();
}
+void
+Socket::SetIfIndex(uint32_t ifIndex)
+{
+ NS_ASSERT(0);
+}
+
void
Socket::NotifyConnectionSucceeded (void)
@@ -415,4 +421,58 @@
os << (m_dontFragment?"true":"false");
}
+
+SocketRecvIfTag::SocketRecvIfTag ()
+{
+}
+
+void
+SocketRecvIfTag::SetRecvIf (uint32_t ifindex)
+{
+ m_ifindex = ifindex;
+}
+
+uint32_t
+SocketRecvIfTag::GetRecvIf (void) const
+{
+ return m_ifindex;
+}
+
+
+TypeId
+SocketRecvIfTag::GetTypeId (void)
+{
+ static TypeId tid = TypeId ("ns3::SocketRecvIfTag")
+ .SetParent<Tag> ()
+ .AddConstructor<SocketRecvIfTag> ()
+ ;
+ return tid;
+}
+TypeId
+SocketRecvIfTag::GetInstanceTypeId (void) const
+{
+ return GetTypeId ();
+}
+
+uint32_t
+SocketRecvIfTag::GetSerializedSize (void) const
+{
+ return sizeof(uint32_t);
+}
+void
+SocketRecvIfTag::Serialize (TagBuffer i) const
+{
+ i.WriteU32 (m_ifindex);
+}
+void
+SocketRecvIfTag::Deserialize (TagBuffer i)
+{
+ m_ifindex = i.ReadU32 ();
+}
+void
+SocketRecvIfTag::Print (std::ostream &os) const
+{
+ os << "RecvIf=" << (uint32_t) m_ifindex;
+}
+
}//namespace ns3
« no previous file with comments | « src/node/socket.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b