INFO: DLC Information on LLC_DIR_SET_MULTICAST_ADDRESS Command

ID: Q129022

The information in this article applies to:

SUMMARY

The DLC programming interface for Windows NT supports Ethernet multicast addressing via the LLC_DIR_SET_MULTICAST_ADDRESS command. This command must be successfully issued before Ethernet multicasts can be received. This article shows by example how to use the command.

MORE INFORMATION

The following function demonstrates the command.

Sample Code

   BOOL DlcSetMulticastAddress( BYTE bAdapter,
                                BYTE *pbResult, BYTE *pbAddress )

   {
       LLC_CCB Ccb;

       Ccb.uchAdapterNumber  = bAdapter;
       Ccb.uchDlcCommand     = LLC_DIR_SET_MULTICAST_ADDRESS;

       // note:  Dlc expects Ethernet addresses to be specified in the
       //        non-canonical form.  In other words, reverse the bits
       //        before passing an Ethernet address.
       // 
       //        Also, the first byte of the canonical form of an
       //        Ethernet multicast address must be 0x01.

       Ccb.u.pParameterTable = (PLLC_PARMS) pbAddress;

       if(!DlcSyncCall( &Ccb ))
           return FALSE;
       else
       {
           *pbResult = Ccb.uchDlcStatus;
           return TRUE;
       }
   }

   // AcsLan wrapper function used by DlcSetMulticastAddress

   BOOL DlcSyncCall( PLLC_CCB pCcb )
   {
      BOOL  fResult = FALSE;
      DWORD dwResult;

      pCcb->hCompletionEvent = CreateEvent(NULL, TRUE, FALSE, NULL);

      if (!pCcb->hCompletionEvent)
         return FALSE;

      int iStatus = (int) AcsLan( pCcb, NULL );
      if ( iStatus != ACSLAN_STATUS_COMMAND_ACCEPTED )
         goto done;

      dwResult = WaitForSingleObject( pCcb->hCompletionEvent, INFINITE );

      if ( dwResult == WAIT_OBJECT_0 )
         fResult = TRUE;

   done:
      CloseHandle( pCcb->hCompletionEvent );

      return fResult;
   }

Additional query words:
Keywords          : kbnetwork kbAPI kbDLC kbNTOS310 kbNTOS350 kbSDKPlatform kbCodeSam kbGrpNet 
Issue type        : kbinfo

Last Reviewed: August 1, 1998