3 * Bacula Director -- mountreq.c -- handles the message channel
4 * Mount request from the Storage daemon.
6 * Kern Sibbald, March MMI
8 * This routine runs as a thread and must be thread reentrant.
10 * Basic tasks done here:
11 * Handle Mount services.
15 Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
17 This program is free software; you can redistribute it and/or
18 modify it under the terms of the GNU General Public License as
19 published by the Free Software Foundation; either version 2 of
20 the License, or (at your option) any later version.
22 This program is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 General Public License for more details.
27 You should have received a copy of the GNU General Public
28 License along with this program; if not, write to the Free
29 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
38 * Handle mount request
39 * For now, we put the bsock in the UA's queue
42 /* Requests from the Storage daemon */
45 /* Responses sent to Storage daemon */
47 static char OK_mount[] = "1000 OK MountVolume\n";
50 static BQUEUE mountq = {&mountq, &mountq};
51 static int num_reqs = 0;
52 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
54 typedef struct mnt_req_s {
61 void mount_request(JCR *jcr, BSOCK *bs, char *buf)
65 mr = (MNT_REQ *) malloc(sizeof(MNT_REQ));
66 memset(mr, 0, sizeof(MNT_REQ));
71 qinsert(&mountq, &mr->bq);