void (*new_conn)(struct tevent_context *,
struct loadparm_context *, struct socket_context *,
struct server_id , void *),
- void *private)
+ void *private_data)
{
NTSTATUS status;
struct socket_context *connected_socket;
return;
}
- talloc_steal(private, connected_socket);
+ talloc_steal(private_data, connected_socket);
- new_conn(ev, lp_ctx, connected_socket, cluster_id(pid, socket_get_fd(connected_socket)), private);
+ new_conn(ev, lp_ctx, connected_socket, cluster_id(pid, socket_get_fd(connected_socket)), private_data);
}
/*
struct loadparm_context *lp_ctx,
const char *service_name,
void (*new_task_fn)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *),
- void *private)
+ void *private_data)
{
pid_t pid;
int i, num_children;
/* the service has given us a private pointer that
encapsulates the context it needs for this new connection -
everything else will be freed */
- talloc_steal(ev2, private);
+ talloc_steal(ev2, private_data);
/* this will free all the listening sockets and all state that
is not associated with this new connection */
prefork_reload_after_fork();
/* setup this new connection: process will bind to it's sockets etc */
- new_task_fn(ev2, lp_ctx, cluster_id(pid, 0), private);
+ new_task_fn(ev2, lp_ctx, cluster_id(pid, 0), private_data);
num_children = lp_parm_int(lp_ctx, NULL, "prefork children", service_name, 0);
if (num_children == 0) {
struct loadparm_context *,
struct socket_context *,
struct server_id , void *),
- void *private)
+ void *private_data)
{
NTSTATUS status;
struct socket_context *connected_socket;
return;
}
- talloc_steal(private, connected_socket);
+ talloc_steal(private_data, connected_socket);
/* The cluster_id(0, fd) cannot collide with the incrementing
* task below, as the first component is 0, not 1 */
new_conn(ev, lp_ctx, connected_socket,
- cluster_id(0, socket_get_fd(connected_socket)), private);
+ cluster_id(0, socket_get_fd(connected_socket)), private_data);
}
/*
struct loadparm_context *lp_ctx,
const char *service_name,
void (*new_task)(struct tevent_context *, struct loadparm_context *, struct server_id, void *),
- void *private)
+ void *private_data)
{
static uint32_t taskid = 0;
* in the accept connection above, and unlikly to collide with
* PIDs from process modal standard (don't run samba as
* init) */
- new_task(ev, lp_ctx, cluster_id(1, taskid++), private);
+ new_task(ev, lp_ctx, cluster_id(1, taskid++), private_data);
}
void (*new_conn)(struct tevent_context *,
struct loadparm_context *, struct socket_context *,
struct server_id , void *),
- void *private)
+ void *private_data)
{
NTSTATUS status;
struct socket_context *sock2;
/* the service has given us a private pointer that
encapsulates the context it needs for this new connection -
everything else will be freed */
- talloc_steal(ev2, private);
- talloc_steal(private, sock2);
+ talloc_steal(ev2, private_data);
+ talloc_steal(private_data, sock2);
/* this will free all the listening sockets and all state that
is not associated with this new connection */
talloc_free(s);
/* setup this new connection. Cluster ID is PID based for this process modal */
- new_conn(ev2, lp_ctx, sock2, cluster_id(pid, 0), private);
+ new_conn(ev2, lp_ctx, sock2, cluster_id(pid, 0), private_data);
/* we can't return to the top level here, as that event context is gone,
so we now process events in the new event context until there are no
struct loadparm_context *lp_ctx,
const char *service_name,
void (*new_task)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *),
- void *private)
+ void *private_data)
{
pid_t pid;
struct tevent_context *ev2;
/* the service has given us a private pointer that
encapsulates the context it needs for this new connection -
everything else will be freed */
- talloc_steal(ev2, private);
+ talloc_steal(ev2, private_data);
/* this will free all the listening sockets and all state that
is not associated with this new connection */
setproctitle("task %s server_id[%d]", service_name, pid);
/* setup this new task. Cluster ID is PID based for this process modal */
- new_task(ev2, lp_ctx, cluster_id(pid, 0), private);
+ new_task(ev2, lp_ctx, cluster_id(pid, 0), private_data);
/* we can't return to the top level here, as that event context is gone,
so we now process events in the new event context until there are no
struct socket_context *sock;
struct loadparm_context *lp_ctx;
void (*new_conn)(struct tevent_context *, struct loadparm_context *lp_ctx, struct socket_context *, uint32_t , void *);
- void *private;
+ void *private_data;
};
static void *thread_connection_fn(void *thread_parm)
{
struct new_conn_state *new_conn = talloc_get_type(thread_parm, struct new_conn_state);
- new_conn->new_conn(new_conn->ev, new_conn->lp_ctx, new_conn->sock, pthread_self(), new_conn->private);
+ new_conn->new_conn(new_conn->ev, new_conn->lp_ctx, new_conn->sock, pthread_self(), new_conn->private_data);
/* run this connection from here */
event_loop_wait(new_conn->ev);
struct loadparm_context *,
struct socket_context *,
uint32_t , void *),
- void *private)
+ void *private_data)
{
NTSTATUS status;
int rc;
}
state->new_conn = new_conn;
- state->private = private;
+ state->private_data = private_data;
state->lp_ctx = lp_ctx;
state->ev = ev2;
struct loadparm_context *lp_ctx;
void (*new_task)(struct tevent_context *, struct loadparm_context *,
uint32_t , void *);
- void *private;
+ void *private_data;
};
static void *thread_task_fn(void *thread_parm)
struct new_task_state *new_task = talloc_get_type(thread_parm, struct new_task_state);
new_task->new_task(new_task->ev, new_task->lp_ctx, pthread_self(),
- new_task->private);
+ new_task->private_data);
/* run this connection from here */
event_loop_wait(new_task->ev);
void (*new_task)(struct tevent_context *,
struct loadparm_context *,
uint32_t , void *),
- void *private)
+ void *private_data)
{
int rc;
pthread_t thread_id;
state->new_task = new_task;
state->lp_ctx = lp_ctx;
- state->private = private;
+ state->private_data = private_data;
state->ev = ev2;
pthread_attr_init(&thread_attr);
handle io on stdin
*/
static void server_stdin_handler(struct tevent_context *event_ctx, struct tevent_fd *fde,
- uint16_t flags, void *private)
+ uint16_t flags, void *private_data)
{
- const char *binary_name = (const char *)private;
+ const char *binary_name = (const char *)private_data;
uint8_t c;
if (read(0, &c, 1) == 0) {
DEBUG(0,("%s: EOF on stdin - terminating\n", binary_name));
*/
_NORETURN_ static void max_runtime_handler(struct tevent_context *ev,
struct tevent_timer *te,
- struct timeval t, void *private)
+ struct timeval t, void *private_data)
{
- const char *binary_name = (const char *)private;
+ const char *binary_name = (const char *)private_data;
DEBUG(0,("%s: maximum runtime exceeded - terminating\n", binary_name));
exit(0);
}
stream_terminate_connection(pipe_conn->connection, nt_errstr(status));
}
-static NTSTATUS named_pipe_full_request(void *private, DATA_BLOB blob, size_t *size)
+static NTSTATUS named_pipe_full_request(void *private_data, DATA_BLOB blob, size_t *size)
{
if (blob.length < 8) {
return STATUS_MORE_ENTRIES;
struct tevent_context *event_ctx;
const struct model_ops *model_ops;
struct socket_context *sock;
- void *private;
+ void *private_data;
};
}
static void stream_io_handler_fde(struct tevent_context *ev, struct tevent_fd *fde,
- uint16_t flags, void *private)
+ uint16_t flags, void *private_data)
{
- struct stream_connection *conn = talloc_get_type(private,
+ struct stream_connection *conn = talloc_get_type(private_data,
struct stream_connection);
stream_io_handler(conn, flags);
}
-void stream_io_handler_callback(void *private, uint16_t flags)
+void stream_io_handler_callback(void *private_data, uint16_t flags)
{
- struct stream_connection *conn = talloc_get_type(private,
+ struct stream_connection *conn = talloc_get_type(private_data,
struct stream_connection);
stream_io_handler(conn, flags);
}
static void stream_new_connection(struct tevent_context *ev,
struct loadparm_context *lp_ctx,
struct socket_context *sock,
- struct server_id server_id, void *private)
+ struct server_id server_id, void *private_data)
{
- struct stream_socket *stream_socket = talloc_get_type(private, struct stream_socket);
+ struct stream_socket *stream_socket = talloc_get_type(private_data, struct stream_socket);
struct stream_connection *srv_conn;
struct socket_address *c, *s;
talloc_steal(srv_conn, sock);
- srv_conn->private = stream_socket->private;
+ srv_conn->private = stream_socket->private_data;
srv_conn->model_ops = stream_socket->model_ops;
srv_conn->socket = sock;
srv_conn->server_id = server_id;
called when someone opens a connection to one of our listening ports
*/
static void stream_accept_handler(struct tevent_context *ev, struct tevent_fd *fde,
- uint16_t flags, void *private)
+ uint16_t flags, void *private_data)
{
- struct stream_socket *stream_socket = talloc_get_type(private, struct stream_socket);
+ struct stream_socket *stream_socket = talloc_get_type(private_data, struct stream_socket);
/* ask the process model to create us a process for this new
connection. When done, it calls stream_new_connection()
const char *sock_addr,
uint16_t *port,
const char *socket_options,
- void *private)
+ void *private_data)
{
NTSTATUS status;
struct stream_socket *stream_socket;
tevent_fd_set_close_fn(fde, socket_tevent_fd_close_fn);
socket_set_flags(stream_socket->sock, SOCKET_FLAG_NOCLOSE);
- stream_socket->private = talloc_reference(stream_socket, private);
+ stream_socket->private_data = talloc_reference(stream_socket, private_data);
stream_socket->ops = stream_ops;
stream_socket->event_ctx = event_context;
stream_socket->model_ops = model_ops;
*/
static void task_server_callback(struct tevent_context *event_ctx,
struct loadparm_context *lp_ctx,
- struct server_id server_id, void *private)
+ struct server_id server_id, void *private_data)
{
- struct task_state *state = talloc_get_type(private, struct task_state);
+ struct task_state *state = talloc_get_type(private_data, struct task_state);
struct task_server *task;
task = talloc(event_ctx, struct task_server);