database id txt record to store settings

This commit is contained in:
Ron Pedde 2004-11-30 04:04:17 +00:00
parent 2a9533fb9f
commit 57bb0851cb
3 changed files with 21 additions and 5 deletions

View File

@ -156,8 +156,8 @@ void rend_callback(void) {
NULL, /* domain */ NULL, /* domain */
NULL, /* host */ NULL, /* host */
msg.port, msg.port,
NULL, /* text record */ "Database ID=beddab1edeadbea7", /* text record */
0, /* text record length */ 28, /* text record length */
rend_howl_reply, rend_howl_reply,
NULL, NULL,
&rend_oid)) != SW_OKAY) { &rend_oid)) != SW_OKAY) {

View File

@ -136,6 +136,18 @@ void *rend_pipe_monitor(void* arg) {
} }
/**
* Add a text stanza to the buffer (pascal-style multistring)
*
* @param buffer where to put the text info
* @param string what pascal string to append
*/
void rend_add_text(char *buffer, char *string) {
char *ptr=&buffer[strlen(buffer)];
*ptr=strlen(string);
strcpy(ptr+1,string);
}
/* /*
* rend_callback * rend_callback
* *
@ -148,7 +160,6 @@ void rend_callback(void *info) {
dns_service_discovery_ref dns_ref=NULL; dns_service_discovery_ref dns_ref=NULL;
/* here, we've seen the message, now we have to process it */ /* here, we've seen the message, now we have to process it */
if(rend_read_message(&msg) != sizeof(msg)) { if(rend_read_message(&msg) != sizeof(msg)) {
DPRINTF(E_FATAL,L_REND,"Error reading rendezvous message\n"); DPRINTF(E_FATAL,L_REND,"Error reading rendezvous message\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -158,7 +169,8 @@ void rend_callback(void *info) {
case REND_MSG_TYPE_REGISTER: case REND_MSG_TYPE_REGISTER:
DPRINTF(E_DBG,L_REND,"Registering %s.%s (%d)\n",msg.type,msg.name,msg.port); DPRINTF(E_DBG,L_REND,"Registering %s.%s (%d)\n",msg.type,msg.name,msg.port);
usPort=msg.port; usPort=msg.port;
dns_ref=DNSServiceRegistrationCreate(msg.name,msg.type,"",usPort,"",rend_reply,nil); dns_ref=DNSServiceRegistrationCreate(msg.name,msg.type,"",usPort,
"Database ID=bedabb1edeadbea7",rend_reply,nil);
if(rend_addtorunloop(dns_ref)) { if(rend_addtorunloop(dns_ref)) {
DPRINTF(E_WARN,L_REND,"Add to runloop failed\n"); DPRINTF(E_WARN,L_REND,"Add to runloop failed\n");
rend_send_response(-1); rend_send_response(-1);

View File

@ -89,6 +89,9 @@
Change History (most recent first): Change History (most recent first):
$Log$ $Log$
Revision 1.20 2004/11/30 04:04:17 rpedde
database id txt record to store settings
Revision 1.19 2004/11/13 07:14:26 rpedde Revision 1.19 2004/11/13 07:14:26 rpedde
modularize debugging statements modularize debugging statements
@ -403,7 +406,8 @@ void rend_callback(void) {
switch(msg.cmd) { switch(msg.cmd) {
case REND_MSG_TYPE_REGISTER: case REND_MSG_TYPE_REGISTER:
DPRINTF(E_DBG,L_REND,"Registering %s.%s (%d)\n",msg.name,msg.type,msg.port); DPRINTF(E_DBG,L_REND,"Registering %s.%s (%d)\n",msg.name,msg.type,msg.port);
RegisterOneService(msg.name,msg.type,"local.",NULL,0,msg.port); RegisterOneService(msg.name,msg.type,"local.","Database ID=beddab1edeadbea7",28,
msg.port);
rend_send_response(0); /* success */ rend_send_response(0); /* success */
break; break;
case REND_MSG_TYPE_UNREGISTER: case REND_MSG_TYPE_UNREGISTER: