detecting the number of nics under qnx

Hi,

I use qnx 6.1 under x86/ppc and I was wondering what is the best way to
detect the number of nics which are bind to the Tcp/ip ?

Thanks


Benzy Gabay
R&D
Everbee Wireless
mailto:bgabay@everbee.com

Benzy Gabay <bgabay@everbee.com> wrote:

Hi,

I use qnx 6.1 under x86/ppc and I was wondering what is the best way to
detect the number of nics which are bind to the Tcp/ip ?

It is the same on all QNX versions. Poke in /dev/io-net/ and look for
the enX entries.

chris

\

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Thanks,

But, what I meant was how do I do it from my program?


“Chris McKillop” <cdm@qnx.com> wrote in message
news:9kpcbc$j3e$1@nntp.qnx.com

Benzy Gabay <> bgabay@everbee.com> > wrote:

Hi,

I use qnx 6.1 under x86/ppc and I was wondering what is the best way to
detect the number of nics which are bind to the Tcp/ip ?


It is the same on all QNX versions. Poke in /dev/io-net/ and look for
the enX entries.

chris

\

cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL

Benzy,
Not sure if this will help, but in an en-en filter layer I wrote I detected
internal io-net messages (npkt->flags & _NPKT_MSG) and used them to keep
track of the endpoints. When my filter was mounted the drivers beneath it
sent up advert messages so I could detect their presence, and on an umount
of a driver a “dying” message is sent up (by io-net I think, although it
appears as though it came from the driver). The details all came from the
DDK
Darren


Benzy Gabay <bgabay@everbee.com> wrote in message
news:9kqmca$5u0$1@inn.qnx.com

Thanks,

But, what I meant was how do I do it from my program?


“Chris McKillop” <> cdm@qnx.com> > wrote in message
news:9kpcbc$j3e$> 1@nntp.qnx.com> …
Benzy Gabay <> bgabay@everbee.com> > wrote:

Hi,

I use qnx 6.1 under x86/ppc and I was wondering what is the best way
to
detect the number of nics which are bind to the Tcp/ip ?


It is the same on all QNX versions. Poke in /dev/io-net/ and look for
the enX entries.

chris

\



cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
\

Darren,

Your idea is great.
Now lets say I’m got the _NPKT_MSG and detected that its from/for a
different endpoint. From where could I get the information of this new
endpoint? meaning: mac,ip, etc.

“Darren” <danderson@wavelength-digital.com> wrote in message
news:9kr27l$kv1$1@nntp.qnx.com

Benzy,
Not sure if this will help, but in an en-en filter layer I wrote I
detected
internal io-net messages (npkt->flags & _NPKT_MSG) and used them to keep
track of the endpoints. When my filter was mounted the drivers beneath it
sent up advert messages so I could detect their presence, and on an umount
of a driver a “dying” message is sent up (by io-net I think, although it
appears as though it came from the driver). The details all came from the
DDK
Darren


Benzy Gabay <> bgabay@everbee.com> > wrote in message
news:9kqmca$5u0$> 1@inn.qnx.com> …
Thanks,

But, what I meant was how do I do it from my program?


“Chris McKillop” <> cdm@qnx.com> > wrote in message
news:9kpcbc$j3e$> 1@nntp.qnx.com> …
Benzy Gabay <> bgabay@everbee.com> > wrote:

Hi,

I use qnx 6.1 under x86/ppc and I was wondering what is the best way
to
detect the number of nics which are bind to the Tcp/ip ?


It is the same on all QNX versions. Poke in /dev/io-net/ and look
for
the enX entries.

chris

\



cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL


\

Benzy,
I’m afraid I can’t pass the idea off as entirely my own as it arose from
discussions with a QNX chap !

My filter layer receives an advert packet from each driver beneath it when
it is mounted, and from any new drivers as they are mounted, so I’ve never
got a packet for an endpoint about which I didn’t know.

The details of each interface are contained in the advert packet that it
sends up - min / max / preferred packet size, MAC address etc etc. See P48
of the DDK or advertise.c of the pcnet driver code.

I don’t know how you’ll learn what IP address/subnet etc are set for the new
interface. My guess would be that its nothing to do with the driver so isn’t
advertised like the MAC address; I’d guess its part of the config of the IP
stack and you’d need to find out how ifconfig does its stuff to see if you
can intercept or evesdrop on the config of the IPstack (or IP_EN ?).
Darren

