home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / netnb / nb.h
C/C++ Source or Header  |  1999-05-11  |  3KB  |  63 lines

  1. /********************************************************Copyright.IBM*****/
  2. /*                                                                        */
  3. /*                                                                        */
  4. /*                                                                        */
  5. /*    OCO Source Materials                                                */
  6. /*    IBM Confidential (IBM Confidential-Restricted when combined         */
  7. /*    with the aggregated OCO source modules for this program)            */
  8. /*                                                                        */
  9. /*    5622-069                                                            */
  10. /*    (C) Copyright International Business Machines Corp. 1993, 1996      */
  11. /*                                                                        */
  12. /*                                                                        */
  13. /********************************************************Copyright.IBM*****/
  14.  
  15. /*
  16.  *  Protocols
  17.  */
  18.  
  19. #ifndef _NETNB_NB_H_
  20. #define _NETNB_NB_H_
  21.  
  22. #ifdef TCPV40HDRS
  23. #include <stack16\netnb\nb.h>
  24. #else
  25. #define NBPROTO_NB      1     /*  NetBIOS protocol    */
  26.  
  27.  
  28. /* DEFINITION OF NETBIOS ADDRESS FORMAT */
  29. #define NB_FAMILY       18                   /* temporary */
  30. #define NB_ADDRSIZE     sizeof (struct sockaddr_nb)
  31. #define NB_UNIQUE       0
  32. #define NB_GROUP        1
  33. #define NB_BROAD        2
  34. #define NB_NAMELEN      16
  35. #define NB_NETIDLEN     8
  36. #define NB_HOSTLEN      12
  37. #define NB_PORTLEN      (NB_NAMELEN - NB_HOSTLEN)
  38. #define NB_BCAST_NAME   "*               "      /* Asterisk plus 15 spaces */
  39. #define NB_BLANK_NAME   "                "      /* 16 spaces */
  40. #define NB_NULL_NAME    "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
  41.  
  42. /*  The following two lines must correspond to IPPORT_RESERVED and */
  43. /*  IPPORT_USERRESERVED constants defined in in.h                  */
  44. #define NBPORT_RESERVED     "49152"
  45. #define NBPORT_USERRESERVED "65535"
  46.  
  47.  
  48. /* DEFINITION OF NETBIOS ADDRESS FORMAT */
  49.  
  50.  
  51. #pragma pack(1)
  52.    struct  sockaddr_nb {
  53.           u_char  snb_len;
  54.           u_char  snb_family;                  /* netbios protocol family */
  55.           short snb_type;                      /* unique or multicast */
  56.           char  snb_netid[NB_NETIDLEN];        /* netbios netid*/
  57.           char  snb_name[NB_NAMELEN];          /* netbios name */
  58.                        };
  59. #pragma pack()
  60.  
  61. #endif /* TCPV40HDRS */
  62. #endif /* _NETNB_NB_H_ */
  63.