This application demonstrates the various datagram operations possible from NetBIOS. This includes sending and receiving both directed and group datagrams as well as broadcast datagrams. The name service operates on UDP port 137 (TCP port 137 can also be used, but rarely is).

cl -o Nbdgram.exe Nbdgram.c ..\Common\Nbcommon.obj Netapi32.lib User32.lib

Command Line Options
nbdgram.exe options

  1. -n:NAME Register my unique name NAME
  2. -g:NAME Register my group name NAME
  3. -s I will be sending datagrams
  4. -c:xxx Number of datagrams to send
  5. -r:NAME The recipients NetBIOS name
  6. -b Use broadcast datagrams
  7. -a Receive datagrams for any NetBIOS name
  8. -l:xxx Send datagrams on LANA number xxx only
  9. -d:xxx Delay (in milliseconds) between sends