From 749f699f871831e9ad5b2a57e498a32f959d23c6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 12 Dec 2007 18:14:54 +0100 Subject: Build fixes for libnetapi. Guenther (This used to be commit 07d33557b95106ac57fdef8c767ab86192930a6d) --- source3/lib/netapi/netapi.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 source3/lib/netapi/netapi.h (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h new file mode 100644 index 0000000000..ad9fbe4209 --- /dev/null +++ b/source3/lib/netapi/netapi.h @@ -0,0 +1,26 @@ +/* + * Unix SMB/CIFS implementation. + * NetApi Support + * Copyright (C) Guenther Deschner 2007 + * + * 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 3 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, see . + */ + +struct libnetapi_ctx { + int debuglevel; +}; + +WERROR libnetapi_init(struct libnetapi_ctx **ctx); + +#include "joindomain.h" -- cgit From 7482a18c83d25b2d00e1086aafb33d9a0ff98309 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 12 Dec 2007 19:00:41 +0100 Subject: More minor libnetapi fixes. Guenther (This used to be commit 9f129c069f9feb357cbe1185058cfe3390609c09) --- source3/lib/netapi/netapi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index ad9fbe4209..ec629d56d9 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -22,5 +22,6 @@ struct libnetapi_ctx { }; WERROR libnetapi_init(struct libnetapi_ctx **ctx); +WERROR libnetapi_free(struct libnetapi_ctx *ctx); #include "joindomain.h" -- cgit From 41410c86cc698f997dd82a143fd92277060384b0 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 14 Dec 2007 12:22:20 +0100 Subject: Some libnet and netapi build fixes. Guenther (This used to be commit 1d47247283f7bc75291007be3fde72b1d3d95b99) --- source3/lib/netapi/netapi.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index ec629d56d9..0810ecb7bc 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -17,6 +17,9 @@ * along with this program; if not, see . */ +#ifndef __LIB_NETAPI_H__ +#define __LIB_NETAPI_H__ + struct libnetapi_ctx { int debuglevel; }; @@ -25,3 +28,5 @@ WERROR libnetapi_init(struct libnetapi_ctx **ctx); WERROR libnetapi_free(struct libnetapi_ctx *ctx); #include "joindomain.h" + +#endif -- cgit From 9dc0ac4637fdd05a95099c0a6a857c51ca811453 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 18 Dec 2007 02:15:49 +0100 Subject: Getting rid of external credentials in libnetapi. Guenther (This used to be commit c10481dba01a084b0f9c4265f3408a0ec9a8b646) --- source3/lib/netapi/netapi.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index 0810ecb7bc..0637570c3e 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -22,6 +22,9 @@ struct libnetapi_ctx { int debuglevel; + char *username; + char *workgroup; + char *password; }; WERROR libnetapi_init(struct libnetapi_ctx **ctx); -- cgit From 4dd84b351125cdd95c945d8820ffe078f7325988 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 18 Dec 2007 02:21:38 +0100 Subject: Define NET_API_STATUS to be just a uin32_t. Guenther (This used to be commit a42850926a26a4065a6126affc3754d291a2e178) --- source3/lib/netapi/netapi.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index 0637570c3e..7946cfb446 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -20,6 +20,8 @@ #ifndef __LIB_NETAPI_H__ #define __LIB_NETAPI_H__ +#define NET_API_STATUS uint32_t + struct libnetapi_ctx { int debuglevel; char *username; -- cgit From 3d853b8e7e975a3e1c07a125e775e3a597112912 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 18 Dec 2007 02:29:50 +0100 Subject: Move basic libnetapi functions to NET_API_STATUS. Guenther (This used to be commit 086c55005976b3173e915e465108214876aa5bd6) --- source3/lib/netapi/netapi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index 7946cfb446..3dfbc0cffb 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -29,8 +29,8 @@ struct libnetapi_ctx { char *password; }; -WERROR libnetapi_init(struct libnetapi_ctx **ctx); -WERROR libnetapi_free(struct libnetapi_ctx *ctx); +NET_API_STATUS libnetapi_init(struct libnetapi_ctx **ctx); +NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx); #include "joindomain.h" -- cgit From c9b44e0fc3750afb6e001baceffad8fa2f33ac4e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 18 Dec 2007 02:34:07 +0100 Subject: Add basic credential functions for libnetapi. Guenther (This used to be commit 7c38f706b5dc17f15708ac932c84d863a0cc713e) --- source3/lib/netapi/netapi.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index 3dfbc0cffb..d75299601f 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -31,6 +31,9 @@ struct libnetapi_ctx { NET_API_STATUS libnetapi_init(struct libnetapi_ctx **ctx); NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx); +NET_API_STATUS libnetapi_set_username(struct libnetapi_ctx *ctx, const char *username); +NET_API_STATUS libnetapi_set_password(struct libnetapi_ctx *ctx, const char *password); +NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx, const char *workgroup); #include "joindomain.h" -- cgit From d14ee1dc08c5c765b07bd472e47e34152db2f9d3 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 18 Dec 2007 02:43:22 +0100 Subject: Use full string based debug_parse_levels in libnetapi. Guenther (This used to be commit 78d8f0e41aa3db0060596a7b345c2f04261986e0) --- source3/lib/netapi/netapi.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index d75299601f..278922224d 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -23,7 +23,7 @@ #define NET_API_STATUS uint32_t struct libnetapi_ctx { - int debuglevel; + const char *debuglevel; char *username; char *workgroup; char *password; @@ -31,6 +31,8 @@ struct libnetapi_ctx { NET_API_STATUS libnetapi_init(struct libnetapi_ctx **ctx); NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx); +NET_API_STATUS libnetapi_set_debuglevel(struct libnetapi_ctx *ctx, const char *debuglevel); +NET_API_STATUS libnetapi_get_debuglevel(struct libnetapi_ctx *ctx, const char **debuglevel); NET_API_STATUS libnetapi_set_username(struct libnetapi_ctx *ctx, const char *username); NET_API_STATUS libnetapi_set_password(struct libnetapi_ctx *ctx, const char *password); NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx, const char *workgroup); -- cgit From fb2c13fe191212f5e782b398fa4dffa42bfba129 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 18 Dec 2007 02:47:01 +0100 Subject: Add static libnetapi_ctx. Guenther (This used to be commit 97449ea341539a709953a57869570cf13be0f44e) --- source3/lib/netapi/netapi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index 278922224d..0b25c93d5b 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -30,6 +30,7 @@ struct libnetapi_ctx { }; NET_API_STATUS libnetapi_init(struct libnetapi_ctx **ctx); +NET_API_STATUS libnetapi_getctx(struct libnetapi_ctx **ctx); NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx); NET_API_STATUS libnetapi_set_debuglevel(struct libnetapi_ctx *ctx, const char *debuglevel); NET_API_STATUS libnetapi_get_debuglevel(struct libnetapi_ctx *ctx, const char **debuglevel); -- cgit From af08d8be3063ada42637a4ae7437499b03457de2 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 19 Dec 2007 12:09:08 +0100 Subject: Add libnetapi_errstr(). Guenther (This used to be commit 465e61a3599a277366ada6ecda3a1e6ddb1f2490) --- source3/lib/netapi/netapi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index 0b25c93d5b..232d9c154f 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -37,6 +37,7 @@ NET_API_STATUS libnetapi_get_debuglevel(struct libnetapi_ctx *ctx, const char ** NET_API_STATUS libnetapi_set_username(struct libnetapi_ctx *ctx, const char *username); NET_API_STATUS libnetapi_set_password(struct libnetapi_ctx *ctx, const char *password); NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx, const char *workgroup); +const char *libnetapi_errstr(struct libnetapi_ctx *ctx, NET_API_STATUS status); #include "joindomain.h" -- cgit From 721d36df8372dd45430a93c99180bb94ec7d9773 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 19 Dec 2007 15:10:24 +0100 Subject: Add NetServerGetInfo and NetServerSetInfo (for level 1005). Guenther (This used to be commit 1cad549f54563c3a9787624ba7a56b54107ebd57) --- source3/lib/netapi/netapi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index 232d9c154f..a1137b45ee 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -40,5 +40,6 @@ NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx, const char *wo const char *libnetapi_errstr(struct libnetapi_ctx *ctx, NET_API_STATUS status); #include "joindomain.h" +#include "serverinfo.h" #endif -- cgit From 5479c50c37ee78037a96df8844fd06b1b0c9ccbb Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 20 Dec 2007 01:19:26 +0100 Subject: Merge all headers into libnetapi.h. Guenther (This used to be commit a2c5beda2ec98dea8951fb3a37774f5f325410ef) --- source3/lib/netapi/netapi.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index a1137b45ee..bbd2282a77 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -39,7 +39,27 @@ NET_API_STATUS libnetapi_set_password(struct libnetapi_ctx *ctx, const char *pas NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx, const char *workgroup); const char *libnetapi_errstr(struct libnetapi_ctx *ctx, NET_API_STATUS status); -#include "joindomain.h" -#include "serverinfo.h" +/* wkssvc */ +NET_API_STATUS NetJoinDomain(const char *server, + const char *domain, + const char *account_ou, + const char *account, + const char *password, + uint32_t join_options); +NET_API_STATUS NetUnjoinDomain(const char *server_name, + const char *account, + const char *password, + uint32_t unjoin_flags); +NET_API_STATUS NetGetJoinInformation(const char *server_name, + const char **name_buffer, + uint16_t *name_type); +/* srvsvc */ +NET_API_STATUS NetServerGetInfo(const char *server_name, + uint32_t level, + uint8_t **buffer); +NET_API_STATUS NetServerSetInfo(const char *server_name, + uint32_t level, + uint8_t *buffer, + uint32_t *parm_error); #endif -- cgit From eddd190921f2b322a227044a5c8067397f80c0f5 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 21 Dec 2007 15:51:00 +0100 Subject: Add basic remote NetGetDCName and NetGetAnyDCName versions to libnetapi. Guenther (This used to be commit 5bc49546a32abb4524133b9f2916cdd51d4eb462) --- source3/lib/netapi/netapi.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index bbd2282a77..0dd6d95ceb 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -62,4 +62,13 @@ NET_API_STATUS NetServerSetInfo(const char *server_name, uint32_t level, uint8_t *buffer, uint32_t *parm_error); + +/* netlogon */ +NET_API_STATUS NetGetDCName(const char *server_name, + const char *domain_name, + uint8_t **buffer); +NET_API_STATUS NetGetAnyDCName(const char *server_name, + const char *domain_name, + uint8_t **buffer); + #endif -- cgit