]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/fd_plugins.h
Restore win32 dir from Branch-5.2 and update it
[bacula/bacula] / bacula / src / filed / fd_plugins.h
index 63af7d749e443807a19d0ac5dd0d0a18b67c8851..32566ce1e9c8c2bd17f25b9daa8dde1618331e36 100644 (file)
@@ -1,8 +1,7 @@
 /*
    Bacula(R) - The Network Backup Solution
 
-   Copyright (C) 2000-2015 Kern Sibbald
-   Copyright (C) 2007-2014 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2017 Kern Sibbald
 
    The original author of Bacula is Kern Sibbald, with contributions
    from many others, a complete list can be found in the file AUTHORS.
@@ -12,7 +11,7 @@
    Public License, v3.0 ("AGPLv3") and some additional permissions and
    terms pursuant to its AGPLv3 Section 7.
 
-   This notice must be preserved when any source code is 
+   This notice must be preserved when any source code is
    conveyed and/or propagated.
 
    Bacula(R) is a registered trademark of Kern Sibbald.
@@ -21,7 +20,6 @@
  * Application Programming Interface (API) definition for Bacula Plugins
  *
  * Kern Sibbald, October 2007
- *
  */
 
 #ifndef __FD_PLUGINS_H
@@ -92,7 +90,7 @@ struct save_pkt {
    char *link;                        /* Link name if any */
    struct stat statp;                 /* System stat() packet for file */
    int32_t type;                      /* FT_xx for this file */
-   uint32_t flags;                    /* Bacula internal flags */
+   uint64_t flags;                     /* Bacula internal flags */
    bool no_read;                      /* During the save, the file should not be saved */
    bool portable;                     /* set if data format is portable */
    bool accurate_found;               /* Found in accurate list (valid after check_changes()) */
@@ -148,11 +146,26 @@ struct io_pkt {
    int32_t io_errno;                  /* errno code */
    int32_t lerror;                    /* Win32 error code */
    int32_t whence;                    /* lseek argument */
-   boffset_t offset;                  /* lseek argument */
+   boffset_t offset;                  /* lseek argument or in bread current offset*/
    bool win32;                        /* Win32 GetLastError returned */
    int32_t pkt_end;                   /* end packet sentinel */
 };
 
+enum {
+    BACL_BACKUP = 1,
+    BACL_RESTORE = 2,
+    BXATTR_BACKUP = 3,
+    BXATTR_RESTORE = 4
+};
+
+struct xacl_pkt {
+    int32_t pkt_size;                  /* Size of this packet */
+    int32_t func;                      /* Function code */
+    int32_t count;                     /* read/write count */
+    char *content;                     /* read/write buffer */
+    int32_t pkt_end;                   /* end packet sentinel */
+};
+
 /****************************************************************************
  *                                                                          *
  *                Bacula definitions                                        *
@@ -161,28 +174,30 @@ struct io_pkt {
 
 /* Bacula Variable Ids */
 typedef enum {
-  bVarJobId     = 1,
-  bVarFDName    = 2,
-  bVarLevel     = 3,
-  bVarType      = 4,
-  bVarClient    = 5,
-  bVarJobName   = 6,
-  bVarJobStatus = 7,
-  bVarSinceTime = 8,
-  bVarAccurate  = 9,
-  bVarFileSeen  = 10,
-  bVarVssObject = 11,
-  bVarVssDllHandle = 12,
-  bVarWorkingDir = 13,
-  bVarWhere      = 14,
-  bVarRegexWhere = 15,
-  bVarExePath    = 16,
-  bVarVersion    = 17,
-  bVarDistName   = 18,
-  bVarxxx        = 19,
-  bVarPrevJobName = 20,
-  bVarPrefixLinks = 21,
-  bVarInteractiveSession = 22
+  bVarJobId                 = 1,
+  bVarFDName                = 2,
+  bVarLevel                 = 3,
+  bVarType                  = 4,
+  bVarClient                = 5,
+  bVarJobName               = 6,
+  bVarJobStatus             = 7,
+  bVarSinceTime             = 8,
+  bVarAccurate              = 9,
+  bVarFileSeen              = 10,
+  bVarVssObject             = 11,
+  bVarVssDllHandle          = 12,
+  bVarWorkingDir            = 13,
+  bVarWhere                 = 14,
+  bVarRegexWhere            = 15,
+  bVarExePath               = 16,
+  bVarVersion               = 17,
+  bVarDistName              = 18,
+  bVarxxx                   = 19,
+  bVarPrevJobName           = 20,
+  bVarPrefixLinks           = 21,
+  bVarInteractiveSession    = 22,
+  bVarFileIndex             = 23,
+  bVarReplace               = 24
 } bVariable;
 
 /* Events that are passed to plugin */
@@ -244,6 +259,10 @@ int plugin_save(JCR *jcr, FF_PKT *ff_pkt, bool top_level);
 int plugin_estimate(JCR *jcr, FF_PKT *ff_pkt, bool top_level);
 bool plugin_check_file(JCR *jcr, char *fname);
 bRC plugin_option_handle_file(JCR *jcr, FF_PKT *ff_pkt, struct save_pkt *sp);
+int plugin_backup_acl(JCR *jcr, FF_PKT *ff_pkt, char **data);
+bool plugin_restore_acl(JCR *jcr, char *data, uint32_t length);
+int plugin_backup_xattr(JCR *jcr, FF_PKT *ff_pkt, char **data);
+bool plugin_restore_xattr(JCR *jcr, char *data, uint32_t length);
 #endif
 
 #ifdef __cplusplus
@@ -295,7 +314,7 @@ typedef enum {
 
 # define FD_PLUGIN_MAGIC  "*FDPluginData*"
 
-#define FD_PLUGIN_INTERFACE_VERSION  ( 13 )
+#define FD_PLUGIN_INTERFACE_VERSION  ( 14 )
 
 typedef struct s_pluginInfo {
    uint32_t size;
@@ -328,6 +347,7 @@ typedef struct s_pluginFuncs {
    bRC (*createFile)(bpContext *ctx, struct restore_pkt *rp);
    bRC (*setFileAttributes)(bpContext *ctx, struct restore_pkt *rp);
    bRC (*checkFile)(bpContext *ctx, char *fname);
+   bRC (*handleXACLdata)(bpContext *ctx, struct xacl_pkt *xacl);
 } pFuncs;
 
 #define plug_func(plugin) ((pFuncs *)(plugin->pfuncs))