mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
s4-messaging Rename messaging -> imessaging
This avoid symbol and structure conflicts between Samba3 and Samba4, and chooses a less generic name. Andrew Bartlett
This commit is contained in:
parent
7261a9b9f7
commit
cdd802af83
@ -109,7 +109,7 @@ struct auth_context {
|
|||||||
struct tevent_context *event_ctx;
|
struct tevent_context *event_ctx;
|
||||||
|
|
||||||
/* the messaging context which can be used by backends */
|
/* the messaging context which can be used by backends */
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
|
|
||||||
/* loadparm context */
|
/* loadparm context */
|
||||||
struct loadparm_context *lp_ctx;
|
struct loadparm_context *lp_ctx;
|
||||||
@ -193,7 +193,7 @@ NTSTATUS auth_system_session_info(TALLOC_CTX *parent_ctx,
|
|||||||
|
|
||||||
NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char **methods,
|
NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char **methods,
|
||||||
struct tevent_context *ev,
|
struct tevent_context *ev,
|
||||||
struct messaging_context *msg,
|
struct imessaging_context *msg,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct ldb_context *sam_ctx,
|
struct ldb_context *sam_ctx,
|
||||||
struct auth_context **auth_ctx);
|
struct auth_context **auth_ctx);
|
||||||
@ -201,7 +201,7 @@ const char **auth_methods_from_lp(TALLOC_CTX *mem_ctx, struct loadparm_context *
|
|||||||
|
|
||||||
NTSTATUS auth_context_create(TALLOC_CTX *mem_ctx,
|
NTSTATUS auth_context_create(TALLOC_CTX *mem_ctx,
|
||||||
struct tevent_context *ev,
|
struct tevent_context *ev,
|
||||||
struct messaging_context *msg,
|
struct imessaging_context *msg,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct auth_context **auth_ctx);
|
struct auth_context **auth_ctx);
|
||||||
NTSTATUS auth_context_create_from_ldb(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, struct auth_context **auth_ctx);
|
NTSTATUS auth_context_create_from_ldb(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, struct auth_context **auth_ctx);
|
||||||
@ -215,7 +215,7 @@ NTSTATUS auth_register(const struct auth_operations *ops);
|
|||||||
NTSTATUS server_service_auth_init(void);
|
NTSTATUS server_service_auth_init(void);
|
||||||
NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
|
NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
|
||||||
struct tevent_context *ev,
|
struct tevent_context *ev,
|
||||||
struct messaging_context *msg,
|
struct imessaging_context *msg,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
const char *nt4_domain,
|
const char *nt4_domain,
|
||||||
const char *nt4_username,
|
const char *nt4_username,
|
||||||
@ -242,7 +242,7 @@ NTSTATUS auth_get_user_info_dc_principal(TALLOC_CTX *mem_ctx,
|
|||||||
|
|
||||||
NTSTATUS samba_server_gensec_start(TALLOC_CTX *mem_ctx,
|
NTSTATUS samba_server_gensec_start(TALLOC_CTX *mem_ctx,
|
||||||
struct tevent_context *event_ctx,
|
struct tevent_context *event_ctx,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct cli_credentials *server_credentials,
|
struct cli_credentials *server_credentials,
|
||||||
const char *target_service,
|
const char *target_service,
|
||||||
|
@ -425,7 +425,7 @@ static NTSTATUS auth_generate_session_info_wrapper(TALLOC_CTX *mem_ctx,
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
_PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char **methods,
|
_PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char **methods,
|
||||||
struct tevent_context *ev,
|
struct tevent_context *ev,
|
||||||
struct messaging_context *msg,
|
struct imessaging_context *msg,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct ldb_context *sam_ctx,
|
struct ldb_context *sam_ctx,
|
||||||
struct auth_context **auth_ctx)
|
struct auth_context **auth_ctx)
|
||||||
@ -508,7 +508,7 @@ const char **auth_methods_from_lp(TALLOC_CTX *mem_ctx, struct loadparm_context *
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
_PUBLIC_ NTSTATUS auth_context_create(TALLOC_CTX *mem_ctx,
|
_PUBLIC_ NTSTATUS auth_context_create(TALLOC_CTX *mem_ctx,
|
||||||
struct tevent_context *ev,
|
struct tevent_context *ev,
|
||||||
struct messaging_context *msg,
|
struct imessaging_context *msg,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct auth_context **auth_ctx)
|
struct auth_context **auth_ctx)
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
_PUBLIC_ NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
|
_PUBLIC_ NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
|
||||||
struct tevent_context *ev,
|
struct tevent_context *ev,
|
||||||
struct messaging_context *msg,
|
struct imessaging_context *msg,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
const char *nt4_domain,
|
const char *nt4_domain,
|
||||||
const char *nt4_username,
|
const char *nt4_username,
|
||||||
|
@ -214,12 +214,12 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
|
|||||||
{
|
{
|
||||||
PyObject *py_lp_ctx = Py_None;
|
PyObject *py_lp_ctx = Py_None;
|
||||||
PyObject *py_ldb = Py_None;
|
PyObject *py_ldb = Py_None;
|
||||||
PyObject *py_messaging_ctx = Py_None;
|
PyObject *py_imessaging_ctx = Py_None;
|
||||||
PyObject *py_auth_context = Py_None;
|
PyObject *py_auth_context = Py_None;
|
||||||
PyObject *py_methods = Py_None;
|
PyObject *py_methods = Py_None;
|
||||||
TALLOC_CTX *mem_ctx;
|
TALLOC_CTX *mem_ctx;
|
||||||
struct auth_context *auth_context;
|
struct auth_context *auth_context;
|
||||||
struct messaging_context *messaging_context = NULL;
|
struct imessaging_context *imessaging_context = NULL;
|
||||||
struct loadparm_context *lp_ctx;
|
struct loadparm_context *lp_ctx;
|
||||||
struct tevent_context *ev;
|
struct tevent_context *ev;
|
||||||
struct ldb_context *ldb;
|
struct ldb_context *ldb;
|
||||||
@ -230,7 +230,7 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
|
|||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOOO",
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOOO",
|
||||||
discard_const_p(char *, kwnames),
|
discard_const_p(char *, kwnames),
|
||||||
&py_lp_ctx, &py_messaging_ctx, &py_ldb, &py_methods))
|
&py_lp_ctx, &py_imessaging_ctx, &py_ldb, &py_methods))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
mem_ctx = talloc_new(NULL);
|
mem_ctx = talloc_new(NULL);
|
||||||
@ -251,12 +251,12 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (py_messaging_ctx != Py_None) {
|
if (py_imessaging_ctx != Py_None) {
|
||||||
messaging_context = py_talloc_get_type(py_messaging_ctx, struct messaging_context);
|
imessaging_context = py_talloc_get_type(py_imessaging_ctx, struct imessaging_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (py_methods == Py_None && py_ldb == Py_None) {
|
if (py_methods == Py_None && py_ldb == Py_None) {
|
||||||
nt_status = auth_context_create(mem_ctx, ev, messaging_context, lp_ctx, &auth_context);
|
nt_status = auth_context_create(mem_ctx, ev, imessaging_context, lp_ctx, &auth_context);
|
||||||
} else {
|
} else {
|
||||||
if (py_methods != Py_None) {
|
if (py_methods != Py_None) {
|
||||||
methods = PyList_AsStringList(mem_ctx, py_methods, "methods");
|
methods = PyList_AsStringList(mem_ctx, py_methods, "methods");
|
||||||
@ -268,7 +268,7 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
|
|||||||
methods = auth_methods_from_lp(mem_ctx, lp_ctx);
|
methods = auth_methods_from_lp(mem_ctx, lp_ctx);
|
||||||
}
|
}
|
||||||
nt_status = auth_context_create_methods(mem_ctx, methods, ev,
|
nt_status = auth_context_create_methods(mem_ctx, methods, ev,
|
||||||
messaging_context, lp_ctx,
|
imessaging_context, lp_ctx,
|
||||||
ldb, &auth_context);
|
ldb, &auth_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
NTSTATUS samba_server_gensec_start(TALLOC_CTX *mem_ctx,
|
NTSTATUS samba_server_gensec_start(TALLOC_CTX *mem_ctx,
|
||||||
struct tevent_context *event_ctx,
|
struct tevent_context *event_ctx,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct cli_credentials *server_credentials,
|
struct cli_credentials *server_credentials,
|
||||||
const char *target_service,
|
const char *target_service,
|
||||||
|
@ -80,7 +80,7 @@ struct tdb_wrap *cluster_tdb_tmp_open(TALLOC_CTX *mem_ctx, struct loadparm_conte
|
|||||||
/*
|
/*
|
||||||
register a callback function for a messaging endpoint
|
register a callback function for a messaging endpoint
|
||||||
*/
|
*/
|
||||||
NTSTATUS cluster_message_init(struct messaging_context *msg, struct server_id server,
|
NTSTATUS cluster_message_init(struct imessaging_context *msg, struct server_id server,
|
||||||
cluster_message_fn_t handler)
|
cluster_message_fn_t handler)
|
||||||
{
|
{
|
||||||
cluster_init();
|
cluster_init();
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
*/
|
*/
|
||||||
#define cluster_node_equal(id1, id2) ((id1)->vnn == (id2)->vnn)
|
#define cluster_node_equal(id1, id2) ((id1)->vnn == (id2)->vnn)
|
||||||
|
|
||||||
struct messaging_context;
|
struct imessaging_context;
|
||||||
typedef void (*cluster_message_fn_t)(struct messaging_context *, DATA_BLOB);
|
typedef void (*cluster_message_fn_t)(struct imessaging_context *, DATA_BLOB);
|
||||||
|
|
||||||
/* prototypes */
|
/* prototypes */
|
||||||
struct server_id cluster_id(uint64_t id, uint32_t id2);
|
struct server_id cluster_id(uint64_t id, uint32_t id2);
|
||||||
@ -45,7 +45,7 @@ char *cluster_id_string(TALLOC_CTX *mem_ctx, struct server_id id);
|
|||||||
struct tdb_wrap *cluster_tdb_tmp_open(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *dbname, int flags);
|
struct tdb_wrap *cluster_tdb_tmp_open(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *dbname, int flags);
|
||||||
void *cluster_backend_handle(void);
|
void *cluster_backend_handle(void);
|
||||||
|
|
||||||
NTSTATUS cluster_message_init(struct messaging_context *msg, struct server_id server,
|
NTSTATUS cluster_message_init(struct imessaging_context *msg, struct server_id server,
|
||||||
cluster_message_fn_t handler);
|
cluster_message_fn_t handler);
|
||||||
NTSTATUS cluster_message_send(struct server_id server, DATA_BLOB *data);
|
NTSTATUS cluster_message_send(struct server_id server, DATA_BLOB *data);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ struct cluster_ops {
|
|||||||
const char *, int);
|
const char *, int);
|
||||||
void *(*backend_handle)(struct cluster_ops *);
|
void *(*backend_handle)(struct cluster_ops *);
|
||||||
NTSTATUS (*message_init)(struct cluster_ops *ops,
|
NTSTATUS (*message_init)(struct cluster_ops *ops,
|
||||||
struct messaging_context *msg, struct server_id server,
|
struct imessaging_context *msg, struct server_id server,
|
||||||
cluster_message_fn_t handler);
|
cluster_message_fn_t handler);
|
||||||
NTSTATUS (*message_send)(struct cluster_ops *ops,
|
NTSTATUS (*message_send)(struct cluster_ops *ops,
|
||||||
struct server_id server, DATA_BLOB *data);
|
struct server_id server, DATA_BLOB *data);
|
||||||
|
@ -80,7 +80,7 @@ static void *local_backend_handle(struct cluster_ops *ops)
|
|||||||
dummy message init function - not needed as all messages are local
|
dummy message init function - not needed as all messages are local
|
||||||
*/
|
*/
|
||||||
static NTSTATUS local_message_init(struct cluster_ops *ops,
|
static NTSTATUS local_message_init(struct cluster_ops *ops,
|
||||||
struct messaging_context *msg,
|
struct imessaging_context *msg,
|
||||||
struct server_id server,
|
struct server_id server,
|
||||||
cluster_message_fn_t handler)
|
cluster_message_fn_t handler)
|
||||||
{
|
{
|
||||||
|
@ -236,7 +236,7 @@ WERROR dreplsrv_ridalloc_check_rid_pool(struct dreplsrv_service *service)
|
|||||||
|
|
||||||
/* called by the samldb ldb module to tell us to ask for a new RID
|
/* called by the samldb ldb module to tell us to ask for a new RID
|
||||||
pool */
|
pool */
|
||||||
void dreplsrv_allocate_rid(struct messaging_context *msg, void *private_data,
|
void dreplsrv_allocate_rid(struct imessaging_context *msg, void *private_data,
|
||||||
uint32_t msg_type,
|
uint32_t msg_type,
|
||||||
struct server_id server_id, DATA_BLOB *data)
|
struct server_id server_id, DATA_BLOB *data)
|
||||||
{
|
{
|
||||||
|
@ -497,7 +497,7 @@ static void dreplsrv_task_init(struct task_server *task)
|
|||||||
IRPC_REGISTER(task->msg_ctx, drsuapi, DRSUAPI_DSREPLICAMOD, dreplsrv_replica_mod, service);
|
IRPC_REGISTER(task->msg_ctx, drsuapi, DRSUAPI_DSREPLICAMOD, dreplsrv_replica_mod, service);
|
||||||
IRPC_REGISTER(task->msg_ctx, irpc, DREPL_TAKEFSMOROLE, drepl_take_FSMO_role, service);
|
IRPC_REGISTER(task->msg_ctx, irpc, DREPL_TAKEFSMOROLE, drepl_take_FSMO_role, service);
|
||||||
IRPC_REGISTER(task->msg_ctx, irpc, DREPL_TRIGGER_REPL_SECRET, drepl_trigger_repl_secret, service);
|
IRPC_REGISTER(task->msg_ctx, irpc, DREPL_TRIGGER_REPL_SECRET, drepl_trigger_repl_secret, service);
|
||||||
messaging_register(task->msg_ctx, service, MSG_DREPL_ALLOCATE_RID, dreplsrv_allocate_rid);
|
imessaging_register(task->msg_ctx, service, MSG_DREPL_ALLOCATE_RID, dreplsrv_allocate_rid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -66,14 +66,14 @@
|
|||||||
*/
|
*/
|
||||||
static void ridalloc_poke_rid_manager(struct ldb_module *module)
|
static void ridalloc_poke_rid_manager(struct ldb_module *module)
|
||||||
{
|
{
|
||||||
struct messaging_context *msg;
|
struct imessaging_context *msg;
|
||||||
struct server_id *server;
|
struct server_id *server;
|
||||||
struct ldb_context *ldb = ldb_module_get_ctx(module);
|
struct ldb_context *ldb = ldb_module_get_ctx(module);
|
||||||
struct loadparm_context *lp_ctx =
|
struct loadparm_context *lp_ctx =
|
||||||
(struct loadparm_context *)ldb_get_opaque(ldb, "loadparm");
|
(struct loadparm_context *)ldb_get_opaque(ldb, "loadparm");
|
||||||
TALLOC_CTX *tmp_ctx = talloc_new(module);
|
TALLOC_CTX *tmp_ctx = talloc_new(module);
|
||||||
|
|
||||||
msg = messaging_client_init(tmp_ctx, lpcfg_messaging_path(tmp_ctx, lp_ctx),
|
msg = imessaging_client_init(tmp_ctx, lpcfg_imessaging_path(tmp_ctx, lp_ctx),
|
||||||
ldb_get_event_context(ldb));
|
ldb_get_event_context(ldb));
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
DEBUG(3,(__location__ ": Failed to create messaging context\n"));
|
DEBUG(3,(__location__ ": Failed to create messaging context\n"));
|
||||||
@ -88,7 +88,7 @@ static void ridalloc_poke_rid_manager(struct ldb_module *module)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
messaging_send(msg, server[0], MSG_DREPL_ALLOCATE_RID, NULL);
|
imessaging_send(msg, server[0], MSG_DREPL_ALLOCATE_RID, NULL);
|
||||||
|
|
||||||
/* we don't care if the message got through */
|
/* we don't care if the message got through */
|
||||||
talloc_free(tmp_ctx);
|
talloc_free(tmp_ctx);
|
||||||
|
@ -1195,7 +1195,7 @@ static int rootdse_become_master(struct ldb_module *module,
|
|||||||
struct ldb_request *req,
|
struct ldb_request *req,
|
||||||
enum drepl_role_master role)
|
enum drepl_role_master role)
|
||||||
{
|
{
|
||||||
struct messaging_context *msg;
|
struct imessaging_context *msg;
|
||||||
struct ldb_context *ldb = ldb_module_get_ctx(module);
|
struct ldb_context *ldb = ldb_module_get_ctx(module);
|
||||||
TALLOC_CTX *tmp_ctx = talloc_new(req);
|
TALLOC_CTX *tmp_ctx = talloc_new(req);
|
||||||
struct loadparm_context *lp_ctx = ldb_get_opaque(ldb, "loadparm");
|
struct loadparm_context *lp_ctx = ldb_get_opaque(ldb, "loadparm");
|
||||||
@ -1223,10 +1223,10 @@ static int rootdse_become_master(struct ldb_module *module,
|
|||||||
"RODC cannot become a role master.");
|
"RODC cannot become a role master.");
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = messaging_client_init(tmp_ctx, lpcfg_messaging_path(tmp_ctx, lp_ctx),
|
msg = imessaging_client_init(tmp_ctx, lpcfg_imessaging_path(tmp_ctx, lp_ctx),
|
||||||
ldb_get_event_context(ldb));
|
ldb_get_event_context(ldb));
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
ldb_asprintf_errstring(ldb, "Failed to generate client messaging context in %s", lpcfg_messaging_path(tmp_ctx, lp_ctx));
|
ldb_asprintf_errstring(ldb, "Failed to generate client messaging context in %s", lpcfg_imessaging_path(tmp_ctx, lp_ctx));
|
||||||
return LDB_ERR_OPERATIONS_ERROR;
|
return LDB_ERR_OPERATIONS_ERROR;
|
||||||
}
|
}
|
||||||
irpc_handle = irpc_binding_handle_by_name(tmp_ctx, msg,
|
irpc_handle = irpc_binding_handle_by_name(tmp_ctx, msg,
|
||||||
|
@ -35,7 +35,7 @@ struct irpc_message {
|
|||||||
struct ndr_pull *ndr;
|
struct ndr_pull *ndr;
|
||||||
bool defer_reply;
|
bool defer_reply;
|
||||||
bool no_reply;
|
bool no_reply;
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
struct irpc_list *irpc;
|
struct irpc_list *irpc;
|
||||||
void *data;
|
void *data;
|
||||||
struct tevent_context *ev;
|
struct tevent_context *ev;
|
||||||
@ -58,24 +58,24 @@ typedef NTSTATUS (*irpc_function_t)(struct irpc_message *, void *r);
|
|||||||
|
|
||||||
struct ndr_interface_table;
|
struct ndr_interface_table;
|
||||||
|
|
||||||
NTSTATUS irpc_register(struct messaging_context *msg_ctx,
|
NTSTATUS irpc_register(struct imessaging_context *msg_ctx,
|
||||||
const struct ndr_interface_table *table,
|
const struct ndr_interface_table *table,
|
||||||
int call, irpc_function_t fn, void *private_data);
|
int call, irpc_function_t fn, void *private_data);
|
||||||
|
|
||||||
struct dcerpc_binding_handle *irpc_binding_handle(TALLOC_CTX *mem_ctx,
|
struct dcerpc_binding_handle *irpc_binding_handle(TALLOC_CTX *mem_ctx,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
struct server_id server_id,
|
struct server_id server_id,
|
||||||
const struct ndr_interface_table *table);
|
const struct ndr_interface_table *table);
|
||||||
struct dcerpc_binding_handle *irpc_binding_handle_by_name(TALLOC_CTX *mem_ctx,
|
struct dcerpc_binding_handle *irpc_binding_handle_by_name(TALLOC_CTX *mem_ctx,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
const char *dest_task,
|
const char *dest_task,
|
||||||
const struct ndr_interface_table *table);
|
const struct ndr_interface_table *table);
|
||||||
void irpc_binding_handle_add_security_token(struct dcerpc_binding_handle *h,
|
void irpc_binding_handle_add_security_token(struct dcerpc_binding_handle *h,
|
||||||
struct security_token *token);
|
struct security_token *token);
|
||||||
|
|
||||||
NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name);
|
NTSTATUS irpc_add_name(struct imessaging_context *msg_ctx, const char *name);
|
||||||
struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, TALLOC_CTX *mem_ctx, const char *name);
|
struct server_id *irpc_servers_byname(struct imessaging_context *msg_ctx, TALLOC_CTX *mem_ctx, const char *name);
|
||||||
void irpc_remove_name(struct messaging_context *msg_ctx, const char *name);
|
void irpc_remove_name(struct imessaging_context *msg_ctx, const char *name);
|
||||||
NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status);
|
NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -36,13 +36,13 @@
|
|||||||
#include "../lib/util/tevent_ntstatus.h"
|
#include "../lib/util/tevent_ntstatus.h"
|
||||||
|
|
||||||
/* change the message version with any incompatible changes in the protocol */
|
/* change the message version with any incompatible changes in the protocol */
|
||||||
#define MESSAGING_VERSION 1
|
#define IMESSAGING_VERSION 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
a pending irpc call
|
a pending irpc call
|
||||||
*/
|
*/
|
||||||
struct irpc_request {
|
struct irpc_request {
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
int callid;
|
int callid;
|
||||||
struct {
|
struct {
|
||||||
void (*handler)(struct irpc_request *irpc, struct irpc_message *m);
|
void (*handler)(struct irpc_request *irpc, struct irpc_message *m);
|
||||||
@ -50,7 +50,7 @@ struct irpc_request {
|
|||||||
} incoming;
|
} incoming;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct messaging_context {
|
struct imessaging_context {
|
||||||
struct server_id server_id;
|
struct server_id server_id;
|
||||||
struct socket_context *sock;
|
struct socket_context *sock;
|
||||||
const char *base_path;
|
const char *base_path;
|
||||||
@ -58,8 +58,8 @@ struct messaging_context {
|
|||||||
struct dispatch_fn **dispatch;
|
struct dispatch_fn **dispatch;
|
||||||
uint32_t num_types;
|
uint32_t num_types;
|
||||||
struct idr_context *dispatch_tree;
|
struct idr_context *dispatch_tree;
|
||||||
struct messaging_rec *pending;
|
struct imessaging_rec *pending;
|
||||||
struct messaging_rec *retry_queue;
|
struct imessaging_rec *retry_queue;
|
||||||
struct irpc_list *irpc;
|
struct irpc_list *irpc;
|
||||||
struct idr_context *idr;
|
struct idr_context *idr;
|
||||||
const char **names;
|
const char **names;
|
||||||
@ -81,12 +81,12 @@ struct dispatch_fn {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* an individual message */
|
/* an individual message */
|
||||||
struct messaging_rec {
|
struct imessaging_rec {
|
||||||
struct messaging_rec *next, *prev;
|
struct imessaging_rec *next, *prev;
|
||||||
struct messaging_context *msg;
|
struct imessaging_context *msg;
|
||||||
const char *path;
|
const char *path;
|
||||||
|
|
||||||
struct messaging_header {
|
struct imessaging_header {
|
||||||
uint32_t version;
|
uint32_t version;
|
||||||
uint32_t msg_type;
|
uint32_t msg_type;
|
||||||
struct server_id from;
|
struct server_id from;
|
||||||
@ -99,14 +99,14 @@ struct messaging_rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static void irpc_handler(struct messaging_context *, void *,
|
static void irpc_handler(struct imessaging_context *, void *,
|
||||||
uint32_t, struct server_id, DATA_BLOB *);
|
uint32_t, struct server_id, DATA_BLOB *);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A useful function for testing the message system.
|
A useful function for testing the message system.
|
||||||
*/
|
*/
|
||||||
static void ping_message(struct messaging_context *msg, void *private_data,
|
static void ping_message(struct imessaging_context *msg, void *private_data,
|
||||||
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
|
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
|
||||||
{
|
{
|
||||||
char *task_id = cluster_id_string(NULL, src);
|
char *task_id = cluster_id_string(NULL, src);
|
||||||
@ -114,7 +114,7 @@ static void ping_message(struct messaging_context *msg, void *private_data,
|
|||||||
task_id, (int)data->length,
|
task_id, (int)data->length,
|
||||||
data->data?(const char *)data->data:""));
|
data->data?(const char *)data->data:""));
|
||||||
talloc_free(task_id);
|
talloc_free(task_id);
|
||||||
messaging_send(msg, src, MSG_PONG, data);
|
imessaging_send(msg, src, MSG_PONG, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -123,7 +123,7 @@ static void ping_message(struct messaging_context *msg, void *private_data,
|
|||||||
static NTSTATUS irpc_uptime(struct irpc_message *msg,
|
static NTSTATUS irpc_uptime(struct irpc_message *msg,
|
||||||
struct irpc_uptime *r)
|
struct irpc_uptime *r)
|
||||||
{
|
{
|
||||||
struct messaging_context *ctx = talloc_get_type(msg->private_data, struct messaging_context);
|
struct imessaging_context *ctx = talloc_get_type(msg->private_data, struct imessaging_context);
|
||||||
*r->out.start_time = timeval_to_nttime(&ctx->start_time);
|
*r->out.start_time = timeval_to_nttime(&ctx->start_time);
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ static NTSTATUS irpc_uptime(struct irpc_message *msg,
|
|||||||
/*
|
/*
|
||||||
return the path to a messaging socket
|
return the path to a messaging socket
|
||||||
*/
|
*/
|
||||||
static char *messaging_path(struct messaging_context *msg, struct server_id server_id)
|
static char *imessaging_path(struct imessaging_context *msg, struct server_id server_id)
|
||||||
{
|
{
|
||||||
TALLOC_CTX *tmp_ctx = talloc_new(msg);
|
TALLOC_CTX *tmp_ctx = talloc_new(msg);
|
||||||
const char *id = cluster_id_string(tmp_ctx, server_id);
|
const char *id = cluster_id_string(tmp_ctx, server_id);
|
||||||
@ -151,7 +151,7 @@ static char *messaging_path(struct messaging_context *msg, struct server_id serv
|
|||||||
per message. That allows a single messasging context to register
|
per message. That allows a single messasging context to register
|
||||||
(for example) a debug handler for more than one piece of code
|
(for example) a debug handler for more than one piece of code
|
||||||
*/
|
*/
|
||||||
static void messaging_dispatch(struct messaging_context *msg, struct messaging_rec *rec)
|
static void imessaging_dispatch(struct imessaging_context *msg, struct imessaging_rec *rec)
|
||||||
{
|
{
|
||||||
struct dispatch_fn *d, *next;
|
struct dispatch_fn *d, *next;
|
||||||
|
|
||||||
@ -178,18 +178,18 @@ static void messaging_dispatch(struct messaging_context *msg, struct messaging_r
|
|||||||
/*
|
/*
|
||||||
handler for messages that arrive from other nodes in the cluster
|
handler for messages that arrive from other nodes in the cluster
|
||||||
*/
|
*/
|
||||||
static void cluster_message_handler(struct messaging_context *msg, DATA_BLOB packet)
|
static void cluster_message_handler(struct imessaging_context *msg, DATA_BLOB packet)
|
||||||
{
|
{
|
||||||
struct messaging_rec *rec;
|
struct imessaging_rec *rec;
|
||||||
|
|
||||||
rec = talloc(msg, struct messaging_rec);
|
rec = talloc(msg, struct imessaging_rec);
|
||||||
if (rec == NULL) {
|
if (rec == NULL) {
|
||||||
smb_panic("Unable to allocate messaging_rec");
|
smb_panic("Unable to allocate imessaging_rec");
|
||||||
}
|
}
|
||||||
|
|
||||||
rec->msg = msg;
|
rec->msg = msg;
|
||||||
rec->path = msg->path;
|
rec->path = msg->path;
|
||||||
rec->header = (struct messaging_header *)packet.data;
|
rec->header = (struct imessaging_header *)packet.data;
|
||||||
rec->packet = packet;
|
rec->packet = packet;
|
||||||
rec->retries = 0;
|
rec->retries = 0;
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ static void cluster_message_handler(struct messaging_context *msg, DATA_BLOB pac
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
messaging_dispatch(msg, rec);
|
imessaging_dispatch(msg, rec);
|
||||||
talloc_free(rec);
|
talloc_free(rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,9 +209,9 @@ static void cluster_message_handler(struct messaging_context *msg, DATA_BLOB pac
|
|||||||
/*
|
/*
|
||||||
try to send the message
|
try to send the message
|
||||||
*/
|
*/
|
||||||
static NTSTATUS try_send(struct messaging_rec *rec)
|
static NTSTATUS try_send(struct imessaging_rec *rec)
|
||||||
{
|
{
|
||||||
struct messaging_context *msg = rec->msg;
|
struct imessaging_context *msg = rec->msg;
|
||||||
size_t nsent;
|
size_t nsent;
|
||||||
void *priv;
|
void *priv;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
@ -240,15 +240,15 @@ static NTSTATUS try_send(struct messaging_rec *rec)
|
|||||||
static void msg_retry_timer(struct tevent_context *ev, struct tevent_timer *te,
|
static void msg_retry_timer(struct tevent_context *ev, struct tevent_timer *te,
|
||||||
struct timeval t, void *private_data)
|
struct timeval t, void *private_data)
|
||||||
{
|
{
|
||||||
struct messaging_context *msg = talloc_get_type(private_data,
|
struct imessaging_context *msg = talloc_get_type(private_data,
|
||||||
struct messaging_context);
|
struct imessaging_context);
|
||||||
msg->retry_te = NULL;
|
msg->retry_te = NULL;
|
||||||
|
|
||||||
/* put the messages back on the main queue */
|
/* put the messages back on the main queue */
|
||||||
while (msg->retry_queue) {
|
while (msg->retry_queue) {
|
||||||
struct messaging_rec *rec = msg->retry_queue;
|
struct imessaging_rec *rec = msg->retry_queue;
|
||||||
DLIST_REMOVE(msg->retry_queue, rec);
|
DLIST_REMOVE(msg->retry_queue, rec);
|
||||||
DLIST_ADD_END(msg->pending, rec, struct messaging_rec *);
|
DLIST_ADD_END(msg->pending, rec, struct imessaging_rec *);
|
||||||
}
|
}
|
||||||
|
|
||||||
EVENT_FD_WRITEABLE(msg->event.fde);
|
EVENT_FD_WRITEABLE(msg->event.fde);
|
||||||
@ -257,10 +257,10 @@ static void msg_retry_timer(struct tevent_context *ev, struct tevent_timer *te,
|
|||||||
/*
|
/*
|
||||||
handle a socket write event
|
handle a socket write event
|
||||||
*/
|
*/
|
||||||
static void messaging_send_handler(struct messaging_context *msg)
|
static void imessaging_send_handler(struct imessaging_context *msg)
|
||||||
{
|
{
|
||||||
while (msg->pending) {
|
while (msg->pending) {
|
||||||
struct messaging_rec *rec = msg->pending;
|
struct imessaging_rec *rec = msg->pending;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
status = try_send(rec);
|
status = try_send(rec);
|
||||||
if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
|
if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
|
||||||
@ -270,7 +270,7 @@ static void messaging_send_handler(struct messaging_context *msg)
|
|||||||
backoff this record */
|
backoff this record */
|
||||||
DLIST_REMOVE(msg->pending, rec);
|
DLIST_REMOVE(msg->pending, rec);
|
||||||
DLIST_ADD_END(msg->retry_queue, rec,
|
DLIST_ADD_END(msg->retry_queue, rec,
|
||||||
struct messaging_rec *);
|
struct imessaging_rec *);
|
||||||
if (msg->retry_te == NULL) {
|
if (msg->retry_te == NULL) {
|
||||||
msg->retry_te =
|
msg->retry_te =
|
||||||
event_add_timed(msg->event.ev, msg,
|
event_add_timed(msg->event.ev, msg,
|
||||||
@ -301,9 +301,9 @@ static void messaging_send_handler(struct messaging_context *msg)
|
|||||||
/*
|
/*
|
||||||
handle a new incoming packet
|
handle a new incoming packet
|
||||||
*/
|
*/
|
||||||
static void messaging_recv_handler(struct messaging_context *msg)
|
static void imessaging_recv_handler(struct imessaging_context *msg)
|
||||||
{
|
{
|
||||||
struct messaging_rec *rec;
|
struct imessaging_rec *rec;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
DATA_BLOB packet;
|
DATA_BLOB packet;
|
||||||
size_t msize;
|
size_t msize;
|
||||||
@ -334,15 +334,15 @@ static void messaging_recv_handler(struct messaging_context *msg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rec = talloc(msg, struct messaging_rec);
|
rec = talloc(msg, struct imessaging_rec);
|
||||||
if (rec == NULL) {
|
if (rec == NULL) {
|
||||||
smb_panic("Unable to allocate messaging_rec");
|
smb_panic("Unable to allocate imessaging_rec");
|
||||||
}
|
}
|
||||||
|
|
||||||
talloc_steal(rec, packet.data);
|
talloc_steal(rec, packet.data);
|
||||||
rec->msg = msg;
|
rec->msg = msg;
|
||||||
rec->path = msg->path;
|
rec->path = msg->path;
|
||||||
rec->header = (struct messaging_header *)packet.data;
|
rec->header = (struct imessaging_header *)packet.data;
|
||||||
rec->packet = packet;
|
rec->packet = packet;
|
||||||
rec->retries = 0;
|
rec->retries = 0;
|
||||||
|
|
||||||
@ -353,7 +353,7 @@ static void messaging_recv_handler(struct messaging_context *msg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
messaging_dispatch(msg, rec);
|
imessaging_dispatch(msg, rec);
|
||||||
talloc_free(rec);
|
talloc_free(rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,16 +361,16 @@ static void messaging_recv_handler(struct messaging_context *msg)
|
|||||||
/*
|
/*
|
||||||
handle a socket event
|
handle a socket event
|
||||||
*/
|
*/
|
||||||
static void messaging_handler(struct tevent_context *ev, struct tevent_fd *fde,
|
static void imessaging_handler(struct tevent_context *ev, struct tevent_fd *fde,
|
||||||
uint16_t flags, void *private_data)
|
uint16_t flags, void *private_data)
|
||||||
{
|
{
|
||||||
struct messaging_context *msg = talloc_get_type(private_data,
|
struct imessaging_context *msg = talloc_get_type(private_data,
|
||||||
struct messaging_context);
|
struct imessaging_context);
|
||||||
if (flags & EVENT_FD_WRITE) {
|
if (flags & EVENT_FD_WRITE) {
|
||||||
messaging_send_handler(msg);
|
imessaging_send_handler(msg);
|
||||||
}
|
}
|
||||||
if (flags & EVENT_FD_READ) {
|
if (flags & EVENT_FD_READ) {
|
||||||
messaging_recv_handler(msg);
|
imessaging_recv_handler(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ static void messaging_handler(struct tevent_context *ev, struct tevent_fd *fde,
|
|||||||
/*
|
/*
|
||||||
Register a dispatch function for a particular message type.
|
Register a dispatch function for a particular message type.
|
||||||
*/
|
*/
|
||||||
NTSTATUS messaging_register(struct messaging_context *msg, void *private_data,
|
NTSTATUS imessaging_register(struct imessaging_context *msg, void *private_data,
|
||||||
uint32_t msg_type, msg_callback_t fn)
|
uint32_t msg_type, msg_callback_t fn)
|
||||||
{
|
{
|
||||||
struct dispatch_fn *d;
|
struct dispatch_fn *d;
|
||||||
@ -411,7 +411,7 @@ NTSTATUS messaging_register(struct messaging_context *msg, void *private_data,
|
|||||||
register a temporary message handler. The msg_type is allocated
|
register a temporary message handler. The msg_type is allocated
|
||||||
above MSG_TMP_BASE
|
above MSG_TMP_BASE
|
||||||
*/
|
*/
|
||||||
NTSTATUS messaging_register_tmp(struct messaging_context *msg, void *private_data,
|
NTSTATUS imessaging_register_tmp(struct imessaging_context *msg, void *private_data,
|
||||||
msg_callback_t fn, uint32_t *msg_type)
|
msg_callback_t fn, uint32_t *msg_type)
|
||||||
{
|
{
|
||||||
struct dispatch_fn *d;
|
struct dispatch_fn *d;
|
||||||
@ -437,7 +437,7 @@ NTSTATUS messaging_register_tmp(struct messaging_context *msg, void *private_dat
|
|||||||
/*
|
/*
|
||||||
De-register the function for a particular message type.
|
De-register the function for a particular message type.
|
||||||
*/
|
*/
|
||||||
void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void *private_data)
|
void imessaging_deregister(struct imessaging_context *msg, uint32_t msg_type, void *private_data)
|
||||||
{
|
{
|
||||||
struct dispatch_fn *d, *next;
|
struct dispatch_fn *d, *next;
|
||||||
|
|
||||||
@ -462,14 +462,14 @@ void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void
|
|||||||
/*
|
/*
|
||||||
Send a message to a particular server
|
Send a message to a particular server
|
||||||
*/
|
*/
|
||||||
NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server,
|
NTSTATUS imessaging_send(struct imessaging_context *msg, struct server_id server,
|
||||||
uint32_t msg_type, const DATA_BLOB *data)
|
uint32_t msg_type, const DATA_BLOB *data)
|
||||||
{
|
{
|
||||||
struct messaging_rec *rec;
|
struct imessaging_rec *rec;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
size_t dlength = data?data->length:0;
|
size_t dlength = data?data->length:0;
|
||||||
|
|
||||||
rec = talloc(msg, struct messaging_rec);
|
rec = talloc(msg, struct imessaging_rec);
|
||||||
if (rec == NULL) {
|
if (rec == NULL) {
|
||||||
return NT_STATUS_NO_MEMORY;
|
return NT_STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
@ -482,10 +482,10 @@ NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server,
|
|||||||
|
|
||||||
rec->retries = 0;
|
rec->retries = 0;
|
||||||
rec->msg = msg;
|
rec->msg = msg;
|
||||||
rec->header = (struct messaging_header *)rec->packet.data;
|
rec->header = (struct imessaging_header *)rec->packet.data;
|
||||||
/* zero padding */
|
/* zero padding */
|
||||||
ZERO_STRUCTP(rec->header);
|
ZERO_STRUCTP(rec->header);
|
||||||
rec->header->version = MESSAGING_VERSION;
|
rec->header->version = IMESSAGING_VERSION;
|
||||||
rec->header->msg_type = msg_type;
|
rec->header->msg_type = msg_type;
|
||||||
rec->header->from = msg->server_id;
|
rec->header->from = msg->server_id;
|
||||||
rec->header->to = server;
|
rec->header->to = server;
|
||||||
@ -503,7 +503,7 @@ NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
rec->path = messaging_path(msg, server);
|
rec->path = imessaging_path(msg, server);
|
||||||
talloc_steal(rec, rec->path);
|
talloc_steal(rec, rec->path);
|
||||||
|
|
||||||
if (msg->pending != NULL) {
|
if (msg->pending != NULL) {
|
||||||
@ -516,7 +516,7 @@ NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server,
|
|||||||
if (msg->pending == NULL) {
|
if (msg->pending == NULL) {
|
||||||
EVENT_FD_WRITEABLE(msg->event.fde);
|
EVENT_FD_WRITEABLE(msg->event.fde);
|
||||||
}
|
}
|
||||||
DLIST_ADD_END(msg->pending, rec, struct messaging_rec *);
|
DLIST_ADD_END(msg->pending, rec, struct imessaging_rec *);
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,7 +528,7 @@ NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server,
|
|||||||
/*
|
/*
|
||||||
Send a message to a particular server, with the message containing a single pointer
|
Send a message to a particular server, with the message containing a single pointer
|
||||||
*/
|
*/
|
||||||
NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id server,
|
NTSTATUS imessaging_send_ptr(struct imessaging_context *msg, struct server_id server,
|
||||||
uint32_t msg_type, void *ptr)
|
uint32_t msg_type, void *ptr)
|
||||||
{
|
{
|
||||||
DATA_BLOB blob;
|
DATA_BLOB blob;
|
||||||
@ -536,14 +536,14 @@ NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id serv
|
|||||||
blob.data = (uint8_t *)&ptr;
|
blob.data = (uint8_t *)&ptr;
|
||||||
blob.length = sizeof(void *);
|
blob.length = sizeof(void *);
|
||||||
|
|
||||||
return messaging_send(msg, server, msg_type, &blob);
|
return imessaging_send(msg, server, msg_type, &blob);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
destroy the messaging context
|
destroy the messaging context
|
||||||
*/
|
*/
|
||||||
static int messaging_destructor(struct messaging_context *msg)
|
static int imessaging_destructor(struct imessaging_context *msg)
|
||||||
{
|
{
|
||||||
unlink(msg->path);
|
unlink(msg->path);
|
||||||
while (msg->names && msg->names[0]) {
|
while (msg->names && msg->names[0]) {
|
||||||
@ -555,12 +555,12 @@ static int messaging_destructor(struct messaging_context *msg)
|
|||||||
/*
|
/*
|
||||||
create the listening socket and setup the dispatcher
|
create the listening socket and setup the dispatcher
|
||||||
*/
|
*/
|
||||||
struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
|
struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
|
||||||
const char *dir,
|
const char *dir,
|
||||||
struct server_id server_id,
|
struct server_id server_id,
|
||||||
struct tevent_context *ev)
|
struct tevent_context *ev)
|
||||||
{
|
{
|
||||||
struct messaging_context *msg;
|
struct imessaging_context *msg;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
struct socket_address *path;
|
struct socket_address *path;
|
||||||
|
|
||||||
@ -568,7 +568,7 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = talloc_zero(mem_ctx, struct messaging_context);
|
msg = talloc_zero(mem_ctx, struct imessaging_context);
|
||||||
if (msg == NULL) {
|
if (msg == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -584,7 +584,7 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
|
|||||||
mkdir(dir, 0700);
|
mkdir(dir, 0700);
|
||||||
|
|
||||||
msg->base_path = talloc_reference(msg, dir);
|
msg->base_path = talloc_reference(msg, dir);
|
||||||
msg->path = messaging_path(msg, server_id);
|
msg->path = imessaging_path(msg, server_id);
|
||||||
msg->server_id = server_id;
|
msg->server_id = server_id;
|
||||||
msg->idr = idr_init(msg);
|
msg->idr = idr_init(msg);
|
||||||
msg->dispatch_tree = idr_init(msg);
|
msg->dispatch_tree = idr_init(msg);
|
||||||
@ -619,13 +619,13 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
|
|||||||
|
|
||||||
msg->event.ev = ev;
|
msg->event.ev = ev;
|
||||||
msg->event.fde = event_add_fd(ev, msg, socket_get_fd(msg->sock),
|
msg->event.fde = event_add_fd(ev, msg, socket_get_fd(msg->sock),
|
||||||
EVENT_FD_READ, messaging_handler, msg);
|
EVENT_FD_READ, imessaging_handler, msg);
|
||||||
tevent_fd_set_auto_close(msg->event.fde);
|
tevent_fd_set_auto_close(msg->event.fde);
|
||||||
|
|
||||||
talloc_set_destructor(msg, messaging_destructor);
|
talloc_set_destructor(msg, imessaging_destructor);
|
||||||
|
|
||||||
messaging_register(msg, NULL, MSG_PING, ping_message);
|
imessaging_register(msg, NULL, MSG_PING, ping_message);
|
||||||
messaging_register(msg, NULL, MSG_IRPC, irpc_handler);
|
imessaging_register(msg, NULL, MSG_IRPC, irpc_handler);
|
||||||
IRPC_REGISTER(msg, irpc, IRPC_UPTIME, irpc_uptime, msg);
|
IRPC_REGISTER(msg, irpc, IRPC_UPTIME, irpc_uptime, msg);
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
@ -634,14 +634,14 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
|
|||||||
/*
|
/*
|
||||||
A hack, for the short term until we get 'client only' messaging in place
|
A hack, for the short term until we get 'client only' messaging in place
|
||||||
*/
|
*/
|
||||||
struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx,
|
struct imessaging_context *imessaging_client_init(TALLOC_CTX *mem_ctx,
|
||||||
const char *dir,
|
const char *dir,
|
||||||
struct tevent_context *ev)
|
struct tevent_context *ev)
|
||||||
{
|
{
|
||||||
struct server_id id;
|
struct server_id id;
|
||||||
ZERO_STRUCT(id);
|
ZERO_STRUCT(id);
|
||||||
id.pid = random() % 0x10000000;
|
id.pid = random() % 0x10000000;
|
||||||
return messaging_init(mem_ctx, dir, id, ev);
|
return imessaging_init(mem_ctx, dir, id, ev);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
a list of registered irpc server functions
|
a list of registered irpc server functions
|
||||||
@ -659,7 +659,7 @@ struct irpc_list {
|
|||||||
/*
|
/*
|
||||||
register a irpc server function
|
register a irpc server function
|
||||||
*/
|
*/
|
||||||
NTSTATUS irpc_register(struct messaging_context *msg_ctx,
|
NTSTATUS irpc_register(struct imessaging_context *msg_ctx,
|
||||||
const struct ndr_interface_table *table,
|
const struct ndr_interface_table *table,
|
||||||
int callnum, irpc_function_t fn, void *private_data)
|
int callnum, irpc_function_t fn, void *private_data)
|
||||||
{
|
{
|
||||||
@ -690,7 +690,7 @@ NTSTATUS irpc_register(struct messaging_context *msg_ctx,
|
|||||||
/*
|
/*
|
||||||
handle an incoming irpc reply message
|
handle an incoming irpc reply message
|
||||||
*/
|
*/
|
||||||
static void irpc_handler_reply(struct messaging_context *msg_ctx, struct irpc_message *m)
|
static void irpc_handler_reply(struct imessaging_context *msg_ctx, struct irpc_message *m)
|
||||||
{
|
{
|
||||||
struct irpc_request *irpc;
|
struct irpc_request *irpc;
|
||||||
|
|
||||||
@ -736,7 +736,7 @@ NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status)
|
|||||||
|
|
||||||
/* send the reply message */
|
/* send the reply message */
|
||||||
packet = ndr_push_blob(push);
|
packet = ndr_push_blob(push);
|
||||||
status = messaging_send(m->msg_ctx, m->from, MSG_IRPC, &packet);
|
status = imessaging_send(m->msg_ctx, m->from, MSG_IRPC, &packet);
|
||||||
if (!NT_STATUS_IS_OK(status)) goto failed;
|
if (!NT_STATUS_IS_OK(status)) goto failed;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
@ -747,7 +747,7 @@ failed:
|
|||||||
/*
|
/*
|
||||||
handle an incoming irpc request message
|
handle an incoming irpc request message
|
||||||
*/
|
*/
|
||||||
static void irpc_handler_request(struct messaging_context *msg_ctx,
|
static void irpc_handler_request(struct imessaging_context *msg_ctx,
|
||||||
struct irpc_message *m)
|
struct irpc_message *m)
|
||||||
{
|
{
|
||||||
struct irpc_list *i;
|
struct irpc_list *i;
|
||||||
@ -811,7 +811,7 @@ failed:
|
|||||||
/*
|
/*
|
||||||
handle an incoming irpc message
|
handle an incoming irpc message
|
||||||
*/
|
*/
|
||||||
static void irpc_handler(struct messaging_context *msg_ctx, void *private_data,
|
static void irpc_handler(struct imessaging_context *msg_ctx, void *private_data,
|
||||||
uint32_t msg_type, struct server_id src, DATA_BLOB *packet)
|
uint32_t msg_type, struct server_id src, DATA_BLOB *packet)
|
||||||
{
|
{
|
||||||
struct irpc_message *m;
|
struct irpc_message *m;
|
||||||
@ -858,7 +858,7 @@ static int irpc_destructor(struct irpc_request *irpc)
|
|||||||
/*
|
/*
|
||||||
open the naming database
|
open the naming database
|
||||||
*/
|
*/
|
||||||
static struct tdb_wrap *irpc_namedb_open(struct messaging_context *msg_ctx)
|
static struct tdb_wrap *irpc_namedb_open(struct imessaging_context *msg_ctx)
|
||||||
{
|
{
|
||||||
struct tdb_wrap *t;
|
struct tdb_wrap *t;
|
||||||
char *path = talloc_asprintf(msg_ctx, "%s/names.tdb", msg_ctx->base_path);
|
char *path = talloc_asprintf(msg_ctx, "%s/names.tdb", msg_ctx->base_path);
|
||||||
@ -874,7 +874,7 @@ static struct tdb_wrap *irpc_namedb_open(struct messaging_context *msg_ctx)
|
|||||||
/*
|
/*
|
||||||
add a string name that this irpc server can be called on
|
add a string name that this irpc server can be called on
|
||||||
*/
|
*/
|
||||||
NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name)
|
NTSTATUS irpc_add_name(struct imessaging_context *msg_ctx, const char *name)
|
||||||
{
|
{
|
||||||
struct tdb_wrap *t;
|
struct tdb_wrap *t;
|
||||||
TDB_DATA rec;
|
TDB_DATA rec;
|
||||||
@ -914,7 +914,7 @@ NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name)
|
|||||||
/*
|
/*
|
||||||
return a list of server ids for a server name
|
return a list of server ids for a server name
|
||||||
*/
|
*/
|
||||||
struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx,
|
struct server_id *irpc_servers_byname(struct imessaging_context *msg_ctx,
|
||||||
TALLOC_CTX *mem_ctx,
|
TALLOC_CTX *mem_ctx,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
@ -959,7 +959,7 @@ struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx,
|
|||||||
/*
|
/*
|
||||||
remove a name from a messaging context
|
remove a name from a messaging context
|
||||||
*/
|
*/
|
||||||
void irpc_remove_name(struct messaging_context *msg_ctx, const char *name)
|
void irpc_remove_name(struct imessaging_context *msg_ctx, const char *name)
|
||||||
{
|
{
|
||||||
struct tdb_wrap *t;
|
struct tdb_wrap *t;
|
||||||
TDB_DATA rec;
|
TDB_DATA rec;
|
||||||
@ -1007,13 +1007,13 @@ void irpc_remove_name(struct messaging_context *msg_ctx, const char *name)
|
|||||||
talloc_free(t);
|
talloc_free(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct server_id messaging_get_server_id(struct messaging_context *msg_ctx)
|
struct server_id imessaging_get_server_id(struct imessaging_context *msg_ctx)
|
||||||
{
|
{
|
||||||
return msg_ctx->server_id;
|
return msg_ctx->server_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct irpc_bh_state {
|
struct irpc_bh_state {
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
struct server_id server_id;
|
struct server_id server_id;
|
||||||
const struct ndr_interface_table *table;
|
const struct ndr_interface_table *table;
|
||||||
uint32_t timeout;
|
uint32_t timeout;
|
||||||
@ -1139,7 +1139,7 @@ static struct tevent_req *irpc_bh_raw_call_send(TALLOC_CTX *mem_ctx,
|
|||||||
|
|
||||||
/* and send it */
|
/* and send it */
|
||||||
state->in_packet = ndr_push_blob(ndr);
|
state->in_packet = ndr_push_blob(ndr);
|
||||||
status = messaging_send(hs->msg_ctx, hs->server_id,
|
status = imessaging_send(hs->msg_ctx, hs->server_id,
|
||||||
MSG_IRPC, &state->in_packet);
|
MSG_IRPC, &state->in_packet);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
tevent_req_nterror(req, status);
|
tevent_req_nterror(req, status);
|
||||||
@ -1272,7 +1272,7 @@ static const struct dcerpc_binding_handle_ops irpc_bh_ops = {
|
|||||||
|
|
||||||
/* initialise a irpc binding handle */
|
/* initialise a irpc binding handle */
|
||||||
struct dcerpc_binding_handle *irpc_binding_handle(TALLOC_CTX *mem_ctx,
|
struct dcerpc_binding_handle *irpc_binding_handle(TALLOC_CTX *mem_ctx,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
struct server_id server_id,
|
struct server_id server_id,
|
||||||
const struct ndr_interface_table *table)
|
const struct ndr_interface_table *table)
|
||||||
{
|
{
|
||||||
@ -1300,7 +1300,7 @@ struct dcerpc_binding_handle *irpc_binding_handle(TALLOC_CTX *mem_ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct dcerpc_binding_handle *irpc_binding_handle_by_name(TALLOC_CTX *mem_ctx,
|
struct dcerpc_binding_handle *irpc_binding_handle_by_name(TALLOC_CTX *mem_ctx,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
const char *dest_task,
|
const char *dest_task,
|
||||||
const struct ndr_interface_table *table)
|
const struct ndr_interface_table *table)
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "librpc/gen_ndr/server_id4.h"
|
#include "librpc/gen_ndr/server_id4.h"
|
||||||
|
|
||||||
struct messaging_context;
|
struct imessaging_context;
|
||||||
|
|
||||||
/* general messages */
|
/* general messages */
|
||||||
#define MSG_DEBUG 1
|
#define MSG_DEBUG 1
|
||||||
@ -42,27 +42,27 @@ struct messaging_context;
|
|||||||
/* taskid for messaging of parent process */
|
/* taskid for messaging of parent process */
|
||||||
#define SAMBA_PARENT_TASKID 0
|
#define SAMBA_PARENT_TASKID 0
|
||||||
|
|
||||||
typedef void (*msg_callback_t)(struct messaging_context *msg, void *private_data,
|
typedef void (*msg_callback_t)(struct imessaging_context *msg, void *private_data,
|
||||||
uint32_t msg_type,
|
uint32_t msg_type,
|
||||||
struct server_id server_id, DATA_BLOB *data);
|
struct server_id server_id, DATA_BLOB *data);
|
||||||
|
|
||||||
NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server,
|
NTSTATUS imessaging_send(struct imessaging_context *msg, struct server_id server,
|
||||||
uint32_t msg_type, const DATA_BLOB *data);
|
uint32_t msg_type, const DATA_BLOB *data);
|
||||||
NTSTATUS messaging_register(struct messaging_context *msg, void *private_data,
|
NTSTATUS imessaging_register(struct imessaging_context *msg, void *private_data,
|
||||||
uint32_t msg_type,
|
uint32_t msg_type,
|
||||||
msg_callback_t fn);
|
msg_callback_t fn);
|
||||||
NTSTATUS messaging_register_tmp(struct messaging_context *msg, void *private_data,
|
NTSTATUS imessaging_register_tmp(struct imessaging_context *msg, void *private_data,
|
||||||
msg_callback_t fn, uint32_t *msg_type);
|
msg_callback_t fn, uint32_t *msg_type);
|
||||||
struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
|
struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
|
||||||
const char *dir,
|
const char *dir,
|
||||||
struct server_id server_id,
|
struct server_id server_id,
|
||||||
struct tevent_context *ev);
|
struct tevent_context *ev);
|
||||||
struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx,
|
struct imessaging_context *imessaging_client_init(TALLOC_CTX *mem_ctx,
|
||||||
const char *dir,
|
const char *dir,
|
||||||
struct tevent_context *ev);
|
struct tevent_context *ev);
|
||||||
NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id server,
|
NTSTATUS imessaging_send_ptr(struct imessaging_context *msg, struct server_id server,
|
||||||
uint32_t msg_type, void *ptr);
|
uint32_t msg_type, void *ptr);
|
||||||
void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void *private_data);
|
void imessaging_deregister(struct imessaging_context *msg, uint32_t msg_type, void *private_data);
|
||||||
struct server_id messaging_get_server_id(struct messaging_context *msg_ctx);
|
struct server_id imessaging_get_server_id(struct imessaging_context *msg_ctx);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
void initmessaging(void);
|
void initmessaging(void);
|
||||||
|
|
||||||
extern PyTypeObject messaging_Type;
|
extern PyTypeObject imessaging_Type;
|
||||||
|
|
||||||
static bool server_id_from_py(PyObject *object, struct server_id *server_id)
|
static bool server_id_from_py(PyObject *object, struct server_id *server_id)
|
||||||
{
|
{
|
||||||
@ -58,23 +58,23 @@ static bool server_id_from_py(PyObject *object, struct server_id *server_id)
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
PyObject_HEAD
|
PyObject_HEAD
|
||||||
TALLOC_CTX *mem_ctx;
|
TALLOC_CTX *mem_ctx;
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
} messaging_Object;
|
} imessaging_Object;
|
||||||
|
|
||||||
static PyObject *py_messaging_connect(PyTypeObject *self, PyObject *args, PyObject *kwargs)
|
static PyObject *py_imessaging_connect(PyTypeObject *self, PyObject *args, PyObject *kwargs)
|
||||||
{
|
{
|
||||||
struct tevent_context *ev;
|
struct tevent_context *ev;
|
||||||
const char *kwnames[] = { "own_id", "messaging_path", NULL };
|
const char *kwnames[] = { "own_id", "messaging_path", NULL };
|
||||||
PyObject *own_id = Py_None;
|
PyObject *own_id = Py_None;
|
||||||
const char *messaging_path = NULL;
|
const char *imessaging_path = NULL;
|
||||||
messaging_Object *ret;
|
imessaging_Object *ret;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|Oz:connect",
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|Oz:connect",
|
||||||
discard_const_p(char *, kwnames), &own_id, &messaging_path)) {
|
discard_const_p(char *, kwnames), &own_id, &imessaging_path)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = PyObject_New(messaging_Object, &messaging_Type);
|
ret = PyObject_New(imessaging_Object, &imessaging_Type);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -82,11 +82,11 @@ static PyObject *py_messaging_connect(PyTypeObject *self, PyObject *args, PyObje
|
|||||||
|
|
||||||
ev = s4_event_context_init(ret->mem_ctx);
|
ev = s4_event_context_init(ret->mem_ctx);
|
||||||
|
|
||||||
if (messaging_path == NULL) {
|
if (imessaging_path == NULL) {
|
||||||
messaging_path = lpcfg_messaging_path(ret->mem_ctx,
|
imessaging_path = lpcfg_imessaging_path(ret->mem_ctx,
|
||||||
py_default_loadparm_context(ret->mem_ctx));
|
py_default_loadparm_context(ret->mem_ctx));
|
||||||
} else {
|
} else {
|
||||||
messaging_path = talloc_strdup(ret->mem_ctx, messaging_path);
|
imessaging_path = talloc_strdup(ret->mem_ctx, imessaging_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (own_id != Py_None) {
|
if (own_id != Py_None) {
|
||||||
@ -95,18 +95,18 @@ static PyObject *py_messaging_connect(PyTypeObject *self, PyObject *args, PyObje
|
|||||||
if (!server_id_from_py(own_id, &server_id))
|
if (!server_id_from_py(own_id, &server_id))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ret->msg_ctx = messaging_init(ret->mem_ctx,
|
ret->msg_ctx = imessaging_init(ret->mem_ctx,
|
||||||
messaging_path,
|
imessaging_path,
|
||||||
server_id,
|
server_id,
|
||||||
ev);
|
ev);
|
||||||
} else {
|
} else {
|
||||||
ret->msg_ctx = messaging_client_init(ret->mem_ctx,
|
ret->msg_ctx = imessaging_client_init(ret->mem_ctx,
|
||||||
messaging_path,
|
imessaging_path,
|
||||||
ev);
|
ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret->msg_ctx == NULL) {
|
if (ret->msg_ctx == NULL) {
|
||||||
PyErr_SetString(PyExc_RuntimeError, "messaging_connect unable to create a messaging context");
|
PyErr_SetString(PyExc_RuntimeError, "imessaging_connect unable to create a messaging context");
|
||||||
talloc_free(ret->mem_ctx);
|
talloc_free(ret->mem_ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -114,16 +114,16 @@ static PyObject *py_messaging_connect(PyTypeObject *self, PyObject *args, PyObje
|
|||||||
return (PyObject *)ret;
|
return (PyObject *)ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void py_messaging_dealloc(PyObject *self)
|
static void py_imessaging_dealloc(PyObject *self)
|
||||||
{
|
{
|
||||||
messaging_Object *iface = (messaging_Object *)self;
|
imessaging_Object *iface = (imessaging_Object *)self;
|
||||||
talloc_free(iface->msg_ctx);
|
talloc_free(iface->msg_ctx);
|
||||||
self->ob_type->tp_free(self);
|
self->ob_type->tp_free(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *py_messaging_send(PyObject *self, PyObject *args, PyObject *kwargs)
|
static PyObject *py_imessaging_send(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||||
{
|
{
|
||||||
messaging_Object *iface = (messaging_Object *)self;
|
imessaging_Object *iface = (imessaging_Object *)self;
|
||||||
uint32_t msg_type;
|
uint32_t msg_type;
|
||||||
DATA_BLOB data;
|
DATA_BLOB data;
|
||||||
PyObject *target;
|
PyObject *target;
|
||||||
@ -143,7 +143,7 @@ static PyObject *py_messaging_send(PyObject *self, PyObject *args, PyObject *kwa
|
|||||||
if (!server_id_from_py(target, &server))
|
if (!server_id_from_py(target, &server))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
status = messaging_send(iface->msg_ctx, server, msg_type, &data);
|
status = imessaging_send(iface->msg_ctx, server, msg_type, &data);
|
||||||
if (NT_STATUS_IS_ERR(status)) {
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
PyErr_SetNTSTATUS(status);
|
PyErr_SetNTSTATUS(status);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -152,7 +152,7 @@ static PyObject *py_messaging_send(PyObject *self, PyObject *args, PyObject *kwa
|
|||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void py_msg_callback_wrapper(struct messaging_context *msg, void *private_data,
|
static void py_msg_callback_wrapper(struct imessaging_context *msg, void *private_data,
|
||||||
uint32_t msg_type,
|
uint32_t msg_type,
|
||||||
struct server_id server_id, DATA_BLOB *data)
|
struct server_id server_id, DATA_BLOB *data)
|
||||||
{
|
{
|
||||||
@ -163,9 +163,9 @@ static void py_msg_callback_wrapper(struct messaging_context *msg, void *private
|
|||||||
data->data, data->length);
|
data->data, data->length);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *py_messaging_register(PyObject *self, PyObject *args, PyObject *kwargs)
|
static PyObject *py_imessaging_register(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||||
{
|
{
|
||||||
messaging_Object *iface = (messaging_Object *)self;
|
imessaging_Object *iface = (imessaging_Object *)self;
|
||||||
int msg_type = -1;
|
int msg_type = -1;
|
||||||
PyObject *callback;
|
PyObject *callback;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
@ -180,11 +180,11 @@ static PyObject *py_messaging_register(PyObject *self, PyObject *args, PyObject
|
|||||||
|
|
||||||
if (msg_type == -1) {
|
if (msg_type == -1) {
|
||||||
uint32_t msg_type32 = msg_type;
|
uint32_t msg_type32 = msg_type;
|
||||||
status = messaging_register_tmp(iface->msg_ctx, callback,
|
status = imessaging_register_tmp(iface->msg_ctx, callback,
|
||||||
py_msg_callback_wrapper, &msg_type32);
|
py_msg_callback_wrapper, &msg_type32);
|
||||||
msg_type = msg_type32;
|
msg_type = msg_type32;
|
||||||
} else {
|
} else {
|
||||||
status = messaging_register(iface->msg_ctx, callback,
|
status = imessaging_register(iface->msg_ctx, callback,
|
||||||
msg_type, py_msg_callback_wrapper);
|
msg_type, py_msg_callback_wrapper);
|
||||||
}
|
}
|
||||||
if (NT_STATUS_IS_ERR(status)) {
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
@ -195,9 +195,9 @@ static PyObject *py_messaging_register(PyObject *self, PyObject *args, PyObject
|
|||||||
return PyLong_FromLong(msg_type);
|
return PyLong_FromLong(msg_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *py_messaging_deregister(PyObject *self, PyObject *args, PyObject *kwargs)
|
static PyObject *py_imessaging_deregister(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||||
{
|
{
|
||||||
messaging_Object *iface = (messaging_Object *)self;
|
imessaging_Object *iface = (imessaging_Object *)self;
|
||||||
int msg_type = -1;
|
int msg_type = -1;
|
||||||
PyObject *callback;
|
PyObject *callback;
|
||||||
const char *kwnames[] = { "callback", "msg_type", NULL };
|
const char *kwnames[] = { "callback", "msg_type", NULL };
|
||||||
@ -207,49 +207,49 @@ static PyObject *py_messaging_deregister(PyObject *self, PyObject *args, PyObjec
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
messaging_deregister(iface->msg_ctx, msg_type, callback);
|
imessaging_deregister(iface->msg_ctx, msg_type, callback);
|
||||||
|
|
||||||
Py_DECREF(callback);
|
Py_DECREF(callback);
|
||||||
|
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyMethodDef py_messaging_methods[] = {
|
static PyMethodDef py_imessaging_methods[] = {
|
||||||
{ "send", (PyCFunction)py_messaging_send, METH_VARARGS|METH_KEYWORDS,
|
{ "send", (PyCFunction)py_imessaging_send, METH_VARARGS|METH_KEYWORDS,
|
||||||
"S.send(target, msg_type, data) -> None\nSend a message" },
|
"S.send(target, msg_type, data) -> None\nSend a message" },
|
||||||
{ "register", (PyCFunction)py_messaging_register, METH_VARARGS|METH_KEYWORDS,
|
{ "register", (PyCFunction)py_imessaging_register, METH_VARARGS|METH_KEYWORDS,
|
||||||
"S.register(callback, msg_type=None) -> msg_type\nRegister a message handler" },
|
"S.register(callback, msg_type=None) -> msg_type\nRegister a message handler" },
|
||||||
{ "deregister", (PyCFunction)py_messaging_deregister, METH_VARARGS|METH_KEYWORDS,
|
{ "deregister", (PyCFunction)py_imessaging_deregister, METH_VARARGS|METH_KEYWORDS,
|
||||||
"S.deregister(callback, msg_type) -> None\nDeregister a message handler" },
|
"S.deregister(callback, msg_type) -> None\nDeregister a message handler" },
|
||||||
{ NULL, NULL, 0, NULL }
|
{ NULL, NULL, 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyObject *py_messaging_server_id(PyObject *obj, void *closure)
|
static PyObject *py_imessaging_server_id(PyObject *obj, void *closure)
|
||||||
{
|
{
|
||||||
messaging_Object *iface = (messaging_Object *)obj;
|
imessaging_Object *iface = (imessaging_Object *)obj;
|
||||||
struct server_id server_id = messaging_get_server_id(iface->msg_ctx);
|
struct server_id server_id = imessaging_get_server_id(iface->msg_ctx);
|
||||||
|
|
||||||
return Py_BuildValue("(iii)", server_id.pid, server_id.id2,
|
return Py_BuildValue("(iii)", server_id.pid, server_id.id2,
|
||||||
server_id.vnn);
|
server_id.vnn);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyGetSetDef py_messaging_getset[] = {
|
static PyGetSetDef py_imessaging_getset[] = {
|
||||||
{ discard_const_p(char, "server_id"), py_messaging_server_id, NULL,
|
{ discard_const_p(char, "server_id"), py_imessaging_server_id, NULL,
|
||||||
discard_const_p(char, "local server id") },
|
discard_const_p(char, "local server id") },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
PyTypeObject messaging_Type = {
|
PyTypeObject imessaging_Type = {
|
||||||
PyObject_HEAD_INIT(NULL) 0,
|
PyObject_HEAD_INIT(NULL) 0,
|
||||||
.tp_name = "messaging.Messaging",
|
.tp_name = "messaging.Messaging",
|
||||||
.tp_basicsize = sizeof(messaging_Object),
|
.tp_basicsize = sizeof(imessaging_Object),
|
||||||
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
|
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
|
||||||
.tp_new = py_messaging_connect,
|
.tp_new = py_imessaging_connect,
|
||||||
.tp_dealloc = py_messaging_dealloc,
|
.tp_dealloc = py_imessaging_dealloc,
|
||||||
.tp_methods = py_messaging_methods,
|
.tp_methods = py_imessaging_methods,
|
||||||
.tp_getset = py_messaging_getset,
|
.tp_getset = py_imessaging_getset,
|
||||||
.tp_doc = "Messaging(own_id=None, messaging_path=None)\n" \
|
.tp_doc = "Messaging(own_id=None, imessaging_path=None)\n" \
|
||||||
"Create a new object that can be used to communicate with the peers in the specified messaging path.\n" \
|
"Create a new object that can be used to communicate with the peers in the specified messaging path.\n" \
|
||||||
"If no path is specified, the default path from smb.conf will be used."
|
"If no path is specified, the default path from smb.conf will be used."
|
||||||
};
|
};
|
||||||
@ -258,13 +258,13 @@ void initmessaging(void)
|
|||||||
{
|
{
|
||||||
PyObject *mod;
|
PyObject *mod;
|
||||||
|
|
||||||
if (PyType_Ready(&messaging_Type) < 0)
|
if (PyType_Ready(&imessaging_Type) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mod = Py_InitModule3("messaging", NULL, "Internal RPC");
|
mod = Py_InitModule3("messaging", NULL, "Internal RPC");
|
||||||
if (mod == NULL)
|
if (mod == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Py_INCREF((PyObject *)&messaging_Type);
|
Py_INCREF((PyObject *)&imessaging_Type);
|
||||||
PyModule_AddObject(mod, "Messaging", (PyObject *)&messaging_Type);
|
PyModule_AddObject(mod, "Messaging", (PyObject *)&imessaging_Type);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ static bool test_debug;
|
|||||||
|
|
||||||
struct irpc_test_data
|
struct irpc_test_data
|
||||||
{
|
{
|
||||||
struct messaging_context *msg_ctx1, *msg_ctx2;
|
struct imessaging_context *msg_ctx1, *msg_ctx2;
|
||||||
struct tevent_context *ev;
|
struct tevent_context *ev;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -246,15 +246,15 @@ static bool irpc_setup(struct torture_context *tctx, void **_data)
|
|||||||
|
|
||||||
data->ev = tctx->ev;
|
data->ev = tctx->ev;
|
||||||
torture_assert(tctx, data->msg_ctx1 =
|
torture_assert(tctx, data->msg_ctx1 =
|
||||||
messaging_init(tctx,
|
imessaging_init(tctx,
|
||||||
lpcfg_messaging_path(tctx, tctx->lp_ctx),
|
lpcfg_imessaging_path(tctx, tctx->lp_ctx),
|
||||||
cluster_id(0, MSG_ID1),
|
cluster_id(0, MSG_ID1),
|
||||||
data->ev),
|
data->ev),
|
||||||
"Failed to init first messaging context");
|
"Failed to init first messaging context");
|
||||||
|
|
||||||
torture_assert(tctx, data->msg_ctx2 =
|
torture_assert(tctx, data->msg_ctx2 =
|
||||||
messaging_init(tctx,
|
imessaging_init(tctx,
|
||||||
lpcfg_messaging_path(tctx, tctx->lp_ctx),
|
lpcfg_imessaging_path(tctx, tctx->lp_ctx),
|
||||||
cluster_id(0, MSG_ID2),
|
cluster_id(0, MSG_ID2),
|
||||||
data->ev),
|
data->ev),
|
||||||
"Failed to init second messaging context");
|
"Failed to init second messaging context");
|
||||||
|
@ -29,24 +29,24 @@
|
|||||||
|
|
||||||
static uint32_t msg_pong;
|
static uint32_t msg_pong;
|
||||||
|
|
||||||
static void ping_message(struct messaging_context *msg, void *private_data,
|
static void ping_message(struct imessaging_context *msg, void *private_data,
|
||||||
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
|
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
|
||||||
{
|
{
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
status = messaging_send(msg, src, msg_pong, data);
|
status = imessaging_send(msg, src, msg_pong, data);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
printf("pong failed - %s\n", nt_errstr(status));
|
printf("pong failed - %s\n", nt_errstr(status));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pong_message(struct messaging_context *msg, void *private_data,
|
static void pong_message(struct imessaging_context *msg, void *private_data,
|
||||||
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
|
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
|
||||||
{
|
{
|
||||||
int *count = (int *)private_data;
|
int *count = (int *)private_data;
|
||||||
(*count)++;
|
(*count)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void exit_message(struct messaging_context *msg, void *private_data,
|
static void exit_message(struct imessaging_context *msg, void *private_data,
|
||||||
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
|
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
|
||||||
{
|
{
|
||||||
talloc_free(private_data);
|
talloc_free(private_data);
|
||||||
@ -59,8 +59,8 @@ static void exit_message(struct messaging_context *msg, void *private_data,
|
|||||||
static bool test_ping_speed(struct torture_context *tctx)
|
static bool test_ping_speed(struct torture_context *tctx)
|
||||||
{
|
{
|
||||||
struct tevent_context *ev;
|
struct tevent_context *ev;
|
||||||
struct messaging_context *msg_client_ctx;
|
struct imessaging_context *msg_client_ctx;
|
||||||
struct messaging_context *msg_server_ctx;
|
struct imessaging_context *msg_server_ctx;
|
||||||
int ping_count = 0;
|
int ping_count = 0;
|
||||||
int pong_count = 0;
|
int pong_count = 0;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
@ -71,24 +71,24 @@ static bool test_ping_speed(struct torture_context *tctx)
|
|||||||
|
|
||||||
ev = tctx->ev;
|
ev = tctx->ev;
|
||||||
|
|
||||||
msg_server_ctx = messaging_init(tctx,
|
msg_server_ctx = imessaging_init(tctx,
|
||||||
lpcfg_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, 1),
|
lpcfg_imessaging_path(tctx, tctx->lp_ctx), cluster_id(0, 1),
|
||||||
ev);
|
ev);
|
||||||
|
|
||||||
torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context");
|
torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context");
|
||||||
|
|
||||||
messaging_register_tmp(msg_server_ctx, NULL, ping_message, &msg_ping);
|
imessaging_register_tmp(msg_server_ctx, NULL, ping_message, &msg_ping);
|
||||||
messaging_register_tmp(msg_server_ctx, tctx, exit_message, &msg_exit);
|
imessaging_register_tmp(msg_server_ctx, tctx, exit_message, &msg_exit);
|
||||||
|
|
||||||
msg_client_ctx = messaging_init(tctx,
|
msg_client_ctx = imessaging_init(tctx,
|
||||||
lpcfg_messaging_path(tctx, tctx->lp_ctx),
|
lpcfg_imessaging_path(tctx, tctx->lp_ctx),
|
||||||
cluster_id(0, 2),
|
cluster_id(0, 2),
|
||||||
ev);
|
ev);
|
||||||
|
|
||||||
torture_assert(tctx, msg_client_ctx != NULL,
|
torture_assert(tctx, msg_client_ctx != NULL,
|
||||||
"msg_client_ctx messaging_init() failed");
|
"msg_client_ctx imessaging_init() failed");
|
||||||
|
|
||||||
messaging_register_tmp(msg_client_ctx, &pong_count, pong_message, &msg_pong);
|
imessaging_register_tmp(msg_client_ctx, &pong_count, pong_message, &msg_pong);
|
||||||
|
|
||||||
tv = timeval_current();
|
tv = timeval_current();
|
||||||
|
|
||||||
@ -100,8 +100,8 @@ static bool test_ping_speed(struct torture_context *tctx)
|
|||||||
data.data = discard_const_p(uint8_t, "testing");
|
data.data = discard_const_p(uint8_t, "testing");
|
||||||
data.length = strlen((const char *)data.data);
|
data.length = strlen((const char *)data.data);
|
||||||
|
|
||||||
status1 = messaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, &data);
|
status1 = imessaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, &data);
|
||||||
status2 = messaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, NULL);
|
status2 = imessaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, NULL);
|
||||||
|
|
||||||
torture_assert_ntstatus_ok(tctx, status1, "msg1 failed");
|
torture_assert_ntstatus_ok(tctx, status1, "msg1 failed");
|
||||||
ping_count++;
|
ping_count++;
|
||||||
@ -121,7 +121,7 @@ static bool test_ping_speed(struct torture_context *tctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
torture_comment(tctx, "sending exit\n");
|
torture_comment(tctx, "sending exit\n");
|
||||||
messaging_send(msg_client_ctx, cluster_id(0, 1), msg_exit, NULL);
|
imessaging_send(msg_client_ctx, cluster_id(0, 1), msg_exit, NULL);
|
||||||
|
|
||||||
torture_assert_int_equal(tctx, ping_count, pong_count, "ping test failed");
|
torture_assert_int_equal(tctx, ping_count, pong_count, "ping test failed");
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
struct finddcs_nbt_state {
|
struct finddcs_nbt_state {
|
||||||
struct tevent_context *ev;
|
struct tevent_context *ev;
|
||||||
struct tevent_req *req;
|
struct tevent_req *req;
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
|
|
||||||
const char *my_netbios_name;
|
const char *my_netbios_name;
|
||||||
const char *domain_name;
|
const char *domain_name;
|
||||||
@ -70,7 +70,7 @@ struct tevent_req *finddcs_nbt_send(TALLOC_CTX *mem_ctx,
|
|||||||
struct dom_sid *domain_sid,
|
struct dom_sid *domain_sid,
|
||||||
struct resolve_context *resolve_ctx,
|
struct resolve_context *resolve_ctx,
|
||||||
struct tevent_context *event_ctx,
|
struct tevent_context *event_ctx,
|
||||||
struct messaging_context *msg_ctx)
|
struct imessaging_context *msg_ctx)
|
||||||
{
|
{
|
||||||
struct finddcs_nbt_state *state;
|
struct finddcs_nbt_state *state;
|
||||||
struct nbt_name name;
|
struct nbt_name name;
|
||||||
@ -295,7 +295,7 @@ NTSTATUS finddcs_nbt(TALLOC_CTX *mem_ctx,
|
|||||||
struct dom_sid *domain_sid,
|
struct dom_sid *domain_sid,
|
||||||
struct resolve_context *resolve_ctx,
|
struct resolve_context *resolve_ctx,
|
||||||
struct tevent_context *event_ctx,
|
struct tevent_context *event_ctx,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
int *num_dcs, struct nbt_dc_name **dcs)
|
int *num_dcs, struct nbt_dc_name **dcs)
|
||||||
{
|
{
|
||||||
struct tevent_req *req = finddcs_nbt_send(mem_ctx,
|
struct tevent_req *req = finddcs_nbt_send(mem_ctx,
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
* \param
|
* \param
|
||||||
*/
|
*/
|
||||||
struct wbc_context *wbc_init(TALLOC_CTX *mem_ctx,
|
struct wbc_context *wbc_init(TALLOC_CTX *mem_ctx,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
struct tevent_context *event_ctx)
|
struct tevent_context *event_ctx)
|
||||||
{
|
{
|
||||||
struct wbc_context *ctx;
|
struct wbc_context *ctx;
|
||||||
|
@ -28,7 +28,7 @@ struct wbc_context {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct wbc_context *wbc_init(TALLOC_CTX *mem_ctx,
|
struct wbc_context *wbc_init(TALLOC_CTX *mem_ctx,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
struct tevent_context *event_ctx);
|
struct tevent_context *event_ctx);
|
||||||
|
|
||||||
struct composite_context *wbc_sids_to_xids_send(struct wbc_context *wbc_ctx,
|
struct composite_context *wbc_sids_to_xids_send(struct wbc_context *wbc_ctx,
|
||||||
|
@ -72,9 +72,9 @@ static NTSTATUS pyrpc_irpc_connect(TALLOC_CTX *mem_ctx, const char *irpc_server,
|
|||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct dcerpc_binding_handle **binding_handle)
|
struct dcerpc_binding_handle **binding_handle)
|
||||||
{
|
{
|
||||||
struct messaging_context *msg;
|
struct imessaging_context *msg;
|
||||||
|
|
||||||
msg = messaging_client_init(mem_ctx, lpcfg_messaging_path(mem_ctx, lp_ctx), event_ctx);
|
msg = imessaging_client_init(mem_ctx, lpcfg_imessaging_path(mem_ctx, lp_ctx), event_ctx);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(msg);
|
NT_STATUS_HAVE_NO_MEMORY(msg);
|
||||||
|
|
||||||
*binding_handle = irpc_binding_handle_by_name(mem_ctx, msg, irpc_server, table);
|
*binding_handle = irpc_binding_handle_by_name(mem_ctx, msg, irpc_server, table);
|
||||||
|
@ -45,16 +45,16 @@ void brl_set_ops(const struct brlock_ops *new_ops)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Open up the brlock database. Close it down using talloc_free(). We
|
Open up the brlock database. Close it down using talloc_free(). We
|
||||||
need the messaging_ctx to allow for pending lock notifications.
|
need the imessaging_ctx to allow for pending lock notifications.
|
||||||
*/
|
*/
|
||||||
struct brl_context *brl_init(TALLOC_CTX *mem_ctx, struct server_id server,
|
struct brl_context *brl_init(TALLOC_CTX *mem_ctx, struct server_id server,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct messaging_context *messaging_ctx)
|
struct imessaging_context *imessaging_ctx)
|
||||||
{
|
{
|
||||||
if (ops == NULL) {
|
if (ops == NULL) {
|
||||||
brl_tdb_init_ops();
|
brl_tdb_init_ops();
|
||||||
}
|
}
|
||||||
return ops->brl_init(mem_ctx, server, lp_ctx, messaging_ctx);
|
return ops->brl_init(mem_ctx, server, lp_ctx, imessaging_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct brl_handle *brl_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *ntvfs, DATA_BLOB *file_key)
|
struct brl_handle *brl_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *ntvfs, DATA_BLOB *file_key)
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
struct brlock_ops {
|
struct brlock_ops {
|
||||||
struct brl_context *(*brl_init)(TALLOC_CTX *, struct server_id ,
|
struct brl_context *(*brl_init)(TALLOC_CTX *, struct server_id ,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct messaging_context *);
|
struct imessaging_context *);
|
||||||
struct brl_handle *(*brl_create_handle)(TALLOC_CTX *, struct ntvfs_handle *, DATA_BLOB *);
|
struct brl_handle *(*brl_create_handle)(TALLOC_CTX *, struct ntvfs_handle *, DATA_BLOB *);
|
||||||
NTSTATUS (*brl_lock)(struct brl_context *,
|
NTSTATUS (*brl_lock)(struct brl_context *,
|
||||||
struct brl_handle *,
|
struct brl_handle *,
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
struct brl_context {
|
struct brl_context {
|
||||||
struct tdb_wrap *w;
|
struct tdb_wrap *w;
|
||||||
struct server_id server;
|
struct server_id server;
|
||||||
struct messaging_context *messaging_ctx;
|
struct imessaging_context *imessaging_ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -89,12 +89,12 @@ static bool brl_invalid_lock_range(uint64_t start, uint64_t size)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Open up the brlock.tdb database. Close it down using
|
Open up the brlock.tdb database. Close it down using
|
||||||
talloc_free(). We need the messaging_ctx to allow for
|
talloc_free(). We need the imessaging_ctx to allow for
|
||||||
pending lock notifications.
|
pending lock notifications.
|
||||||
*/
|
*/
|
||||||
static struct brl_context *brl_tdb_init(TALLOC_CTX *mem_ctx, struct server_id server,
|
static struct brl_context *brl_tdb_init(TALLOC_CTX *mem_ctx, struct server_id server,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct messaging_context *messaging_ctx)
|
struct imessaging_context *imessaging_ctx)
|
||||||
{
|
{
|
||||||
struct brl_context *brl;
|
struct brl_context *brl;
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ static struct brl_context *brl_tdb_init(TALLOC_CTX *mem_ctx, struct server_id se
|
|||||||
}
|
}
|
||||||
|
|
||||||
brl->server = server;
|
brl->server = server;
|
||||||
brl->messaging_ctx = messaging_ctx;
|
brl->imessaging_ctx = imessaging_ctx;
|
||||||
|
|
||||||
return brl;
|
return brl;
|
||||||
}
|
}
|
||||||
@ -419,7 +419,7 @@ static void brl_tdb_notify_unlock(struct brl_context *brl,
|
|||||||
if (locks[i].lock_type == PENDING_WRITE_LOCK) {
|
if (locks[i].lock_type == PENDING_WRITE_LOCK) {
|
||||||
last_notice = i;
|
last_notice = i;
|
||||||
}
|
}
|
||||||
messaging_send_ptr(brl->messaging_ctx, locks[i].context.server,
|
imessaging_send_ptr(brl->imessaging_ctx, locks[i].context.server,
|
||||||
MSG_BRL_RETRY, locks[i].notify_ptr);
|
MSG_BRL_RETRY, locks[i].notify_ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
struct notify_context {
|
struct notify_context {
|
||||||
struct tdb_wrap *w;
|
struct tdb_wrap *w;
|
||||||
struct server_id server;
|
struct server_id server;
|
||||||
struct messaging_context *messaging_ctx;
|
struct imessaging_context *imessaging_ctx;
|
||||||
struct notify_list *list;
|
struct notify_list *list;
|
||||||
struct notify_array *array;
|
struct notify_array *array;
|
||||||
int seqnum;
|
int seqnum;
|
||||||
@ -63,7 +63,7 @@ struct notify_list {
|
|||||||
#define NOTIFY_ENABLE_DEFAULT true
|
#define NOTIFY_ENABLE_DEFAULT true
|
||||||
|
|
||||||
static NTSTATUS notify_remove_all(struct notify_context *notify);
|
static NTSTATUS notify_remove_all(struct notify_context *notify);
|
||||||
static void notify_handler(struct messaging_context *msg_ctx, void *private_data,
|
static void notify_handler(struct imessaging_context *msg_ctx, void *private_data,
|
||||||
uint32_t msg_type, struct server_id server_id, DATA_BLOB *data);
|
uint32_t msg_type, struct server_id server_id, DATA_BLOB *data);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -71,18 +71,18 @@ static void notify_handler(struct messaging_context *msg_ctx, void *private_data
|
|||||||
*/
|
*/
|
||||||
static int notify_destructor(struct notify_context *notify)
|
static int notify_destructor(struct notify_context *notify)
|
||||||
{
|
{
|
||||||
messaging_deregister(notify->messaging_ctx, MSG_PVFS_NOTIFY, notify);
|
imessaging_deregister(notify->imessaging_ctx, MSG_PVFS_NOTIFY, notify);
|
||||||
notify_remove_all(notify);
|
notify_remove_all(notify);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Open up the notify.tdb database. You should close it down using
|
Open up the notify.tdb database. You should close it down using
|
||||||
talloc_free(). We need the messaging_ctx to allow for notifications
|
talloc_free(). We need the imessaging_ctx to allow for notifications
|
||||||
via internal messages
|
via internal messages
|
||||||
*/
|
*/
|
||||||
struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server,
|
struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server,
|
||||||
struct messaging_context *messaging_ctx,
|
struct imessaging_context *imessaging_ctx,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct tevent_context *ev,
|
struct tevent_context *ev,
|
||||||
struct share_config *scfg)
|
struct share_config *scfg)
|
||||||
@ -109,7 +109,7 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server,
|
|||||||
}
|
}
|
||||||
|
|
||||||
notify->server = server;
|
notify->server = server;
|
||||||
notify->messaging_ctx = messaging_ctx;
|
notify->imessaging_ctx = imessaging_ctx;
|
||||||
notify->list = NULL;
|
notify->list = NULL;
|
||||||
notify->array = NULL;
|
notify->array = NULL;
|
||||||
notify->seqnum = tdb_get_seqnum(notify->w->tdb);
|
notify->seqnum = tdb_get_seqnum(notify->w->tdb);
|
||||||
@ -118,7 +118,7 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server,
|
|||||||
|
|
||||||
/* register with the messaging subsystem for the notify
|
/* register with the messaging subsystem for the notify
|
||||||
message type */
|
message type */
|
||||||
messaging_register(notify->messaging_ctx, notify,
|
imessaging_register(notify->imessaging_ctx, notify,
|
||||||
MSG_PVFS_NOTIFY, notify_handler);
|
MSG_PVFS_NOTIFY, notify_handler);
|
||||||
|
|
||||||
notify->sys_notify_ctx = sys_notify_context_create(scfg, notify, ev);
|
notify->sys_notify_ctx = sys_notify_context_create(scfg, notify, ev);
|
||||||
@ -247,7 +247,7 @@ static NTSTATUS notify_save(struct notify_context *notify)
|
|||||||
/*
|
/*
|
||||||
handle incoming notify messages
|
handle incoming notify messages
|
||||||
*/
|
*/
|
||||||
static void notify_handler(struct messaging_context *msg_ctx, void *private_data,
|
static void notify_handler(struct imessaging_context *msg_ctx, void *private_data,
|
||||||
uint32_t msg_type, struct server_id server_id, DATA_BLOB *data)
|
uint32_t msg_type, struct server_id server_id, DATA_BLOB *data)
|
||||||
{
|
{
|
||||||
struct notify_context *notify = talloc_get_type(private_data, struct notify_context);
|
struct notify_context *notify = talloc_get_type(private_data, struct notify_context);
|
||||||
@ -563,7 +563,7 @@ static void notify_send(struct notify_context *notify, struct notify_entry *e,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = messaging_send(notify->messaging_ctx, e->server,
|
status = imessaging_send(notify->imessaging_ctx, e->server,
|
||||||
MSG_PVFS_NOTIFY, &data);
|
MSG_PVFS_NOTIFY, &data);
|
||||||
talloc_free(tmp_ctx);
|
talloc_free(tmp_ctx);
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ void odb_set_ops(const struct opendb_ops *new_ops)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Open up the openfiles.tdb database. Close it down using
|
Open up the openfiles.tdb database. Close it down using
|
||||||
talloc_free(). We need the messaging_ctx to allow for pending open
|
talloc_free(). We need the imessaging_ctx to allow for pending open
|
||||||
notifications.
|
notifications.
|
||||||
*/
|
*/
|
||||||
struct odb_context *odb_init(TALLOC_CTX *mem_ctx,
|
struct odb_context *odb_init(TALLOC_CTX *mem_ctx,
|
||||||
|
@ -74,13 +74,13 @@ struct odb_lock {
|
|||||||
} can_open;
|
} can_open;
|
||||||
};
|
};
|
||||||
|
|
||||||
static NTSTATUS odb_oplock_break_send(struct messaging_context *msg_ctx,
|
static NTSTATUS odb_oplock_break_send(struct imessaging_context *msg_ctx,
|
||||||
struct opendb_entry *e,
|
struct opendb_entry *e,
|
||||||
uint8_t level);
|
uint8_t level);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Open up the openfiles.tdb database. Close it down using
|
Open up the openfiles.tdb database. Close it down using
|
||||||
talloc_free(). We need the messaging_ctx to allow for pending open
|
talloc_free(). We need the imessaging_ctx to allow for pending open
|
||||||
notifications.
|
notifications.
|
||||||
*/
|
*/
|
||||||
static struct odb_context *odb_tdb_init(TALLOC_CTX *mem_ctx,
|
static struct odb_context *odb_tdb_init(TALLOC_CTX *mem_ctx,
|
||||||
@ -294,7 +294,7 @@ static NTSTATUS odb_push_record(struct odb_lock *lck, struct opendb_file *file)
|
|||||||
/*
|
/*
|
||||||
send an oplock break to a client
|
send an oplock break to a client
|
||||||
*/
|
*/
|
||||||
static NTSTATUS odb_oplock_break_send(struct messaging_context *msg_ctx,
|
static NTSTATUS odb_oplock_break_send(struct imessaging_context *msg_ctx,
|
||||||
struct opendb_entry *e,
|
struct opendb_entry *e,
|
||||||
uint8_t level)
|
uint8_t level)
|
||||||
{
|
{
|
||||||
@ -311,7 +311,7 @@ static NTSTATUS odb_oplock_break_send(struct messaging_context *msg_ctx,
|
|||||||
|
|
||||||
blob = data_blob_const(&op_break, sizeof(op_break));
|
blob = data_blob_const(&op_break, sizeof(op_break));
|
||||||
|
|
||||||
status = messaging_send(msg_ctx, e->server,
|
status = imessaging_send(msg_ctx, e->server,
|
||||||
MSG_NTVFS_OPLOCK_BREAK, &blob);
|
MSG_NTVFS_OPLOCK_BREAK, &blob);
|
||||||
NT_STATUS_NOT_OK_RETURN(status);
|
NT_STATUS_NOT_OK_RETURN(status);
|
||||||
|
|
||||||
@ -611,7 +611,7 @@ static NTSTATUS odb_tdb_close_file(struct odb_lock *lck, void *file_handle,
|
|||||||
|
|
||||||
/* send any pending notifications, removing them once sent */
|
/* send any pending notifications, removing them once sent */
|
||||||
for (i=0;i<lck->file.num_pending;i++) {
|
for (i=0;i<lck->file.num_pending;i++) {
|
||||||
messaging_send_ptr(odb->ntvfs_ctx->msg_ctx,
|
imessaging_send_ptr(odb->ntvfs_ctx->msg_ctx,
|
||||||
lck->file.pending[i].server,
|
lck->file.pending[i].server,
|
||||||
MSG_PVFS_RETRY_OPEN,
|
MSG_PVFS_RETRY_OPEN,
|
||||||
lck->file.pending[i].notify_ptr);
|
lck->file.pending[i].notify_ptr);
|
||||||
@ -666,7 +666,7 @@ static NTSTATUS odb_tdb_update_oplock(struct odb_lock *lck, void *file_handle,
|
|||||||
|
|
||||||
/* send any pending notifications, removing them once sent */
|
/* send any pending notifications, removing them once sent */
|
||||||
for (i=0;i<lck->file.num_pending;i++) {
|
for (i=0;i<lck->file.num_pending;i++) {
|
||||||
messaging_send_ptr(odb->ntvfs_ctx->msg_ctx,
|
imessaging_send_ptr(odb->ntvfs_ctx->msg_ctx,
|
||||||
lck->file.pending[i].server,
|
lck->file.pending[i].server,
|
||||||
MSG_PVFS_RETRY_OPEN,
|
MSG_PVFS_RETRY_OPEN,
|
||||||
lck->file.pending[i].notify_ptr);
|
lck->file.pending[i].notify_ptr);
|
||||||
|
@ -201,7 +201,7 @@ struct ntvfs_context {
|
|||||||
struct server_id server_id;
|
struct server_id server_id;
|
||||||
struct loadparm_context *lp_ctx;
|
struct loadparm_context *lp_ctx;
|
||||||
struct tevent_context *event_ctx;
|
struct tevent_context *event_ctx;
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
void *private_data;
|
void *private_data;
|
||||||
@ -330,7 +330,7 @@ struct ntvfs_critical_sizes {
|
|||||||
.sizeof_ntvfs_handle_data = sizeof(struct ntvfs_handle_data), \
|
.sizeof_ntvfs_handle_data = sizeof(struct ntvfs_handle_data), \
|
||||||
}
|
}
|
||||||
|
|
||||||
struct messaging_context;
|
struct imessaging_context;
|
||||||
#include "librpc/gen_ndr/security.h"
|
#include "librpc/gen_ndr/security.h"
|
||||||
#include "librpc/gen_ndr/s4_notify.h"
|
#include "librpc/gen_ndr/s4_notify.h"
|
||||||
#include "ntvfs/ntvfs_proto.h"
|
#include "ntvfs/ntvfs_proto.h"
|
||||||
|
@ -153,7 +153,7 @@ bool ntvfs_interface_differs(const struct ntvfs_critical_sizes *const iface)
|
|||||||
NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, struct share_config *scfg, enum ntvfs_type type,
|
NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, struct share_config *scfg, enum ntvfs_type type,
|
||||||
enum protocol_types protocol,
|
enum protocol_types protocol,
|
||||||
uint64_t ntvfs_client_caps,
|
uint64_t ntvfs_client_caps,
|
||||||
struct tevent_context *ev, struct messaging_context *msg,
|
struct tevent_context *ev, struct imessaging_context *msg,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct server_id server_id, struct ntvfs_context **_ctx)
|
struct server_id server_id, struct ntvfs_context **_ctx)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@ struct pvfs_oplock {
|
|||||||
uint32_t level;
|
uint32_t level;
|
||||||
struct timeval break_to_level_II;
|
struct timeval break_to_level_II;
|
||||||
struct timeval break_to_none;
|
struct timeval break_to_none;
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
static NTSTATUS pvfs_oplock_release_internal(struct pvfs_file_handle *h,
|
static NTSTATUS pvfs_oplock_release_internal(struct pvfs_file_handle *h,
|
||||||
@ -158,7 +158,7 @@ static void pvfs_oplock_break(struct pvfs_oplock *opl, uint8_t level)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pvfs_oplock_break_dispatch(struct messaging_context *msg,
|
static void pvfs_oplock_break_dispatch(struct imessaging_context *msg,
|
||||||
void *private_data, uint32_t msg_type,
|
void *private_data, uint32_t msg_type,
|
||||||
struct server_id src, DATA_BLOB *data)
|
struct server_id src, DATA_BLOB *data)
|
||||||
{
|
{
|
||||||
@ -169,7 +169,7 @@ static void pvfs_oplock_break_dispatch(struct messaging_context *msg,
|
|||||||
ZERO_STRUCT(opb);
|
ZERO_STRUCT(opb);
|
||||||
|
|
||||||
/* we need to check that this one is for us. See
|
/* we need to check that this one is for us. See
|
||||||
messaging_send_ptr() for the other side of this.
|
imessaging_send_ptr() for the other side of this.
|
||||||
*/
|
*/
|
||||||
if (data->length == sizeof(struct opendb_oplock_break)) {
|
if (data->length == sizeof(struct opendb_oplock_break)) {
|
||||||
struct opendb_oplock_break *p;
|
struct opendb_oplock_break *p;
|
||||||
@ -192,7 +192,7 @@ static void pvfs_oplock_break_dispatch(struct messaging_context *msg,
|
|||||||
|
|
||||||
static int pvfs_oplock_destructor(struct pvfs_oplock *opl)
|
static int pvfs_oplock_destructor(struct pvfs_oplock *opl)
|
||||||
{
|
{
|
||||||
messaging_deregister(opl->msg_ctx, MSG_NTVFS_OPLOCK_BREAK, opl);
|
imessaging_deregister(opl->msg_ctx, MSG_NTVFS_OPLOCK_BREAK, opl);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ NTSTATUS pvfs_setup_oplock(struct pvfs_file *f, uint32_t oplock_granted)
|
|||||||
opl->level = level;
|
opl->level = level;
|
||||||
opl->msg_ctx = f->pvfs->ntvfs->ctx->msg_ctx;
|
opl->msg_ctx = f->pvfs->ntvfs->ctx->msg_ctx;
|
||||||
|
|
||||||
status = messaging_register(opl->msg_ctx,
|
status = imessaging_register(opl->msg_ctx,
|
||||||
opl,
|
opl,
|
||||||
MSG_NTVFS_OPLOCK_BREAK,
|
MSG_NTVFS_OPLOCK_BREAK,
|
||||||
pvfs_oplock_break_dispatch);
|
pvfs_oplock_break_dispatch);
|
||||||
|
@ -33,7 +33,7 @@ struct pvfs_wait {
|
|||||||
void (*handler)(void *, enum pvfs_wait_notice);
|
void (*handler)(void *, enum pvfs_wait_notice);
|
||||||
void *private_data;
|
void *private_data;
|
||||||
int msg_type;
|
int msg_type;
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
struct tevent_context *ev;
|
struct tevent_context *ev;
|
||||||
struct ntvfs_request *req;
|
struct ntvfs_request *req;
|
||||||
enum pvfs_wait_notice reason;
|
enum pvfs_wait_notice reason;
|
||||||
@ -56,7 +56,7 @@ NTSTATUS pvfs_async_setup(struct ntvfs_module_context *ntvfs,
|
|||||||
/*
|
/*
|
||||||
receive a completion message for a wait
|
receive a completion message for a wait
|
||||||
*/
|
*/
|
||||||
static void pvfs_wait_dispatch(struct messaging_context *msg,
|
static void pvfs_wait_dispatch(struct imessaging_context *msg,
|
||||||
void *private_data, uint32_t msg_type,
|
void *private_data, uint32_t msg_type,
|
||||||
struct server_id src, DATA_BLOB *data)
|
struct server_id src, DATA_BLOB *data)
|
||||||
{
|
{
|
||||||
@ -66,7 +66,7 @@ static void pvfs_wait_dispatch(struct messaging_context *msg,
|
|||||||
void *p = NULL;
|
void *p = NULL;
|
||||||
|
|
||||||
/* we need to check that this one is for us. See
|
/* we need to check that this one is for us. See
|
||||||
messaging_send_ptr() for the other side of this.
|
imessaging_send_ptr() for the other side of this.
|
||||||
*/
|
*/
|
||||||
if (data->length == sizeof(void *)) {
|
if (data->length == sizeof(void *)) {
|
||||||
void **pp;
|
void **pp;
|
||||||
@ -116,7 +116,7 @@ static void pvfs_wait_timeout(struct tevent_context *ev,
|
|||||||
static int pvfs_wait_destructor(struct pvfs_wait *pwait)
|
static int pvfs_wait_destructor(struct pvfs_wait *pwait)
|
||||||
{
|
{
|
||||||
if (pwait->msg_type != -1) {
|
if (pwait->msg_type != -1) {
|
||||||
messaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait);
|
imessaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait);
|
||||||
}
|
}
|
||||||
DLIST_REMOVE(pwait->pvfs->wait_list, pwait);
|
DLIST_REMOVE(pwait->pvfs->wait_list, pwait);
|
||||||
return 0;
|
return 0;
|
||||||
@ -162,7 +162,7 @@ struct pvfs_wait *pvfs_wait_message(struct pvfs_state *pvfs,
|
|||||||
/* register with the messaging subsystem for this message
|
/* register with the messaging subsystem for this message
|
||||||
type */
|
type */
|
||||||
if (msg_type != -1) {
|
if (msg_type != -1) {
|
||||||
messaging_register(pwait->msg_ctx,
|
imessaging_register(pwait->msg_ctx,
|
||||||
pwait,
|
pwait,
|
||||||
msg_type,
|
msg_type,
|
||||||
pvfs_wait_dispatch);
|
pvfs_wait_dispatch);
|
||||||
|
@ -40,7 +40,7 @@ static uint32_t num_backends;
|
|||||||
_PUBLIC_ struct sys_lease_context *sys_lease_context_create(struct share_config *scfg,
|
_PUBLIC_ struct sys_lease_context *sys_lease_context_create(struct share_config *scfg,
|
||||||
TALLOC_CTX *mem_ctx,
|
TALLOC_CTX *mem_ctx,
|
||||||
struct tevent_context *ev,
|
struct tevent_context *ev,
|
||||||
struct messaging_context *msg,
|
struct imessaging_context *msg,
|
||||||
sys_lease_send_break_fn break_send)
|
sys_lease_send_break_fn break_send)
|
||||||
{
|
{
|
||||||
struct sys_lease_context *ctx;
|
struct sys_lease_context *ctx;
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
|
|
||||||
struct sys_lease_context;
|
struct sys_lease_context;
|
||||||
struct opendb_entry;
|
struct opendb_entry;
|
||||||
struct messaging_context;
|
struct imessaging_context;
|
||||||
struct tevent_context;
|
struct tevent_context;
|
||||||
|
|
||||||
typedef NTSTATUS (*sys_lease_send_break_fn)(struct messaging_context *,
|
typedef NTSTATUS (*sys_lease_send_break_fn)(struct imessaging_context *,
|
||||||
struct opendb_entry *,
|
struct opendb_entry *,
|
||||||
uint8_t level);
|
uint8_t level);
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ struct sys_lease_ops {
|
|||||||
|
|
||||||
struct sys_lease_context {
|
struct sys_lease_context {
|
||||||
struct tevent_context *event_ctx;
|
struct tevent_context *event_ctx;
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
sys_lease_send_break_fn break_send;
|
sys_lease_send_break_fn break_send;
|
||||||
void *private_data; /* for use of backend */
|
void *private_data; /* for use of backend */
|
||||||
const struct sys_lease_ops *ops;
|
const struct sys_lease_ops *ops;
|
||||||
@ -53,7 +53,7 @@ NTSTATUS sys_lease_init(void);
|
|||||||
struct sys_lease_context *sys_lease_context_create(struct share_config *scfg,
|
struct sys_lease_context *sys_lease_context_create(struct share_config *scfg,
|
||||||
TALLOC_CTX *mem_ctx,
|
TALLOC_CTX *mem_ctx,
|
||||||
struct tevent_context *ev,
|
struct tevent_context *ev,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
sys_lease_send_break_fn break_send);
|
sys_lease_send_break_fn break_send);
|
||||||
|
|
||||||
NTSTATUS sys_lease_setup(struct sys_lease_context *ctx,
|
NTSTATUS sys_lease_setup(struct sys_lease_context *ctx,
|
||||||
|
@ -332,7 +332,7 @@ bool run_init_functions(init_module_fn *fns);
|
|||||||
* Will return an array of function pointers to initialization functions
|
* Will return an array of function pointers to initialization functions
|
||||||
*/
|
*/
|
||||||
init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *subsystem);
|
init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *subsystem);
|
||||||
const char *lpcfg_messaging_path(TALLOC_CTX *mem_ctx,
|
const char *lpcfg_imessaging_path(TALLOC_CTX *mem_ctx,
|
||||||
struct loadparm_context *lp_ctx);
|
struct loadparm_context *lp_ctx);
|
||||||
struct smb_iconv_handle *smb_iconv_handle_reinit_lp(TALLOC_CTX *mem_ctx,
|
struct smb_iconv_handle *smb_iconv_handle_reinit_lp(TALLOC_CTX *mem_ctx,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
|
@ -292,7 +292,7 @@ init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, struct loadparm_context
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *lpcfg_messaging_path(TALLOC_CTX *mem_ctx,
|
const char *lpcfg_imessaging_path(TALLOC_CTX *mem_ctx,
|
||||||
struct loadparm_context *lp_ctx)
|
struct loadparm_context *lp_ctx)
|
||||||
{
|
{
|
||||||
return smbd_tmp_path(mem_ctx, lp_ctx, "msg");
|
return smbd_tmp_path(mem_ctx, lp_ctx, "msg");
|
||||||
|
@ -366,7 +366,7 @@ _PUBLIC_ NTSTATUS dcesrv_endpoint_connect(struct dcesrv_context *dce_ctx,
|
|||||||
const struct dcesrv_endpoint *ep,
|
const struct dcesrv_endpoint *ep,
|
||||||
struct auth_session_info *session_info,
|
struct auth_session_info *session_info,
|
||||||
struct tevent_context *event_ctx,
|
struct tevent_context *event_ctx,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
struct server_id server_id,
|
struct server_id server_id,
|
||||||
uint32_t state_flags,
|
uint32_t state_flags,
|
||||||
struct dcesrv_connection **_p)
|
struct dcesrv_connection **_p)
|
||||||
|
@ -111,7 +111,7 @@ struct dcesrv_call_state {
|
|||||||
struct tevent_context *event_ctx;
|
struct tevent_context *event_ctx;
|
||||||
|
|
||||||
/* the message_context that will be used for async replies */
|
/* the message_context that will be used for async replies */
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
|
|
||||||
/* this is the pointer to the allocated function struct */
|
/* this is the pointer to the allocated function struct */
|
||||||
void *r;
|
void *r;
|
||||||
@ -200,7 +200,7 @@ struct dcesrv_connection {
|
|||||||
struct tevent_context *event_ctx;
|
struct tevent_context *event_ctx;
|
||||||
|
|
||||||
/* the message_context that will be used for this connection */
|
/* the message_context that will be used for this connection */
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
|
|
||||||
/* the server_id that will be used for this connection */
|
/* the server_id that will be used for this connection */
|
||||||
struct server_id server_id;
|
struct server_id server_id;
|
||||||
@ -319,7 +319,7 @@ NTSTATUS dcesrv_endpoint_connect(struct dcesrv_context *dce_ctx,
|
|||||||
const struct dcesrv_endpoint *ep,
|
const struct dcesrv_endpoint *ep,
|
||||||
struct auth_session_info *session_info,
|
struct auth_session_info *session_info,
|
||||||
struct tevent_context *event_ctx,
|
struct tevent_context *event_ctx,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
struct server_id server_id,
|
struct server_id server_id,
|
||||||
uint32_t state_flags,
|
uint32_t state_flags,
|
||||||
struct dcesrv_connection **_p);
|
struct dcesrv_connection **_p);
|
||||||
|
@ -221,11 +221,11 @@ static NTSTATUS samba_terminate(struct irpc_message *msg,
|
|||||||
static NTSTATUS setup_parent_messaging(struct tevent_context *event_ctx,
|
static NTSTATUS setup_parent_messaging(struct tevent_context *event_ctx,
|
||||||
struct loadparm_context *lp_ctx)
|
struct loadparm_context *lp_ctx)
|
||||||
{
|
{
|
||||||
struct messaging_context *msg;
|
struct imessaging_context *msg;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
|
||||||
msg = messaging_init(talloc_autofree_context(),
|
msg = imessaging_init(talloc_autofree_context(),
|
||||||
lpcfg_messaging_path(event_ctx, lp_ctx),
|
lpcfg_imessaging_path(event_ctx, lp_ctx),
|
||||||
cluster_id(0, SAMBA_PARENT_TASKID), event_ctx);
|
cluster_id(0, SAMBA_PARENT_TASKID), event_ctx);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(msg);
|
NT_STATUS_HAVE_NO_MEMORY(msg);
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ NTSTATUS stream_new_connection_merge(struct tevent_context *ev,
|
|||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
const struct model_ops *model_ops,
|
const struct model_ops *model_ops,
|
||||||
const struct stream_server_ops *stream_ops,
|
const struct stream_server_ops *stream_ops,
|
||||||
struct messaging_context *msg_ctx,
|
struct imessaging_context *msg_ctx,
|
||||||
void *private_data,
|
void *private_data,
|
||||||
struct stream_connection **_srv_conn)
|
struct stream_connection **_srv_conn)
|
||||||
{
|
{
|
||||||
@ -186,11 +186,11 @@ static void stream_new_connection(struct tevent_context *ev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* setup to receive internal messages on this connection */
|
/* setup to receive internal messages on this connection */
|
||||||
srv_conn->msg_ctx = messaging_init(srv_conn,
|
srv_conn->msg_ctx = imessaging_init(srv_conn,
|
||||||
lpcfg_messaging_path(srv_conn, lp_ctx),
|
lpcfg_imessaging_path(srv_conn, lp_ctx),
|
||||||
srv_conn->server_id, ev);
|
srv_conn->server_id, ev);
|
||||||
if (!srv_conn->msg_ctx) {
|
if (!srv_conn->msg_ctx) {
|
||||||
stream_terminate_connection(srv_conn, "messaging_init() failed");
|
stream_terminate_connection(srv_conn, "imessaging_init() failed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ struct stream_connection {
|
|||||||
} event;
|
} event;
|
||||||
|
|
||||||
struct socket_context *socket;
|
struct socket_context *socket;
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
struct loadparm_context *lp_ctx;
|
struct loadparm_context *lp_ctx;
|
||||||
|
|
||||||
struct tstream_context *tstream;
|
struct tstream_context *tstream;
|
||||||
|
@ -78,12 +78,12 @@ static void task_server_callback(struct tevent_context *event_ctx,
|
|||||||
task->server_id = server_id;
|
task->server_id = server_id;
|
||||||
task->lp_ctx = lp_ctx;
|
task->lp_ctx = lp_ctx;
|
||||||
|
|
||||||
task->msg_ctx = messaging_init(task,
|
task->msg_ctx = imessaging_init(task,
|
||||||
lpcfg_messaging_path(task, task->lp_ctx),
|
lpcfg_imessaging_path(task, task->lp_ctx),
|
||||||
task->server_id,
|
task->server_id,
|
||||||
task->event_ctx);
|
task->event_ctx);
|
||||||
if (!task->msg_ctx) {
|
if (!task->msg_ctx) {
|
||||||
task_server_terminate(task, "messaging_init() failed", true);
|
task_server_terminate(task, "imessaging_init() failed", true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
struct task_server {
|
struct task_server {
|
||||||
struct tevent_context *event_ctx;
|
struct tevent_context *event_ctx;
|
||||||
const struct model_ops *model_ops;
|
const struct model_ops *model_ops;
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
struct loadparm_context *lp_ctx;
|
struct loadparm_context *lp_ctx;
|
||||||
struct server_id server_id;
|
struct server_id server_id;
|
||||||
void *private_data;
|
void *private_data;
|
||||||
|
@ -366,7 +366,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
|
|||||||
};
|
};
|
||||||
struct gensec_ntlm_state *state;
|
struct gensec_ntlm_state *state;
|
||||||
struct tevent_context *ev;
|
struct tevent_context *ev;
|
||||||
struct messaging_context *msg;
|
struct imessaging_context *msg;
|
||||||
|
|
||||||
NTSTATUS nt_status;
|
NTSTATUS nt_status;
|
||||||
bool first = false;
|
bool first = false;
|
||||||
@ -463,7 +463,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
|
|||||||
const char *winbind_method[] = { "winbind", NULL };
|
const char *winbind_method[] = { "winbind", NULL };
|
||||||
struct auth_context *auth_context;
|
struct auth_context *auth_context;
|
||||||
|
|
||||||
msg = messaging_client_init(state, lpcfg_messaging_path(state, lp_ctx), ev);
|
msg = imessaging_client_init(state, lpcfg_imessaging_path(state, lp_ctx), ev);
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
talloc_free(mem_ctx);
|
talloc_free(mem_ctx);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -306,7 +306,7 @@ static NTSTATUS wreplsrv_scavenging_replica_non_active_records(struct wreplsrv_s
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct verify_state {
|
struct verify_state {
|
||||||
struct messaging_context *msg_ctx;
|
struct imessaging_context *msg_ctx;
|
||||||
struct wreplsrv_service *service;
|
struct wreplsrv_service *service;
|
||||||
struct winsdb_record *rec;
|
struct winsdb_record *rec;
|
||||||
struct nbtd_proxy_wins_challenge r;
|
struct nbtd_proxy_wins_challenge r;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user