Operating System - HP-UX
1820057 Members
2999 Online
109608 Solutions
New Discussion юеВ

Re: IP address of NIC (ethernet) interface queue

 
james edele
New Member

IP address of NIC (ethernet) interface queue

We have a streams module that is pushed,
along with the dlpi module, onto
the stream queue for the ethernet driver and
then examines incoming and outgoing packets.
The module essentially sits below the IP layer
and above the NIC layer.

Is there a way to get the IP address of the
interface associated with the ethernet driver
using the stream queue and the stream mechanism? We have code that gets the MAC
address of the NIC using the DLPI protocol. Is there
something similar for getting the IP address
of the corresponding interface?
4 REPLIES 4
Ashish Patwardhan_2
New Member

Re: IP address of NIC (ethernet) interface queue

Hi James,
Not sure if this helps you out or you are aware of this already.
But i think if you are able to get MAC address and looking for IP address asscoiated with it then ARP/RARP protocol may help. These are address resolution protocol (mac to ip and ip to mac). Don't know how your module will interact with ARP.
Anyways, if you think this may helpful, u can get ample info about ARP/RARP protocols on web.

Also see if "man arp" help.

Regards,
Ashish
Biswajit Tripathy
Honored Contributor

Re: IP address of NIC (ethernet) interface queue

I'm assuming that you are using autopush(1M)
to push your module over dlpi.

When exactly do you need the IP address (i.e
during interface plumbing or during when
interface is up and you are seeing packets?)
As you know, the dlpi does not care about IP
address. The IP address is an abstraction
stored in private datastructures in IP layer.
So if you need the IP address, you need to
ask the IP module about it.

Can you elaborate what exactly you want to
do?

- Biswajit
:-)
james edele
New Member

Re: IP address of NIC (ethernet) interface queue

We are using autopush to push our module
over the dlpi. We need the IP address
when our streams module is pushed, not when the interface is brought up. We want the
IP address of the stream Q we are associated
with. We will use it for processing
packets on the queue.

Is there a way to query the IP layer
for the IP address? Is there good documentation on how to program the query?
Biswajit Tripathy
Honored Contributor

Re: IP address of NIC (ethernet) interface queue

James,
Sorry for late reply (vacation season in
India did not let me connect to this forum
for couple of weeks).

While, AFAIK, there is no direct way of doing
this, you could use the following trick. Take
a look at public domain ipfilter source code
(more precisely, download
ftp://coombs.anu.edu.au/pub/net/ip-filter/pfil-2.1.6.tar.gz
and see file pfil/HP-UX/qif.c). This file
does exactly what you are doing. See how
if_lookup_on_name() routine is used. You
might have to do some manipulation to use
this routine, but should not be too
difficult.

- Biswajit
:-)