LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-23-2009, 11:53 PM   #1
predatorz
Member
 
Registered: Mar 2007
Posts: 58

Rep: Reputation: 15
Using C++ to list wireless interfaces in linux


Hi,

I am trying to write a program to list wireless interfaces and changing mac address the interface that will run primarily on ubuntu 8.04 and hopefully other linux distros.
I am able to list out the wireless interfaces and change MAC address using popen with linux commands in ubuntu 8.04

Is there a way to use C++ to do the above instead of using popen with linux commands so that the program can be used for other linux distros?
I have been googling on this but no luck so far.

Last edited by predatorz; 12-23-2009 at 11:54 PM.
 
Old 12-24-2009, 02:38 AM   #2
Gutsy_Iain_08
LQ Newbie
 
Registered: Jan 2008
Posts: 25

Rep: Reputation: 16
you can use

Quote:
system("ifconfig eth0 command");
to access system resources.
 
Old 12-24-2009, 06:17 AM   #3
GooseYArd
Member
 
Registered: Jul 2009
Location: Reston, VA
Distribution: Slackware, Ubuntu, RHEL
Posts: 183

Rep: Reputation: 46
Quote:
Originally Posted by predatorz View Post
Hi,

I am trying to write a program to list wireless interfaces and changing mac address the interface that will run primarily on ubuntu 8.04 and hopefully other linux distros.
I am able to list out the wireless interfaces and change MAC address using popen with linux commands in ubuntu 8.04

Is there a way to use C++ to do the above instead of using popen with linux commands so that the program can be used for other linux distros?
I have been googling on this but no luck so far.
You'll find the devices enumerated under /proc/net/wireless

Hunt around in google code search and you'll find a bunch of examples of reading it.

.andy
 
  


Reply



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
Multiple Wireless Interfaces Paris Heng Linux - Networking 3 03-25-2008 02:52 PM
Figured you guys may know.. Conky, possible to list multiple interfaces as arguments? Mysticle31 Programming 0 01-08-2008 05:23 PM
Ntop - list interfaces alphabetically granny Linux - Software 0 12-12-2007 11:53 AM
2 Wireless interfaces...? How to get rid of one. Mr. President Linux - Wireless Networking 4 02-07-2005 02:01 PM
wireless channel list different from router's list heluani Linux - Laptop and Netbook 1 08-29-2004 10:04 PM

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

All times are GMT -5. The time now is 03:31 AM.

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