LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-28-2012, 01:37 PM   #1
warint06
LQ Newbie
 
Registered: May 2010
Posts: 8

Rep: Reputation: 0
Unhappy Unable to register mcast address in c++


i was working for a routing algo protocol in c++ on centos. centos was running on vmware .. i was able to register mcast address 224.0.0.9 when my interfaces card are connected in bridge mode in vmware. but as i connected my centos with cisco router using gns3 cloud i got errors

so overall topolgoy is like

cenots++bridgemode-----bridgemode+centos //able to add into group

centos+--vmnet1-----------+vmnet1(gns3cloud---cisco router) //unable to add into group

h=gethostbyname("224.0.0.9");
if(h==NULL) {
cout << "unknown group address"<<endl;
exit(1);
}
if memcpy((char *) &mcastAddr.sin_addr.s_addr,h->h_addr_list[0],h->h_length);

mreq.imr_multiaddr.s_addr=mcastAddr.sin_addr.s_addr; //
mreq.imr_interface.s_addr=htonl(INADDR_ANY);

int mc = setsockopt(soc,IPPROTO_IP,IP_ADD_MEMBERSHIP,(void *) &mreq, sizeof(mreq));
if(mc<0) {
cout <<"unable to join MCAST GROUP"<<endl;
printf("ERROR: %s\n", strerror(errno));
exit(1);
}

errno returns. ERROR: No such device

ps# there is only one interface eth0 using which m able to ping cisco router

Any pointer is welcomed

Thanks
 
Old 12-30-2012, 09:16 AM   #2
warint06
LQ Newbie
 
Registered: May 2010
Posts: 8

Original Poster
Rep: Reputation: 0
i will be gratefull if anyone can comment on this plz
 
Old 01-01-2013, 02:57 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
How do you open the socket in the first place? The errno you're talking about comes from the setsockopt, right?
 
  


Reply

Tags
c++, cisco, gns3, sockets



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how does macro to get base address register in configuration space works jamesbon Programming 1 11-22-2010 07:19 PM
Base address for hardware pin and register..! cvr Linux - Hardware 1 07-22-2010 05:06 PM
unable to register Suse vivek rai SUSE / openSUSE 1 01-29-2009 12:53 AM
dynamically register ip address to windows 2000 dns PantherSE Linux - Networking 0 06-23-2004 12:38 PM
ALSA unable to register device Griffon26 Linux - Software 3 11-27-2002 08:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration