smblib.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2019 The Squid Software Foundation and contributors
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 
9 /* UNIX SMBlib NetBIOS implementation
10 
11  Version 1.0
12  SMBlib Defines
13 
14  Copyright (C) Richard Sharpe 1996
15 */
16 
17 /*
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
35 
36 #include "smblib-common.h"
37 #include "smblib/smbencrypt.h"
38 #include "std-defines.h"
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /* Just define all the entry points */
45 
46 /* Create a handle to allow us to set/override some parameters ... */
47 
49 
50 /* Connect to a server, but do not do a tree con etc ... */
51 
53  const char *server,
54  const char *NTdomain);
55 
56 /* Connect to a server and give us back a handle. If Con == NULL, create */
57 /* The handle and populate it with defaults */
58 
60  SMB_Tree_Handle *tree,
61  char *service,
62  char *username,
63  char *password);
64 
65 int SMB_Init(void);
66 
67 int SMB_Logon_Server(SMB_Handle_Type Con_Handle,
68  char *UserName,
69  char *PassWord,
70  const char *NtDomain,
71  int PreCrypted);
72 
73 /* Negotiate a protocol */
74 
75 int SMB_Negotiate(SMB_Handle_Type Con_Handle, const char *Prots[]);
76 
77 /* Connect to a tree ... */
78 
80  SMB_Tree_Handle tree,
81  const char *path,
82  const char *password,
83  const char *dev);
84 
85 /* Disconnect a tree ... */
86 
87 int SMB_TreeDisconect(void *tree_handle);
88 
89 /* Open a file */
90 
91 void *SMB_Open(void *tree_handle,
92  void *file_handle,
93  char *file_name,
94  unsigned short mode,
95  unsigned short search);
96 
97 /* Close a file */
98 
99 int SMB_Close(void *file_handle);
100 
101 /* Disconnect from server. Has flag to specify whether or not we keep the */
102 /* handle. */
103 
104 int SMB_Discon(SMB_Handle_Type Con_Handle, BOOL KeepHandle);
105 
106 void *SMB_Create(void *Tree_Handle,
107  void *File_Handle,
108  char *file_name,
109  short search);
110 
111 int SMB_Delete(void *tree, char *file_name, short search);
112 
113 int SMB_Create_Dir(void *tree, char *dir_name);
114 
115 int SMB_Delete_Dir(void *tree, char *dir_name);
116 
117 int SMB_Check_Dir(void *tree, char *dir_name);
118 
119 int SMB_Get_Last_Error(void);
120 
121 int SMB_Get_Last_SMB_Err(void);
122 
123 void SMB_Get_Error_Msg(int msg, char *msgbuf, int len);
124 
125 void *SMB_Logon_And_TCon(void *con, void *tree, char *user, char *pass,
126  char *service, char *st);
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 #endif /* _SMBLIB_SMBLIB_H */
132 
int SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName, char *PassWord, const char *NtDomain, int PreCrypted)
Definition: smblib.c:332
SMB_Handle_Type SMB_Create_Con_Handle(void)
Definition: smblib.c:89
SMB_Handle_Type SMB_Connect(SMB_Handle_Type Con_Handle, SMB_Tree_Handle *tree, char *service, char *username, char *password)
Definition: smblib.c:197
SMB_Handle_Type SMB_Connect_Server(SMB_Handle_Type Con_Handle, const char *server, const char *NTdomain)
Definition: smblib.c:101
SMB_Tree_Handle SMB_TreeConnect(SMB_Handle_Type con, SMB_Tree_Handle tree, const char *path, const char *password, const char *dev)
Definition: smblib-util.c:477
void * SMB_Logon_And_TCon(void *con, void *tree, char *user, char *pass, char *service, char *st)
int SMB_Check_Dir(void *tree, char *dir_name)
void * SMB_Open(void *tree_handle, void *file_handle, char *file_name, unsigned short mode, unsigned short search)
#define BOOL
Definition: std-includes.h:38
int SMB_Discon(SMB_Handle_Type Con_Handle, BOOL KeepHandle)
Definition: smblib.c:577
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
int SMB_Delete_Dir(void *tree, char *dir_name)
static char server[MAXLINE]
int SMB_Get_Last_SMB_Err(void)
Definition: smblib-util.c:766
int SMB_Create_Dir(void *tree, char *dir_name)
int SMB_Init(void)
Definition: smblib.c:67
int SMB_Delete(void *tree, char *file_name, short search)
void SMB_Get_Error_Msg(int msg, char *msgbuf, int len)
Definition: smblib-util.c:798
int SMB_Negotiate(SMB_Handle_Type Con_Handle, const char *Prots[])
Definition: smblib-util.c:239
void * SMB_Create(void *Tree_Handle, void *File_Handle, char *file_name, short search)
int SMB_TreeDisconect(void *tree_handle)
int SMB_Close(void *file_handle)
int SMB_Get_Last_Error(void)
Definition: smblib-util.c:755

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors