netlink/netlink-socket-factory.cc
changeset 66 2fe1f3e576c9
parent 63 e89dca438df6
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netlink/netlink-socket-factory.cc	Thu May 05 09:28:21 2011 +0200
     1.3 @@ -0,0 +1,50 @@
     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-socket-factory.h"
    1.26 +#include "netlink-socket.h"
    1.27 +#include "ns3/node.h"
    1.28 +
    1.29 +namespace ns3 {
    1.30 +
    1.31 +NS_OBJECT_ENSURE_REGISTERED (NetlinkSocketFactory);
    1.32 +
    1.33 +TypeId 
    1.34 +NetlinkSocketFactory::GetTypeId (void)
    1.35 +{
    1.36 +  static TypeId tid = TypeId ("ns3::NetlinkSocketFactory")
    1.37 +    .AddConstructor<NetlinkSocketFactory> ()
    1.38 +    .SetParent<SocketFactory> ()
    1.39 +    ;
    1.40 +  return tid;
    1.41 +}
    1.42 +
    1.43 +NetlinkSocketFactory::NetlinkSocketFactory ()
    1.44 +{}
    1.45 +
    1.46 +Ptr<Socket> NetlinkSocketFactory::CreateSocket (void)
    1.47 +{
    1.48 +  Ptr<Node> node = GetObject<Node> ();
    1.49 +  Ptr<NetlinkSocket> socket = CreateObject<NetlinkSocket> ();
    1.50 +  socket->SetNode (node);
    1.51 +  return socket;
    1.52 +} 
    1.53 +} // namespace ns3