Module jcifs

Class DcerpcPipeHandle

java.lang.Object
org.codelibs.jcifs.smb.dcerpc.DcerpcHandle
org.codelibs.jcifs.smb.dcerpc.DcerpcPipeHandle
All Implemented Interfaces:
AutoCloseable, DcerpcConstants

public class DcerpcPipeHandle extends DcerpcHandle
DCE/RPC handle implementation for named pipe communications. This class provides DCE/RPC communication over SMB named pipes.
  • 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 endpoint
      tc - the CIFS context for connection configuration
      unshared - whether to use an exclusive connection
      Throws:
      DcerpcException - if DCERPC initialization fails
      MalformedURLException - if the URL is malformed
  • Method Details

    • getTransportContext

      public CIFSContext getTransportContext()
      Description copied from class: DcerpcHandle
      Gets the CIFS context used for transport operations
      Specified by:
      getTransportContext in class DcerpcHandle
      Returns:
      the transport context used
    • getServer

      public String getServer()
      Description copied from class: DcerpcHandle
      Gets the server hostname or address currently connected to
      Specified by:
      getServer in class DcerpcHandle
      Returns:
      the server connected to
    • getServerWithDfs

      public String getServerWithDfs()
      Description copied from class: DcerpcHandle
      Gets the server hostname resolved through DFS (Distributed File System)
      Specified by:
      getServerWithDfs in class DcerpcHandle
      Returns:
      the server resolved by DFS
    • getSessionKey

      public byte[] getSessionKey() throws CIFSException
      Description copied from class: DcerpcHandle
      Gets the session key from the underlying SMB session for encryption
      Specified by:
      getSessionKey in class DcerpcHandle
      Returns:
      session key of the underlying smb session
      Throws:
      CIFSException - if unable to retrieve the session key
    • doSendReceiveFragment

      protected int doSendReceiveFragment(byte[] buf, int off, int length, byte[] inB) throws IOException
      Sends a DCERPC fragment and receives the response in a single operation
      Specified by:
      doSendReceiveFragment in class DcerpcHandle
      Parameters:
      buf - the outgoing buffer containing the request
      off - the offset into the outgoing buffer
      length - the length of data to send
      inB - 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

      protected void doSendFragment(byte[] buf, int off, int length) throws IOException
      Description copied from class: DcerpcHandle
      Sends a DCERPC fragment to the remote endpoint
      Specified by:
      doSendFragment in class DcerpcHandle
      Parameters:
      buf - the buffer containing the fragment data
      off - the offset into the buffer
      length - the length of data to send
      Throws:
      IOException - if an I/O error occurs during transmission
    • doReceiveFragment

      protected int doReceiveFragment(byte[] buf) throws IOException
      Description copied from class: DcerpcHandle
      Receives a DCERPC fragment from the remote endpoint
      Specified by:
      doReceiveFragment in class DcerpcHandle
      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

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class DcerpcHandle
      Throws:
      IOException