Lines Matching defs:rr

110     AuthRecord *rr;             // Pointer to variable-sized AuthRecord (Why a pointer? Why not just embed it here?)
669 AuthRecord *rr;
688 rr = mallocL("AuthRecord/read_rr_from_ipc_msg", sizeof(AuthRecord) - sizeof(RDataBody) + storage_size);
689 if (!rr) FatalError("ERROR: malloc");
706 mDNS_SetupResourceRecord(rr, mDNSNULL, InterfaceID, type, 0,
709 if (!MakeDomainNameFromDNSNameString(&rr->namestorage, name))
712 freeL("AuthRecord/read_rr_from_ipc_msg", rr);
716 if (flags & kDNSServiceFlagsAllowRemoteQuery) rr->AllowRemoteQuery = mDNStrue;
717 rr->resrec.rrclass = class;
718 rr->resrec.rdlength = rdlen;
719 rr->resrec.rdata->MaxRDLength = rdlen;
720 mDNSPlatformMemCopy(rr->resrec.rdata->u.data, rdata, rdlen);
721 if (GetTTL) rr->resrec.rroriginalttl = ttl;
722 rr->resrec.namehash = DomainNameHashValue(rr->resrec.name);
723 SetNewRData(&rr->resrec, mDNSNULL, 0); // Sets rr->rdatahash for us
724 return rr;
862 mDNSexport void FreeExtraRR(mDNS *const m, AuthRecord *const rr, mStatus result)
864 ExtraResourceRecord *extra = (ExtraResourceRecord *)rr->RecordContext;
869 LogInfo(" FreeExtraRR %s", RRDisplayString(m, &rr->resrec));
871 if (rr->resrec.rdata != &rr->rdatastorage)
872 freeL("Extra RData", rr->resrec.rdata);
924 AuthRecord *rr;
926 for (rr = m->ResourceRecords; rr; rr=rr->next)
927 if (rr->resrec.rrtype == kDNSType_SRV && SameDomainName(rr->resrec.name, r->name) && !IdenticalSameNameRecord(&rr->resrec, r))
937 AuthRecord *rr;
938 for (rr = mDNSStorage.ResourceRecords; rr; rr=rr->next)
939 if (rr->resrec.rrtype == kDNSType_SRV &&
940 mDNSSameIPPort(rr->resrec.rdata->u.srv.port, port) &&
941 SameDomainName(rr->resrec.name, srv))
1067 mDNSlocal void regrecord_callback(mDNS *const m, AuthRecord *rr, mStatus result)
1070 if (!rr->RecordContext) // parent struct already freed by termination callback
1073 LogMsg("Error: regrecord_callback: successful registration of orphaned record %s", ARDisplayString(m, rr));
1080 // with the old rdata (so that we can free it) and stores the new rdata in "rr->resrec.rdata". This means, we need
1082 if (rr->resrec.rdata != &rr->rdatastorage) freeL("RData/regrecord_callback", rr->resrec.rdata);
1083 freeL("AuthRecord/regrecord_callback", rr);
1088 registered_record_entry *re = rr->RecordContext;
1097 LogOperation(fmt, request->sd, re->key, RRDisplayString(m, &rr->resrec), result);
1106 reply->rhdr->ifi = dnssd_htonl(mDNSPlatformInterfaceIndexfromInterfaceID(m, rr->resrec.InterfaceID, mDNSfalse));
1125 freeL("registered_record_entry AuthRecord regrecord_callback", re->rr);
1133 if (callExternalHelpers(re->origInterfaceID, &rr->namestorage, request->flags))
1136 external_start_advertising_service(&rr->resrec, request->flags);
1202 LogOperation("%3d: DNSServiceRegisterRecord(%u %s) STOP PID[%d](%s)", request->sd, ptr->key, RRDisplayString(&mDNSStorage, &ptr->rr->resrec), request->process_id, request->pid_name);
1204 ptr->rr->RecordContext = NULL;
1208 external_stop_advertising_service(&ptr->rr->resrec, request->flags);
1210 LogMcastS(&mDNSStorage, ptr->rr, request, reg_stop);
1211 mDNS_Deregister(&mDNSStorage, ptr->rr); // Will free ptr->rr for us
1240 AuthRecord *rr = read_rr_from_ipc_msg(request, 1, 1);
1241 if (rr)
1246 if (rr->resrec.InterfaceID == mDNSInterface_LocalOnly && !IsLocalDomain(rr->resrec.name) &&
1247 rr->resrec.rrclass == kDNSClass_IN && (rr->resrec.rrtype == kDNSType_A || rr->resrec.rrtype == kDNSType_AAAA ||
1248 rr->resrec.rrtype == kDNSType_CNAME))
1250 freeL("AuthRecord/handle_regrecord_request", rr);
1258 re->rr = rr;
1262 rr->RecordContext = re;
1263 rr->RecordCallback = regrecord_callback;
1265 re->origInterfaceID = rr->resrec.InterfaceID;
1266 if (rr->resrec.InterfaceID == mDNSInterface_P2P)
1267 rr->resrec.InterfaceID = mDNSInterface_Any;
1269 if (!AuthorizedDomain(request, rr->resrec.name, AutoRegistrationDomains)) return (mStatus_NoError);
1271 if (rr->resrec.rroriginalttl == 0)
1272 rr->resrec.rroriginalttl = DefaultTTLforRRType(rr->resrec.rrtype);
1274 LogOperation("%3d: DNSServiceRegisterRecord(%u %s) START PID[%d](%s)", request->sd, re->key, RRDisplayString(&mDNSStorage, &rr->resrec),
1277 err = mDNS_Register(&mDNSStorage, rr);
1280 LogOperation("%3d: DNSServiceRegisterRecord(%u %s) ERROR (%d)", request->sd, re->key, RRDisplayString(&mDNSStorage, &rr->resrec), err);
1282 freeL("registered_record_entry/AuthRecord", rr);
1286 LogMcastS(&mDNSStorage, rr, request, reg_start);
1427 mDNSlocal void update_callback(mDNS *const m, AuthRecord *const rr, RData *oldrd, mDNSu16 oldrdlen)
1429 mDNSBool external_advertise = (rr->UpdateContext) ? *((mDNSBool *)rr->UpdateContext) : mDNSfalse;
1443 ResourceRecord ext = rr->resrec;
1448 if (rr->ARType == AuthRecordAnyIncludeP2P)
1450 else if (rr->ARType == AuthRecordAnyIncludeAWDL)
1457 external_start_advertising_service(&rr->resrec, flags);
1460 if (oldrd != &rr->rdatastorage) freeL("RData/update_callback", oldrd);
1463 mDNSlocal mStatus update_record(AuthRecord *rr, mDNSu16 rdlen, const char *rdata, mDNSu32 ttl, const mDNSBool *const external_advertise)
1475 if (rr->resrec.rrtype == kDNSType_TXT && rdlen == 0) { rdlen = 1; newrd->u.txt.c[0] = 0; }
1477 if (external_advertise) rr->UpdateContext = (void *)external_advertise;
1479 result = mDNS_Update(&mDNSStorage, rr, ttl, rdlen, newrd, update_callback);
1480 if (result) { LogMsg("update_record: Error %d for %s", (int)result, ARDisplayString(&mDNSStorage, rr)); freeL("RData/update_record", newrd); }
1489 AuthRecord *rr = NULL;
1511 result = update_record(reptr->rr, rdlen, rdata, ttl, &reptr->external_advertise);
1513 request->sd, reptr->rr->resrec.name->c, reptr->rr ? DNSTypeName(reptr->rr->resrec.rrtype) : "<NONE>");
1545 if (hdr->reg_index == TXT_RECORD_INDEX) rr = &i->srs.RR_TXT;
1550 if (e->ClientID == hdr->reg_index) { rr = &e->r; break; }
1553 if (!rr) { result = mStatus_BadReferenceErr; goto end; }
1554 result = update_record(rr, rdlen, rdata, ttl, &i->external_advertise);
1563 rr ? DNSTypeName(rr->resrec.rrtype) : "<NONE>");
1579 LogOperation("%3d: DNSServiceRemoveRecord(%u %s)", request->sd, e->key, RRDisplayString(&mDNSStorage, &e->rr->resrec));
1580 e->rr->RecordContext = NULL;
1583 external_stop_advertising_service(&e->rr->resrec, request->flags);
1586 LogMcastS(&mDNSStorage, e->rr, request, reg_stop);
1587 err = mDNS_Deregister(&mDNSStorage, e->rr); // Will free e->rr for us; we're responsible for freeing e
1591 freeL("registered_record_entry AuthRecord remove_record", e->rr);
2353 mDNSlocal void FreeARElemCallback(mDNS *const m, AuthRecord *const rr, mStatus result)
2365 while (*ptr && &(*ptr)->ar != rr) ptr = &(*ptr)->next;
2366 if (*ptr) { *ptr = (*ptr)->next; LogMsg("FreeARElemCallback: Have to cut %s", ARDisplayString(m, rr)); }
2367 mDNSPlatformMemFree(rr->RecordContext);
4004 AuthRecord *rr = read_rr_from_ipc_msg(request, 0, 0);
4005 if (rr)
4007 status = mDNS_ReconfirmByValue(&mDNSStorage, &rr->resrec);
4012 request->sd, RRDisplayString(&mDNSStorage, &rr->resrec),
4013 mDNSPlatformInterfaceIndexfromInterfaceID(&mDNSStorage, rr->resrec.InterfaceID, mDNSfalse), status);
4014 freeL("AuthRecord/handle_reconfirm_request", rr);
5299 req->flags, req->interfaceIndex, p->key, ARDisplayString(m, p->rr), req->process_id, req->pid_name);
5368 if (!AuthRecord_uDNS(p->rr))
5431 if (!AuthRecord_uDNS(p->rr))
5432 LogMcastNoIdent("R: -> DNSServiceRegisterRecord: %##s %s PID[%d](%s)", p->rr->resrec.name->c,
5433 DNSTypeName(p->rr->resrec.rrtype), req->process_id, req->pid_name, i_mcount++);