diff options
-rw-r--r-- | source3/libsmb/clidgram.c | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c index 5b619b6458..82f874f383 100644 --- a/source3/libsmb/clidgram.c +++ b/source3/libsmb/clidgram.c @@ -113,95 +113,3 @@ bool cli_send_mailslot(struct messaging_context *msg_ctx, MSG_SEND_PACKET, (uint8 *)&p, sizeof(p))); } - -/* - * cli_get_response: Get a response ... - */ -bool cli_get_response(const char *mailslot, char *buf, int bufsiz) -{ - struct packet_struct *p; - - p = receive_unexpected(DGRAM_PACKET, 0, mailslot); - - if (p == NULL) - return False; - - memcpy(buf, &p->packet.dgram.data[92], - MIN(bufsiz, p->packet.dgram.datasize-92)); - - return True; -} - -/* - * cli_get_backup_list: Send a get backup list request ... - */ - -static char cli_backup_list[1024]; - -int cli_get_backup_list(struct messaging_context *msg_ctx, - const char *myname, const char *send_to_name) -{ - pstring outbuf; - char *p; - struct sockaddr_storage sendto_ss; - - if (!resolve_name(send_to_name, &sendto_ss, 0x1d)) { - - DEBUG(0, ("Could not resolve name: %s<1D>\n", send_to_name)); - return False; - - } - - memset(cli_backup_list, '\0', sizeof(cli_backup_list)); - memset(outbuf, '\0', sizeof(outbuf)); - - p = outbuf; - - SCVAL(p, 0, ANN_GetBackupListReq); - p++; - - SCVAL(p, 0, 1); /* Count pointer ... */ - p++; - - SIVAL(p, 0, 1); /* The sender's token ... */ - p += 4; - - cli_send_mailslot(msg_ctx, True, "\\MAILSLOT\\BROWSE", 1, outbuf, - PTR_DIFF(p, outbuf), myname, 0, send_to_name, - 0x1d, &sendto_ss); - - /* We should check the error and return if we got one */ - - /* Now, get the response ... */ - - cli_get_response("\\MAILSLOT\\BROWSE", - cli_backup_list, sizeof(cli_backup_list)); - - return True; - -} - -/* - * cli_get_backup_server: Get the backup list and retrieve a server from it - */ - -int cli_get_backup_server(struct messaging_context *msg_ctx, - char *my_name, char *target, char *servername, - int namesize) -{ - - /* Get the backup list first. We could pull this from the cache later */ - - cli_get_backup_list(msg_ctx, my_name, target); /* FIXME: Check the response */ - - if (!cli_backup_list[0]) { /* Empty list ... try again */ - - cli_get_backup_list(msg_ctx, my_name, target); - - } - - strncpy(servername, cli_backup_list, MIN(16, namesize)); - - return True; - -} |