~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to lib/include/hgfsProto.h

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
   HGFS_OP_DESTROY_SESSION_V4,    /* Destroy/close session. */
127
127
   HGFS_OP_READ_FAST_V4,          /* Read */
128
128
   HGFS_OP_WRITE_FAST_V4,         /* Write */
 
129
   HGFS_OP_SET_WATCH_V4,          /* Start monitoring directory changes. */
 
130
   HGFS_OP_REMOVE_WATCH_V4,       /* Stop monitoring directory changes. */
 
131
   HGFS_OP_NOTIFY_V4,             /* Notification for a directory change event. */
129
132
   HGFS_OP_OPEN_V4,               /* Open file */
130
133
   HGFS_OP_DIRECTORY_READ_V4,     /* Read directory entries. */
131
134
   HGFS_OP_ENUMERATE_STREAMS_V4,  /* Enumerate alternative named streams for a file. */
143
146
   HGFS_OP_UNLOCK_BYTE_RANGE_V4,  /* Release byte range lock. */
144
147
   HGFS_OP_QUERY_EAS_V4,          /* Query extended attributes. */
145
148
   HGFS_OP_SET_EAS_V4,            /* Add or modify extended attributes. */
146
 
   HGFS_OP_SET_WATCH_V4,          /* Start monitoring directory changes. */
147
 
   HGFS_OP_REMOVE_WATCH_V4,       /* Stop monitoring directory changes. */
148
 
   HGFS_OP_NOTIFY_V4,             /* Notification for a directory change event. */
149
149
 
150
150
   HGFS_OP_MAX,                   /* Dummy op, must be last in enum */
151
151
} HgfsOp;
1811
1811
 */
1812
1812
typedef
1813
1813
#include "vmware_pack_begin.h"
1814
 
