pppd on Neutrino2

Hi, I have a question about ppp daemon on Neutrino2.
I’m trying to get some information from pppd using ioclt(). I use control
codes defined in ioctl.h header. I try to put socket and file descriptor of
opened /dev/ppp0 but I’m still getting error while I call ioctl(). I hope
there is someone who know how to get ppp stats.

Thanks in advance.
Sebastian

What stats are you trying to get?

-seanb

Sebastian Slezak <sebastian@psi.mikronika.com.pl> wrote:
: Hi, I have a question about ppp daemon on Neutrino2.
: I’m trying to get some information from pppd using ioclt(). I use control
: codes defined in ioctl.h header. I try to put socket and file descriptor of
: opened /dev/ppp0 but I’m still getting error while I call ioctl(). I hope
: there is someone who know how to get ppp stats.

: Thanks in advance.
: Sebastian

There is some stats in ppp device and it’s posible to see it typing ‘cat
/dev/ppp0’ in shell, and I hope there is some way to get it from my process
using ioctl() call with apriopriate ioctls.

Sebastian

U¿ytkownik “Sean Boudreau” <seanb@qnx.com> napisa³ w wiadomo¶ci
news:a6nmdv$41m$1@nntp.qnx.com

What stats are you trying to get?

-seanb

Sebastian Slezak <> sebastian@psi.mikronika.com.pl> > wrote:
: Hi, I have a question about ppp daemon on Neutrino2.
: I’m trying to get some information from pppd using ioclt(). I use
control
: codes defined in ioctl.h header. I try to put socket and file descriptor
of
: opened /dev/ppp0 but I’m still getting error while I call ioctl(). I
hope
: there is someone who know how to get ppp stats.

: Thanks in advance.
: Sebastian

cat just does the equivalent of:
fd = open("/dev/ppp0", …);
read(fd, buf, sizeof buf);

-seanb

Sebastian Slezak <sebastian@psi.mikronika.com.pl> wrote:
: There is some stats in ppp device and it’s posible to see it typing ‘cat
: /dev/ppp0’ in shell, and I hope there is some way to get it from my process
: using ioctl() call with apriopriate ioctls.

: Sebastian

: U¿ytkownik “Sean Boudreau” <seanb@qnx.com> napisa³ w wiadomo¶ci
: news:a6nmdv$41m$1@nntp.qnx.com
:>
:> What stats are you trying to get?
:>
:> -seanb
:>
:> Sebastian Slezak <sebastian@psi.mikronika.com.pl> wrote:
:> : Hi, I have a question about ppp daemon on Neutrino2.
:> : I’m trying to get some information from pppd using ioclt(). I use
: control
:> : codes defined in ioctl.h header. I try to put socket and file descriptor
: of
:> : opened /dev/ppp0 but I’m still getting error while I call ioctl(). I
: hope
:> : there is someone who know how to get ppp stats.
:>
:> : Thanks in advance.
:> : Sebastian
:>
:>

Okay, in file ioctl.h:

/* PPP ioctls /
/
** Not in NetBSD or SUN /
#define SIOCSIFCOMPAC _IOW(‘i’, 33, struct ifreq)
#define SIOCSIFCOMPPROT _IOW(‘i’, 34, struct ifreq)
#define SIOCSIFMRU _IOW(‘i’, 35, struct ifreq)
#define SIOCGIFMRU _IOWR(‘i’, 36, struct ifreq)
#define SIOCGETU _IOWR(‘i’, 39, struct ifreq) /
get unit number
/
#define SIOCSIFVJCOMP _IOW(‘i’, 40, struct ifreq) /
enable/disable VJ
Compression /
/
END /
/
Not in Sun, In NetBSD /
#define SIOCGIFASYNCMAP _IOWR(‘i’, 37, struct ifreq)
#define SIOCSIFASYNCMAP _IOW(‘i’, 38, struct ifreq)
/
END ***/
#define SIOCSIFMTU _IOW(‘i’, 41, struct ifreq)
#define SIOCGIFMTU _IOWR(‘i’, 41, struct ifreq)

I call ioctl() with descriptor created with socket(AF_INET, SOCK_DGRAM,0)
and some of this ioctls nad proper third argument and I get error in
return. So how can I use this ioctls?

Sebastian