def decodeProxyMessage(self, msg): self.msg = msg self.reqid, seqByte, flagBytes, self.data = splitFields( msg, [REQID_LENGTH, SEQ_LENGTH, FLAGS_LENGTH], True) self.seq = decodeSeq(seqByte) self.flags = decodeFlags(flagBytes) self.fin = self.flags[0]
def decodeInviteMessage(self, message): self.message=message #print('decodeInviteMessage('+encode(message)+')'+str(len(message))) pubkey, flags, ip, port, id, secret=splitFields(self.message, [PUBKEY_LENGTH, FLAGS_LENGTH, IP_LENGTH, PORT_LENGTH, ID_LENGTH, SECRET_LENGTH]) self.pubkey=Key(pubkey, False) flags=decodeFlags(flags) self.v6=flags[0] self.tcp=flags[1] if self.v6: self.ip=inet_ntop(AF_INET6, ip) else: ip=ip[:IPV4_LENGTH] self.ip=inet_ntop(AF_INET, ip) self.port=struct.unpack("H", port)[0] self.id=id self.secret=secret
def decodeInviteMessage(self, message): self.message = message #print('decodeInviteMessage('+encode(message)+')'+str(len(message))) pubkey, flags, ip, port, id, secret = splitFields( self.message, [ PUBKEY_LENGTH, FLAGS_LENGTH, IP_LENGTH, PORT_LENGTH, ID_LENGTH, SECRET_LENGTH ]) self.pubkey = Key(pubkey, False) flags = decodeFlags(flags) self.v6 = flags[0] self.tcp = flags[1] if self.v6: self.ip = inet_ntop(AF_INET6, ip) else: ip = ip[:IPV4_LENGTH] self.ip = inet_ntop(AF_INET, ip) self.port = struct.unpack("H", port)[0] self.id = id self.secret = secret
def decodeProxyMessage(self, msg): self.msg=msg self.reqid, seqByte, flagBytes, self.data=splitFields(msg, [REQID_LENGTH, SEQ_LENGTH, FLAGS_LENGTH], True) self.seq=decodeSeq(seqByte) self.flags=decodeFlags(flagBytes) self.fin=self.flags[0]