mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.0 to HEAD
5910: Web Services getUsers 5913: Web Services admin user password change 5956: LDAP anon simple bind test 6133: WCM-486 6158: Merged V1.4 to V2.0 5600: Split person bootstrap 5642: AR-439 NetBIOS adaptor status request 6160: VersionHistoryPerformance patch with no versionedNodeId git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6166 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -35,6 +35,7 @@ import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.alfresco.filesys.netbios.NetBIOSName;
|
||||
import org.alfresco.filesys.netbios.NetBIOSNameList;
|
||||
import org.alfresco.filesys.netbios.NetBIOSPacket;
|
||||
import org.alfresco.filesys.netbios.NetworkSettings;
|
||||
import org.alfresco.filesys.netbios.RFCNetBIOSProtocol;
|
||||
@@ -1105,10 +1106,20 @@ public class NetBIOSNameServer extends NetworkServer implements Runnable
|
||||
char nameType = searchName.charAt(15);
|
||||
|
||||
int len = 0;
|
||||
while (len <= 14 && searchName.charAt(len) != ' ')
|
||||
len++;
|
||||
while (len <= 14 && searchName.charAt(len) != ' ' && searchName.charAt(len) != 0)
|
||||
len++;
|
||||
searchName = searchName.substring(0, len);
|
||||
|
||||
// Check if this is an adapter status request
|
||||
|
||||
if ( searchName.equals( NetBIOSName.AdapterStatusName)) {
|
||||
|
||||
// Process the adapter status request
|
||||
|
||||
processAdapterStatus( pkt, fromAddr, fromPort);
|
||||
return;
|
||||
}
|
||||
|
||||
// Debug
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -1399,6 +1410,50 @@ public class NetBIOSNameServer extends NetworkServer implements Runnable
|
||||
}
|
||||
|
||||
/**
|
||||
* Process an adapter status request
|
||||
* @param pkt NetBIOSPacket
|
||||
* @param fromAddr InetAddress
|
||||
* @param fromPort int
|
||||
*/
|
||||
protected final void processAdapterStatus(NetBIOSPacket pkt, InetAddress fromAddr, int fromPort) {
|
||||
|
||||
// Debug
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("%% Adapter status request");
|
||||
|
||||
// Build the local name list
|
||||
|
||||
NetBIOSNameList nameList = new NetBIOSNameList();
|
||||
for ( int i = 0; i < m_localNames.size(); i++)
|
||||
nameList.addName( m_localNames.get( i));
|
||||
|
||||
// Build the name query response
|
||||
|
||||
int pktLen = pkt.buildAdapterStatusResponse( nameList, hasPrimaryWINSServer() ? NetBIOSPacket.NAME_TYPE_PNODE : NetBIOSPacket.NAME_TYPE_BNODE);
|
||||
|
||||
// Debug
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("%% NetBIOS Reply to " + fromAddr.getHostAddress() + " :-");
|
||||
pkt.DumpPacket(false);
|
||||
}
|
||||
|
||||
// Send the reply packet
|
||||
|
||||
try {
|
||||
|
||||
// Send the name query reply
|
||||
|
||||
sendPacket(pkt, pktLen, fromAddr, fromPort);
|
||||
}
|
||||
catch (java.io.IOException ex) {
|
||||
if ( logger.isErrorEnabled())
|
||||
logger.error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a local add name listener from the NetBIOS name server.
|
||||
*
|
||||
* @param l AddNameListener
|
||||
|
Reference in New Issue
Block a user