-/*
- * bacula.h -- main header file to include in all Bacula source
- *
- * Version $Id$
- */
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ * bacula.h -- main header file to include in all Bacula source
+ *
+ * Version $Id$
+ */
#ifndef _BACULA_H
#define _BACULA_H 1
if (!set_cmd_plugin(&ff_pkt->bfd, jcr)) {
goto bail_out;
}
- send_plugin_name(jcr, sd);
+ send_plugin_name(jcr, sd, true); /* signal start of plugin data */
}
/* Send attributes -- must be done after binit() */
sd->send();
sd->signal(BNET_EOD); /* end of checksum */
}
+ if (ff_pkt->cmd_plugin) {
+ send_plugin_name(jcr, sd, false); /* signal end of plugin data */
+ }
good_rtn:
rtnstat = 1; /* good return */
int len;
char *p;
char *cmd = (char *)value;
+ struct save_pkt sp;
+ FF_PKT *ff_pkt;
if (!plugin_list) {
return;
foreach_alist(plugin, plugin_list) {
Dmsg3(000, "plugin=%s cmd=%s len=%d\n", plugin->file, cmd, len);
if (strncmp(plugin->file, cmd, len) == 0) {
- struct save_pkt sp;
- FF_PKT *ff_pkt;
Dmsg1(000, "Command plugin = %s\n", cmd);
if (plug_func(plugin)->handlePluginEvent(&plugin_ctx_list[i], &event, value) != bRC_OK) {
goto bail_out;
sp.portable = true;
sp.cmd = cmd;
Dmsg0(000, "Plugin startBackup\n");
+ printf("st_size=%p st_blocks=%p sp=%p\n", &sp.statp.st_size, &sp.statp.st_blocks,
+ &sp);
if (plug_func(plugin)->startPluginBackup(&plugin_ctx_list[i], &sp) != bRC_OK) {
goto bail_out;
}
}
/*
- * Send plugin name record to SD
+ * Send plugin name start/end record to SD
*/
-bool send_plugin_name(JCR *jcr, BSOCK *sd)
+bool send_plugin_name(JCR *jcr, BSOCK *sd, bool start)
{
int stat;
struct save_pkt *sp = (struct save_pkt *)jcr->plugin_sp;
Plugin *plugin = (Plugin *)jcr->plugin;
- if (!sd->fsend("%ld %d 0", jcr->JobFiles, STREAM_PLUGIN_NAME)) {
+
+ if (!sd->fsend("%ld %d %d", jcr->JobFiles, STREAM_PLUGIN_NAME, start)) {
Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"),
sd->bstrerror());
return false;
}
- stat = sd->fsend("%ld %d %s%c%s%c", jcr->JobFiles, sp->portable, 0, plugin->file,
- sp->cmd, 0);
+ if (start) {
+ stat = sd->fsend("%ld 1 %d %s%c%s%c", jcr->JobFiles, sp->portable, plugin->file, 0,
+ sp->cmd, 0);
+ } else {
+ stat = sd->fsend("%ld 0 %d %s%c%s%c", jcr->JobFiles, sp->portable, plugin->file, 0,
+ sp->cmd, 0);
+ }
if (!stat) {
Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"),
sd->bstrerror());
#ifndef __FD_PLUGINS_H
#define __FD_PLUGINS_H
+#ifndef _BACULA_H
+#ifdef __cplusplus
+/* Workaround for SGI IRIX 6.5 */
+#define _LANGUAGE_C_PLUS_PLUS 1
+#endif
+#define _REENTRANT 1
+#define _THREAD_SAFE 1
+#define _POSIX_PTHREAD_SEMANTICS 1
+#define _FILE_OFFSET_BITS 64
+#define _LARGEFILE_SOURCE 1
+#define _LARGE_FILES 1
+#endif
+
#include <sys/types.h>
#ifndef __CONFIG_H
#define __CONFIG_H
void new_plugins(JCR *jcr);
void free_plugins(JCR *jcr);
void generate_plugin_event(JCR *jcr, bEventType event, void *value=NULL);
-bool send_plugin_name(JCR *jcr, BSOCK *sd);
+bool send_plugin_name(JCR *jcr, BSOCK *sd, bool start);
#ifdef __cplusplus
extern "C" {