netlink/netlink-socket-factory.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 05 May 2011 09:28:21 +0200
changeset 66 2fe1f3e576c9
parent 63 model/netlink-socket-factory.cc@e89dca438df6
permissions -rw-r--r--
make it somewhat build sanely

/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2008 Liu Jian
 *
 * 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: Liu Jian <liujatp@gmail.com>
 *         Hajime Tazaki <tazaki@sfc.wide.ad.jp>
 */

#include "netlink-socket-factory.h"
#include "netlink-socket.h"
#include "ns3/node.h"

namespace ns3 {

NS_OBJECT_ENSURE_REGISTERED (NetlinkSocketFactory);

TypeId 
NetlinkSocketFactory::GetTypeId (void)
{
  static TypeId tid = TypeId ("ns3::NetlinkSocketFactory")
    .AddConstructor<NetlinkSocketFactory> ()
    .SetParent<SocketFactory> ()
    ;
  return tid;
}

NetlinkSocketFactory::NetlinkSocketFactory ()
{}

Ptr<Socket> NetlinkSocketFactory::CreateSocket (void)
{
  Ptr<Node> node = GetObject<Node> ();
  Ptr<NetlinkSocket> socket = CreateObject<NetlinkSocket> ();
  socket->SetNode (node);
  return socket;
} 
} // namespace ns3