Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.9 KiB

  1. /*
  2. * wsnetbs.h
  3. *
  4. * Windows Sockets include file for NETBIOS. This file contains all
  5. * standardized NETBIOS information. Include this header file after
  6. * winsock.h.
  7. *
  8. */
  9. #ifndef _WSNETBS_
  10. #define _WSNETBS_
  11. /*
  12. * This is the structure of the SOCKADDR structure for NETBIOS.
  13. *
  14. */
  15. #define NETBIOS_NAME_LENGTH 16
  16. typedef struct sockaddr_nb {
  17. short snb_family;
  18. u_short snb_type;
  19. char snb_name[NETBIOS_NAME_LENGTH];
  20. } SOCKADDR_NB, *PSOCKADDR_NB,FAR *LPSOCKADDR_NB;
  21. /*
  22. * Bit values for the snb_type field of SOCKADDR_NB.
  23. *
  24. */
  25. #define NETBIOS_GROUP_NAME 0x80
  26. #define NETBIOS_UNIQUE_NAME 0x00
  27. #define NETBIOS_REGISTERING 0x00
  28. #define NETBIOS_REGISTERED 0x04
  29. #define NETBIOS_DEREGISTERED 0x05
  30. #define NETBIOS_DUPLICATE 0x06
  31. #define NETBIOS_DUPLICATE_DEREG 0x07
  32. /*
  33. * A macro convenient for setting up NETBIOS SOCKADDRs.
  34. *
  35. */
  36. #define SET_NETBIOS_SOCKADDR(_snb,_type,_name,_port) \
  37. { \
  38. int _i; \
  39. (_snb)->snb_family = AF_NETBIOS; \
  40. (_snb)->snb_type = (_type); \
  41. for (_i=0; _i<NETBIOS_NAME_LENGTH-1; _i++) { \
  42. (_snb)->snb_name[_i] = ' '; \
  43. } \
  44. for (_i=0; *((_name)+_i) != '\0' && _i<NETBIOS_NAME_LENGTH-1; _i++) { \
  45. (_snb)->snb_name[_i] = *((_name)+_i); \
  46. } \
  47. (_snb)->snb_name[NETBIOS_NAME_LENGTH-1] = (_port); \
  48. }
  49. /*
  50. * Protocol families used in the "protocol" parameter of the socket() API.
  51. *
  52. */
  53. #define NBPROTO_NETBEUI 17001
  54. #endif