' ########################################################################################
' Microsoft Windows
'' File: wsnetbs.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_WSnetbs_PBI)
#DEFINE PBX_WSnetbs_PBI
%WSNETBS_INC = 1
'/*
' * wsnetbs.h
' * Copyright (c) 1994-1999, Microsoft Corp. All rights reserved.
' *
' * Windows Sockets include file for NETBIOS. This file contains all
' * standardized NETBIOS information. Include this header file after
' * winsock.h.
' *
' */
'/*
' * This is the structure of the SOCKADDR structure for NETBIOS.
' *
' */
%NETBIOS_NAME_LENGTH = 16
' // Size = 20 bytes
TYPE SOCKADDR_NB BYTE
 snb_family AS INTEGER ' short
 snb_type AS WORD ' u_short
 snb_name AS STRING * %NETBIOS_NAME_LENGTH ' char
END TYPE
'/*
' * Bit values for the snb_type field of SOCKADDR_NB.
' *
' */
%NETBIOS_UNIQUE_NAME = &H0000??
%NETBIOS_GROUP_NAME = &H0001??
%NETBIOS_TYPE_QUICK_UNIQUE = &H0002??
%NETBIOS_TYPE_QUICK_GROUP = &H0003??
'/*
' * A macro convenient for setting up NETBIOS SOCKADDRs.
' *
' */
'#define SET_NETBIOS_SOCKADDR(_snb,_type,_name,_port) \
' { \
' int _i; \
' (_snb)->snb_family = AF_NETBIOS; \
' (_snb)->snb_type = (_type); \
' for (_i=0; _i<NETBIOS_NAME_LENGTH-1; _i++) { \
' (_snb)->snb_name[_i] = ' '; \
' } \
' for (_i=0; *((_name)+_i) != '\0' && _i<NETBIOS_NAME_LENGTH-1; _i++) { \
' (_snb)->snb_name[_i] = *((_name)+_i); \
' } \
' (_snb)->snb_name[NETBIOS_NAME_LENGTH-1] = (_port); \
' }
'/*
' * To open a NetBIOS socket, call the socket() function as follows:
' *
' * s = socket( AF_NETBIOS, {SOCK_SEQPACKET|SOCK_DGRAM}, -Lana );
' *
' * where Lana is the NetBIOS Lana number of interest. For example, to
' * open a socket for Lana 2, specify -2 as the "protocol" parameter
' * to the socket() function.
' *
' */