DcerpcBindingpublic class DcerpcBinding extends Object
Fields Summary |
---|
private static HashMap | INTERFACES | String | proto | String | server | String | endpoint | HashMap | options | UUID | uuid | int | major | int | minor |
Constructors Summary |
---|
DcerpcBinding(String proto, String server)
this.proto = proto;
this.server = server;
|
Methods Summary |
---|
public static void | addInterface(java.lang.String name, java.lang.String syntax)
INTERFACES = new HashMap();
INTERFACES.put("srvsvc", srvsvc.getSyntax());
INTERFACES.put("lsarpc", lsarpc.getSyntax());
INTERFACES.put("samr", samr.getSyntax());
INTERFACES.put("netdfs", netdfs.getSyntax());
INTERFACES.put(name, syntax);
| java.lang.Object | getOption(java.lang.String key)
if (key.equals("endpoint"))
return endpoint;
if (options != null)
return options.get(key);
return null;
| void | setOption(java.lang.String key, java.lang.Object val)
if (key.equals("endpoint")) {
endpoint = val.toString().toLowerCase();
if (endpoint.startsWith("\\pipe\\")) {
String iface = (String)INTERFACES.get(endpoint.substring(6));
if (iface != null) {
int c, p;
c = iface.indexOf(':");
p = iface.indexOf('.", c + 1);
uuid = new UUID(iface.substring(0, c));
major = Integer.parseInt(iface.substring(c + 1, p));
minor = Integer.parseInt(iface.substring(p + 1));
return;
}
}
throw new DcerpcException("Bad endpoint: " + endpoint);
}
if (options == null)
options = new HashMap();
options.put(key, val);
| public java.lang.String | toString()
String ret = proto + ":" + server + "[" + endpoint;
if (options != null) {
Iterator iter = options.keySet().iterator();
while (iter.hasNext()) {
Object key = iter.next();
Object val = options.get(key);
ret += "," + key + "=" + val;
}
}
ret += "]";
return ret;
|
|