Lines Matching defs:towire
1247 srpl_dso_message_setup(dso_state_t *dso, dso_message_t *state, dns_towire_state_t *towire, uint8_t *buffer,
1280 memset(towire, 0, sizeof(*towire));
1281 towire->p = &buffer[DNS_HEADER_SIZE];
1282 towire->lim = towire->p + (buffer_size - DNS_HEADER_SIZE);
1283 towire->message = (dns_wire_t *)buffer;
1301 dns_towire_state_t towire;
1305 if (!srpl_dso_message_setup(srpl_connection->dso, &message, &towire, dsobuf, sizeof(dsobuf),
1310 dns_u16_to_wire(&towire, kDSOType_Keepalive);
1311 dns_rdlength_begin(&towire);
1312 dns_u32_to_wire(&towire, DEFAULT_KEEPALIVE_WAKEUP_EXPIRY / 2); // Idle timeout (we are never idle)
1313 dns_u32_to_wire(&towire, DEFAULT_KEEPALIVE_WAKEUP_EXPIRY / 2); // Keepalive timeout
1314 dns_rdlength_end(&towire);
1315 if (towire.error) {
1316 ERROR("ran out of message space at " PUB_S_SRP ", :%d", __FILE__, towire.line);
1320 iov.iov_len = towire.p - dsobuf;
1375 dns_towire_state_t towire;
1389 bool ret = srpl_dso_message_setup(srpl_connection->dso, &message, &towire, dsobuf, sizeof(dsobuf),
1399 if (!srpl_dso_message_setup(srpl_connection->dso, &message, &towire, dsobuf, sizeof(dsobuf),
1403 dns_u16_to_wire(&towire, kDSOType_SRPLSession);
1404 dns_rdlength_begin(&towire);
1405 dns_u64_to_wire(&towire, domain->partner_id);
1406 dns_rdlength_end(&towire);
1409 dns_u16_to_wire(&towire, kDSOType_SRPLVersion);
1410 dns_rdlength_begin(&towire);
1411 dns_u16_to_wire(&towire, SRPL_CURRENT_VERSION);
1412 dns_rdlength_end(&towire);
1415 dns_u16_to_wire(&towire, kDSOType_SRPLDomainName);
1416 dns_rdlength_begin(&towire);
1418 dns_full_name_to_wire(NULL, &towire, domain->name);
1419 dns_rdlength_end(&towire);
1422 dns_u16_to_wire(&towire, kDSOType_SRPLNewPartner);
1423 dns_rdlength_begin(&towire);
1424 dns_rdlength_end(&towire);
1427 if (towire.error) {
1428 ERROR("ran out of message space at " PUB_S_SRP ", :%d", __FILE__, towire.line);
1432 iov.iov_len = towire.p - dsobuf;
1450 dns_towire_state_t towire;
1454 if (!srpl_dso_message_setup(srpl_connection->dso, &message, &towire, dsobuf, sizeof(dsobuf),
1458 dns_u16_to_wire(&towire, kDSOType_SRPLSendCandidates);
1459 dns_rdlength_begin(&towire);
1460 dns_rdlength_end(&towire);
1461 if (towire.error) {
1462 ERROR("ran out of message space at " PUB_S_SRP ", :%d", __FILE__, towire.line);
1466 iov.iov_len = towire.p - dsobuf;
1483 dns_towire_state_t towire;
1488 if (!srpl_dso_message_setup(srpl_connection->dso, &message, &towire,
1500 dns_u16_to_wire(&towire, kDSOType_SRPLCandidate);
1501 dns_rdlength_begin(&towire);
1502 dns_rdlength_end(&towire);
1503 dns_u16_to_wire(&towire, kDSOType_SRPLHostname);
1504 dns_rdlength_begin(&towire);
1505 dns_full_name_to_wire(NULL, &towire, host->name);
1506 dns_rdlength_end(&towire);
1507 dns_u16_to_wire(&towire, kDSOType_SRPLTimeOffset);
1508 dns_rdlength_begin(&towire);
1509 dns_u32_to_wire(&towire, (uint32_t)(srp_time() - update_time));
1510 dns_rdlength_end(&towire);
1511 dns_u16_to_wire(&towire, kDSOType_SRPLKeyID);
1512 dns_rdlength_begin(&towire);
1513 dns_u32_to_wire(&towire, host->key_id);
1514 dns_rdlength_end(&towire);
1515 if (towire.error) {
1516 ERROR("ran out of message space at " PUB_S_SRP ", :%d", __FILE__, towire.line);
1520 iov.iov_len = towire.p - dsobuf;
1537 dns_towire_state_t towire;
1541 if (!srpl_dso_message_setup(srpl_connection->dso, &message, &towire, dsobuf, sizeof(dsobuf),
1545 dns_u16_to_wire(&towire, kDSOType_SRPLCandidate);
1546 dns_rdlength_begin(&towire);
1547 dns_rdlength_end(&towire);
1548 dns_u16_to_wire(&towire, response_type);
1549 dns_rdlength_begin(&towire);
1550 dns_rdlength_end(&towire);
1551 if (towire.error) {
1552 ERROR("ran out of message space at " PUB_S_SRP ", :%d", __FILE__, towire.line);
1556 iov.iov_len = towire.p - dsobuf;
1589 dns_towire_state_t towire;
1663 if (!srpl_dso_message_setup(srpl_connection->dso, &message, &towire,
1675 dns_u16_to_wire(&towire, kDSOType_SRPLHost);
1676 dns_rdlength_begin(&towire);
1677 dns_rdlength_end(&towire);
1678 dns_u16_to_wire(&towire, kDSOType_SRPLHostname);
1679 dns_rdlength_begin(&towire);
1680 dns_full_name_to_wire(NULL, &towire, host->name);
1681 dns_rdlength_end(&towire);
1685 dns_u16_to_wire(&towire, kDSOType_SRPLTimeOffset);
1686 dns_rdlength_begin(&towire);
1687 dns_u32_to_wire(&towire, (uint32_t)(srpl_now - host->message->received_time));
1688 dns_rdlength_end(&towire);
1690 dns_u16_to_wire(&towire, kDSOType_SRPLServerStableID);
1691 dns_rdlength_begin(&towire);
1692 dns_u64_to_wire(&towire, host->server_stable_id);
1693 dns_rdlength_end(&towire);
1695 dns_u16_to_wire(&towire, kDSOType_SRPLHostMessage);
1696 dns_u16_to_wire(&towire, host->message->length);
1697 iov[iov_cur].iov_len = towire.p - dsobuf;
1706 dns_u16_to_wire(&towire, kDSOType_SRPLHostMessage);
1707 dns_u16_to_wire(&towire, 12 + messages[i]->length);
1708 dns_u32_to_wire(&towire, messages[i]->lease);
1709 dns_u32_to_wire(&towire, messages[i]->key_lease);
1710 dns_u32_to_wire(&towire, (uint32_t)(srpl_now - messages[i]->received_time));
1711 iov[iov_cur].iov_len = towire.p - start;
1717 start = towire.p;
1721 if (towire.error) {
1722 ERROR("ran out of message space at " PUB_S_SRP ", :%d", __FILE__, towire.line);
1754 dns_towire_state_t towire;
1758 if (!srpl_dso_message_setup(srpl_connection->dso, &message, &towire, dsobuf, sizeof(dsobuf),
1762 dns_u16_to_wire(&towire, kDSOType_SRPLHost);
1763 dns_rdlength_begin(&towire);
1764 dns_rdlength_end(&towire);
1765 if (towire.error) {
1766 ERROR("ran out of message space at " PUB_S_SRP ", :%d", __FILE__, towire.line);
1770 iov.iov_len = towire.p - dsobuf;
1787 dns_towire_state_t towire;
1801 if (!srpl_dso_message_setup(srpl_connection->dso, &message, &towire, dsobuf, sizeof(dsobuf),
1807 dns_u16_to_wire(&towire, kDSOType_RetryDelay);
1808 dns_rdlength_begin(&towire);
1809 dns_u32_to_wire(&towire, delay); // One hour.
1810 dns_rdlength_end(&towire);
1811 if (towire.error) {
1812 ERROR("ran out of message space at " PUB_S_SRP ", :%d", __FILE__, towire.line);
1816 iov.iov_len = towire.p - dsobuf;
3785 dns_towire_state_t towire;
3787 memset(&towire, 0, sizeof(towire));
3788 towire.p = name_buffer;
3789 towire.lim = towire.p + kDNSServiceMaxDomainName;
3790 dns_full_name_to_wire(NULL, &towire, full_service_name);
3793 service->ptr_length = towire.p - name_buffer;