Esempio n. 1
0
File: ldap.py Progetto: korc/structx
	def bind_response(self):
		msg_nr=1
		code=0
		errmsg=''
		matched_dn=''
		return LDAPPacket(tf=BERTypeField.mk("SEQ",True),data=ArrayAttr._c(dtype=BERPacket)([
			BERPacket(tf=BERTypeField.mk("INTEGER"),data=self.bindpkt.get_msgnr()),
			BERPacket(tf=LDAPTypeField.mk(AppTags("BindResponse"),True,"application"),data=ArrayAttr._c(dtype=BERPacket)([
				BERPacket(tf=BERTypeField.mk("ENUM"),data=code),
				BERPacket(tf=BERTypeField.mk("OCTETSTRING"),data=matched_dn),
				BERPacket(tf=BERTypeField.mk("OCTETSTRING"),data=errmsg),
			])),
		]))
Esempio n. 2
0
File: ldap.py Progetto: korc/structx
	def mk(cls,msgnr,pkttype,payload):
		return cls(tf=BERTypeField.mk("SEQ",True),data=LDAPPktArr([BERIntPrim(int(msgnr)),
			LDAPPacket(tf=LDAPTypeField.mk(AppTags(pkttype),True,"application"),data=LDAPPktArr(payload))]))