questions about 4.3BSD struct ifnet.if_addrlist

Michael A. Ziober mziober at raspail.ics.uci.edu
Wed Jan 30 08:06:08 AEST 1991


(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



More information about the Comp.unix.programmer mailing list