Dear Gajendra
Please include this for loop inside the iterator of show neighbor function
in node.cc
for(a1=node_a1->list_neighbors_.begin(); a1 !=
node_a1->list_neighbors_.end(); ++a1)
{
cout<<"\tNeighbor ID : "<<*a1<<endl;
}
Hope it helps.
S. Hashim Bukhari
PhD Student,
COMSATS Institute of Information Technology
Pakistan
On 21 March 2014 04:39, gajendra <[email protected]> wrote:
>
> i have tried it but it gives only node id.
> Would you give me the function that print all neighbor of node.
>
>
>
> Thanks & Regards
> Gajendra
>
>
> On Thu, Mar 20, 2014 at 5:19 AM, itishi saxena [via Network Simulator ns-2]
> <[email protected]> wrote:
>
> >
> > Write this line inside nb_insert function... then u might have idea how
> to
> > use it.
> >
> > cout<<" For node: "<<index<<" Nbr : "<<nb->nb_addr<<endl;
> >
> >
> > You written loop correctly but no need to write if statement......just
> > print the nbr address.
> >
> >
> > Regards
> > Ranjana
> >
> >
> >
> > On Wednesday, 19 March 2014 8:49 PM, Gajendra Vyas <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=28448&i=0>>
> > wrote:
> >
> >
> > Hello
> >
> > I have write following code in forward function. But while compiling it
> > gets compile. But while executing tcl file it gives segmentation fault
> > error.
> > Please help for getting neighbor list and i have to print it.
> >
> > int neighbor=1;
> > AODV_Neighbor *nb;
> > if (nb)
> > {
> > neighbor=nb->nb_addr;
> > for(; nb; nb = nb->nb_link.le_next)
> > {
> > if(nb->nb_addr == index) break;
> > printf("Neighbor :%d \t",neighbor);
> > }
> > }
> >
> >
> >
> > On Wed, Mar 19, 2014 at 10:38 AM, gajendra <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=28448&i=1>>
> > wrote:
> >
> > >
> > > Hello
> > >
> > > I have write following code in forward function. But while compiling it
> > > gets compile. But while executing tcl file it gives segmentation fault
> > > error.
> > > Please help for getting neighbor list and i have to print it.
> > >
> > > int neighbor=1;
> > > AODV_Neighbor *nb;
> > > if (nb)
> > > {
> > > neighbor=nb->nb_addr;
> > > for(; nb; nb = nb->nb_link.le_next)
> > > {
> > > if(nb->nb_addr == index) break;
> > > printf("Neighbor :%d \t",neighbor);
> > > }
> > > }
> > >
> > >
> > >
> > > Thanks & Regards
> > > Gajendra
> > >
> > >
> > > On Tue, Mar 18, 2014 at 3:49 PM, itishi saxena [via Network Simulator
> > ns-2]
> > > <[hidden email] <http://user/SendEmail.jtp?type=node&node=28448&i=2>>
> > wrote:
> > >
> > > >
> > > > Hi All,
> > > > To get this information.....you have to write a method that invokes
> > list
> > > > of neighbours using a FOR LOOP ...for hints go through method
> > nb_insert
> > > > defined in AODV.
> > > >
> > > > I hope it will help.
> > > > Ranjana
> > > >
> > > >
> > > >
> > > > On Tuesday, 18 March 2014 7:24 PM, Hashim Bukhari <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=28432&i=0>>
> > > > wrote:
> > > >
> > > >
> > > > Are the functions discover_neighbors and show_neighbors working?
> > > > You cant put some cout commands to see that compiler comes into the
> > > > function or not.
> > > >
> > > > S. Hashim Bukhari
> > > > PhD Student - Electrical Engineering Department
> > > > COMSATS Institute of Information Technology
> > > > https://sites.google.com/site/hashimbukhari01/home
> > > >
> > > >
> > > > On 18 March 2014 13:25, gajendra <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=28432&i=1>>
> > > > wrote:
> > > >
> > > > >
> > > > > i have tried it
> > > > > but it is not printing neighbor node.
> > > > >
> > > > >
> > > > > On Fri, Mar 14, 2014 at 4:34 PM, Hashim Bukhari [via Network
> > Simulator
> > > > > ns-2] <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=28432&i=2>>
> > > > wrote:
> > > > >
> > > > > >
> > > > > > You can use List function for this purpose and initialize
> > > > > > discover_neighbor
> > > > > > and show_neighbor functions in node.h and node.cc and use them in
> > > > aodv.cc
> > > > > >
> > > > > > Regards.
> > > > > >
> > > > > >
> > > > > > On 14 March 2014 14:28, gajendra <[hidden email]<
> > > > > http://user/SendEmail.jtp?type=node&node=28382&i=0>>
> > > > > > wrote:
> > > > > >
> > > > > > >
> > > > > > > Hello Hashim
> > > > > > > but i have to print all neighbor node. so
> can
> > > you
> > > > > > > please help me to print all these node.
> > > > > > >
> > > > > > > On 3/14/14, Hashim Bukhari [via Network Simulator ns-2]
> > > > > > > <[hidden email] <
> > > http://user/SendEmail.jtp?type=node&node=28382&i=1>>
> > > >
> > > > > > wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hello Gajendra
> > > > > > > >
> > > > > > > > Please follow the neighbor management function for your
> > purposes
> > > > > > > >
> > > > > > > > AODV Neighbor* nb lookup(nsaddr t id)
> > > > > > > >
> > > > > > > > Regards
> > > > > > > >
> > > > > > > >
> > > > > > > > On 14 March 2014 13:43, gajendra <[hidden email]<
> > > > > http://user/SendEmail.jtp?type=node&node=28382&i=2>>
> > > > > > wrote:
> > > > > > > >
> > > > > > > >>
> > > > > > > >> is it possible to access all the neighbor of a node by
> using
> > > > AODV
> > > > > as
> > > > > > a
> > > > > > > >> routing protocol.
> > > > > > > >> I have tried with rt->rt_nexthop. it gives only the current
> > path
> > > > > next
> > > > > > > >> node
> > > > > > > >> and not all nodes.
> > > > > > > >>
> > > > > > > >>
> > > > > > > >>
> > > > > > > >>
> > > > > > > >> Thanks & Regards
> > > > > > > >> Gajendra
> > > > > > > >>
> > > > > > > >>
> > > > > > > >>
> > > > > > > >> --
> > > > > > > >> View this message in context:
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://network-simulator-ns-2.7690.n7.nabble.com/List-of-Neighbor-tp28379.html
> > > > > > > >> Sent from the ns-users mailing list archive at Nabble.com.
> > > > > > > >>
> > > > > > > >>
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > _______________________________________________
> > > > > > > > If you reply to this email, your message will be added to the
> > > > > > discussion
> > > > > > > > below:
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://network-simulator-ns-2.7690.n7.nabble.com/List-of-Neighbor-tp28379p28380.html
> > > > > > > > To start a new topic under ns-users, email
> > > > > > > [hidden email] <
> > http://user/SendEmail.jtp?type=node&node=28382&i=3
> > > >
> > > > > > > > To unsubscribe from List of Neighbor, visit
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > View this message in context:
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://network-simulator-ns-2.7690.n7.nabble.com/List-of-Neighbor-tp28379p28381.html
> > > > > >
> > > > > > > Sent from the ns-users mailing list archive at Nabble.com.
> > > > > > >
> > > > > >
> > > > > >
> > > > > > ------------------------------
> > > > > > If you reply to this email, your message will be added to the
> > > > discussion
> > > > > > below:
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://network-simulator-ns-2.7690.n7.nabble.com/List-of-Neighbor-tp28379p28382.html
> > > > > > To start a new topic under ns-users, email
> > > > > > [hidden email] <
> http://user/SendEmail.jtp?type=node&node=28432&i=3>
> >
> > > > > > To unsubscribe from List of Neighbor, click here<
> > > > >
> > > > >
> > > > > > .
> > > > > > NAML<
> > > > >
> > > >
> > >
> >
> http://network-simulator-ns-2.7690.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > View this message in context:
> > > > >
> > > >
> > >
> >
> http://network-simulator-ns-2.7690.n7.nabble.com/List-of-Neighbor-tp28379p28429.html
> > > > > Sent from the ns-users mailing list archive at Nabble.com.
> > > > >
> > > >
> > > >
> > > > ------------------------------
> > > > If you reply to this email, your message will be added to the
> > discussion
> > > > below:
> > > >
> > > >
> > >
> >
> http://network-simulator-ns-2.7690.n7.nabble.com/List-of-Neighbor-tp28379p28432.html
> > > > To start a new topic under ns-users, email
> > > > [hidden email] <http://user/SendEmail.jtp?type=node&node=28448&i=3>
> > > > To unsubscribe from List of Neighbor, click here<
> > >
> > >
> > > > .
> > > > NAML<
> > >
> >
> http://network-simulator-ns-2.7690.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > >
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://network-simulator-ns-2.7690.n7.nabble.com/List-of-Neighbor-tp28379p28441.html
> > > Sent from the ns-users mailing list archive at Nabble.com.
> > >
> >
> >
> > ------------------------------
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://network-simulator-ns-2.7690.n7.nabble.com/List-of-Neighbor-tp28379p28448.html
> > To start a new topic under ns-users, email
> > [email protected]
> > To unsubscribe from List of Neighbor, click here<
> http://network-simulator-ns-2.7690.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=28379&code=Z2FqdS52eWFzQGdtYWlsLmNvbXwyODM3OXwtMTU5MDg2Nzg5MQ==
> >
> > .
> > NAML<
> http://network-simulator-ns-2.7690.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
> --
> View this message in context:
> http://network-simulator-ns-2.7690.n7.nabble.com/List-of-Neighbor-tp28379p28455.html
> Sent from the ns-users mailing list archive at Nabble.com.
>