xref: /reactos/sdk/include/psdk/wsnetbs.h (revision c2c66aff)
1 #ifndef _WSNETBS_H
2 #define _WSNETBS_H
3 
4 #define NETBIOS_NAME_LENGTH	16
5 #define NETBIOS_UNIQUE_NAME	0
6 #define NETBIOS_GROUP_NAME	1
7 #define NETBIOS_TYPE_QUICK_UNIQUE	2
8 #define NETBIOS_TYPE_QUICK_GROUP	3
9 
10 #ifndef RC_INVOKED
11 typedef struct sockaddr_nb {
12 	short	snb_family;
13 	u_short	snb_type;
14 	char	snb_name[NETBIOS_NAME_LENGTH];
15 } SOCKADDR_NB, *PSOCKADDR_NB, *LPSOCKADDR_NB;
16 #define SET_NETBIOS_SOCKADDR(_snb,_type,_name,_port) \
17 { \
18 	register int _i; \
19 	register char *_n = (_name); \
20 	register PSOCKADDR_NB _s = (_snb); \
21 	_s->snb_family = AF_NETBIOS; \
22 	_s->snb_type = (_type); \
23 	for (_i=0; _n[_i] != '\0' && _i<NETBIOS_NAME_LENGTH-1; _i++) { \
24 		_s->snb_name[_i] = _n[_i]; \
25 	} \
26 	for (; _i<NETBIOS_NAME_LENGTH-1; _i++) { \
27 		_s->snb_name[_i] = ' '; \
28 	} \
29 	_s->snb_name[NETBIOS_NAME_LENGTH-1] = (_port); \
30 }
31 #endif   /* RC_INVOKED */
32 #endif
33