Microsoft KB Archive/129022

{|
 * width="100%"|

INFO: DLC Information on LLC_DIR_SET_MULTICAST_ADDRESS Command

 * }

Q129022

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK) for Windows NT

-

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 kbOSWinNT310 kbOSWinNT350 kbSDKPlatform kbCodeSam kbGrpDSNet

Issue type : kbinfo

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch