| [221] | 1 | /*
|
|---|
| 2 | Unix SMB/Netbios implementation.
|
|---|
| 3 | SMB client library implementation
|
|---|
| 4 | Copyright (C) Andrew Tridgell 1998
|
|---|
| 5 | Copyright (C) Richard Sharpe 2000, 2002
|
|---|
| 6 | Copyright (C) John Terpstra 2000
|
|---|
| 7 | Copyright (C) Tom Jansen (Ninja ISD) 2002
|
|---|
| 8 | Copyright (C) Derrell Lipman 2003-2008
|
|---|
| 9 | Copyright (C) Jeremy Allison 2007, 2008
|
|---|
| 10 |
|
|---|
| 11 | This program is free software; you can redistribute it and/or modify
|
|---|
| 12 | it under the terms of the GNU General Public License as published by
|
|---|
| 13 | the Free Software Foundation; either version 3 of the License, or
|
|---|
| 14 | (at your option) any later version.
|
|---|
| 15 |
|
|---|
| 16 | This program is distributed in the hope that it will be useful,
|
|---|
| 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 19 | GNU General Public License for more details.
|
|---|
| 20 |
|
|---|
| 21 | You should have received a copy of the GNU General Public License
|
|---|
| 22 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 23 | */
|
|---|
| 24 |
|
|---|
| 25 | #include "includes.h"
|
|---|
| 26 | #define __LIBSMBCLIENT_INTERNAL__
|
|---|
| 27 | #include "libsmbclient.h"
|
|---|
| 28 | #include "libsmb_internal.h"
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 | /** Get the netbios name used for making connections */
|
|---|
| 32 | char *
|
|---|
| 33 | smbc_getNetbiosName(SMBCCTX *c)
|
|---|
| 34 | {
|
|---|
| 35 | return c->netbios_name;
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 | /** Set the netbios name used for making connections */
|
|---|
| 39 | void
|
|---|
| 40 | smbc_setNetbiosName(SMBCCTX *c, char * netbios_name)
|
|---|
| 41 | {
|
|---|
| [411] | 42 | SAFE_FREE(c->netbios_name);
|
|---|
| 43 | if (netbios_name) {
|
|---|
| 44 | c->netbios_name = SMB_STRDUP(netbios_name);
|
|---|
| 45 | }
|
|---|
| [221] | 46 | }
|
|---|
| 47 |
|
|---|
| 48 | /** Get the workgroup used for making connections */
|
|---|
| 49 | char *
|
|---|
| 50 | smbc_getWorkgroup(SMBCCTX *c)
|
|---|
| 51 | {
|
|---|
| 52 | return c->workgroup;
|
|---|
| 53 | }
|
|---|
| 54 |
|
|---|
| 55 | /** Set the workgroup used for making connections */
|
|---|
| 56 | void
|
|---|
| 57 | smbc_setWorkgroup(SMBCCTX *c, char * workgroup)
|
|---|
| 58 | {
|
|---|
| [411] | 59 | SAFE_FREE(c->workgroup);
|
|---|
| 60 | if (workgroup) {
|
|---|
| 61 | c->workgroup = SMB_STRDUP(workgroup);
|
|---|
| 62 | }
|
|---|
| [221] | 63 | }
|
|---|
| 64 |
|
|---|
| 65 | /** Get the username used for making connections */
|
|---|
| 66 | char *
|
|---|
| 67 | smbc_getUser(SMBCCTX *c)
|
|---|
| 68 | {
|
|---|
| 69 | return c->user;
|
|---|
| 70 | }
|
|---|
| 71 |
|
|---|
| 72 | /** Set the username used for making connections */
|
|---|
| 73 | void
|
|---|
| 74 | smbc_setUser(SMBCCTX *c, char * user)
|
|---|
| 75 | {
|
|---|
| [411] | |
|---|