2 * Unix SMB/CIFS implementation.
4 * Copyright (C) Guenther Deschner 2008
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
22 void popt_common_callback(poptContext con
,
23 enum poptCallbackReason reason
,
24 const struct poptOption
*opt
,
25 const char *arg
, const void *data
);
27 extern struct poptOption popt_common_netapi_examples
[];
29 #define POPT_COMMON_LIBNETAPI_EXAMPLES { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_netapi_examples, 0, "Common samba netapi example options:", NULL },
32 #define POPT_TABLEEND { NULL, '\0', 0, 0, 0, NULL, NULL }
35 NET_API_STATUS
test_netuseradd(const char *hostname
,
36 const char *username
);
38 NET_API_STATUS
netapitest_localgroup(struct libnetapi_ctx
*ctx
,
39 const char *hostname
);
40 NET_API_STATUS
netapitest_user(struct libnetapi_ctx
*ctx
,
41 const char *hostname
);
42 NET_API_STATUS
netapitest_group(struct libnetapi_ctx
*ctx
,
43 const char *hostname
);
44 NET_API_STATUS
netapitest_display(struct libnetapi_ctx
*ctx
,
45 const char *hostname
);
46 NET_API_STATUS
netapitest_share(struct libnetapi_ctx
*ctx
,
47 const char *hostname
);
48 NET_API_STATUS
netapitest_file(struct libnetapi_ctx
*ctx
,
49 const char *hostname
);
50 NET_API_STATUS
netapitest_server(struct libnetapi_ctx
*ctx
,
51 const char *hostname
);
54 #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
57 #define NETAPI_STATUS(x,y,fn) \
58 printf("FAILURE: line %d: %s failed with status: %s (%d)\n", \
59 __LINE__, fn, libnetapi_get_error_string(x,y), y);
61 #define NETAPI_STATUS_MSG(x,y,fn,z) \
62 printf("FAILURE: line %d: %s failed with status: %s (%d), %s\n", \
63 __LINE__, fn, libnetapi_get_error_string(x,y), y, z);
65 #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))