public class Win32NetBIOS extends Object
Modifier and Type | Field and Description |
---|---|
protected static int |
FindNameBufferLen |
Constructor and Description |
---|
Win32NetBIOS() |
Modifier and Type | Method and Description |
---|---|
static int |
AddGroupName(int lana,
byte[] name)
Add a group NetBIOS name to the local name table
|
static int |
AddName(int lana,
byte[] name)
Add a NetBIOS name to the local name table
|
protected static int |
BindSocket(int sockPtr,
byte[] name)
Bind a NetBIOS socket to a name to listen for incoming sessions
|
protected static int |
BindSocket(int sockPtr,
byte[] name,
boolean fastAddName)
Bind a NetBIOS socket to a name to listen for incoming sessions
|
protected static void |
CloseSocket(int sockPtr)
Close a NetBIOS socket
|
protected static void |
ConnectSocket(int sockPtr,
byte[] remoteName)
Connect to a remote server
|
protected static int |
CreateSocket(int lana)
Create a NetBIOS socket
|
static int |
DeleteName(int lana,
byte[] name)
Delete a NetBIOS name from the local name table
|
static int |
FindName(int lana,
NetBIOSName nbName)
Find a NetBIOS name
|
static int |
FindNameRaw(int lana,
byte[] name,
byte[] nameBuf,
int bufLen)
Find a NetBIOS name, return the name buffer
|
static String |
getAdapterNameForLANA(int lana)
Find the adapter name for a LANA
|
static String |
getIPAddressForLANA(int lana)
Find the TCP/IP address for a LANA
|
static int |
getLANAForAdapterName(String name)
Find the LANA for a network adapter
|
static int |
getLANAForIPAddress(String addr)
Find the LANA for a TCP/IP address
|
static String |
GetLocalDomainName()
Return the local domain name
|
static String |
GetLocalNetBIOSName()
Return the local computers NetBIOS name
|
protected static int |
GetMaximumSocketsPerSelect()
Return the maximum number of sockets that can be configured per SelectSockets() call
|
static int |
getSocketReceiveBufferSize(int sockPtr)
Get the current receive buffer size for the socket
|
static int |
getSocketSendBufferSize(int sockPtr)
Get the current send buffer size for the socket
|
static String |
getWINSServerList()
Return a comma delimeted list of WINS server TCP/IP addresses, or null if no WINS servers are
configured.
|
static int |
Hangup(int lana,
int lsn)
Hangup a session
|
protected static void |
InitializeSockets()
Initialize the NetBIOS socket interface
|
static int[] |
LanaEnumerate()
Enumerate the available LANAs
|
static int |
Listen(int lana,
byte[] toName,
byte[] fromName,
byte[] callerName)
Listen for an incoming session request
|
protected static int |
ListenSocket(int sockPtr,
byte[] callerName)
Listen for an incoming connection
|
static int |
Receive(int lana,
int lsn,
byte[] buf,
int off,
int maxLen)
Receive a data packet on a session
|
static int |
ReceiveBroadcastDatagram(int lana,
int nameNum,
byte[] buf,
int off,
int maxLen)
Receive a broadcast datagram
|
static int |
ReceiveDatagram(int lana,
int nameNum,
byte[] buf,
int off,
int maxLen)
Receive a datagram on a specified name
|
protected static int |
ReceiveLengthSocket(int sockPtr)
Return the amount of receive data available on the socket
|
protected static int |
ReceiveSocket(int sockPtr,
byte[] buf,
int off,
int maxLen)
Receive data on a session socket
|
static int |
Reset(int lana)
Reset the NetBIOS environment
|
protected static int |
SelectReceiveSockets(int sockCnt,
int[] readSocksIn,
int[] readSocksOut)
Wait for an event on one or more sockets
|
static int |
Send(int lana,
int lsn,
byte[] buf,
int off,
int len)
Send a data packet on a session
|
static int |
SendBroadcastDatagram(int lana,
byte[] buf,
int off,
int len)
Send a broadcast datagram
|
static int |
SendDatagram(int lana,
int srcNum,
byte[] destName,
byte[] buf,
int off,
int len)
Send a datagram to a specified name
|
protected static int |
SendSocket(int sockPtr,
byte[] buf,
int off,
int len)
Send data on a session socket
|
protected static int |
SetNonBlockingSocket(int sockPtr,
boolean nonBlocking)
Configure a socket to be non-blocking
|
static void |
setSocketReceiveBufferSize(int sockPtr,
int bufSize)
Set the socket receive buffer size
|
static void |
setSocketSendBufferSize(int sockPtr,
int bufSize)
Set the socket send buffer size
|
protected static void |
ShutdownSockets()
Shutdown the NetBIOS socket interface
|
static void |
waitForNetworkAddressChange()
Wait for a network address change event, block until a change occurs or the Winsock NetBIOS
interface is shut down
|
static void |
Win32CloseEvent(int eventHandle)
Close a Win32 event
|
static int |
Win32CreateEvent()
Create a Win32 event
|
static boolean |
Win32ResetEvent(int eventHandle)
Reset a Win32 event
|
static boolean |
Win32SetEvent(int eventHandle)
Set a Win32 event
|
static void |
WinsockCloseEvent(int eventHandle)
Close a Winsock event
|
static int |
WinsockCreateEvent()
Create a Winsock event
|
static int |
WinsockEnumNetworkEvents(int sockPtr,
int eventHandle)
Get the list of socket events that have triggered for a particular socket
|
static void |
WinsockEventSelect(int sockPtr,
int eventHandle,
int eventMask)
Set Winsock events for a socket
|
static boolean |
WinsockResetEvent(int eventHandle)
Reset a Winsock event
|
static boolean |
WinsockSetEvent(int eventHandle)
Set a Winsock event
|
static int |
WinsockWaitForMultipleEvents(int eventCnt,
int[] events,
boolean waitAll,
int timeout,
boolean alertable)
Wait for Winsock events
|
protected static final int FindNameBufferLen
public static int AddName(int lana, byte[] name)
lana
- intname
- byte[]public static int AddGroupName(int lana, byte[] name)
lana
- intname
- byte[]public static int FindNameRaw(int lana, byte[] name, byte[] nameBuf, int bufLen)
lana
- intname
- byte[]nameBuf
- byte[]bufLen
- intpublic static int FindName(int lana, NetBIOSName nbName)
lana
- intnbName
- NetBIOSNamepublic static int DeleteName(int lana, byte[] name)
lana
- intname
- byte[]public static int[] LanaEnumerate()
public static int Reset(int lana)
lana
- intpublic static int Listen(int lana, byte[] toName, byte[] fromName, byte[] callerName)
lana
- inttoName
- byte[]fromName
- byte[]callerName
- byte[]public static int Receive(int lana, int lsn, byte[] buf, int off, int maxLen)
lana
- intlsn
- intbuf
- byte[]off
- intmaxLen
- intpublic static int Send(int lana, int lsn, byte[] buf, int off, int len)
lana
- intlsn
- intbuf
- byte[]off
- intlen
- intpublic static int SendDatagram(int lana, int srcNum, byte[] destName, byte[] buf, int off, int len)
lana
- intsrcNum
- intdestName
- byte[]buf
- byte[]off
- intlen
- intpublic static int SendBroadcastDatagram(int lana, byte[] buf, int off, int len)
lana
- intbuf
- byte[]off
- intlen
- intpublic static int ReceiveDatagram(int lana, int nameNum, byte[] buf, int off, int maxLen)
lana
- intnameNum
- intbuf
- byte[]off
- intmaxLen
- intpublic static int ReceiveBroadcastDatagram(int lana, int nameNum, byte[] buf, int off, int maxLen)
lana
- intnameNum
- intbuf
- byte[]off
- intmaxLen
- intpublic static int Hangup(int lana, int lsn)
lsn
- intpublic static String GetLocalNetBIOSName()
public static String GetLocalDomainName()
public static String getWINSServerList()
public static final String getIPAddressForLANA(int lana)
lana
- intpublic static final String getAdapterNameForLANA(int lana)
lana
- intpublic static final int getLANAForIPAddress(String addr)
addr
- Stringpublic static final int getLANAForAdapterName(String name)
name
- Stringprotected static void InitializeSockets() throws WinsockNetBIOSException
WinsockNetBIOSException
- If a Winsock error occursprotected static void ShutdownSockets()
protected static int CreateSocket(int lana) throws WinsockNetBIOSException
lana
- intWinsockNetBIOSException
- If a Winsock error occursprotected static int BindSocket(int sockPtr, byte[] name) throws WinsockNetBIOSException
sockPtr
- intname
- byte[]WinsockNetBIOSException
- If a Winsock error occursprotected static int BindSocket(int sockPtr, byte[] name, boolean fastAddName) throws WinsockNetBIOSException
sockPtr
- intname
- byte[]fastAddName
- booleanWinsockNetBIOSException
- If a Winsock error occursprotected static int ListenSocket(int sockPtr, byte[] callerName) throws WinsockNetBIOSException
sockPtr
- intcallerName
- byte[]WinsockNetBIOSException
- If a Winsock error occursprotected static void ConnectSocket(int sockPtr, byte[] remoteName) throws WinsockNetBIOSException
sockPtr
- intremoteName
- byte[]WinsockNetBIOSException
- If a Winsock error occursprotected static void CloseSocket(int sockPtr)
sockPtr
- intprotected static int SendSocket(int sockPtr, byte[] buf, int off, int len) throws WinsockNetBIOSException
sockPtr
- intbuf
- byte[]off
- intlen
- intWinsockNetBIOSException
- If a Winsock error occursprotected static int ReceiveSocket(int sockPtr, byte[] buf, int off, int maxLen) throws WinsockNetBIOSException
sockPtr
- intbuf
- byte[]off
- intmaxLen
- intWinsockNetBIOSException
- If a Winsock error occursprotected static int ReceiveLengthSocket(int sockPtr) throws WinsockNetBIOSException
sockPtr
- intWinsockNetBIOSException
- If a Winsock error occursprotected static int SetNonBlockingSocket(int sockPtr, boolean nonBlocking) throws WinsockNetBIOSException
sockPtr
- intnonBlocking
- booleanWinsockNetBIOSException
- If a Winsock error occursprotected static int SelectReceiveSockets(int sockCnt, int[] readSocksIn, int[] readSocksOut) throws WinsockNetBIOSException
sockCnt
- intreadSocksIn
- int[]readSocksOut
- int[]WinsockNetBIOSException
- If a Winsock error occursprotected static int GetMaximumSocketsPerSelect()
public static int Win32CreateEvent() throws Exception
Exception
public static void Win32CloseEvent(int eventHandle) throws Exception
eventHandle
- intException
public static boolean Win32SetEvent(int eventHandle)
eventHandle
- intpublic static boolean Win32ResetEvent(int eventHandle)
eventHandle
- intpublic static int WinsockCreateEvent() throws WinsockNetBIOSException
WinsockNetBIOSException
public static boolean WinsockSetEvent(int eventHandle)
eventHandle
- intpublic static boolean WinsockResetEvent(int eventHandle)
eventHandle
- intpublic static void WinsockCloseEvent(int eventHandle) throws WinsockNetBIOSException
eventHandle
- intWinsockNetBIOSException
public static int WinsockWaitForMultipleEvents(int eventCnt, int[] events, boolean waitAll, int timeout, boolean alertable) throws WinsockNetBIOSException
eventCnt
- intevents
- int[]waitAll
- booleantimeout
- intalertable
- booleanWinsockNetBIOSException
public static void WinsockEventSelect(int sockPtr, int eventHandle, int eventMask) throws WinsockNetBIOSException
sockPtr
- inteventHandle
- inteventMask
- intWinsockNetBIOSException
public static int WinsockEnumNetworkEvents(int sockPtr, int eventHandle) throws WinsockNetBIOSException
sockPtr
- inteventHandle
- intWinsockNetBIOSException
public static int getSocketReceiveBufferSize(int sockPtr) throws WinsockNetBIOSException
sockPtr
- intWinsockNetBIOSException
public static void setSocketReceiveBufferSize(int sockPtr, int bufSize) throws WinsockNetBIOSException
sockPtr
- intbufSize
- intWinsockNetBIOSException
public static int getSocketSendBufferSize(int sockPtr) throws WinsockNetBIOSException
sockPtr
- intWinsockNetBIOSException
public static void setSocketSendBufferSize(int sockPtr, int bufSize) throws WinsockNetBIOSException
sockPtr
- intbufSize
- intWinsockNetBIOSException
public static void waitForNetworkAddressChange()
Copyright © 2005–2017 Alfresco Software. All rights reserved.