Get list of IPv6 addresses of an interface

Folks,

Is there any portable way of getting the list of IPv6 addresses for a
network interface?

sysctl() could have probably worked, but seems to be deprecated for
Linux. On the other hand, ioctl's SIOCGIFADDR only returns IPv4
addresses in Linux.

Thoughts?

Thanks,
Fernando



0
11/29/2011 7:12:06 AM
comp.unix.programmer 10733 articles. 0 followers. kokososo56 (349) is leader. Post Follow

2 Replies
1142 Views

Similar Articles

[PageSpeed] 2
Fernando Gont <fernando.gont@gmail.com> writes:
> Is there any portable way of getting the list of IPv6 addresses for a
> network interface?
>
> sysctl() could have probably worked, but seems to be deprecated for
> Linux. On the other hand, ioctl's SIOCGIFADDR only returns IPv4
> addresses in Linux.

Last time I looked into this there was no portable way.

On Solaris and HPUX I used SIOCGLIFCONF; on Linux, /proc/net/if_inet6;
on AIX, CSIOCIFCONF+SIOCGIFADDRS.  *BSD and OSX weren't required targets
so I didn't look into those; I think you can look at the source of
ifconfig for hints in those cases though.

Off-topic for this group, but on Windows I used GetAdaptersAddresses()
and my notes say that SIO_GET_INTERFACE_LIST looked like a reasonable
approach too, though I don't remember the details.

-- 
http://www.greenend.org.uk/rjk/
0
rjk (534)
11/29/2011 12:52:55 PM
On Mon, 28 Nov 2011, Fernando Gont wrote:

> sysctl() could have probably worked, but seems to be deprecated for 
> Linux. On the other hand, ioctl's SIOCGIFADDR only returns IPv4 
> addresses in Linux.

http://www.kernel.org/doc/man-pages/online/pages/man3/getifaddrs.3.html

perhaps?
0
lacos2 (200)
12/1/2011 6:04:15 PM
Reply:
Similar Artilces:

Trouble setting IPv6 traffic class (QoS) bits with iperf
I am running iperf 2.0.5 on 2.6.23.1-42.fc8. I want to use the -S option to set the IPv6 traffic class (QoS) bits. I used the following command: iperf -c fec0::4:f5d2:c695:40e3:cab6 -b 10k -t 1000000 -S 0x38 -p 5111 -l 64 -V With tcpdump, I can see that the traffic class is still 0x0. I know the -S option works with IPv4. Does it work with IPv6? If so, what am I doing wrong? ...

FAQ - Etiquette
There are several FAQs about the Oracle database scattered around the Internet, and many ways of finding answers to the simpler questions about Oracle very quickly. The following list is a suggestion of where you might find answers to questions that you feel should have an easy answer. The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html The archive for this news group http://www.google.com select the GROUPS tab then work through the list to comp -> databases -> oracle A search engine for searching the manuals for current versions...

