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

Unified Diff: src/internet/model/tcp-option-end.cc

Issue 5452045: TCP options feature for ns-3
Patch Set: Created 12 years, 3 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
Index: src/internet/model/tcp-option-end.cc
===================================================================
new file mode 100644
--- /dev/null
+++ b/src/internet/model/tcp-option-end.cc
@@ -0,0 +1,80 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Adrian Sai-wah Tam
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com>
+ */
+
+#include "tcp-option-end.h"
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (TcpOptionEnd);
+
+TcpOptionEnd::TcpOptionEnd ()
+{
+}
+
+TcpOptionEnd::~TcpOptionEnd ()
+{
+}
+
+TypeId
+TcpOptionEnd::GetTypeId (void)
+{
+ static TypeId tid = TypeId ("ns3::TcpOptionEnd")
+ .SetParent<TcpOption> ()
+ ;
+ return tid;
+}
+
+TypeId
+TcpOptionEnd::GetInstanceTypeId (void) const
+{
+ return GetTypeId ();
+}
+
+void
+TcpOptionEnd::Print (std::ostream &os) const
+{
+}
+
+uint32_t
+TcpOptionEnd::GetSerializedSize (void) const
+{
+ return 1;
+}
+
+void
+TcpOptionEnd::Serialize (Buffer::Iterator start) const
+{
+ Buffer::Iterator i = start;
+ i.WriteU8 (0);
+}
+
+uint32_t
+TcpOptionEnd::Deserialize (Buffer::Iterator start)
+{
+ return 1;
+}
+
+uint8_t
+TcpOptionEnd::GetKind (void) const
+{
+ return 0;
+}
+
+} // namespace ns3

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