java.lang.Object
org.codelibs.jcifs.smb.dcerpc.DcerpcHandle
org.codelibs.jcifs.smb.dcerpc.DcerpcPipeHandle
- All Implemented Interfaces:
AutoCloseable,DcerpcConstants
DCE/RPC handle implementation for named pipe communications.
This class provides DCE/RPC communication over SMB named pipes.
-
Field Summary
Fields inherited from interface org.codelibs.jcifs.smb.dcerpc.DcerpcConstants
DCERPC_CONC_MPX, DCERPC_DID_NOT_EXECUTE, DCERPC_FIRST_FRAG, DCERPC_LAST_FRAG, DCERPC_MAYBE, DCERPC_OBJECT_UUID, DCERPC_PENDING_CANCEL, DCERPC_RESERVED_1, DCERPC_UUID_SYNTAX_NDR, RPC_C_PF_BROADCAST, RPC_C_PF_BROADCAST_MAYBE, RPC_C_PF_IDEMPOTENT, RPC_C_PF_MAYBE, RPC_C_PF_NO_AUTO_LISTEN, RPC_C_PF_NO_AUTO_RETRY, RPC_C_PF_NO_FRAGMENT, RPC_C_PF_NOT_IDEMPOTENT, RPC_PT_ACK, RPC_PT_ALTER_CONTEXT, RPC_PT_ALTER_CONTEXT_RESPONSE, RPC_PT_BIND, RPC_PT_BIND_ACK, RPC_PT_BIND_NAK, RPC_PT_CANCEL, RPC_PT_CO_CANCEL, RPC_PT_FAULT, RPC_PT_ORPHANED, RPC_PT_PING, RPC_PT_REJECT, RPC_PT_REQUEST, RPC_PT_RESPONSE, RPC_PT_SHUTDOWN -
Constructor Summary
ConstructorsConstructorDescriptionDcerpcPipeHandle(String url, CIFSContext tc, boolean unshared) Creates a DCERPC pipe handle for named pipe communication -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected intdoReceiveFragment(byte[] buf) Receives a DCERPC fragment from the remote endpointprotected voiddoSendFragment(byte[] buf, int off, int length) Sends a DCERPC fragment to the remote endpointprotected intdoSendReceiveFragment(byte[] buf, int off, int length, byte[] inB) Sends a DCERPC fragment and receives the response in a single operationGets the server hostname or address currently connected toGets the server hostname resolved through DFS (Distributed File System)byte[]Gets the session key from the underlying SMB session for encryptionGets the CIFS context used for transport operationsMethods inherited from class org.codelibs.jcifs.smb.dcerpc.DcerpcHandle
bind, encodeMessage, getBinding, getHandle, getHandle, parseBinding, sendrecv, setDcerpcSecurityProvider, toString
-
Constructor Details
-
DcerpcPipeHandle
public DcerpcPipeHandle(String url, CIFSContext tc, boolean unshared) throws DcerpcException, MalformedURLException Creates a DCERPC pipe handle for named pipe communication- Parameters:
url- the DCERPC URL specifying the endpointtc- the CIFS context for connection configurationunshared- whether to use an exclusive connection- Throws:
DcerpcException- if DCERPC initialization failsMalformedURLException- if the URL is malformed
-
-
Method Details
-
getTransportContext
Description copied from class:DcerpcHandleGets the CIFS context used for transport operations- Specified by:
getTransportContextin classDcerpcHandle- Returns:
- the transport context used
-
getServer
Description copied from class:DcerpcHandleGets the server hostname or address currently connected to- Specified by:
getServerin classDcerpcHandle- Returns:
- the server connected to
-
getServerWithDfs
Description copied from class:DcerpcHandleGets the server hostname resolved through DFS (Distributed File System)- Specified by:
getServerWithDfsin classDcerpcHandle- Returns:
- the server resolved by DFS
-
getSessionKey
Description copied from class:DcerpcHandleGets the session key from the underlying SMB session for encryption- Specified by:
getSessionKeyin classDcerpcHandle- Returns:
- session key of the underlying smb session
- Throws:
CIFSException- if unable to retrieve the session key
-
doSendReceiveFragment
Sends a DCERPC fragment and receives the response in a single operation- Specified by:
doSendReceiveFragmentin classDcerpcHandle- Parameters:
buf- the outgoing buffer containing the requestoff- the offset into the outgoing bufferlength- the length of data to sendinB- the buffer to receive the response- Returns:
- the number of bytes received
- Throws:
IOException- if an I/O error occurs during the operation- See Also:
-
doSendFragment
Description copied from class:DcerpcHandleSends a DCERPC fragment to the remote endpoint- Specified by:
doSendFragmentin classDcerpcHandle- Parameters:
buf- the buffer containing the fragment dataoff- the offset into the bufferlength- the length of data to send- Throws:
IOException- if an I/O error occurs during transmission
-
doReceiveFragment
Description copied from class:DcerpcHandleReceives a DCERPC fragment from the remote endpoint- Specified by:
doReceiveFragmentin classDcerpcHandle- Parameters:
buf- the buffer to receive the fragment data- Returns:
- the number of bytes received
- Throws:
IOException- if an I/O error occurs during reception
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classDcerpcHandle- Throws:
IOException
-