LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-19-2012, 10:19 AM   #1
sindhu4sind
Member
 
Registered: Apr 2012
Posts: 38

Rep: Reputation: Disabled
Question how to add a new member into ifreq?


Hello Everyone,

I am trying to get my userspace pid into ioctl function through ifreq, but I am unknown of adding a member into structure of ifreq
here is my code:
Code:
...
int my_ioctl (struct net_device* dev, struct ifreq *ifr, int cmd)
{
 int errorCode = 0;
 struct hInfo *hostInfo;
 struct netInfo *netInfo;

 switch (cmd) {
   case SIOTRYTOGETDEVICEINFO:
     /* Working fine and I am getting required information  */
     break;
   case SIOTRYTOGETNETWORKINFO:
     /* Working fin and I am getting required information*/
     break;
   case SIOTRYTOGETPIDINFO:
     int pid = copy_from_user(pid, ifr->ifr_pid, sizeof(pid));   // here i want to add ifr_pid into ifreq structure
     break;
   default:
     break;
   }
   return errorCode;
}

so i want to know that is it possible to get pid using this way into virtual interface?
if it is possible then how can i add this ifr_pid member into structure of ifreq without edditing linux/if.h file.

I am not so good with C language, so pardon me and make me correct if i made any technical mistake..

Thank you so much in advance..
Sindhu
 
  


Reply

Tags
ioctl, linux, structure



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
Can Vista Add as a member in Samba PDC harry_uk Linux - Server 0 04-20-2009 08:56 AM
LQ member progress status from member to senior member............. emailssent LQ Suggestions & Feedback 3 10-11-2004 01:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:56 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