struct HgfsRequestSetWatch {
 
1814
struct HgfsRequestSetWatchV4 {
1815
1815
    uint64 events;             /* What events to watch? */
1816
1816
    uint32 flags;              /* Flags. */
1817
1817
    uint64 reserved;           /* Reserved for future use. */
1818
1818
    HgfsFileNameV3 fileName;   /* Filename to watch. */
1819
1819
}
1820
1820
#include "vmware_pack_end.h"
1821
 
HgfsRequestSetWatch;
 
1821
HgfsRequestSetWatchV4;
1822
1822
 
1823
1823
/*
1824
1824
 *  Coarse grain notification event types.
1831
1831
/*
1832
1832
 * Fine grain notification event types.
1833
1833
 * HgfsRequestSetWatch events.
1834
 
 * Events marked with (*) apply only to directories.
1835
1834
 */
1836
 
#define HGFS_NOTIFY_ACCESS        (1 << 0)    /* File accessed (read) */
1837
 
#define HGFS_NOTIFY_ATTRIB        (1 << 1)    /* Windows file attributes changed. */
1838
 
#define HGFS_NOTIFY_SIZE          (1 << 2)    /* File size changed. */
1839
 
#define HGFS_NOTIFY_ATIME         (1 << 3)    /* Access time changed. */
1840
 
#define HGFS_NOTIFY_MTIME         (1 << 4)    /* Modification time changed. */
1841
 
#define HGFS_NOTIFY_CTIME         (1 << 5)    /* Attribute change time changed. */
1842
 
#define HGFS_NOTIFY_CRTIME        (1 << 6)    /* Creation time changed. */
1843
 
#define HGFS_NOTIFY_NAME          (1 << 7)    /* File / Directory name changed. */
1844
 
#define HGFS_NOTIFY_OPEN          (1 << 8)    /* File opened */
1845
 
#define HGFS_NOTIFY_CLOSE_WRITE   (1 << 9)    /* File opened for writing closed */
1846
 
#define HGFS_NOTIFY_CLOSE_NOWRITE (1 << 10)   /* File opened for reading closed */
1847
 
#define HGFS_NOTIFY_CREATE        (1 << 11)   /* File / directory created */
1848
 
#define HGFS_NOTIFY_DELETE        (1 << 12)   /* (*) File / directory deleted */
1849
 
#define HGFS_NOTIFY_DELETE_SELF   (1 << 13)   /* Watched file / directory deleted */
1850
 
#define HGFS_NOTIFY_MODIFY        (1 << 14)   /* File or directory modified. */
1851
 
#define HGFS_NOTIFY_MOVE_SELF     (1 << 15)   /* Watched file / directory moved. */
1852
 
#define HGFS_NOTIFY_MOVE_FROM     (1 << 16)   /* (*) Moved out of watched directory. */
1853
 
#define HGFS_NOTIFY_MOVE_TO       (1 << 17)   /* (*) Moved into watched directory. */
1854
 
#define HGFS_NOTIFY_RENAME        (1 << 18)   /* File / directory name changed. */
 
1835
#define HGFS_NOTIFY_ACCESS                   (1 << 0)    /* File accessed (read) */
 
1836
#define HGFS_NOTIFY_ATTRIB                   (1 << 1)    /* File attributes changed. */
 
1837
#define HGFS_NOTIFY_SIZE                     (1 << 2)    /* File size changed. */
 
1838
#define HGFS_NOTIFY_ATIME                    (1 << 3)    /* Access time changed. */
 
1839
#define HGFS_NOTIFY_MTIME                    (1 << 4)    /* Modification time changed. */
 
1840
#define HGFS_NOTIFY_CTIME                    (1 << 5)    /* Attribute time changed. */
 
1841
#define HGFS_NOTIFY_CRTIME                   (1 << 6)    /* Creation time changed. */
 
1842
#define HGFS_NOTIFY_NAME                     (1 << 7)    /* File / Directory name. */
 
1843
#define HGFS_NOTIFY_OPEN                     (1 << 8)    /* File opened */
 
1844
#define HGFS_NOTIFY_CLOSE_WRITE              (1 << 9)    /* Modified file closed. */
 
1845
#define HGFS_NOTIFY_CLOSE_NOWRITE            (1 << 10)   /* Non-modified file closed. */
 
1846
#define HGFS_NOTIFY_CREATE_FILE              (1 << 11)   /* File created */
 
1847
#define HGFS_NOTIFY_CREATE_DIR               (1 << 12)   /* Directory created */
 
1848
#define HGFS_NOTIFY_DELETE_FILE              (1 << 13)   /* File deleted */
 
1849
#define HGFS_NOTIFY_DELETE_DIR               (1 << 14)   /* Directory deleted */
 
1850
#define HGFS_NOTIFY_DELETE_SELF              (1 << 15)   /* Watched directory deleted */
 
1851
#define HGFS_NOTIFY_MODIFY                   (1 << 16)   /* File modified. */
 
1852
#define HGFS_NOTIFY_MOVE_SELF                (1 << 17)   /* Watched directory moved. */
 
1853
#define HGFS_NOTIFY_OLD_FILE_NAME            (1 << 18)   /* Rename: old file name. */
 
1854
#define HGFS_NOTIFY_NEW_FILE_NAME            (1 << 19)   /* Rename: new file name. */
 
1855
#define HGFS_NOTIFY_OLD_DIR_NAME             (1 << 20)   /* Rename: old dir name. */
 
1856
#define HGFS_NOTIFY_NEW_DIR_NAME             (1 << 21)   /* Rename: new dir name. */
 
1857
#define HGFS_NOTIFY_CHANGE_EA                (1 << 22)   /* Extended attributes. */
 
1858
#define HGFS_NOTIFY_CHANGE_SECURITY          (1 << 23)   /* Security/permissions. */
 
1859
#define HGFS_NOTIFY_ADD_STREAM               (1 << 24)   /* Named stream created. */
 
1860
#define HGFS_NOTIFY_DELETE_STREAM            (1 << 25)   /* Named stream deleted. */
 
1861
#define HGFS_NOTIFY_CHANGE_STREAM_SIZE       (1 << 26)   /* Named stream size changed. */
 
1862
#define HGFS_NOTIFY_CHANGE_STREAM_LAST_WRITE (1 << 27)   /* Stream timestamp changed. */
 
1863
#define HGFS_NOTIFY_WATCH_DELETED            (1 << 28)   /* Dir with watch deleted. */
 
1864
#define HGFS_NOTIFY_EVENTS_DROPPED           (1 << 29)   /* Notifications dropped. */
1855
1865
 
1856
1866
/* HgfsRequestSetWatch flags. */
1857
1867
#define HGFS_NOTIFY_FLAG_WATCH_TREE  (1 << 0)    /* Watch the entire directory tree. */
1864
1874
                                                  * set.
1865
1875
                                                  */
1866
1876
 
1867
 
typedef
1868
 
#include "vmware_pack_begin.h"
1869
 
struct HgfsReplySetWatch {
1870
 
