This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
* cli_send_mailslot, send a mailslot for client code ...
*/
-BOOL cli_send_mailslot(BOOL unique, const char *mailslot,
+BOOL cli_send_mailslot(struct messaging_context *msg_ctx,
+ BOOL unique, const char *mailslot,
uint16 priority,
char *buf, int len,
const char *srcname, int src_type,
return False;
}
- if (!message_init())
- return False;
-
memset((char *)&p, '\0', sizeof(p));
/*
SSVAL(ptr,smb_vwv16,2);
p2 = smb_buf(ptr);
fstrcpy(p2,mailslot);
- p2 = skip_string(p2,1);
+ p2 = skip_string(ptr,MAX_DGRAM_SIZE,p2);
+ if (!p2) {
+ return False;
+ }
memcpy(p2,buf,len);
p2 += len;
DEBUGADD(4,("to %s IP %s\n", nmb_namestr(&dgram->dest_name),
inet_ntoa(dest_ip)));
- return message_send_pid(nmbd_pid, MSG_SEND_PACKET, &p, sizeof(p),
- False);
+ return NT_STATUS_IS_OK(messaging_send_buf(msg_ctx,
+ pid_to_procid(nmbd_pid),
+ MSG_SEND_PACKET,
+ (uint8 *)&p, sizeof(p)));
}
/*
static char cli_backup_list[1024];
-int cli_get_backup_list(const char *myname, const char *send_to_name)
+int cli_get_backup_list(struct messaging_context *msg_ctx,
+ const char *myname, const char *send_to_name)
{
pstring outbuf;
char *p;
SIVAL(p, 0, 1); /* The sender's token ... */
p += 4;
- cli_send_mailslot(True, "\\MAILSLOT\\BROWSE", 1, outbuf,
+ cli_send_mailslot(msg_ctx, True, "\\MAILSLOT\\BROWSE", 1, outbuf,
PTR_DIFF(p, outbuf), myname, 0, send_to_name,
0x1d, sendto_ip);
* cli_get_backup_server: Get the backup list and retrieve a server from it
*/
-int cli_get_backup_server(char *my_name, char *target, char *servername, int namesize)
+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(my_name, target); /* FIXME: Check the response */
+ 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(my_name, target);
+ cli_get_backup_list(msg_ctx, my_name, target);
}