Lines Matching refs:aMessage
727 Error Client::PrepareUpdateMessage(Message &aMessage) in PrepareUpdateMessage() argument
759 SuccessOrExit(error = aMessage.Append(header)); in PrepareUpdateMessage()
763 info.mDomainNameOffset = aMessage.GetLength(); in PrepareUpdateMessage()
764 SuccessOrExit(error = Dns::Name::AppendName(mDomainName, aMessage)); in PrepareUpdateMessage()
765 SuccessOrExit(error = aMessage.Append(Dns::Zone())); in PrepareUpdateMessage()
773 SuccessOrExit(error = AppendServiceInstructions(service, aMessage, info)); in PrepareUpdateMessage()
777 SuccessOrExit(error = AppendHostDescriptionInstruction(aMessage, info)); in PrepareUpdateMessage()
780 aMessage.Write(kHeaderOffset, header); in PrepareUpdateMessage()
784 SuccessOrExit(error = AppendUpdateLeaseOptRecord(aMessage)); in PrepareUpdateMessage()
785 SuccessOrExit(error = AppendSignature(aMessage, info)); in PrepareUpdateMessage()
788 aMessage.Write(kHeaderOffset, header); in PrepareUpdateMessage()
817 Error Client::AppendServiceInstructions(Service &aService, Message &aMessage, Info &aInfo) in AppendServiceInstructions() argument
846 serviceNameOffset = aMessage.GetLength(); in AppendServiceInstructions()
847 SuccessOrExit(error = Dns::Name::AppendMultipleLabels(aService.GetName(), aMessage)); in AppendServiceInstructions()
848 SuccessOrExit(error = Dns::Name::AppendPointerLabel(aInfo.mDomainNameOffset, aMessage)); in AppendServiceInstructions()
855 offset = aMessage.GetLength(); in AppendServiceInstructions()
856 SuccessOrExit(error = aMessage.Append(rr)); in AppendServiceInstructions()
859 instanceNameOffset = aMessage.GetLength(); in AppendServiceInstructions()
860 SuccessOrExit(error = Dns::Name::AppendLabel(aService.GetInstanceName(), aMessage)); in AppendServiceInstructions()
861 SuccessOrExit(error = Dns::Name::AppendPointerLabel(serviceNameOffset, aMessage)); in AppendServiceInstructions()
863 UpdateRecordLengthInMessage(rr, offset, aMessage); in AppendServiceInstructions()
875 SuccessOrExit(error = Dns::Name::AppendLabel(subTypeLabel, aMessage)); in AppendServiceInstructions()
879 subServiceNameOffset = aMessage.GetLength(); in AppendServiceInstructions()
880 SuccessOrExit(error = Dns::Name::AppendLabel("_sub", aMessage)); in AppendServiceInstructions()
881 SuccessOrExit(error = Dns::Name::AppendPointerLabel(serviceNameOffset, aMessage)); in AppendServiceInstructions()
885 … SuccessOrExit(error = Dns::Name::AppendPointerLabel(subServiceNameOffset, aMessage)); in AppendServiceInstructions()
889 offset = aMessage.GetLength(); in AppendServiceInstructions()
890 SuccessOrExit(error = aMessage.Append(rr)); in AppendServiceInstructions()
892 SuccessOrExit(error = Dns::Name::AppendPointerLabel(instanceNameOffset, aMessage)); in AppendServiceInstructions()
893 UpdateRecordLengthInMessage(rr, offset, aMessage); in AppendServiceInstructions()
903 SuccessOrExit(error = Dns::Name::AppendPointerLabel(instanceNameOffset, aMessage)); in AppendServiceInstructions()
904 SuccessOrExit(error = AppendDeleteAllRrsets(aMessage)); in AppendServiceInstructions()
911 SuccessOrExit(error = Dns::Name::AppendPointerLabel(instanceNameOffset, aMessage)); in AppendServiceInstructions()
917 offset = aMessage.GetLength(); in AppendServiceInstructions()
918 SuccessOrExit(error = aMessage.Append(srv)); in AppendServiceInstructions()
919 SuccessOrExit(error = AppendHostName(aMessage, aInfo)); in AppendServiceInstructions()
920 UpdateRecordLengthInMessage(srv, offset, aMessage); in AppendServiceInstructions()
925 SuccessOrExit(error = Dns::Name::AppendPointerLabel(instanceNameOffset, aMessage)); in AppendServiceInstructions()
927 offset = aMessage.GetLength(); in AppendServiceInstructions()
928 SuccessOrExit(error = aMessage.Append(rr)); in AppendServiceInstructions()
930 … Dns::TxtEntry::AppendEntries(aService.GetTxtEntries(), aService.GetNumTxtEntries(), aMessage)); in AppendServiceInstructions()
931 UpdateRecordLengthInMessage(rr, offset, aMessage); in AppendServiceInstructions()
941 SuccessOrExit(error = Dns::Name::AppendPointerLabel(instanceNameOffset, aMessage)); in AppendServiceInstructions()
942 SuccessOrExit(error = AppendKeyRecord(aMessage, aInfo)); in AppendServiceInstructions()
950 Error Client::AppendHostDescriptionInstruction(Message &aMessage, Info &aInfo) const in AppendHostDescriptionInstruction() argument
960 SuccessOrExit(error = AppendHostName(aMessage, aInfo)); in AppendHostDescriptionInstruction()
961 SuccessOrExit(error = AppendDeleteAllRrsets(aMessage)); in AppendHostDescriptionInstruction()
972 SuccessOrExit(error = AppendHostName(aMessage, aInfo)); in AppendHostDescriptionInstruction()
973 SuccessOrExit(error = aMessage.Append(rr)); in AppendHostDescriptionInstruction()
974 SuccessOrExit(error = aMessage.Append(mHostInfo.GetAddress(index))); in AppendHostDescriptionInstruction()
980 SuccessOrExit(error = AppendHostName(aMessage, aInfo)); in AppendHostDescriptionInstruction()
981 SuccessOrExit(error = AppendKeyRecord(aMessage, aInfo)); in AppendHostDescriptionInstruction()
987 Error Client::AppendKeyRecord(Message &aMessage, Info &aInfo) const in AppendKeyRecord() argument
1000 SuccessOrExit(error = aMessage.Append(key)); in AppendKeyRecord()
1002 SuccessOrExit(error = aMessage.Append(publicKey)); in AppendKeyRecord()
1009 Error Client::AppendDeleteAllRrsets(Message &aMessage) const in AppendDeleteAllRrsets()
1020 return aMessage.Append(rr); in AppendDeleteAllRrsets()
1023 Error Client::AppendHostName(Message &aMessage, Info &aInfo, bool aDoNotCompress) const in AppendHostName() argument
1031 SuccessOrExit(error = Dns::Name::AppendMultipleLabels(mHostInfo.GetName(), aMessage)); in AppendHostName()
1032 error = Dns::Name::AppendName(mDomainName, aMessage); in AppendHostName()
1042 ExitNow(error = Dns::Name::AppendPointerLabel(aInfo.mHostNameOffset, aMessage)); in AppendHostName()
1045 aInfo.mHostNameOffset = aMessage.GetLength(); in AppendHostName()
1046 SuccessOrExit(error = Dns::Name::AppendMultipleLabels(mHostInfo.GetName(), aMessage)); in AppendHostName()
1047 error = Dns::Name::AppendPointerLabel(aInfo.mDomainNameOffset, aMessage); in AppendHostName()
1053 Error Client::AppendUpdateLeaseOptRecord(Message &aMessage) const in AppendUpdateLeaseOptRecord()
1060 SuccessOrExit(error = Dns::Name::AppendTerminator(aMessage)); in AppendUpdateLeaseOptRecord()
1069 SuccessOrExit(error = aMessage.Append(optRecord)); in AppendUpdateLeaseOptRecord()
1084 error = aMessage.Append(leaseOption); in AppendUpdateLeaseOptRecord()
1090 Error Client::AppendSignature(Message &aMessage, Info &aInfo) in AppendSignature() argument
1114 offset = aMessage.GetLength(); in AppendSignature()
1115 SuccessOrExit(error = aMessage.Append(sig)); in AppendSignature()
1116 SuccessOrExit(error = AppendHostName(aMessage, aInfo, /* aDoNotCompress */ true)); in AppendSignature()
1128 len = aMessage.GetLength() - offset - sizeof(Dns::ResourceRecord); in AppendSignature()
1129 sha256.Update(aMessage, offset + sizeof(Dns::ResourceRecord), len); in AppendSignature()
1132 sha256.Update(aMessage, 0, offset); in AppendSignature()
1140 IgnoreError(aMessage.SetLength(offset)); in AppendSignature()
1143 SuccessOrExit(error = Dns::Name::AppendTerminator(aMessage)); in AppendSignature()
1145 offset = aMessage.GetLength(); in AppendSignature()
1146 SuccessOrExit(error = aMessage.Append(sig)); in AppendSignature()
1147 SuccessOrExit(error = AppendHostName(aMessage, aInfo)); in AppendSignature()
1148 SuccessOrExit(error = aMessage.Append(signature)); in AppendSignature()
1149 UpdateRecordLengthInMessage(sig, offset, aMessage); in AppendSignature()
1155 …pdateRecordLengthInMessage(Dns::ResourceRecord &aRecord, uint16_t aOffset, Message &aMessage) const in UpdateRecordLengthInMessage()
1163 aRecord.SetLength(aMessage.GetLength() - aOffset - sizeof(Dns::ResourceRecord)); in UpdateRecordLengthInMessage()
1164 aMessage.Write(aOffset, aRecord); in UpdateRecordLengthInMessage()
1167 void Client::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInf… in HandleUdpReceive() argument
1171 static_cast<Client *>(aContext)->ProcessResponse(*static_cast<Message *>(aMessage)); in HandleUdpReceive()
1174 void Client::ProcessResponse(Message &aMessage) in ProcessResponse() argument
1189 uint16_t offset = aMessage.GetOffset(); in ProcessResponse()
1195 SuccessOrExit(error = aMessage.Read(offset, header)); in ProcessResponse()
1270 SuccessOrExit(error = Dns::Name::ParseName(aMessage, offset)); in ProcessResponse()
1271 VerifyOrExit(offset + sizeof(Dns::Zone) <= aMessage.GetLength(), error = kErrorParse); in ProcessResponse()
1288 SuccessOrExit(error = ReadResourceRecord(aMessage, offset, rr)); in ProcessResponse()
1293 … SuccessOrExit(error = ProcessOptRecord(aMessage, startOffset, static_cast<Dns::OptRecord &>(rr))); in ProcessResponse()
1380 Error Client::ReadResourceRecord(const Message &aMessage, uint16_t &aOffset, Dns::ResourceRecord &a… in ReadResourceRecord() argument
1388 SuccessOrExit(error = Dns::Name::ParseName(aMessage, aOffset)); in ReadResourceRecord()
1389 SuccessOrExit(error = aMessage.Read(aOffset, aRecord)); in ReadResourceRecord()
1390 VerifyOrExit(aOffset + aRecord.GetSize() <= aMessage.GetLength(), error = kErrorParse); in ReadResourceRecord()
1397 Error Client::ProcessOptRecord(const Message &aMessage, uint16_t aOffset, const Dns::OptRecord &aOp… in ProcessOptRecord() argument
1405 IgnoreError(Dns::Name::ParseName(aMessage, aOffset)); in ProcessOptRecord()
1416 SuccessOrExit(error = aMessage.Read(aOffset, option)); in ProcessOptRecord()
1418 VerifyOrExit(aOffset + option.GetSize() <= aMessage.GetLength(), error = kErrorParse); in ProcessOptRecord()
1423 SuccessOrExit(error = aMessage.Read(aOffset, leaseOption)); in ProcessOptRecord()