Dirk-Willem van Gulik (NXP/mbed)
/
Bonjour
Bonjour/Zerconf library
Revision 5:8e53abda9900, committed 2010-08-14
- Comitter:
- dirkx
- Date:
- Sat Aug 14 15:54:31 2010 +0000
- Parent:
- 4:d9f5c4abc5f8
- Commit message:
Changed in this revision
dbg/dbg.h | Show annotated file Show diff for this revision Revisions of this file |
services/mDNS/mDNSResponder.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/dbg/dbg.h Sat Jul 31 14:30:45 2010 +0000 +++ b/dbg/dbg.h Sat Aug 14 15:54:31 2010 +0000 @@ -53,6 +53,9 @@ #endif #else + +// No debugging + #undef DBG #undef DBG_END #undef BREAK
--- a/services/mDNS/mDNSResponder.cpp Sat Jul 31 14:30:45 2010 +0000 +++ b/services/mDNS/mDNSResponder.cpp Sat Aug 14 15:54:31 2010 +0000 @@ -45,7 +45,6 @@ #include "lwip/opt.h" #if LWIP_DNS /* don't build if not configured for use in lwipopts.h */ -#define __DEBUG #include "dbg/dbg.h" #include "mDNSResponder.h" @@ -344,6 +343,8 @@ p = qPTR(p,moi_local_proto); p = mPTR(p,moi_local_proto, moi_local_pglue); + p = mSRV(p,moi_local_pglue, moi_port, moi_local_name); + if (moi_txt && * moi_txt) p = mTXT(p,moi_local_pglue,moi_txt); @@ -353,18 +354,17 @@ p = qA(p,moi_local_name); break; - case DNS_RRTYPE_SRV: // SRV record and a gratious A record to complete. + case DNS_RRTYPE_SRV: // SRV record, optional TXT and a gratious A record to complete. op->aa_count = ntohs(moi_txt ? 2 : 1); p = qSRV(p,moi_local_pglue); - p = mPTR(p,moi_local_proto, moi_local_pglue); + p = mSRV(p,moi_local_pglue, moi_port, moi_local_name); if (moi_txt && * moi_txt) p = mTXT(p,moi_local_pglue,moi_txt); - break; + break; } p = mARR(p,moi_local_name,moi_ip); m_pUDPSocket->sendto(out,p-out,&dst); - DBG("Reply type %d sent to %s\r\n",t,dst); } char * mDNSResponder::decodeQBlock(char * udp, int len, char *p, char * fqdn, int fqdn_size, uint32_t *Qclass, uint32_t *Qtype) { @@ -470,7 +470,7 @@ if (Qc != DNS_RRCLASS_IN) continue; - DBG("IN query %x for %s\n\r", Qt, fqdn); + DBG("IN query 0x%x for %s\n\r", Qt, fqdn); // Normally we'll respond to a mCast query for the PTR of our conceptual // service; to which we reply with the services we run; and then the A