KLALB UDP TEST
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package org.kne.cloud.network;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class SSHDetectorItem implements ProtocolDetectorItem {
|
||||
|
||||
@Override
|
||||
public Protocol apply(InputStream t) {
|
||||
try {
|
||||
byte[]b=new byte[3];
|
||||
new DataInputStream(t).readFully(b);
|
||||
String s=new String(b, "ascii");
|
||||
if(s.equals("SSH")) {
|
||||
return new Protocol("SSH");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user