smb_types.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*****************************************************************************
  2. * __________________ _________ _____ _____ .__ ._.
  3. * \______ \______ \ / _____/ / \ / _ \ |__| ____ | |
  4. * | | _/| | \ \_____ \ / \ / \ / /_\ \| _/ __ \ | |
  5. * | | \| ` \/ / Y \ / | | \ ___/ \|
  6. * |______ /_______ /_______ \____|__ / /\ \____|__ |__|\___ | __
  7. * \/ \/ \/ \/ )/ \/ \/ \/
  8. *
  9. * This file is part of liBDSM. Copyright © 2014-2015 VideoLabs SAS
  10. *
  11. * Author: Julien 'Lta' BALLET <contact@lta.io>
  12. *
  13. * liBDSM is released under LGPLv2.1 (or later) and is also available
  14. * under a commercial license.
  15. *****************************************************************************
  16. * This program is free software; you can redistribute it and/or modify it
  17. * under the terms of the GNU Lesser General Public License as published by
  18. * the Free Software Foundation; either version 2.1 of the License, or
  19. * (at your option) any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU Lesser General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Lesser General Public License
  27. * along with this program; if not, write to the Free Software Foundation,
  28. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  29. *****************************************************************************/
  30. /**
  31. * @file smb_types.h
  32. * @brief liBDSM types and structures
  33. */
  34. #ifndef __BDSM_SMB_TYPES_H_
  35. #define __BDSM_SMB_TYPES_H_
  36. #include <stddef.h>
  37. #include <stdint.h>
  38. #define _FILE_OFFSET_BITS 64
  39. #include <libtasn1.h>
  40. #if defined(__ANDROID__)
  41. # undef off_t
  42. # define off_t off64_t
  43. #endif
  44. /**
  45. * @struct smb_tid
  46. * @brief The id of a connection to a share within a session.
  47. */
  48. typedef uint16_t smb_tid;
  49. /**
  50. * @struct smb_fid
  51. * @brief The id of a file within a share within a session.
  52. */
  53. typedef uint16_t smb_fid;
  54. // Concatenation of the two above, representing a file inside of a session
  55. // First 4 bytes are the TreeID (smb_tid), last 4 are the File ID (FUID)
  56. // A map between smb_fd and smb_file is maintained inside each session
  57. /** @struct smb_fd
  58. * @brief SMB File descriptor, represents a file within a session.
  59. */
  60. typedef uint32_t smb_fd;
  61. // An structure to store user credentials;
  62. // login:password@domain (also DOMAIN\login)
  63. typedef struct
  64. {
  65. char *domain;
  66. char *login;
  67. char *password;
  68. } smb_creds;
  69. /**
  70. * @brief An opaque data structure to represent a SMB Session.
  71. */
  72. typedef struct smb_session smb_session;
  73. /**
  74. * @struct smb_share_list
  75. * @brief An opaque object representing the list of share of a SMB file server.
  76. */
  77. typedef char **smb_share_list;
  78. /**
  79. * @brief An opaque data structure to represent file
  80. */
  81. typedef struct smb_file smb_file;
  82. /**
  83. * @struct smb_stat_list
  84. * @brief An opaque structure containing a list of file status
  85. */
  86. typedef smb_file *smb_stat_list;
  87. /**
  88. * @struct smb_stat
  89. * @brief An opaque structure containing info about a file
  90. */
  91. typedef smb_file *smb_stat;
  92. #endif