public UUID(String str) { char[] arr = str.toCharArray(); time_low = hex_to_bin(arr, 0, 8); time_mid = S(hex_to_bin(arr, 9, 4)); time_hi_and_version = S(hex_to_bin(arr, 14, 4)); clock_seq_hi_and_reserved = B(hex_to_bin(arr, 19, 2)); clock_seq_low = B(hex_to_bin(arr, 21, 2)); node = new byte[6]; node[0] = B(hex_to_bin(arr, 24, 2)); node[1] = B(hex_to_bin(arr, 26, 2)); node[2] = B(hex_to_bin(arr, 28, 2)); node[3] = B(hex_to_bin(arr, 30, 2)); node[4] = B(hex_to_bin(arr, 32, 2)); node[5] = B(hex_to_bin(arr, 34, 2)); }
@Override public String toString () { return bin_to_hex(this.time_low, 8) + '-' + bin_to_hex(this.time_mid, 4) + '-' + bin_to_hex(this.time_hi_and_version, 4) + '-' + bin_to_hex(this.clock_seq_hi_and_reserved, 2) + bin_to_hex(this.clock_seq_low, 2) + '-' + bin_to_hex(this.node[ 0 ], 2) + bin_to_hex(this.node[ 1 ], 2) + bin_to_hex(this.node[ 2 ], 2) + bin_to_hex(this.node[ 3 ], 2) + bin_to_hex(this.node[ 4 ], 2) + bin_to_hex(this.node[ 5 ], 2); } }
void setOption(String key, Object val) throws DcerpcException { 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); } Object getOption(String key) {
public void encode_in(NdrBuffer buf) throws NdrException { buf.enc_ndr_short(max_xmit); buf.enc_ndr_short(max_recv); buf.enc_ndr_long(0); /* assoc. group */ buf.enc_ndr_small(1); /* num context items */ buf.enc_ndr_small(0); /* reserved */ buf.enc_ndr_short(0); /* reserved2 */ buf.enc_ndr_short(0); /* context id */ buf.enc_ndr_small(1); /* number of items */ buf.enc_ndr_small(0); /* reserved */ binding.uuid.encode(buf); buf.enc_ndr_short(binding.major); buf.enc_ndr_short(binding.minor); DCERPC_UUID_SYNTAX_NDR.encode(buf); buf.enc_ndr_long(2); /* syntax version */ } public void decode_out(NdrBuffer buf) throws NdrException {
void setOption ( String key, Object val ) throws DcerpcException { if ( key.equals("endpoint") ) { this.endpoint = val.toString(); String lep = this.endpoint.toLowerCase(Locale.ENGLISH); if ( lep.startsWith("\\pipe\\") ) { String iface = INTERFACES.get(lep.substring(6)); if ( iface != null ) { int c, p; c = iface.indexOf(':'); p = iface.indexOf('.', c + 1); this.uuid = new UUID(iface.substring(0, c)); this.major = Integer.parseInt(iface.substring(c + 1, p)); this.minor = Integer.parseInt(iface.substring(p + 1)); return; } } throw new DcerpcException("Bad endpoint: " + this.endpoint); } if ( this.options == null ) this.options = new HashMap<>(); this.options.put(key, val); }
public void encode_in(NdrBuffer buf) throws NdrException { buf.enc_ndr_short(max_xmit); buf.enc_ndr_short(max_recv); buf.enc_ndr_long(0); /* assoc. group */ buf.enc_ndr_small(1); /* num context items */ buf.enc_ndr_small(0); /* reserved */ buf.enc_ndr_short(0); /* reserved2 */ buf.enc_ndr_short(0); /* context id */ buf.enc_ndr_small(1); /* number of items */ buf.enc_ndr_small(0); /* reserved */ binding.uuid.encode(buf); buf.enc_ndr_short(binding.major); buf.enc_ndr_short(binding.minor); DCERPC_UUID_SYNTAX_NDR.encode(buf); buf.enc_ndr_long(2); /* syntax version */ } public void decode_out(NdrBuffer buf) throws NdrException {
public UUID(String str) { char[] arr = str.toCharArray(); time_low = hex_to_bin(arr, 0, 8); time_mid = S(hex_to_bin(arr, 9, 4)); time_hi_and_version = S(hex_to_bin(arr, 14, 4)); clock_seq_hi_and_reserved = B(hex_to_bin(arr, 19, 2)); clock_seq_low = B(hex_to_bin(arr, 21, 2)); node = new byte[6]; node[0] = B(hex_to_bin(arr, 24, 2)); node[1] = B(hex_to_bin(arr, 26, 2)); node[2] = B(hex_to_bin(arr, 28, 2)); node[3] = B(hex_to_bin(arr, 30, 2)); node[4] = B(hex_to_bin(arr, 32, 2)); node[5] = B(hex_to_bin(arr, 34, 2)); }
@Override public String toString () { return bin_to_hex(this.time_low, 8) + '-' + bin_to_hex(this.time_mid, 4) + '-' + bin_to_hex(this.time_hi_and_version, 4) + '-' + bin_to_hex(this.clock_seq_hi_and_reserved, 2) + bin_to_hex(this.clock_seq_low, 2) + '-' + bin_to_hex(this.node[ 0 ], 2) + bin_to_hex(this.node[ 1 ], 2) + bin_to_hex(this.node[ 2 ], 2) + bin_to_hex(this.node[ 3 ], 2) + bin_to_hex(this.node[ 4 ], 2) + bin_to_hex(this.node[ 5 ], 2); } }
void setOption(String key, Object val) throws DcerpcException { 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); } Object getOption(String key) {
public void encode_in(NdrBuffer buf) throws NdrException { buf.enc_ndr_short(max_xmit); buf.enc_ndr_short(max_recv); buf.enc_ndr_long(0); /* assoc. group */ buf.enc_ndr_small(1); /* num context items */ buf.enc_ndr_small(0); /* reserved */ buf.enc_ndr_short(0); /* reserved2 */ buf.enc_ndr_short(0); /* context id */ buf.enc_ndr_small(1); /* number of items */ buf.enc_ndr_small(0); /* reserved */ binding.uuid.encode(buf); buf.enc_ndr_short(binding.major); buf.enc_ndr_short(binding.minor); DCERPC_UUID_SYNTAX_NDR.encode(buf); buf.enc_ndr_long(2); /* syntax version */ } public void decode_out(NdrBuffer buf) throws NdrException {
public UUID(String str) { char[] arr = str.toCharArray(); time_low = hex_to_bin(arr, 0, 8); time_mid = S(hex_to_bin(arr, 9, 4)); time_hi_and_version = S(hex_to_bin(arr, 14, 4)); clock_seq_hi_and_reserved = B(hex_to_bin(arr, 19, 2)); clock_seq_low = B(hex_to_bin(arr, 21, 2)); node = new byte[6]; node[0] = B(hex_to_bin(arr, 24, 2)); node[1] = B(hex_to_bin(arr, 26, 2)); node[2] = B(hex_to_bin(arr, 28, 2)); node[3] = B(hex_to_bin(arr, 30, 2)); node[4] = B(hex_to_bin(arr, 32, 2)); node[5] = B(hex_to_bin(arr, 34, 2)); }
public String toString() { return bin_to_hex(time_low, 8) + '-' + bin_to_hex(time_mid, 4) + '-' + bin_to_hex(time_hi_and_version, 4) + '-' + bin_to_hex(clock_seq_hi_and_reserved, 2) + bin_to_hex(clock_seq_low, 2) + '-' + bin_to_hex(node[0], 2) + bin_to_hex(node[1], 2) + bin_to_hex(node[2], 2) + bin_to_hex(node[3], 2) + bin_to_hex(node[4], 2) + bin_to_hex(node[5], 2); } }
void setOption(String key, Object val) throws DcerpcException { 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); } Object getOption(String key) {
@Override public void encode_in ( NdrBuffer buf ) throws NdrException { buf.enc_ndr_short(this.max_xmit); buf.enc_ndr_short(this.max_recv); buf.enc_ndr_long(0); /* assoc. group */ buf.enc_ndr_small(1); /* num context items */ buf.enc_ndr_small(0); /* reserved */ buf.enc_ndr_short(0); /* reserved2 */ buf.enc_ndr_short(0); /* context id */ buf.enc_ndr_small(1); /* number of items */ buf.enc_ndr_small(0); /* reserved */ this.binding.getUuid().encode(buf); buf.enc_ndr_short(this.binding.getMajor()); buf.enc_ndr_short(this.binding.getMinor()); DCERPC_UUID_SYNTAX_NDR.encode(buf); buf.enc_ndr_long(2); /* syntax version */ }
public UUID(String str) { char[] arr = str.toCharArray(); time_low = hex_to_bin(arr, 0, 8); time_mid = S(hex_to_bin(arr, 9, 4)); time_hi_and_version = S(hex_to_bin(arr, 14, 4)); clock_seq_hi_and_reserved = B(hex_to_bin(arr, 19, 2)); clock_seq_low = B(hex_to_bin(arr, 21, 2)); node = new byte[6]; node[0] = B(hex_to_bin(arr, 24, 2)); node[1] = B(hex_to_bin(arr, 26, 2)); node[2] = B(hex_to_bin(arr, 28, 2)); node[3] = B(hex_to_bin(arr, 30, 2)); node[4] = B(hex_to_bin(arr, 32, 2)); node[5] = B(hex_to_bin(arr, 34, 2)); }
public String toString() { return bin_to_hex(time_low, 8) + '-' + bin_to_hex(time_mid, 4) + '-' + bin_to_hex(time_hi_and_version, 4) + '-' + bin_to_hex(clock_seq_hi_and_reserved, 2) + bin_to_hex(clock_seq_low, 2) + '-' + bin_to_hex(node[0], 2) + bin_to_hex(node[1], 2) + bin_to_hex(node[2], 2) + bin_to_hex(node[3], 2) + bin_to_hex(node[4], 2) + bin_to_hex(node[5], 2); } }
void setOption ( String key, Object val ) throws DcerpcException { if ( key.equals("endpoint") ) { this.endpoint = val.toString(); String lep = this.endpoint.toLowerCase(Locale.ENGLISH); if ( lep.startsWith("\\pipe\\") ) { String iface = INTERFACES.get(lep.substring(6)); if ( iface != null ) { int c, p; c = iface.indexOf(':'); p = iface.indexOf('.', c + 1); this.uuid = new UUID(iface.substring(0, c)); this.major = Integer.parseInt(iface.substring(c + 1, p)); this.minor = Integer.parseInt(iface.substring(p + 1)); return; } } throw new DcerpcException("Bad endpoint: " + this.endpoint); } if ( this.options == null ) this.options = new HashMap<>(); this.options.put(key, val); }
@Override public void encode_in ( NdrBuffer buf ) throws NdrException { buf.enc_ndr_short(this.max_xmit); buf.enc_ndr_short(this.max_recv); buf.enc_ndr_long(0); /* assoc. group */ buf.enc_ndr_small(1); /* num context items */ buf.enc_ndr_small(0); /* reserved */ buf.enc_ndr_short(0); /* reserved2 */ buf.enc_ndr_short(0); /* context id */ buf.enc_ndr_small(1); /* number of items */ buf.enc_ndr_small(0); /* reserved */ this.binding.getUuid().encode(buf); buf.enc_ndr_short(this.binding.getMajor()); buf.enc_ndr_short(this.binding.getMinor()); DCERPC_UUID_SYNTAX_NDR.encode(buf); buf.enc_ndr_long(2); /* syntax version */ }
/** * Construct a UUID from string * * @param str */ public UUID ( String str ) { char[] arr = str.toCharArray(); this.time_low = hex_to_bin(arr, 0, 8); this.time_mid = S(hex_to_bin(arr, 9, 4)); this.time_hi_and_version = S(hex_to_bin(arr, 14, 4)); this.clock_seq_hi_and_reserved = B(hex_to_bin(arr, 19, 2)); this.clock_seq_low = B(hex_to_bin(arr, 21, 2)); this.node = new byte[6]; this.node[ 0 ] = B(hex_to_bin(arr, 24, 2)); this.node[ 1 ] = B(hex_to_bin(arr, 26, 2)); this.node[ 2 ] = B(hex_to_bin(arr, 28, 2)); this.node[ 3 ] = B(hex_to_bin(arr, 30, 2)); this.node[ 4 ] = B(hex_to_bin(arr, 32, 2)); this.node[ 5 ] = B(hex_to_bin(arr, 34, 2)); }
public String toString() { return bin_to_hex(time_low, 8) + '-' + bin_to_hex(time_mid, 4) + '-' + bin_to_hex(time_hi_and_version, 4) + '-' + bin_to_hex(clock_seq_hi_and_reserved, 2) + bin_to_hex(clock_seq_low, 2) + '-' + bin_to_hex(node[0], 2) + bin_to_hex(node[1], 2) + bin_to_hex(node[2], 2) + bin_to_hex(node[3], 2) + bin_to_hex(node[4], 2) + bin_to_hex(node[5], 2); } }