Logo Search packages:      
Sourcecode: likewise-open version File versions

messages.c File Reference

Detailed Description

Module for internal messaging between Samba daemons.

The idea is that if a part of Samba wants to do communication with another Samba process then it will do a message_register() of a dispatch function, and use message_send_pid() to send messages to that process.

The dispatch function is given the pid of the sender, and it can use that to reply by message_send_pid(). See ping_message() for a simple example.

Dispatch functions must be able to cope with incoming messages on an *odd* byte boundary.

This system doesn't have any inherent size limitations but is not very efficient for large messages or when messages are sent in very quick succession.

Definition in file messages.c.

#include "includes.h"
#include "librpc/gen_ndr/messaging.h"
#include "librpc/gen_ndr/ndr_messaging.h"

Go to the source code of this file.


struct  messaging_callback
struct  msg_all


bool message_send_all (struct messaging_context *msg_ctx, int msg_type, const void *buf, size_t len, int *n_sent)
void messaging_deregister (struct messaging_context *ctx, uint32_t msg_type, void *private_data)
void messaging_dispatch_rec (struct messaging_context *msg_ctx, struct messaging_rec *rec)
struct event_context * messaging_event_context (struct messaging_context *msg_ctx)
struct messaging_context * messaging_init (TALLOC_CTX *mem_ctx, struct server_id server_id, struct event_context *ev)
NTSTATUS messaging_register (struct messaging_context *msg_ctx, void *private_data, uint32_t msg_type, void(*fn)(struct messaging_context *msg, void *private_data, uint32_t msg_type, struct server_id server_id, DATA_BLOB *data))
NTSTATUS messaging_reinit (struct messaging_context *msg_ctx)
NTSTATUS messaging_send (struct messaging_context *msg_ctx, struct server_id server, uint32_t msg_type, const DATA_BLOB *data)
NTSTATUS messaging_send_buf (struct messaging_context *msg_ctx, struct server_id server, uint32_t msg_type, const uint8 *buf, size_t len)
static void ping_message (struct messaging_context *msg_ctx, void *private_data, uint32_t msg_type, struct server_id src, DATA_BLOB *data)
static int traverse_fn (struct db_record *rec, const struct connections_key *ckey, const struct connections_data *crec, void *state)

Generated by  Doxygen 1.6.0   Back to index