Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - pppstats information in qnx 6.4 : (6 Items)
   
pppstats information in qnx 6.4  
Hi 

we are using ppc target having limited QNX file system

I was earlier using 6.3.2 kernel and for getting statastics of PPP link we use to use  cat /dev/socket/pppmgr ..

Now these commands are no more working and more over i had seen pppstats gives this information. But when i am trying 
that i says cannot execute no such file or directory. I want to know what binary i need to add to my build other than 
pppd i need to add to get pppstats running.

Do i need to do any changes in build file ?

2nd part : In help documents it says /etc/ppp folders contains info about ppp link, but i am using host QNX and i 
connected ppp link between my target and host, but i am not able to see any such folder exisitng in host machine. what 
do i need to do ?

Thanks
Ravi 
Re: pppstats information in qnx 6.4  
On Fri, Feb 06, 2009 at 05:43:28AM -0500, ravi varma wrote:
> Hi 
> 
> we are using ppc target having limited QNX file system
> 
> I was earlier using 6.3.2 kernel and for getting statastics of PPP link we use to use  cat /dev/socket/pppmgr ..
> 
> Now these commands are no more working and more over i had seen pppstats gives this information. But when i am trying 
that i says cannot execute no such file or directory. I want to know what binary i need to add to my build other than 
pppd i need to add to get pppstats running.
> 
> Do i need to do any changes in build file ?
> 
> 2nd part : In help documents it says /etc/ppp folders contains info about ppp link, but i am using host QNX and i 
connected ppp link between my target and host, but i am not able to see any such folder exisitng in host machine. what 
do i need to do ?
> 

What stats in particular are you looking for?

-seanb
Re: pppstats information in qnx 6.4  
We are looking to know the link statistics like :
No.of frames/bytes tranmistted /Received Etc over ppp link

-Ravi 


> On Fri, Feb 06, 2009 at 05:43:28AM -0500, ravi varma wrote:
> > Hi 
> > 
> > we are using ppc target having limited QNX file system
> > 
> > I was earlier using 6.3.2 kernel and for getting statastics of PPP link we 
> use to use  cat /dev/socket/pppmgr ..
> > 
> > Now these commands are no more working and more over i had seen pppstats 
> gives this information. But when i am trying that i says cannot execute no 
> such file or directory. I want to know what binary i need to add to my build 
> other than pppd i need to add to get pppstats running.
> > 
> > Do i need to do any changes in build file ?
> > 
> > 2nd part : In help documents it says /etc/ppp folders contains info about 
> ppp link, but i am using host QNX and i connected ppp link between my target 
> and host, but i am not able to see any such folder exisitng in host machine. 
> what do i need to do ?
> > 
> 
> What stats in particular are you looking for?
> 
> -seanb


Re: pppstats information in qnx 6.4  
On Fri, Feb 06, 2009 at 09:18:50AM -0500, ravi varma wrote:
> We are looking to know the link statistics like :
> No.of frames/bytes tranmistted /Received Etc over ppp link
> 

You can get number of bytes from 'netstat -inv'.  You can
get bytes, frames and a lot of other info from the
SIOCGIFDATA ioctl which populates a struct ifdatareq.

-seanb
Re: pppstats information in qnx 6.4  
> On Fri, Feb 06, 2009 at 09:18:50AM -0500, ravi varma wrote:
> > We are looking to know the link statistics like :
> > No.of frames/bytes tranmistted /Received Etc over ppp link
> > 
> 
> You can get number of bytes from 'netstat -inv'.  You can
> get bytes, frames and a lot of other info from the
> SIOCGIFDATA ioctl which populates a struct ifdatareq.
> 
> -seanb


Hi 

I tried the way you suggested, first of all thank you as i got introduced to different structures over the process.

code i am using is, every time ioctl call is failing i tried "/dev/ser2" assuming that my ppp0 interface runs on ser2, i
 am not getting what i should attach as file i.e /dev/PPP0 or /dev/(process id of ppp0) etc... the error code suggests "
Inappropriate I/O control operation", so let me know wher ei am going wrong.


struct ifdata 
{
         char ifdr_name[IFNAMSIZ];
         struct if_data ifdr_data;
}ifdatareq;



int main()
{

	struct ifdatareq ifdr;
	struct if_data *ifi;
	unsigned char ifi_type; 
	int fd;
   fd = open("/dev/ser2", O_RDWR | O_NOCTTY | O_NDELAY);
   while(1)
   {
        if (ioctl(fd, SIOCGIFDATA, &ifdr) == -1)
       {
	perror("Socket Bind failed\n");	
	printf( "That means(%d): %s\n",errno, strerror(errno) );
	return -1;
       }
       ifi = &ifdr.ifdr_data;
       ifi_type = ifi->ifi_type;
       printf("%c is number\n",ifi_type);
}		
}

Thnaks
RAVI 


Re: pppstats information in qnx 6.4  
On Mon, Feb 09, 2009 at 10:35:47AM -0500, ravi varma wrote:
> > On Fri, Feb 06, 2009 at 09:18:50AM -0500, ravi varma wrote:
> > > We are looking to know the link statistics like :
> > > No.of frames/bytes tranmistted /Received Etc over ppp link
> > > 
> > 
> > You can get number of bytes from 'netstat -inv'.  You can
> > get bytes, frames and a lot of other info from the
> > SIOCGIFDATA ioctl which populates a struct ifdatareq.
> > 
> > -seanb
> 
> 
> Hi 
> 
> I tried the way you suggested, first of all thank you as i got introduced to different structures over the process.
> 
> code i am using is, every time ioctl call is failing i tried "/dev/ser2" assuming that my ppp0 interface runs on ser2,
 i am not getting what i should attach as file i.e /dev/PPP0 or /dev/(process id of ppp0) etc... the error code suggests
 "Inappropriate I/O control operation", so let me know wher ei am going wrong.
> 
> 
> struct ifdata 
> {
>          char ifdr_name[IFNAMSIZ];
>          struct if_data ifdr_data;
> }ifdatareq;
> 
> 
> 
> int main()
> {
> 
> 	struct ifdatareq ifdr;
> 	struct if_data *ifi;
> 	unsigned char ifi_type; 
> 	int fd;
>    fd = open("/dev/ser2", O_RDWR | O_NOCTTY | O_NDELAY);
/* A socket is needed here */
fd = socket(AF_INET, SOCK_DGRAM, 0);
>    while(1)
>    {
memset(&ifdr, 0x00, sizeof(ifdr));
strlcpy(ifdr.ifdr_name, "ppp0", sizeof(ifdr.ifdr_name));
/* where "ppp0" above is as reported by (for example), the ifconfig utility */

>         if (ioctl(fd, SIOCGIFDATA, &ifdr) == -1)
>        {
> 	perror("Socket Bind failed\n");	
> 	printf( "That means(%d): %s\n",errno, strerror(errno) );
> 	return -1;
>        }
>        ifi = &ifdr.ifdr_data;
>        ifi_type = ifi->ifi_type;
>        printf("%c is number\n",ifi_type);
> }		
> }
> 
> Thnaks
> RAVI 
> 
> 
> 
> 
> _______________________________________________
> io-net migration
> http://community.qnx.com/sf/go/post21763
>