Benzy Gabay <bgabay@everbee.com> wrote in message
news:9krfcj$l27$1@inn.qnx.com

Darren,

Your idea is great.
Now lets say I’m got the _NPKT_MSG and detected that its from/for a
different endpoint. From where could I get the information of this new
endpoint? meaning: mac,ip, etc.

“Darren” <> danderson@wavelength-digital.com> > wrote in message
news:9kr27l$kv1$> 1@nntp.qnx.com> …

Benzy,
Not sure if this will help, but in an en-en filter layer I wrote I
detected
internal io-net messages (npkt->flags & _NPKT_MSG) and used them to keep
track of the endpoints. When my filter was mounted the drivers beneath
it
sent up advert messages so I could detect their presence, and on an
umount
of a driver a “dying” message is sent up (by io-net I think, although it
appears as though it came from the driver). The details all came from
the
DDK
Darren


Benzy Gabay <> bgabay@everbee.com> > wrote in message
news:9kqmca$5u0$> 1@inn.qnx.com> …
Thanks,

But, what I meant was how do I do it from my program?


“Chris McKillop” <> cdm@qnx.com> > wrote in message
news:9kpcbc$j3e$> 1@nntp.qnx.com> …
Benzy Gabay <> bgabay@everbee.com> > wrote:

Hi,

I use qnx 6.1 under x86/ppc and I was wondering what is the best
way
to
detect the number of nics which are bind to the Tcp/ip ?


It is the same on all QNX versions. Poke in /dev/io-net/ and look
for
the enX entries.

chris

\




cdm@qnx.com > “The faster I go, the behinder I
get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL





\

Darren <danderson@wavelength-digital.com> wrote:

Benzy,
I’m afraid I can’t pass the idea off as entirely my own as it arose from
discussions with a QNX chap !

My filter layer receives an advert packet from each driver beneath it when
it is mounted, and from any new drivers as they are mounted, so I’ve never
got a packet for an endpoint about which I didn’t know.

The details of each interface are contained in the advert packet that it
sends up - min / max / preferred packet size, MAC address etc etc. See P48
of the DDK or advertise.c of the pcnet driver code.

I don’t know how you’ll learn what IP address/subnet etc are set for the new
interface. My guess would be that its nothing to do with the driver so isn’t
advertised like the MAC address; I’d guess its part of the config of the IP
stack and you’d need to find out how ifconfig does its stuff to see if you
can intercept or evesdrop on the config of the IPstack (or IP_EN ?).

You won’t know the IP util you have a Tcpip stack loaded, and somebody
setup the interface (ifconfig en0 …). In that case, you will receive
an “Add_Address” message from top (tcpip stack). Look into sys/io-net.h
for these structures.

-xtang


Darren

Benzy Gabay <> bgabay@everbee.com> > wrote in message
news:9krfcj$l27$> 1@inn.qnx.com> …
Darren,

Your idea is great.
Now lets say I’m got the _NPKT_MSG and detected that its from/for a
different endpoint. From where could I get the information of this new
endpoint? meaning: mac,ip, etc.

“Darren” <> danderson@wavelength-digital.com> > wrote in message
news:9kr27l$kv1$> 1@nntp.qnx.com> …

Benzy,
Not sure if this will help, but in an en-en filter layer I wrote I
detected
internal io-net messages (npkt->flags & _NPKT_MSG) and used them to keep
track of the endpoints. When my filter was mounted the drivers beneath
it
sent up advert messages so I could detect their presence, and on an
umount
of a driver a “dying” message is sent up (by io-net I think, although it
appears as though it came from the driver). The details all came from
the
DDK
Darren


Benzy Gabay <> bgabay@everbee.com> > wrote in message
news:9kqmca$5u0$> 1@inn.qnx.com> …
Thanks,

But, what I meant was how do I do it from my program?


“Chris McKillop” <> cdm@qnx.com> > wrote in message
news:9kpcbc$j3e$> 1@nntp.qnx.com> …
Benzy Gabay <> bgabay@everbee.com> > wrote:

Hi,

I use qnx 6.1 under x86/ppc and I was wondering what is the best
way
to
detect the number of nics which are bind to the Tcp/ip ?


It is the same on all QNX versions. Poke in /dev/io-net/ and look
for
the enX entries.

chris

\




cdm@qnx.com > “The faster I go, the behinder I
get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL





\