Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion 32bit address issue (ns-3.2 stable)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mathieu Lacage  
View profile  
 More options Nov 24 2008, 2:42 pm
From: Mathieu Lacage <mathieu.lac...@sophia.inria.fr>
Date: Mon, 24 Nov 2008 20:42:20 +0100
Local: Mon, Nov 24 2008 2:42 pm
Subject: Re: 32bit address issue (ns-3.2 stable)

On Mon, 2008-11-24 at 05:04 -0800, Norman wrote:
> Hi Gustavo,

> Many thanks for your suggestion.
> Are you sure that this object/functions are meant to use directly?
> From what I see there is not header file in "./build/debug/ns3/" for
> Ipv4LoopbackInterface.
> [ this is not a problem since I can use the one from "./src/internet-
> stack",
> but what bothers me is the fact that AddIpv4Interface() method is
> private for object "Ipv4L3Protocol" and I'm not sure how to use it
> properly before starting to modifying "ns".

> Snip from: "src/internet-stack/ipv4-l3-protocol.cc":
> void
> Ipv4L3Protocol::SetupLoopback (void)
> {
>   NS_LOG_FUNCTION_NOARGS ();

>   Ptr<Ipv4LoopbackInterface> interface =
> CreateObject<Ipv4LoopbackInterface> ();
>   interface->SetNode (m_node);
>   interface->SetAddress (Ipv4Address::GetLoopback ());
>   interface->SetNetworkMask (Ipv4Mask::GetLoopback ());
>   uint32_t index = AddIpv4Interface (interface);
>   AddHostRouteTo (Ipv4Address::GetLoopback (), index);
>   interface->SetUp ();
> }

> And below what I'm trying to do:
> void makerid2(char *ipaddr, Ptr<Node> n) {
>   Ptr<Ipv4LoopbackInterface> interface =
> CreateObject<Ipv4LoopbackInterface> ();
>   Ptr<Ipv4StaticRouting> srt = CreateObject<Ipv4StaticRouting> ();
>   Ipv4Address ip(ipaddr);
>   interface->SetNode (n);
>   interface->SetAddress (ip);
>   interface->SetNetworkMask (0xffffffff);

>   uint32_t index = AddIpv4Interface (interface);
>   srt->AddHostRouteTo (ip, index);
>   interface->SetUp ();
> }

> That's the error I get once trying to run it:
> [469/513] cxx: scratch/myfirst.cc -> build/debug/scratch/myfirst_4.o
> ../scratch/myfirst.cc: In function 'void makerid2(char*,
> ns3::Ptr<ns3::Node>)':
> ../scratch/myfirst.cc:236: error: 'AddIpv4Interface' was not declared
> in this scope
> Build failed
>  -> task failed (err #129): [bld:///wrk/ns3/ns-3.2/scratch/
> myfirst_4.o]

> This is because AddIpv4Interface is a private method,
> any idea how to solve it nicely without any modification to ns?

There is no other way than to patch the src/internet-stack directory.

Mathieu


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.