]>
Commit | Line | Data |
---|---|---|
04e4e140 | 1 | /* |
f70aedc4 | 2 | * Copyright (C) 1996-2021 The Squid Software Foundation and contributors |
04e4e140 AJ |
3 | * |
4 | * Squid software is distributed under GPLv2+ license and includes | |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
7 | */ | |
8 | ||
94439e4e | 9 | /* UNIX SMBlib NetBIOS implementation |
7c16470c AJ |
10 | |
11 | Version 1.0 | |
12 | SMBlib Defines | |
13 | ||
14 | Copyright (C) Richard Sharpe 1996 | |
7c16470c | 15 | */ |
94439e4e | 16 | |
17 | /* | |
7c16470c AJ |
18 | This program is free software; you can redistribute it and/or modify |
19 | it under the terms of the GNU General Public License as published by | |
20 | the Free Software Foundation; either version 2 of the License, or | |
21 | (at your option) any later version. | |
22 | ||
23 | This program is distributed in the hope that it will be useful, | |
24 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
26 | GNU General Public License for more details. | |
27 | ||
28 | You should have received a copy of the GNU General Public License | |
29 | along with this program; if not, write to the Free Software | |
30 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
31 | */ | |
32 | ||
33 | #ifndef _SMBLIB_SMBLIB_H | |
34 | #define _SMBLIB_SMBLIB_H | |
94439e4e | 35 | |
94439e4e | 36 | #include "smblib-common.h" |
7c16470c | 37 | #include "smblib/smbencrypt.h" |
602d9612 | 38 | #include "std-defines.h" |
7c16470c AJ |
39 | |
40 | #ifdef __cplusplus | |
41 | extern "C" { | |
42 | #endif | |
94439e4e | 43 | |
f53969cc | 44 | /* Just define all the entry points */ |
94439e4e | 45 | |
f53969cc | 46 | /* Create a handle to allow us to set/override some parameters ... */ |
94439e4e | 47 | |
f53969cc | 48 | SMB_Handle_Type SMB_Create_Con_Handle(void); |
94439e4e | 49 | |
f53969cc | 50 | /* Connect to a server, but do not do a tree con etc ... */ |
94439e4e | 51 | |
f53969cc | 52 | SMB_Handle_Type SMB_Connect_Server(SMB_Handle_Type Con_Handle, |
44ad873e | 53 | const char *server, |
f53969cc | 54 | const char *NTdomain); |
94439e4e | 55 | |
f53969cc SM |
56 | /* Connect to a server and give us back a handle. If Con == NULL, create */ |
57 | /* The handle and populate it with defaults */ | |
94439e4e | 58 | |
f53969cc SM |
59 | SMB_Handle_Type SMB_Connect(SMB_Handle_Type Con_Handle, |
60 | SMB_Tree_Handle *tree, | |
61 | char *service, | |
62 | char *username, | |
63 | char *password); | |
94439e4e | 64 | |
f53969cc | 65 | int SMB_Init(void); |
7c16470c | 66 | |
f53969cc SM |
67 | int SMB_Logon_Server(SMB_Handle_Type Con_Handle, |
68 | char *UserName, | |
69 | char *PassWord, | |
70 | const char *NtDomain, | |
71 | int PreCrypted); | |
7c16470c | 72 | |
f53969cc | 73 | /* Negotiate a protocol */ |
94439e4e | 74 | |
f53969cc | 75 | int SMB_Negotiate(SMB_Handle_Type Con_Handle, const char *Prots[]); |
94439e4e | 76 | |
f53969cc | 77 | /* Connect to a tree ... */ |
94439e4e | 78 | |
f53969cc SM |
79 | SMB_Tree_Handle SMB_TreeConnect(SMB_Handle_Type con, |
80 | SMB_Tree_Handle tree, | |
81 | const char *path, | |
82 | const char *password, | |
83 | const char *dev); | |
94439e4e | 84 | |
f53969cc | 85 | /* Disconnect a tree ... */ |
94439e4e | 86 | |
f53969cc | 87 | int SMB_TreeDisconect(void *tree_handle); |
94439e4e | 88 | |
f53969cc | 89 | /* Open a file */ |
94439e4e | 90 | |
f53969cc SM |
91 | void *SMB_Open(void *tree_handle, |
92 | void *file_handle, | |
93 | char *file_name, | |
94 | unsigned short mode, | |
95 | unsigned short search); | |
94439e4e | 96 | |
f53969cc | 97 | /* Close a file */ |
94439e4e | 98 | |
f53969cc | 99 | int SMB_Close(void *file_handle); |
94439e4e | 100 | |
f53969cc SM |
101 | /* Disconnect from server. Has flag to specify whether or not we keep the */ |
102 | /* handle. */ | |
94439e4e | 103 | |
f53969cc | 104 | int SMB_Discon(SMB_Handle_Type Con_Handle, BOOL KeepHandle); |
94439e4e | 105 | |
f53969cc SM |
106 | void *SMB_Create(void *Tree_Handle, |
107 | void *File_Handle, | |
108 | char *file_name, | |
109 | short search); | |
94439e4e | 110 | |
f53969cc | 111 | int SMB_Delete(void *tree, char *file_name, short search); |
94439e4e | 112 | |
f53969cc | 113 | int SMB_Create_Dir(void *tree, char *dir_name); |
94439e4e | 114 | |
f53969cc | 115 | int SMB_Delete_Dir(void *tree, char *dir_name); |
94439e4e | 116 | |
f53969cc | 117 | int SMB_Check_Dir(void *tree, char *dir_name); |
94439e4e | 118 | |
f53969cc | 119 | int SMB_Get_Last_Error(void); |
94439e4e | 120 | |
f53969cc | 121 | int SMB_Get_Last_SMB_Err(void); |
94439e4e | 122 | |
f53969cc | 123 | void SMB_Get_Error_Msg(int msg, char *msgbuf, int len); |
94439e4e | 124 | |
f53969cc SM |
125 | void *SMB_Logon_And_TCon(void *con, void *tree, char *user, char *pass, |
126 | char *service, char *st); | |
c06f9773 | 127 | |
7c16470c AJ |
128 | #ifdef __cplusplus |
129 | } | |
130 | #endif | |
131 | #endif /* _SMBLIB_SMBLIB_H */ | |
f53969cc | 132 |