    HgfsHandle watchId;    /* Watch identifier for subsequent references. */
1871
 
    uint64 reserved;       /* Reserved for future use. */
1872
 
}
1873
 
#include "vmware_pack_end.h"
1874
 
HgfsReplySetWatch;
1875
 
 
1876
 
typedef
1877
 
#include "vmware_pack_begin.h"
1878
 
struct HgfsRequestRemoveWatch {
1879
 
    HgfsHandle watchId;    /* Watch identifier to remove. */
1880
 
}
1881
 
#include "vmware_pack_end.h"
1882
 
HgfsRequestRemoveWatch;
1883
 
 
1884
 
typedef
1885
 
#include "vmware_pack_begin.h"
1886
 
struct HgfsReplyRemoveWatch {
1887
 
    uint64 reserved;       /* Reserved for future use. */
1888
 
}
1889
 
#include "vmware_pack_end.h"
1890
 
HgfsReplyRemoveWatch;
1891
 
 
1892
 
typedef
1893
 
#include "vmware_pack_begin.h"
1894
 
struct HgfsNotifyEvent {
 
1877
typedef uint64 HgfsSubscriberHandle;
 
1878
#define HGFS_INVALID_SUBSCRIBER_HANDLE         ((HgfsSubscriberHandle)~((HgfsSubscriberHandle)0))
 
1879
 
 
1880
typedef
 
1881
#include "vmware_pack_begin.h"
 
1882
struct HgfsReplySetWatchV4 {
 
1883
    HgfsSubscriberHandle watchId; /* Watch identifier for subsequent references. */
 
1884
    uint64 reserved;              /* Reserved for future use. */
 
1885
}
 
1886
#include "vmware_pack_end.h"
 
1887
HgfsReplySetWatchV4;
 
1888
 
 
1889
typedef
 
1890
#include "vmware_pack_begin.h"
 
1891
struct HgfsRequestRemoveWatchV4 {
 
1892
    HgfsSubscriberHandle watchId;  /* Watch identifier to remove. */
 
1893
}
 
1894
#include "vmware_pack_end.h"
 
1895
HgfsRequestRemoveWatchV4;
 
1896
 
 
1897
typedef
 
1898
#include "vmware_pack_begin.h"
 
1899
struct HgfsReplyRemoveWatchV4 {
 
1900
    uint64 reserved;       /* Reserved for future use. */
 
1901
}
 
1902
#include "vmware_pack_end.h"
 
1903
HgfsReplyRemoveWatchV4;
 
1904
 
 
1905
typedef
 
1906
#include "vmware_pack_begin.h"
 
1907
struct HgfsNotifyEventV4 {
1895
1908
   uint32 nextOffset;        /* Offset of next event; 0 if it i sthe last one. */
1896
1909
   uint64 mask;              /* Event occurred. */
1897
1910
   uint64 reserved;          /* Reserved for future use. */
1898
1911
   HgfsFileName fileName;    /* Filename. */
1899
 
