Example #1
0
  public void encode(NdrBuffer buf) throws NdrException {
    int start = buf.getIndex();
    int alloc_hint_index = 0;

    buf.advance(16); /* momentarily skip header */
    if (ptype == 0) {
      /* Request */
      alloc_hint_index = buf.getIndex();
      buf.enc_ndr_long(0); /* momentarily skip alloc hint */
      buf.enc_ndr_short(0); /* context id */
      buf.enc_ndr_short(getOpnum());
    }

    encode_in(buf);
    length = buf.getIndex() - start;

    if (ptype == 0) {
      buf.setIndex(alloc_hint_index);
      alloc_hint = length - alloc_hint_index;
      buf.enc_ndr_long(alloc_hint);
    }

    buf.setIndex(start);
    encode_header(buf);
    buf.setIndex(start + length);
  }
Example #2
0
 void encode_header(NdrBuffer buf) {
   buf.enc_ndr_small(5); /* RPC version */
   buf.enc_ndr_small(0); /* minor version */
   buf.enc_ndr_small(ptype);
   buf.enc_ndr_small(flags);
   buf.enc_ndr_long(0x00000010); /* Little-endian / ASCII / IEEE */
   buf.enc_ndr_short(length);
   buf.enc_ndr_short(0); /* length of auth_value */
   buf.enc_ndr_long(call_id);
 }
 public void encode_in(NdrBuffer paramNdrBuffer) {
   handle.encode(paramNdrBuffer);
   paramNdrBuffer.enc_ndr_short(level);
 }