2007-08-01 09:02:03 +02:00
|
|
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2007 Emmanuelle Laprise
|
|
|
|
|
*
|
|
|
|
|
* 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: Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
|
|
|
|
|
*/
|
|
|
|
|
#include "packet-socket-factory.h"
|
|
|
|
|
#include "node.h"
|
2007-09-06 18:19:22 +02:00
|
|
|
#include "packet-socket.h"
|
2007-08-01 09:02:03 +02:00
|
|
|
|
|
|
|
|
namespace ns3 {
|
|
|
|
|
|
2008-01-03 11:39:45 +01:00
|
|
|
NS_OBJECT_ENSURE_REGISTERED (PacketSocketFactory);
|
|
|
|
|
|
2008-01-15 12:36:22 +01:00
|
|
|
TypeId
|
2008-01-15 12:43:07 +01:00
|
|
|
PacketSocketFactory::GetTypeId (void)
|
2008-01-02 10:33:39 +01:00
|
|
|
{
|
2008-03-13 12:56:49 -07:00
|
|
|
static TypeId tid = TypeId ("ns3::PacketSocketFactory")
|
2008-01-03 08:34:31 +01:00
|
|
|
.SetParent<SocketFactory> ();
|
2008-01-15 12:44:09 +01:00
|
|
|
return tid;
|
2008-01-02 10:33:39 +01:00
|
|
|
}
|
2007-08-01 09:02:03 +02:00
|
|
|
|
|
|
|
|
PacketSocketFactory::PacketSocketFactory ()
|
2008-01-02 09:09:24 +01:00
|
|
|
{}
|
2007-08-01 09:02:03 +02:00
|
|
|
|
|
|
|
|
Ptr<Socket> PacketSocketFactory::CreateSocket (void)
|
|
|
|
|
{
|
2008-01-31 22:11:03 +01:00
|
|
|
Ptr<Node> node = GetObject<Node> ();
|
2008-03-11 13:30:12 -07:00
|
|
|
Ptr<PacketSocket> socket = CreateObject<PacketSocket> ();
|
|
|
|
|
socket->SetNode (node);
|
2007-08-01 09:02:03 +02:00
|
|
|
return socket;
|
|
|
|
|
}
|
|
|
|
|
} // namespace ns3
|