   HgfsFileName oldName;     /* New filename for rename operation. */
1900
1912
}
1901
1913
#include "vmware_pack_end.h"
1902
 
HgfsNotifyEvent;
 
1914
HgfsNotifyEventV4;
1903
1915
 
1904
1916
/* Too many events, some or all event were dropped by the server. */
1905
1917
#define HGFS_NOTIFY_FLAG_OVERFLOW          (1 << 0)
1910
1922
 
1911
1923
typedef
1912
1924
#include "vmware_pack_begin.h"
1913
 
struct HgfsRequestNotify {
1914
 
   HgfsHandle watchId;         /* Watch identifier. */
1915
 
   uint32 flags;               /* Various flags. */
1916
 
   uint32 count;               /* Number of events occured. */
1917
 
   uint64 reserved;            /* Reserved for future use. */
1918
 
   HgfsNotifyEvent events[1];  /* Events. HgfsNotifyEvent(s). */
 
1925
struct HgfsRequestNotifyV4 {
 
1926
   HgfsSubscriberHandle watchId; /* Watch identifier. */
 
1927
   uint32 flags;                 /* Various flags. */
 
1928
   uint32 count;                 /* Number of events occured. */
 
1929
   uint64 reserved;              /* Reserved for future use. */
 
1930
   HgfsNotifyEventV4 events[1];  /* Events. HgfsNotifyEvent(s). */
1919
1931
}
1920
1932
#include "vmware_pack_end.h"
1921
 
HgfsRequestNotify;
 
1933
HgfsRequestNotifyV4;
1922
1934
 
1923
1935
// Query EA flags values.
1924
1936
#define HGFS_QUERY_EA_INDEX_SPECIFIED (1 << 0)
1927
1939
 
1928
1940
typedef
1929
1941
#include "vmware_pack_begin.h"
1930
 
struct HgfsRequestQueryEA {
 
1942
struct HgfsRequestQueryEAV4 {
1931
1943
   uint32 flags;                 /* EA flags. */
1932
1944
   uint32 index;
1933
1945
   uint64 reserved;              /* Reserved for future use. */
1940
1952
                                  */
1941
1953
}
1942
1954
#include "vmware_pack_end.h"
1943
 
HgfsRequestQueryEA;
 
1955
HgfsRequestQueryEAV4;
1944
1956
 
1945
1957
typedef
1946
1958
#include "vmware_pack_begin.h"
1947
 
struct HgfsReplyQueryEA {
 
1959
struct HgfsReplyQueryEAV4 {
1948
1960
   uint32 nextOffset;            /* Offset of the next structure when more then
1949
1961
                                  * one record is returned.
1950
1962
                                  */
1955
1967
   char eaData[1];               /* NULL termianed EA name followed by EA value. */
1956
1968
}
1957
1969
#include "vmware_pack_end.h"
1958
 
HgfsReplyQueryEA;
 
1970
HgfsReplyQueryEAV4;
1959
1971
 
1960
1972
 
1961
1973
typedef
1962
1974
#include "vmware_pack_begin.h"
1963
 
struct HgfsEA {
 
1975
struct HgfsEAV4 {
1964
1976
   uint32 nextOffset;      /* Offset of the next structure in the chain. */
1965
1977
   uint32 valueLength;     /* EA value length. */
1966
1978
   char data[1];           /* NULL terminated EA name followed by EA value. */
1967
1979
}
1968
1980
#include "vmware_pack_end.h"
1969
 
HgfsEA;
1970
 
 
1971
 
typedef
1972
 
#include "vmware_pack_begin.h"
1973
 
struct HgfsRequestSetEA {
1974
 
   uint32 flags;           /* Flags, see below. */
1975
 
   uint64 reserved;        /* Reserved for future use. */
1976
 
   uint32 numEAs;          /* Number of EAs in this request. */
1977
 
   HgfsEA attributes[1];   /* Array of attributes. */
1978
 
}
1979
 
#include "vmware_pack_end.h"
1980
 
HgfsRequestSetEA;
1981
 
 
1982
 
typedef
1983
 
#include "vmware_pack_begin.h"
1984
 
struct HgfsReplySetEA {
1985
 
