File: smblib.h

package info (click to toggle)
squid3 3.4.8-6
  • links: PTS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 31,084 kB
  • sloc: cpp: 165,325; ansic: 21,998; sh: 12,166; makefile: 5,964; perl: 2,153; sql: 322; awk: 118
file content (124 lines) | stat: -rw-r--r-- 4,055 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/* UNIX SMBlib NetBIOS implementation

   Version 1.0
   SMBlib Defines

   Copyright (C) Richard Sharpe 1996

*/

/*
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef _SMBLIB_SMBLIB_H
#define _SMBLIB_SMBLIB_H

#include "std-defines.h"
#include "smblib-common.h"
#include "smblib/smbencrypt.h"

#ifdef __cplusplus
extern "C" {
#endif

    /* Just define all the entry points */

    /* Create a handle to allow us to set/override some parameters ...       */

    SMB_Handle_Type SMB_Create_Con_Handle(void);

    /* Connect to a server, but do not do a tree con etc ... */

    SMB_Handle_Type SMB_Connect_Server(SMB_Handle_Type Con_Handle,
                                       char *server,
                                       const char *NTdomain);

    /* Connect to a server and give us back a handle. If Con == NULL, create */
    /* The handle and populate it with defaults                              */

    SMB_Handle_Type SMB_Connect(SMB_Handle_Type Con_Handle,
                                SMB_Tree_Handle *tree,
                                char *service,
                                char *username,
                                char *password);

    int SMB_Init(void);

    int SMB_Logon_Server(SMB_Handle_Type Con_Handle,
                         char *UserName,
                         char *PassWord,
                         const char *NtDomain,
                         int PreCrypted);

    /* Negotiate a protocol                                                  */

    int SMB_Negotiate(SMB_Handle_Type Con_Handle, const char *Prots[]);

    /* Connect to a tree ...                                                 */

    SMB_Tree_Handle SMB_TreeConnect(SMB_Handle_Type con,
                                    SMB_Tree_Handle tree,
                                    const char *path,
                                    const char *password,
                                    const char *dev);

    /* Disconnect a tree ...                                                 */

    int SMB_TreeDisconect(void *tree_handle);

    /* Open a file                                                           */

    void *SMB_Open(void *tree_handle,
                   void *file_handle,
                   char *file_name,
                   unsigned short mode,
                   unsigned short search);

    /* Close a file                                                          */

    int SMB_Close(void *file_handle);

    /* Disconnect from server. Has flag to specify whether or not we keep the */
    /* handle.                                                                */

    int SMB_Discon(SMB_Handle_Type Con_Handle, BOOL KeepHandle);

    void *SMB_Create(void *Tree_Handle,
                     void *File_Handle,
                     char *file_name,
                     short search);

    int SMB_Delete(void *tree, char *file_name, short search);

    int SMB_Create_Dir(void *tree, char *dir_name);

    int SMB_Delete_Dir(void *tree, char *dir_name);

    int SMB_Check_Dir(void *tree, char *dir_name);

    int SMB_Get_Last_Error(void);

    int SMB_Get_Last_SMB_Err(void);

    void SMB_Get_Error_Msg(int msg, char *msgbuf, int len);

    void *SMB_Logon_And_TCon(void *con, void *tree, char *user, char *pass,
                             char *service, char *st);

#ifdef __cplusplus
}
#endif
#endif /* _SMBLIB_SMBLIB_H */