[comp.unix.questions] questions about 4.3BSD struct ifnet.if_addrlist

mziober@trocadero.ics.uci.edu (Michael A. Ziober) (01/29/91)

Hi,
    This is my first posting to these groups (I don't think my
previous attempt made it off campus).  I hope that someone out there
can answer a few questions for me.

    I am working on a project which requires connecting IP to a new
network interface. In order to achieve this we are using the following
scheme:
    - We have a pseudo-device (we call it rawpacket) that receives an
      IP-packet and sends it to a user daemon by calling raw_input()
      (using raw socket).
    - The user daemon then send the packet to a device driver that
      handles placing the packet on the network.
    - Incoming packets are picked up from the device driver by the
      daemon which writes them on the raw socket.
    - The socket's pr_output() routine, rawpacket_output(), calls
      IF_ENQUEUE to pass the data up to IP.

    When implementing the pseudo-device, we had some questions about
the Network interface data structures (described on page 316 of the
book "The Design and Implementation of the 4.3BSD UNIX Operating
System"). The questions are related to the address list field. I will
put the questions in an itemized form.

    - Does my procedure rpattach() (When attaching the pseudo-device
      to the system) initialize this address list?
    - If so, what should it be? Should it be initialized to NULL?
    - If not, who should do the initialization?
    - When using this field in the structure (for example to send a
      packet) how do I find the appropriate address to use from this
      list?
    - In the routine rpioctl() (for the SIOCSIFADDR and SIOCSDSTADDR
      commands), does it add new address to the address list?
    - Does it replace any existing entries by matching address families?

    In summary, we need to know how this field address list is handled.
Who initilizes it? Who modifies it? How is it done? How it it maintained?
Are there any useful support routines?

-Michael Ziober

mziober@raspail.ics.uci.edu (Michael A. Ziober) (01/30/91)

(I'm having a little trouble getting this off campus.  I apologize if
you have to see this more than once.)

Hi,
    I hope that someone out there can answer a few questions for me.

    I am working on a project which requires connecting IP to a new
network interface. In order to achieve this we are using the following
scheme:
    - We have a pseudo-device (we call it rawpacket) that receives an
      IP-packet and sends it to a user daemon by calling raw_input()
      (using raw socket).
    - The user daemon then send the packet to a device driver that
      handles placing the packet on the network.
    - Incoming packets are picked up from the device driver by the
      daemon which writes them on the raw socket.
    - The socket's pr_output() routine, rawpacket_output(), calls
      IF_ENQUEUE to pass the data up to IP.

    When implementing the pseudo-device, we had some questions about
the Network interface data structures (described on page 316 of the
book "The Design and Implementation of the 4.3BSD UNIX Operating
System"). The questions are related to the address list field. I will
put the questions in an itemized form.

    - Does my procedure rpattach() (When attaching the pseudo-device
      to the system) initialize this address list?
    - If so, what should it be? Should it be initialized to NULL?
    - If not, who should do the initialization?
    - When using this field in the structure (for example to send a
      packet) how do I find the appropriate address to use from this
      list?
    - In the routine rpioctl() (for the SIOCSIFADDR and SIOCSDSTADDR
      commands), does it add new address to the address list?
    - Does it replace any existing entries by matching address families?

    In summary, we need to know how this field address list is handled.
Who initilizes it? Who modifies it? How is it done? How it it maintained?
Are there any useful support routines?

Thanks for any help,
Michael Ziober

mziober@iena.ics.uci.edu (Michael A. Ziober) (02/06/91)

(Since I received no response to my previous posting and I have been
unable to find the information anywhere else, I am going to ask again
in the hopes that this time I will strike gold. :-)

We are trying to implement a network interface on an Omron SX-9100
workstation running 4.3BSD.  When implementing the pseudo-device, we
had some questions about the network interface data structures
(described on page 316 of the book "The Design and Implementation of
the 4.3BSD UNIX Operating System").  The questions are related to the
struct ifnet.if_addrlist:

    - Does my procedure rpattach() (When attaching the pseudo-device
      to the system) initialize this address list?
    - If so, what should it be?  Should it be initialized to NULL?
    - If not, who should do the initialization?

    - When using this field in the structure (for example to send a
      packet) how do I find the appropriate address to use from this
      list?

    - In the routine rpioctl() (for the SIOCSIFADDR and SIOCSDSTADDR
      commands), does it add new address to the address list?
    - Does it replace any existing entries by matching address families?

In short: How is this address list handled?  Who initializes it?  Who
modifies it?  How is it done?  How it it maintained?

Sorry about the noise, but this project needs some help to get it over
this hurdle.

Thanks for ANY help,
Michael Ziober