   uint64 reserved;        /* Reserved for future use. */
1986
 
}
1987
 
#include "vmware_pack_end.h"
1988
 
HgfsReplySetEA;
 
1981
HgfsEAV4;
 
1982
 
 
1983
typedef
 
1984
#include "vmware_pack_begin.h"
 
1985
struct HgfsRequestSetEAV4 {
 
1986
   uint32   flags;           /* Flags, see below. */
 
1987
   uint64   reserved;        /* Reserved for future use. */
 
1988
   uint32   numEAs;          /* Number of EAs in this request. */
 
1989
   HgfsEAV4 attributes[1];   /* Array of attributes. */
 
1990
}
 
1991
#include "vmware_pack_end.h"
 
1992
HgfsRequestSetEAV4;
 
1993
 
 
1994
typedef
 
1995
#include "vmware_pack_begin.h"
 
1996
struct HgfsReplySetEAV4 {
 
1997
   uint64 reserved;        /* Reserved for future use. */
 
1998
}
 
1999
#include "vmware_pack_end.h"
 
2000
HgfsReplySetEAV4;
1989
2001
 
1990
2002
/*
1991
2003
 * EA Flags. When both flags are set EA is either created or replaced if it exists.
2007
2019
 
2008
2020
typedef
2009
2021
#include "vmware_pack_begin.h"
2010
 
struct HgfsRequestLockRange {
 
2022
struct HgfsRequestLockRangeV4 {
2011
2023
   HgfsHandle     fid;          /* File to take lock on. */
2012
2024
   uint32 flags;                /* Various flags. */
2013
2025
   uint64 start;                /* Starting offset in the file. */
2015
2027
   uint64 reserved;             /* Reserved for future use. */
2016
2028
}
2017
2029
#include "vmware_pack_end.h"
2018
 
HgfsRequestLockRange;
 
2030
HgfsRequestLockRangeV4;
2019
2031
 
2020
2032
typedef
2021
2033
#include "vmware_pack_begin.h"
2022
 
struct HgfsReplyLockRange {
 
2034
struct HgfsReplyLockRangeV4 {
2023
2035
   uint64 reserved;             /* Reserved for future use. */
2024
2036
}
2025
2037
#include "vmware_pack_end.h"
2026
 
HgfsReplyLockRange;
 
2038
HgfsReplyLockRangeV4;
2027
2039
 
2028
2040
#define HGFS_RANGE_LOCK_UNLOCK_ALL               (1 << 0)
2029
2041
 
2030
2042
typedef
2031
2043
#include "vmware_pack_begin.h"
2032
 
struct HgfsRequestUnlockRange {
 
2044
struct HgfsRequestUnlockRangeV4 {
2033
2045
   HgfsHandle     fid;          /* File to take lock on. */
2034
2046
   uint32 flags;                /* Various flags. */
2035
2047
   uint64 start;                /* Starting offset in the file. */
2036
2048
   uint64 length;               /* Number of bytes to lock. */
 
2049
   uint64 reserved;             /* Reserved for future use. */
2037
2050
}
2038
2051
#include "vmware_pack_end.h"
2039
 
HgfsRequestUnlockRange;
 
2052
HgfsRequestUnlockRangeV4;
2040
2053
 
2041
2054
typedef
2042
2055
#include "vmware_pack_begin.h"
2043
 
struct HgfsReplyUnlockRange {
 
2056
struct HgfsReplyUnlockRangeV4 {
2044
2057
   uint64 reserved;             /* Reserved for future use. */
2045
2058
}
2046
2059
#include "vmware_pack_end.h"
2047
 
HgfsReplyUnlockRange;
 
2060
HgfsReplyUnlockRangeV4;
2048
2061
 
2049
2062
/*
2050
2063
 * There are three types of oplocks: level 1, batch, and level 2. Both the level 1 and
2294
2307
    * If the host file system does not support EA server should fail the request rather
2295
2308
    * then succeeding and silently dropping EA.
2296
2309
    */
2297
 
