enable ethernet multicast inside my TLI driver

enable ethernet multicast inside my TLI driver

Post by Nicolas Le Sou » Thu, 01 Jun 1995 04:00:00



I'm writing a TLI driver for a multicast protocol. This protocol uses ethernet
multicast. First, ethernet multicast was enabled at user level. But it's not
the user's job to make that. Then, I would like to make that inside my bind
procedure : ptpbind(queue_t *q, mblk_t *mp)

Here is what I do :
multibp = allocb(sizeof(dl_enabmulti_req_t) + 6, BPRI_HI);
multibp->b_datap->db_type = M_PCPROTO;
multireqp = (dl_enabmulti_req_t *)multibp->b_wptr;
multireqp -> dl_primitive = DL_ENABMULTI_REQ ;
multireqp -> dl_addr_length = 6;
multireqp -> dl_addr_offset = sizeof(dl_enabmulti_req_t);
multibp->b_wptr+=sizeof(dl_enabmulti_req_t);

then, I fill the message with my muticast address.
and I transmit the message to the stream head of the ethernet driver :
putq(netlink.bottom, multibp);
(the ethernet driver (le) was already linked under my driver)

But it doesn't work. I receive nothing with the test program. It worked when I
made that from user level.

Then, does any one know that problem ?
I thank you for any help.

--
                Nicolas Le Sourd.

Ecole Nationale Superieure des Telecommunications de Bretagne
3, rue de la Chataigneraie
BP 78
35512 Cesson Sevigne Cedex
Brittany, France.

 
 
 

enable ethernet multicast inside my TLI driver

Post by Steve Ra » Sun, 04 Jun 1995 04:00:00



Quote:>I'm writing a TLI driver for a multicast protocol. This protocol uses ethernet
>multicast. First, ethernet multicast was enabled at user level. But it's not
>the user's job to make that. Then, I would like to make that inside my bind
>procedure : ptpbind(queue_t *q, mblk_t *mp)

>Here is what I do :

Since I can't tell whether you're abbreviating your steps or not,
pardon me if I happen to be pointing out the obvious.

Quote:>multibp = allocb(sizeof(dl_enabmulti_req_t) + 6, BPRI_HI);

Don't forget to check if allocb() returned NULL.

Quote:>multibp->b_datap->db_type = M_PCPROTO;
>multireqp = (dl_enabmulti_req_t *)multibp->b_wptr;
>multireqp -> dl_primitive = DL_ENABMULTI_REQ ;
>multireqp -> dl_addr_length = 6;
>multireqp -> dl_addr_offset = sizeof(dl_enabmulti_req_t);
>multibp->b_wptr+=sizeof(dl_enabmulti_req_t);

>then, I fill the message with my muticast address.

Don't forget to increase b_wptr by the size of your address (6).

Quote:>and I transmit the message to the stream head of the ethernet driver :
>putq(netlink.bottom, multibp);
>(the ethernet driver (le) was already linked under my driver)

I think you're confused by the terminology.  The Ethernet driver
doesn't have a stream head.  When you linked the Ethernet driver's
stream under your multiplexing driver, the stream head's queues
were borrowed for use by the bottom half of your multiplexing
driver.  To send the message to the Ethernet driver, you need to
execute "putnext(netlink.bottom, multibp)", assuming that netlink.bottom
is the lower write queue of your multiplexing driver.  If you
use putq(), all you are doing is placing the message on your
driver's lower write queue.  If you don't have a lower write
service procedure, then the message will probably just sit there
until the multiplexing link is dismantled.

Quote:>But it doesn't work. I receive nothing with the test program. It worked when I
>made that from user level.

>Then, does any one know that problem ?

It's really hard to tell without looking at the source, so I'm just
guessing.  Hope this helps.

Steve Rago