* \return The calculated hash value
*/
-static int NameHash(const int8_t *str)
+static int NameHash(const char *str)
{
- const uint8_t *name = (const uint8_t *)str;
+ const char *name = (const char *)str;
uint32_t hash = 0;
uint32_t g;
*
* \return The next matching query or NULL
*/
-static TQuery *QueryNext(TMdnsd *mdnsd, TQuery *query, int8_t *host, int type)
+static TQuery *QueryNext(TMdnsd *mdnsd, TQuery *query, char *host, int type)
{
if (query == NULL) {
query = mdnsd->queries[NameHash(host) % SPRIME];
*
* \return The next matching cache entry or NULL
*/
-static TCached *CachedNext(TMdnsd *mdnsd, TCached *cached, uint8_t *host, int type)
+static TCached *CachedNext(TMdnsd *mdnsd, TCached *cached, char *host, int type)
{
if (cached == NULL) {
cached = mdnsd->cache[NameHash(host) % LPRIME];
*
* \return The next matching dns record or NULL
*/
-static TMdnsdRecord *RecordNext(TMdnsd *mdnsd, TMdnsdRecord *record, uint8_t *host, int type)
+static TMdnsdRecord *RecordNext(TMdnsd *mdnsd, TMdnsdRecord *record, char *host, int type)
{
if (record == NULL) {
record = mdnsd->published[NameHash(host) % SPRIME];
}
#ifdef MDNSD_DEBUG
-uint8_t *MdnsdDecodeType(uint16_t type)
+char *MdnsdDecodeType(uint16_t type)
{
switch (type) {
case QTYPE_A: return "A";
}
}
-void mdnsd_dump (FILE *file, DNSMESSAGE *msg, uint8_t *type)
+void mdnsd_dump (FILE *file, DNSMESSAGE *msg, char *type)
{
int idx;
*
* \return Maximum time after which MdnsdOutput needs to be called again
*/
-void MdnsdQuery(TMdnsd *mdnsd, uint8_t *host, int type, int (*answer)(TMdnsdAnswer *answer, void *arg), void *arg)
+void MdnsdQuery(TMdnsd *mdnsd, char *host, int type, int (*answer)(TMdnsdAnswer *answer, void *arg), void *arg)
{
TQuery *query;
TCached *current = NULL;
*
* \return next cached answer
*/
-TMdnsdAnswer *MdnsdListCachedAnswers(TMdnsd *mdnsd, uint8_t *host, int type, TMdnsdAnswer *last)
+TMdnsdAnswer *MdnsdListCachedAnswers(TMdnsd *mdnsd, char *host, int type, TMdnsdAnswer *last)
{
return (TMdnsdAnswer *)CachedNext(mdnsd, (TCached *)last, host, type);
}
*
* \return newly allocated share record
*/
-TMdnsdRecord *MdnsdAllocShared(TMdnsd *mdnsd, uint8_t *host, int type, uint32_t ttl)
+TMdnsdRecord *MdnsdAllocShared(TMdnsd *mdnsd, char *host, int type, uint32_t ttl)
{
int idx;
TMdnsdRecord *record;
*
* \return newly allocated share record
*/
-TMdnsdRecord *MdnsdAllocUnique(TMdnsd *mdnsd, uint8_t *host, int type, uint32_t ttl, void (*conflict)(TMdnsdRecord *record, uint8_t *host, int type, void *arg), void *arg)
+TMdnsdRecord *MdnsdAllocUnique(TMdnsd *mdnsd, char *host, int type, uint32_t ttl, void (*conflict)(TMdnsdRecord *record, char *host, int type, void *arg), void *arg)
{
TMdnsdRecord *record;
record = MdnsdAllocShared(mdnsd, host, type, ttl);
* \param record The record which shall be de-listed
* \param name Hostname
*/
-void MdnsdSetHost(TMdnsd *mdnsd, TMdnsdRecord *record, uint8_t *name)
+void MdnsdSetHost(TMdnsd *mdnsd, TMdnsdRecord *record, char *name)
{
free(record->rr.rdname);
record->rr.rdname = strdup(name);
* \param port TCP / UDP port number of the service
* \param name The canonical hostname of the machine providing the service.
*/
-void MdnsdSetSrv(TMdnsd *mdnsd, TMdnsdRecord *record, int priority, int weight, uint16_t port, uint8_t *name)
+void MdnsdSetSrv(TMdnsd *mdnsd, TMdnsdRecord *record, int priority, int weight, uint16_t port, char *name)
{
record->rr.srv.priority = priority;
record->rr.srv.weight = weight;