Re: List of multiple elements #2
> Given the list > a={1,1,2,1,2}; > ... how to compute the list of multiple elements. > {1,1,2} Hi. One additional way might be to just delete each unique item from the original list. DupsOnly[v_List] := Module[{u, t}, u = Union[v]; t = Fold[DeleteCases[#1, #2, {1}, 1] &, v, u]; Sort[t] ] DupsOnly[{1, 1, 2, 1, 2}] {1, 1, 2} v = RandomChoice[Range[5], 10] {4, 2, 2, 3, 5, 5, 3, 3, 1, 1} Sort[v] {1, 1, 2, 2, 3, 3, 3, 4, 5, 5} DupsOnly[v] {1, 2, 3, 3, 5} I may be wrong, but the suggestion on =93DuplicateElements=94 seems a little slower in...

Kmail Address Book
I installed Kmail 1.7.2 from Linspire CNR. I set up Kmail and everything looks fine and I can send and receive mail - Except - I can not access the Address Book. In fact, under the "Tools" menu tab, "Address Book" "Certificate Manager, "GNU Log Viewer" and Import Messages are all grayed out. Anyone know how to fix? Is this a faulty install, conflict with the Mozilla email program (which I am not running concurrently with Kmail) or a possible conflict with an old SuSE 9.1 on a different hard drive? Any fix suggestions would be greatly appreciated. I di...

How to get a vendor to listen to you
I don't know how much of this is true or just conjecture, but it does paint an interesting picture about how to get support for a platform, despite political repercussions. Yousuf Khan http://www.theinquirer.net/?article=12797 ...

Spammer getting through my NAT router?
I have a home network that I thought was pretty secure. It uses an old Macintosh running the NAT program IPNetRouter. Sometimes I use the FTP or web server function of IPNetRouter, but fortunately no one writes viruses for old out&#8211;of-date Macs these days and I have never had a problem. These are currently turned off. I am upstairs running Windows XP with ZoneAlarm Pro (mostly to check for anything I don&#8217;t know about going out). I was surprised to find a few rare cases of ICMP packets coming in from the outside and reaching my PC. Most of these were responses to pings initi...

ipv6 #2
ipv6 -------------------------------------------------- All your IPV6 are belong to me -------------------------------------------------- -- --------------------------------- --- -- - Posted with NewsLeecher v3.8 Final Web @ http://www.newsleecher.com/?usenet ------------------- ----- ---- -- - ...

How to get combinations of a matrix
hello, I have R=[ 0 1 1 0 ] means 2 number are there and 4 places in R. I need 16 different R combinations. can anyone help me??? Thanks Ankur Ankur Garg wrote: > > > hello, > > I have R=[ 0 1 1 0 ] > means 2 number are there and 4 places in R. > > I need 16 different R combinations. > > can anyone help me??? > > Thanks > Ankur I'm not sure if I've understood your assignment properly, but this gives an interesting output that might be sort of what you want. str2num(reshape([reshape(dec2bin(0:15)',1,64); char(ones(1,64)*32)],8,16)') ...

How could I get two desktop Macs in two apartments of the same building to share the same contents?
How could I get two desktop Macs in two apartments of the same building to share the same contents, so that if I change the contents of one computer, the changes are reflected in the other computer? I would be the only person operating the computers. In both apartments I want to operate printers connected to the desktop Macs. I have an Airport Extreme and an Airport Express already hooked up to my existing Mac, so I'm wondering how I could extend my network into the second apartment, which is in a different apartment of the same building. Robert On 2013-03-18, Robert Montgo...

Get the pid of a os.startfile(filename)
Hi to all, How can I get the Process ID (PID) of an application started because of os.startfile(filename)? Or, better, How can I get the PID of a running program, suposing I know the name of the running application? Many thanks. Daniel Hi ! With W2K or WXP : tasklist /FI "IMAGENAME eq exename.exe" And, with Python, how capture this information : def findPID(exename): import os a = os.popen4('tasklist /FI "IMAGENAME eq '+exename+'"') a[0].flush() try: info=a[1].readlines()[3].split() except: info=[exename...

I Keep Getting and "unknown database" error when I open my program that is using Flashfiler
Hi, I have been using AccuEvents for my entertainment company over the past= 6 years or so. I'm not very good working with this Flashfiler server, so = I try not to make changes. However, due to a problem with one of the compu= ters on my network tried to make changes for the software to work. Now I k= eep getting an "unknown database" error when I open up the software after I= 've started the server. I have gone both thru the tcpi/int and single serv= er steps, but it keeps coming back with "unknown database". Can someone he= lp me solve this? Al...

sort and get index?
In matlab, the sort function returns two things: [a,b]=sort([5, 8, 7]) a = 5 7 8 b = 1 3 2 where a is the sorted result, and b is the corresponding index. Is there C++ code available to achieve this? Better compatible with STL vector. Thanks "b83503104" <b83503104@yahoo.com> wrote... > In matlab, the sort function returns two things: > > [a,b]=sort([5, 8, 7]) > > a = 5 7 8 > b = 1 3 2 > > where a is the sorted result, and b is the corresponding index. > Is there C++ code available to achieve this? Probably. You co...

Cannot get PiCTeX to process an example file.
Hi All, I bought the PiCTeX manual from PCTeX and copied the LaTeX code (see below) from page 71 of the manual. I guarantee there are no typos in my copying. I also bought the LaTeX CD from TeXnicCenter and use PiCTeX which came on that CD. When I run the code below through the LaTeX compiler from TeXnicCenter I get the errors: ! Undefined control sequence. <argument> \fiverm l.2566 \setplotsymbol({\fiverm .}) ! Undefined control sequence. <argument> \fiverm l.3102 \setshadesymbol ({\fiverm .}) ! Undefined control sequence. \ninepoint I have used TeXnicCent...

difference between chan gets / gets
Hi ! What difference between command chan gets and gets, chan puts and puts ? Many thanks ! serge_darin@mail.ru <serge_darin@mail.ru> wrote: > What difference between command chan gets and gets, chan puts and > puts ? They are supposed to be the same. puts is here for compatibility (and for those too lazy to write those extra 5 chars, like me), whereas chan is an attempt to have related functionality together in a single command. If you're old to tcl, you'll likely be used to top-level "puts", whereas if you're new to tcl, you're more likely to memo...

getting rid of a while(1) "poll"
Typical problem where a while(1) consumes gobs of CPU. Not as straightforward (to me) to figure out how to replace it with something more CPU friendly. The overall system has three daemons: 1) suck_packets_d 2) first_order_packet_filter_and_packet_buffer_d 3) extract_interesting_packet_features_and_generate_report_d Using some sort of blocking calls in 1) or 2) seems like a bad idea, because packet volume can be high and I want to keep up with it as much as possible. I could use some help thinking this through if anyone is so inclined. C / Linux pseudocode for daemon (2) (biggest ...

[telecom] Woman allegedly records own arrest, gets accused of wiretapping
Woman allegedly records own arrest, gets accused of wiretapping Massachusetts wiretapping law prohibits secretly recording police. by David Kravets May 11 2014 Ars Technica A Massachusetts woman faces charges of allegedly using a hidden mobile phone to audio-record her own suspicion-of-disorderly-conduct arrest. .... http://arstechnica.com/tech-policy/2014/05/woman-allegedly-records-own-arrest-gets-accused-of-wiretapping/ Per Monty Solomon: >Massachusetts wiretapping law prohibits secretly recording police. Can somebody explain the rationale for such laws? -- P...

Get Rich
Take advantage of a great deal ...

Process getting terminated
I am facing a very strange problem. We have a process that is getting terminated without giving any clue as to how it got terminated. There are 3 threads in the process and my logs indicate that each of them was in a waiting state when the process got terminated. I have put __try __except inside each of the top level functions being executed by the threads so that I do not miss any exception if any which might cause the process to be terminated. I hooked the ExitProcess function at the very beginning (inside winmain before the other threads are created) to figure out if any thread was ...

list of BooleanButtons will not display in hiCreateAppForm
The following snippet is used to generate a list of boolean buttons that will be used to select what Level 0 text will be used to generate hierarchial power plots. Everything seems to run okay except that only the first boolean button in the list shows up in the Form. Anyone know what I am doing wrong here? TIA, David . . . /***** Create Fields for AppForm *****/ loopCntr = 1 xCrd = 20 yCrd = 90 foreach( labelItem labelList printf( "%d %s\n", loopCntr labelItem ) if( loopCntr == 1 then ...

Virtual user table, alias file and catchall email address
I have a virtual user table that I would like to put a catchall address for the domain. @domain someone@somewhere.com All my users for the domains are not in the virtualuser table and I don't want them to be. With this, my catchall would be used for everyone, and I don't want that. Does anyone have a way to have all emails addressed to a domain that do not have entries in virtualusers and aliases go to the catchall. Thanks cross wrote: > I have a virtual user table that I would like to put a catchall address for > the domain. > > @domain someone@somewhere.co...

How can I get the mean of all elements of a 2D Array?
I found a VI to extract the minimal and maximal value of a array, but not the mean. Is there another possibility? Thanks Simon Use the Mean function.:smileywink: On the function palette, right at the very top, is a button called 'Search'. "Mean" is such a simple function, you should make your own. The following code works for 2D, 3D, 4D, etc. arrays. :D <img src="http://forums.ni.com/attachments/ni/170/198999/1/2Dmean.png"> (You might suggest to NI that "mean" should be made polymorphic with respect to array dimensionality.)Message Edited by alte...

How get on a computer from a lan?
I have a pc IBM Netvista and I know that it's possible start it from the lan when connected at lan. Do you know a program, codes and how do it? TKS On Fri, 27 May 2005 13:17:17 -0300, Rudy <rudy@genesi.ws> wrote: > I have a pc IBM Netvista and I know that it's possible start it from the > lan when connected at lan. > Do you know a program, codes and how do it? > TKS you need a dhcp server, as well as nfs, i think that's it. should boot from net fine once you have that. -- Using Opera's revolutionary e-mail client: http://www.opera.co...

Address book categories
H What is the maximum number of categories that Address Book can accept Is there a good Address Book enhancement that can be used with FunSMS? I tried Contact M but FunSMS does not detect the contacts inside Contac M ... only those in Address Boo -- MagiClick - The Best Palm OS Game: www.palmgear.com/?xyz=9672 ...

How to get a Maximal Image View in a Window?
*** post for FREE via your newsreader at post.newsfeed.com *** After I resized a (image) window how can I get the image maximized to fit the window? thanks Phuoc -- _/\__/\__/\__/\__/\__/\_ www.folksfun.com -----= Posted via Newsfeed.Com, Uncensored Usenet News =----- http://www.newsfeed.com - The #1 Newsgroup Service in the World! -----== 100,000 Groups! - 19 Servers! - Unlimited Download! =----- PC HUA <home-AT-huaonline.DOT.com> wrote: > *** post for FREE via your newsreader at post.newsfeed.com *** > > After I resized a (image) window how can I ...

How to get the function of the fitting surface?
Hi, all. I've some test data in three dimension. I can get the fitting surface by some function, e.g., the griddata function. I wanna to know whether MATLAB can get the function of the surface. If can, how to get it? Many thanks for your kind. bowlder. In article <41888f1d.47620859@news.cn99.com>, bowlder <bowlders@tom.com> wrote: > Hi, all. > I've some test data in three dimension. > I can get the fitting surface by some function, e.g., the griddata function. > I wanna to know whether MATLAB can get the function of the surface. > If can, how to get i...