public byte[] Encode(int type) { switch (type) { case 3: { LDAPBindResponse protocolOp = (LDAPBindResponse)this.ProtocolOp; return(BerConverter.Encode("{it{eooto}}", this.MessageID, 0x61, protocolOp.ResultCode, protocolOp.MatchedDN, protocolOp.DiagnosticMessage, 0x87, protocolOp.ServerSaslCreds)); } case 4: { LDAPSearchResEntry protocolOp = (LDAPSearchResEntry)this.ProtocolOp; return(BerConverter.Encode("{it{sto}}", this.MessageID, 0x64, protocolOp.ObjectDN, 0x30, protocolOp.Attributes)); } case 5: { LDAPSearchResDone protocolOp = (LDAPSearchResDone)this.ProtocolOp; return(BerConverter.Encode("{it{eoo}}", this.MessageID, 0x65, protocolOp.ResultCode, protocolOp.MatchedDN, protocolOp.ErrorMessage)); } } return(null); }
public byte[] Encode(LDAPSearchResEntry search) { return(BerConverter.Encode("{it{stX}}", this.MessageID, 0x64, search.ObjectDN, 0x30, search.Attributes)); }