   HgfsRequestSetEA extendedAttributes;
 
2310
   HgfsRequestSetEAV4 extendedAttributes;
2298
2311
   uint32 aclLength;               /* Length of the acl field. */
2299
2312
   char acl[1];                    /* Multi-platform ACL as defined in RFC 3530. */
2300
2313
}
2484
2497
   uint32 numberEntriesReturned;
2485
2498
   uint32 offsetToContinue;
2486
2499
   HgfsDirectoryReadMaskV4 mask; /* Returned mask that may be a subset of requested mask. */
 
2500
   uint64 reserved;              /* Reserved for future use. */
2487
2501
   HgfsDirectoryEntryV4 entries[1];
2488
2502
}
2489
2503
#include "vmware_pack_end.h"
2513
2527
 
2514
2528
typedef
2515
2529
#include "vmware_pack_begin.h"
2516
 
struct HgfsRequestGetAttrV4 {
 
2530
struct HgfsReplyEnumerateStreamsV4 {
 
2531
   uint32 numberEntriesReturned;
 
2532
   uint32 offsetToContinue;
 
2533
   uint64 reserved;
 
2534
   HgfsRequestStreamEntryV4 entries[1];
 
2535
}
 
2536
#include "vmware_pack_end.h"
 
2537
HgfsReplyEnumerateStreamsV4;
 
2538
 
 
2539
typedef
 
2540
#include "vmware_pack_begin.h"
 
2541
struct HgfsRequestGetattrV4 {
2517
2542
   uint32 mask;
2518
2543
   uint32 flags;
 
2544
   uint64 reserved;
2519
2545
   HgfsFileNameV3 name;
2520
2546
}
2521
2547
#include "vmware_pack_end.h"
2522
 
HgfsRequestGetAttrV4;
 
2548
HgfsRequestGetattrV4;
2523
2549
 
2524
2550
/*
2525
2551
 * V4 reports different file size for symlinks then V3 or V2.
2547
2573
   HgfsFileName shortName;
2548
2574
   HgfsFileName symlinkTarget;
2549
2575
   uint32 aclLength;
 
2576
   uint64 reserved;
2550
2577
   char acl[1];
2551
2578
}
2552
2579
#include "vmware_pack_end.h"
2554
2581
 
2555
2582
typedef
2556
2583
#include "vmware_pack_begin.h"
2557
 
struct HgfsReplyGetAttrV4 {
 
2584
struct HgfsReplyGetattrV4 {
2558
2585
   HgfsAttrV4 attr;
2559
2586
}
2560
2587
#include "vmware_pack_end.h"
2561
 
HgfsReplyGetAttrV4;
2562
 
 
2563
 
typedef
2564
 
#include "vmware_pack_begin.h"
2565
 
struct HgfsReplySetAttrV4 {
 
2588
HgfsReplyGetattrV4;
 
2589
 
 
2590
typedef
 
2591
#include "vmware_pack_begin.h"
 
2592
struct HgfsRequestSetattrV4 {
 
2593
   HgfsAttrHint hints;
 
2594
   HgfsAttrV2 attr;
 
2595
   uint64 reserved;          /* Reserved for future use */
 
2596
   HgfsFileNameV3 fileName;  /* Filename used when file handle invalid. */
 
2597
}
 
2598
#include "vmware_pack_end.h"
 
2599
HgfsRequestSetattrV4;
 
2600
 
 
2601
typedef
 
2602
#include "vmware_pack_begin.h"
 
2603
struct HgfsReplySetattrV4 {
2566
2604
   uint32 mask;                      /* Defines which attributes were set. */
2567
2605
}
2568
2606
#include "vmware_pack_end.h"
2569
 
HgfsReplySetAttrV4;
 
2607
HgfsReplySetattrV4;
2570
2608
 
2571
2609
/*
2572
2610
 * Unlike V3 deletion this command can be used to delete both files and directories.