source: Daodan/MinGW/include/wsnetbs.h@ 1095

Last change on this file since 1095 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 892 bytes
RevLine 
[1046]1#ifndef _WSNETBS_H
2#define _WSNETBS_H
3#if __GNUC__ >=3
4#pragma GCC system_header
5#endif
6
7#define NETBIOS_NAME_LENGTH 16
8#define NETBIOS_UNIQUE_NAME 0
9#define NETBIOS_GROUP_NAME 1
10#define NETBIOS_TYPE_QUICK_UNIQUE 2
11#define NETBIOS_TYPE_QUICK_GROUP 3
12
13#ifndef RC_INVOKED
14typedef struct sockaddr_nb {
15 short snb_family;
16 u_short snb_type;
17 char snb_name[NETBIOS_NAME_LENGTH];
18} SOCKADDR_NB, *PSOCKADDR_NB, *LPSOCKADDR_NB;
19#define SET_NETBIOS_SOCKADDR(_snb,_type,_name,_port) \
20{ \
21 register int _i; \
22 register char *_n = (_name); \
23 register PSOCKADDR_NB _s = (_snb); \
24 _s->snb_family = AF_NETBIOS; \
25 _s->snb_type = (_type); \
26 for (_i=0; _n[_i] != '\0' && _i<NETBIOS_NAME_LENGTH-1; _i++) { \
27 _s->snb_name[_i] = _n[_i]; \
28 } \
29 for (; _i<NETBIOS_NAME_LENGTH-1; _i++) { \
30 _s->snb_name[_i] = ' '; \
31 } \
32 _s->snb_name[NETBIOS_NAME_LENGTH-1] = (_port); \
33}
34#endif /* RC_INVOKED */
35#endif
Note: See TracBrowser for help on using the repository browser.