model/netlink-message-route.cc
changeset 66 2fe1f3e576c9
parent 65 227f6347e4e1
child 67 fb900a594421
     1.1 --- a/model/netlink-message-route.cc	Tue Apr 19 23:13:50 2011 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,647 +0,0 @@
     1.4 -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
     1.5 -/*
     1.6 - * Copyright (c) 2008 Liu Jian
     1.7 - *
     1.8 - * This program is free software; you can redistribute it and/or modify
     1.9 - * it under the terms of the GNU General Public License version 2 as
    1.10 - * published by the Free Software Foundation;
    1.11 - *
    1.12 - * This program is distributed in the hope that it will be useful,
    1.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.15 - * GNU General Public License for more details.
    1.16 - *
    1.17 - * You should have received a copy of the GNU General Public License
    1.18 - * along with this program; if not, write to the Free Software
    1.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.20 - *
    1.21 - * Author: Liu Jian <liujatp@gmail.com>
    1.22 - *         Hajime Tazaki <tazaki@sfc.wide.ad.jp>
    1.23 - */
    1.24 -
    1.25 -#include "netlink-message-route.h"
    1.26 -#include "netlink-message.h"
    1.27 -
    1.28 -namespace ns3 {
    1.29 -
    1.30 -/***********************************************************************************
    1.31 -* \ NetlinkPayload
    1.32 -***********************************************************************************/
    1.33 -TypeId 
    1.34 -NetlinkPayload::GetTypeId (void)
    1.35 -{
    1.36 -  static TypeId tid = TypeId ("ns3::NetlinkPayload")
    1.37 -    .SetParent<ObjectBase> ()
    1.38 -    ;
    1.39 -  return tid;
    1.40 -}
    1.41 -
    1.42 -
    1.43 -/***********************************************************************************
    1.44 -* \ GeneralMessage
    1.45 -***********************************************************************************/
    1.46 -
    1.47 -NS_OBJECT_ENSURE_REGISTERED (GeneralMessage);
    1.48 -NS_OBJECT_ENSURE_REGISTERED (InterfaceInfoMessage);
    1.49 -NS_OBJECT_ENSURE_REGISTERED (InterfaceAddressMessage);
    1.50 -NS_OBJECT_ENSURE_REGISTERED (RouteMessage);
    1.51 -
    1.52 -GeneralMessage::GeneralMessage ()
    1.53 -  : m_family(0)
    1.54 -{}
    1.55 -GeneralMessage::~GeneralMessage ()
    1.56 -{}
    1.57 -
    1.58 -void
    1.59 -GeneralMessage::SetFamily (uint8_t v)
    1.60 -{
    1.61 -  m_family = v;
    1.62 -}
    1.63 -uint8_t
    1.64 -GeneralMessage::GetFamily (void) const
    1.65 -{
    1.66 -  return m_family;
    1.67 -}
    1.68 -
    1.69 -TypeId 
    1.70 -GeneralMessage::GetTypeId (void)
    1.71 -{
    1.72 -  static TypeId tid = TypeId ("ns3::GeneralMessage")
    1.73 -    .SetParent<NetlinkPayload> ()
    1.74 -    .AddConstructor<GeneralMessage> ()
    1.75 -    ;
    1.76 -  return tid;
    1.77 -}
    1.78 -
    1.79 -TypeId 
    1.80 -GeneralMessage::GetInstanceTypeId (void) const
    1.81 -{
    1.82 -  return GetTypeId ();
    1.83 -}
    1.84 -void 
    1.85 -GeneralMessage::Print (std::ostream &os) const
    1.86 -{
    1.87 -  os << " ----GeneralMessage ("
    1.88 -     << "family: " << (uint32_t)m_family << ")"; 
    1.89 -}
    1.90 -
    1.91 -uint32_t 
    1.92 -GeneralMessage::GetSerializedSize (void) const
    1.93 -{
    1.94 -  /* this is the size of an nlmsghdr payload. */
    1.95 -  return NETLINK_MSG_ALIGN (NETLINK_GENMSG_SIZE);
    1.96 -}
    1.97 -
    1.98 -
    1.99 -void
   1.100 -GeneralMessage::Serialize (Buffer::Iterator& start) const
   1.101 -{
   1.102 -  start.WriteU8 (m_family);
   1.103 -  start.WriteU8 (0, 3);
   1.104 -}
   1.105 -
   1.106 -uint32_t
   1.107 -GeneralMessage::Deserialize (Buffer::Iterator& start)
   1.108 -{
   1.109 -  uint8_t buf[3];
   1.110 -  m_family = start.ReadU8 ();
   1.111 -  start.Read (buf, 3);
   1.112 -  return GetSerializedSize ();
   1.113 -}
   1.114 -uint32_t
   1.115 -GeneralMessage::Deserialize (Buffer::Iterator& start, uint32_t len)
   1.116 -{
   1.117 -  uint8_t buf[3];
   1.118 -  m_family = start.ReadU8 ();
   1.119 -  start.Read (buf, 3);
   1.120 -  return GetSerializedSize ();
   1.121 -}
   1.122 -
   1.123 -
   1.124 -uint32_t
   1.125 -GeneralMessage::GetNNetlinkAttribute (void)const
   1.126 -{
   1.127 -  return m_attributes.size ();
   1.128 -}
   1.129 -NetlinkAttribute
   1.130 -GeneralMessage::GetNetlinkAttribute (uint32_t index)const
   1.131 -{
   1.132 -  NS_ASSERT(index < GetNNetlinkAttribute ());
   1.133 -  return m_attributes[index];
   1.134 -}
   1.135 -
   1.136 -uint32_t
   1.137 -GeneralMessage::GetAttributeSerializedSize (void) const
   1.138 -{
   1.139 -  uint32_t size = 0;
   1.140 -
   1.141 -  for (uint32_t i = 0; i < m_attributes.size (); i ++)
   1.142 -    {
   1.143 -      size += m_attributes[i].GetSerializedSize ();
   1.144 -    }
   1.145 -  return size;
   1.146 -}
   1.147 -bool
   1.148 -GeneralMessage::GetAttributeByType (NetlinkAttribute& attr, uint16_t type)
   1.149 -{
   1.150 -  for (uint32_t i = 0; i < m_attributes.size (); i ++)
   1.151 -    {
   1.152 -      if (type == m_attributes[i].GetAttrType ())
   1.153 -        {
   1.154 -          attr = m_attributes[i];
   1.155 -          return true;
   1.156 -        }
   1.157 -    }
   1.158 -  return false;  
   1.159 -}
   1.160 -void
   1.161 -GeneralMessage::AppendAttribute (NetlinkAttribute v)
   1.162 -{
   1.163 -  m_attributes.push_back (v);
   1.164 -}
   1.165 -
   1.166 -void
   1.167 -GeneralMessage::SerializeAttribute (Buffer::Iterator& start) const
   1.168 -{
   1.169 -  for (uint32_t i = 0; i < m_attributes.size (); i ++)
   1.170 -    {
   1.171 -      m_attributes[i].Serialize (start);
   1.172 -    }
   1.173 -}
   1.174 -
   1.175 -void
   1.176 -GeneralMessage::PrintAttribute (std::ostream &os) const
   1.177 -{
   1.178 -  for (uint32_t i = 0; i < m_attributes.size (); i ++)
   1.179 -    {
   1.180 -      os << " ----Attribute (" << i << "):";
   1.181 -      m_attributes[i].Print(os);
   1.182 -    }
   1.183 -}
   1.184 -
   1.185 -/***********************************************************************************
   1.186 -* \ InterfaceInfoMessage
   1.187 -***********************************************************************************/
   1.188 -InterfaceInfoMessage::InterfaceInfoMessage ()
   1.189 -  : m_reserved (0),
   1.190 -    m_deviceType (0),
   1.191 -    m_interfaceIndex(0),
   1.192 -    m_deviceFlags (0),
   1.193 -    m_changeMask (0)
   1.194 -{
   1.195 -  memset ((void*)m_attributeTypes, 0, sizeof (m_attributeTypes));
   1.196 -  m_attributeTypes[IFL_A_UNSPEC] = UNSPEC;
   1.197 -  m_attributeTypes[IFL_A_ADDRESS] = ADDRESS;
   1.198 -  m_attributeTypes[IFL_A_BROADCAST] = ADDRESS;
   1.199 -  m_attributeTypes[IFL_A_IFNAME] = STRING;
   1.200 -  m_attributeTypes[IFL_A_MTU] = U32;
   1.201 -  m_attributeTypes[IFL_A_LINK] = U32;
   1.202 -  m_attributeTypes[IFL_A_QDISC] = U8;
   1.203 -  m_attributeTypes[IFL_A_STATS] = UNSPEC;
   1.204 -  m_attributeTypes[IFL_A_COST] = UNSPEC;
   1.205 -}
   1.206 -InterfaceInfoMessage::~InterfaceInfoMessage ()
   1.207 -{}
   1.208 -void
   1.209 -InterfaceInfoMessage::SetDeviceType (uint16_t type)
   1.210 -{
   1.211 -  m_deviceType = type;
   1.212 -}
   1.213 -void
   1.214 -InterfaceInfoMessage::SetInterfaceIndex (int32_t index)
   1.215 -{
   1.216 -  m_interfaceIndex = index;
   1.217 -}
   1.218 -void
   1.219 -InterfaceInfoMessage::SetDeviceFlags (uint32_t flags)
   1.220 -{
   1.221 -  m_deviceFlags = flags;
   1.222 -}
   1.223 -void
   1.224 -InterfaceInfoMessage::SetChangeMask (uint32_t mask)
   1.225 -{
   1.226 -  m_changeMask = mask;
   1.227 -}
   1.228 -uint16_t
   1.229 -InterfaceInfoMessage::GetDeviceType (void) const
   1.230 -{
   1.231 -  return m_deviceType;
   1.232 -}
   1.233 -int32_t
   1.234 -InterfaceInfoMessage::GetInterfaceIndex (void) const
   1.235 -{
   1.236 -  return m_interfaceIndex;
   1.237 -}
   1.238 -uint32_t
   1.239 -InterfaceInfoMessage::GetDeviceFlags (void) const
   1.240 -{
   1.241 -  return m_deviceFlags;
   1.242 -}
   1.243 -uint32_t
   1.244 -InterfaceInfoMessage::GetChangeMask (void) const
   1.245 -{
   1.246 -  return m_changeMask;
   1.247 -}
   1.248 -TypeId 
   1.249 -InterfaceInfoMessage::GetTypeId (void)
   1.250 -{
   1.251 -  static TypeId tid = TypeId ("ns3::InterfaceInfoMessage")
   1.252 -    .SetParent<GeneralMessage> ()
   1.253 -    .AddConstructor<InterfaceInfoMessage> ()
   1.254 -    ;
   1.255 -  return tid;
   1.256 -}
   1.257 -TypeId 
   1.258 -InterfaceInfoMessage::GetInstanceTypeId (void) const
   1.259 -{
   1.260 -  return GetTypeId ();
   1.261 -}
   1.262 -void 
   1.263 -InterfaceInfoMessage::Print (std::ostream &os) const
   1.264 -{  
   1.265 -  os << " ----InterfaceInfoMessage ("
   1.266 -     << "deviceType: " << m_deviceType << " "
   1.267 -     << "interfaceIndex: " << m_interfaceIndex << " "
   1.268 -     << "deviceFlags: " << m_deviceFlags << " "
   1.269 -     << "changeMask: " << m_changeMask << ")" ;
   1.270 -  PrintAttribute (os);
   1.271 -}
   1.272 -uint32_t 
   1.273 -InterfaceInfoMessage::GetSerializedSize (void) const
   1.274 -{
   1.275 -  return NETLINK_INTERFACE_SIZE + GetAttributeSerializedSize ();
   1.276 -}
   1.277 -
   1.278 -void
   1.279 -InterfaceInfoMessage::Serialize (Buffer::Iterator& start) const
   1.280 -{
   1.281 -  start.WriteU8 (m_family);
   1.282 -  start.WriteU8 (m_reserved);
   1.283 -  start.WriteU16 (m_deviceType);
   1.284 -  start.WriteU32 (m_interfaceIndex);
   1.285 -  start.WriteU32 (m_deviceFlags);
   1.286 -  start.WriteU32 (m_changeMask);
   1.287 -
   1.288 -  SerializeAttribute (start);
   1.289 -}
   1.290 -uint32_t
   1.291 -InterfaceInfoMessage::Deserialize (Buffer::Iterator& start, uint32_t len)
   1.292 -{
   1.293 -  m_family = start.ReadU8 ();
   1.294 -  m_reserved = start.ReadU8 ();
   1.295 -  m_deviceType = start.ReadU16 ();
   1.296 -  m_interfaceIndex = start.ReadU32 ();
   1.297 -  m_deviceFlags = start.ReadU32 ();
   1.298 -  m_changeMask = start.ReadU32 ();
   1.299 -
   1.300 -  len -= NETLINK_INTERFACE_SIZE;
   1.301 -
   1.302 -  while (len)
   1.303 -    {
   1.304 -      NetlinkAttribute attr;
   1.305 -
   1.306 -      len -= attr.Deserialize (start, m_attributeTypes);
   1.307 -      m_attributes.push_back (attr);
   1.308 -    }
   1.309 -
   1.310 -  return GetSerializedSize ();
   1.311 -}
   1.312 -
   1.313 -
   1.314 -
   1.315 -/***********************************************************************************
   1.316 -* \InterfaceAddressMessage
   1.317 -***********************************************************************************/
   1.318 -InterfaceAddressMessage::InterfaceAddressMessage ()
   1.319 -  : m_length (0),
   1.320 -    m_flags (0),
   1.321 -    m_scope (0),
   1.322 -    m_index(0)
   1.323 -{
   1.324 -  memset ((void*)m_attributeTypes, 0, sizeof (m_attributeTypes));
   1.325 -  m_attributeTypes[IF_A_UNSPEC] = UNSPEC;
   1.326 -  m_attributeTypes[IF_A_ADDRESS] = ADDRESS;
   1.327 -  m_attributeTypes[IF_A_LOCAL] = ADDRESS;
   1.328 -  m_attributeTypes[IF_A_LABEL] = STRING;
   1.329 -  m_attributeTypes[IF_A_BROADCAST] = ADDRESS;
   1.330 -  m_attributeTypes[IF_A_ANYCAST] = ADDRESS;
   1.331 -  m_attributeTypes[IF_A_CACHEINFO] = UNSPEC;
   1.332 -  m_attributeTypes[IF_A_MULTICAST] = ADDRESS;
   1.333 -}
   1.334 -InterfaceAddressMessage::~InterfaceAddressMessage ()
   1.335 -{
   1.336 -}
   1.337 -void
   1.338 -InterfaceAddressMessage::SetFamily (uint8_t family)
   1.339 -{
   1.340 -  m_family = family;
   1.341 -}
   1.342 -void
   1.343 -InterfaceAddressMessage::SetLength (uint8_t length)
   1.344 -{
   1.345 -  m_length = length;
   1.346 -}
   1.347 -void
   1.348 -InterfaceAddressMessage::SetFlags (uint8_t flags)
   1.349 -{
   1.350 -  m_flags = flags;
   1.351 -}
   1.352 -void
   1.353 -InterfaceAddressMessage::SetScope (uint8_t scope)
   1.354 -{
   1.355 -  m_scope = scope;
   1.356 -}
   1.357 -void
   1.358 -InterfaceAddressMessage::SetInterfaceIndex (int32_t index)
   1.359 -{
   1.360 -  m_index = index;
   1.361 -}
   1.362 -
   1.363 -uint8_t
   1.364 -InterfaceAddressMessage::GetFamily (void) const
   1.365 -{
   1.366 -  return m_family;
   1.367 -}
   1.368 -uint8_t
   1.369 -InterfaceAddressMessage::GetLength (void) const
   1.370 -{
   1.371 -  return m_length;
   1.372 -}
   1.373 -uint8_t
   1.374 -InterfaceAddressMessage::GetFlags (void) const
   1.375 -{
   1.376 -  return m_flags;
   1.377 -}
   1.378 -uint8_t
   1.379 -InterfaceAddressMessage::GetScope (void) const
   1.380 -{
   1.381 -  return m_scope;
   1.382 -}
   1.383 -int32_t
   1.384 -InterfaceAddressMessage::GetInterfaceIndex (void) const
   1.385 -{
   1.386 -  return m_index;
   1.387 -}
   1.388 -
   1.389 -TypeId 
   1.390 -InterfaceAddressMessage::GetTypeId (void)
   1.391 -{
   1.392 -  static TypeId tid = TypeId ("ns3::InterfaceAddressMessage")
   1.393 -    .SetParent<GeneralMessage> ()
   1.394 -    .AddConstructor<InterfaceAddressMessage> ()
   1.395 -    ;
   1.396 -  return tid;
   1.397 -}
   1.398 -TypeId 
   1.399 -InterfaceAddressMessage::GetInstanceTypeId (void) const
   1.400 -{
   1.401 -  return GetTypeId ();
   1.402 -}
   1.403 -void 
   1.404 -InterfaceAddressMessage::Print (std::ostream &os) const
   1.405 -{  
   1.406 -  os << " ----InterfaceAddressMessage ("
   1.407 -     << "family: " << (uint32_t)m_family << " "
   1.408 -     << "length: " << (uint32_t)m_length << " "
   1.409 -     << "flags: " << (uint32_t)m_flags << " "
   1.410 -     << "scope: " << (uint32_t)m_scope << " "
   1.411 -     << "index: " << m_index << ")";
   1.412 -  PrintAttribute (os);
   1.413 -}
   1.414 -uint32_t 
   1.415 -InterfaceAddressMessage::GetSerializedSize (void) const
   1.416 -{
   1.417 -  return NETLINK_ADDRESS_SIZE + GetAttributeSerializedSize ();
   1.418 -}
   1.419 -
   1.420 -void
   1.421 -InterfaceAddressMessage::Serialize (Buffer::Iterator& start) const
   1.422 -{
   1.423 -  start.WriteU8 (m_family);
   1.424 -  start.WriteU8 (m_length);
   1.425 -  start.WriteU8 (m_flags);
   1.426 -  start.WriteU8 (m_scope);
   1.427 -  start.WriteU32 (m_index);
   1.428 -
   1.429 -  SerializeAttribute(start);
   1.430 -}
   1.431 -
   1.432 -uint32_t
   1.433 -InterfaceAddressMessage::Deserialize (Buffer::Iterator& start, uint32_t len)
   1.434 -{
   1.435 -  m_family = start.ReadU8 ();
   1.436 -  m_length = start.ReadU8 ();
   1.437 -  m_flags = start.ReadU8 ();
   1.438 -  m_scope = start.ReadU8 ();
   1.439 -  m_index = start.ReadU32 ();
   1.440 -
   1.441 -  len -= NETLINK_ADDRESS_SIZE;
   1.442 -
   1.443 -  while (len)
   1.444 -    {
   1.445 -      NetlinkAttribute attr;
   1.446 -
   1.447 -      len -= attr.Deserialize (start, m_attributeTypes);
   1.448 -      m_attributes.push_back (attr);
   1.449 -    }
   1.450 -
   1.451 -  return GetSerializedSize ();
   1.452 -}
   1.453 -
   1.454 -
   1.455 -
   1.456 -/***********************************************************************************
   1.457 -* \ RouteMessage
   1.458 -***********************************************************************************/
   1.459 -RouteMessage::RouteMessage ()
   1.460 -  : m_dstLen (0),
   1.461 -    m_srcLen (0),
   1.462 -    m_tos (0),
   1.463 -    m_tableId (0),
   1.464 -    m_protocol(0),
   1.465 -    m_scope (0),
   1.466 -    m_type (0),
   1.467 -    m_flags (0)
   1.468 -{
   1.469 -  memset ((void*)m_attributeTypes, 0, sizeof (m_attributeTypes));
   1.470 -  m_attributeTypes[RT_A_UNSPEC] = UNSPEC;
   1.471 -  m_attributeTypes[RT_A_DST] = ADDRESS;
   1.472 -  m_attributeTypes[RT_A_SRC] = ADDRESS;
   1.473 -  m_attributeTypes[RT_A_IIF] = U32;
   1.474 -  m_attributeTypes[RT_A_OIF] = U32;
   1.475 -  m_attributeTypes[RT_A_GATEWAY] = ADDRESS;
   1.476 -  m_attributeTypes[RT_A_PRIORITY] = U8;
   1.477 -  m_attributeTypes[RT_A_PREFSRC] = ADDRESS;
   1.478 -  m_attributeTypes[RT_A_METRICS] = UNSPEC;
   1.479 -  //others default value UNSPEC
   1.480 -}
   1.481 -RouteMessage::~RouteMessage ()
   1.482 -{}
   1.483 -
   1.484 -void
   1.485 -RouteMessage::SetFamily (uint8_t v)
   1.486 -{
   1.487 -  m_family = v;
   1.488 -}
   1.489 -void
   1.490 -RouteMessage::SetDstLength (uint8_t v)
   1.491 -{
   1.492 -  m_dstLen = v;
   1.493 -}
   1.494 -void
   1.495 -RouteMessage::SetSrcLength (uint8_t v)
   1.496 -{
   1.497 -  m_srcLen = v;
   1.498 -}
   1.499 -void
   1.500 -RouteMessage::SetTos (uint8_t v)
   1.501 -{
   1.502 -  m_tos = v;
   1.503 -}
   1.504 -void
   1.505 -RouteMessage::SetTableId (uint8_t v)
   1.506 -{
   1.507 -  m_tableId = v;
   1.508 -}
   1.509 -void
   1.510 -RouteMessage::SetProtocol (uint8_t v)
   1.511 -{
   1.512 -  m_protocol = v;
   1.513 -}
   1.514 -void
   1.515 -RouteMessage::SetScope (uint8_t v)
   1.516 -{
   1.517 -  m_scope = v;
   1.518 -}
   1.519 -void
   1.520 -RouteMessage::SetType (uint8_t v)
   1.521 -{
   1.522 -  m_type = v;
   1.523 -}
   1.524 -void
   1.525 -RouteMessage::SetFlags (uint32_t v)
   1.526 -{
   1.527 -  m_flags = v;
   1.528 -}
   1.529 -uint8_t
   1.530 -RouteMessage::GetFamily (void) const
   1.531 -{
   1.532 -  return m_family;
   1.533 -}
   1.534 -uint8_t
   1.535 -RouteMessage::GetDstLength (void) const
   1.536 -{
   1.537 -  return m_dstLen;
   1.538 -}
   1.539 -uint8_t
   1.540 -RouteMessage::GetSrcLength (void) const
   1.541 -{
   1.542 -  return m_srcLen;
   1.543 -}
   1.544 -uint8_t
   1.545 -RouteMessage::GetTos (void) const
   1.546 -{
   1.547 -  return m_tos;
   1.548 -}
   1.549 -uint8_t
   1.550 -RouteMessage::GetTableId (void) const
   1.551 -{
   1.552 -  return m_tableId;
   1.553 -}
   1.554 -uint8_t
   1.555 -RouteMessage::GetProtocol (void) const
   1.556 -{
   1.557 -  return m_protocol;
   1.558 -}
   1.559 -uint8_t
   1.560 -RouteMessage::GetType (void) const
   1.561 -{
   1.562 -  return m_type;
   1.563 -}
   1.564 -uint8_t
   1.565 -RouteMessage::GetScope (void) const
   1.566 -{
   1.567 -  return m_scope;
   1.568 -}
   1.569 -uint32_t
   1.570 -RouteMessage::GetFlags (void) const
   1.571 -{
   1.572 -  return m_flags;
   1.573 -}
   1.574 -
   1.575 -TypeId 
   1.576 -RouteMessage::GetTypeId (void)
   1.577 -{
   1.578 -  static TypeId tid = TypeId ("ns3::RouteMessage")
   1.579 -    .SetParent<GeneralMessage> ()
   1.580 -    .AddConstructor<RouteMessage> ()
   1.581 -    ;
   1.582 -  return tid;
   1.583 -}
   1.584 -TypeId 
   1.585 -RouteMessage::GetInstanceTypeId (void) const
   1.586 -{
   1.587 -  return GetTypeId ();
   1.588 -}
   1.589 -void 
   1.590 -RouteMessage::Print (std::ostream &os) const
   1.591 -{  
   1.592 -  os << " ----RouteMessage ("
   1.593 -     << "family: " << (uint32_t)m_family << " "
   1.594 -     << "dstLen: " << (uint32_t)m_dstLen << " "
   1.595 -     << "srcLen: " << (uint32_t)m_srcLen << " "
   1.596 -     << "tos: " << (uint32_t)m_tos << " "
   1.597 -     << "tableId: " << (uint32_t)m_tableId << " "
   1.598 -     << "protocol: " << (uint32_t)m_protocol << " "
   1.599 -     << "scope: " << (uint32_t)m_scope << " "
   1.600 -     << "type: " << (uint32_t)m_type << " "
   1.601 -     << "flags: " << m_flags<< ")" ;
   1.602 -  PrintAttribute (os);
   1.603 -}
   1.604 -uint32_t 
   1.605 -RouteMessage::GetSerializedSize (void) const
   1.606 -{
   1.607 -  return NETLINK_ROUTE_SIZE + GetAttributeSerializedSize ();
   1.608 -}
   1.609 -
   1.610 -void
   1.611 -RouteMessage::Serialize (Buffer::Iterator& start) const
   1.612 -{
   1.613 -  start.WriteU8 (m_family);
   1.614 -  start.WriteU8 (m_dstLen);
   1.615 -  start.WriteU8 (m_srcLen);
   1.616 -  start.WriteU8 (m_tos);
   1.617 -  start.WriteU8 (m_tableId);
   1.618 -  start.WriteU8 (m_protocol);
   1.619 -  start.WriteU8 (m_scope);
   1.620 -  start.WriteU8 (m_type);
   1.621 -  start.WriteU32 (m_flags);
   1.622 -
   1.623 -  SerializeAttribute (start);
   1.624 -}
   1.625 -uint32_t
   1.626 -RouteMessage::Deserialize (Buffer::Iterator& start, uint32_t len)
   1.627 -{
   1.628 -  m_family = start.ReadU8 ();
   1.629 -  m_dstLen = start.ReadU8 ();
   1.630 -  m_srcLen = start.ReadU8 ();
   1.631 -  m_tos = start.ReadU8 ();
   1.632 -  m_tableId = start.ReadU8 ();
   1.633 -  m_protocol = start.ReadU8 ();
   1.634 -  m_scope = start.ReadU8 ();
   1.635 -  m_type = start.ReadU8 ();
   1.636 -  m_flags = start.ReadU32 ();
   1.637 -
   1.638 -  len -= NETLINK_ROUTE_SIZE;
   1.639 -
   1.640 -  while (len)
   1.641 -    {
   1.642 -      NetlinkAttribute attr;
   1.643 -
   1.644 -      len -= attr.Deserialize (start, m_attributeTypes);
   1.645 -      m_attributes.push_back (attr);
   1.646 -    }
   1.647 -
   1.648 -  return GetSerializedSize ();
   1.649 -}
   1.650 -}; // namespace ns3