Module jcifs

Class DcerpcMessage

java.lang.Object
org.codelibs.jcifs.smb1.dcerpc.ndr.NdrObject
org.codelibs.jcifs.smb1.dcerpc.DcerpcMessage
All Implemented Interfaces:
DcerpcConstants
Direct Known Subclasses:
DcerpcBind, lsarpc.LsarClose, lsarpc.LsarLookupSids, lsarpc.LsarOpenPolicy2, lsarpc.LsarQueryInformationPolicy, lsarpc.LsarQueryInformationPolicy2, netdfs.NetrDfsEnumEx, samr.SamrCloseHandle, samr.SamrConnect2, samr.SamrConnect4, samr.SamrEnumerateAliasesInDomain, samr.SamrGetMembersInAlias, samr.SamrOpenAlias, samr.SamrOpenDomain, srvsvc.RemoteTOD, srvsvc.ServerGetInfo, srvsvc.ShareEnumAll, srvsvc.ShareGetInfo

public abstract class DcerpcMessage extends NdrObject implements DcerpcConstants
Abstract base class for DCERPC messages. This class provides common functionality for all DCE/RPC message types in SMB1 protocol.
  • Field Details

    • ptype

      protected int ptype
      The packet type of this DCERPC message
    • flags

      protected int flags
      The flags for this DCERPC message
    • length

      protected int length
      The total length of this DCERPC message
    • call_id

      protected int call_id
      The call ID for matching requests and responses
    • alloc_hint

      protected int alloc_hint
      The allocation hint for buffer sizing
    • result

      protected int result
      The result code of the DCERPC operation
  • Constructor Details

    • DcerpcMessage

      protected DcerpcMessage()
      Default constructor for DcerpcMessage. Initializes the DCE/RPC message structure for SMB1 protocol.
  • Method Details

    • isFlagSet

      public boolean isFlagSet(int flag)
      Checks if a specific flag is set
      Parameters:
      flag - the flag to check
      Returns:
      true if the flag is set, false otherwise
    • unsetFlag

      public void unsetFlag(int flag)
      Unsets a specific flag
      Parameters:
      flag - the flag to unset
    • setFlag

      public void setFlag(int flag)
      Sets a specific flag
      Parameters:
      flag - the flag to set
    • getResult

      public DcerpcException getResult()
      Get the result of the DCERPC call.
      Returns:
      result exception if the call failed, null otherwise
    • encode

      public void encode(NdrBuffer buf) throws NdrException
      Description copied from class: NdrObject
      Encodes this NDR object into the specified buffer
      Specified by:
      encode in class NdrObject
      Parameters:
      buf - the destination buffer for encoding
      Throws:
      NdrException - if encoding fails
    • decode

      public void decode(NdrBuffer buf) throws NdrException
      Description copied from class: NdrObject
      Decodes this NDR object from the specified buffer
      Specified by:
      decode in class NdrObject
      Parameters:
      buf - the source buffer for decoding
      Throws:
      NdrException - if decoding fails
    • getOpnum

      public abstract int getOpnum()
      Get the operation number for this DCERPC message.
      Returns:
      the operation number
    • encode_in

      public abstract void encode_in(NdrBuffer buf) throws NdrException
      Encode the input parameters for this DCERPC message.
      Parameters:
      buf - the buffer to encode into
      Throws:
      NdrException - if encoding fails
    • decode_out

      public abstract void decode_out(NdrBuffer buf) throws NdrException
      Decode the output parameters from this DCERPC message.
      Parameters:
      buf - the buffer to decode from
      Throws:
      NdrException - if decoding fails