diff options
| author | Martin Schwenke <martin@meltin.net> | 2009-11-11 12:16:30 +1100 |
|---|---|---|
| committer | Martin Schwenke <martin@meltin.net> | 2009-11-11 12:16:30 +1100 |
| commit | 9dabb86f3f5270a17882fa72be7d79cd23032d5e (patch) | |
| tree | 8ed033041dbfbdd20c975d28a18f41a3793ea52a /ctdb/include | |
| parent | 8767c894a0388f576a6bdd625d2917628f49150d (diff) | |
| parent | 14a6592511eb8dc9930f6722856c91d7b5f97889 (diff) | |
Merge commit 'origin/master'
(This used to be ctdb commit ffb911896704ddf6bd5a66e43ba2ae8c382e68de)
Diffstat (limited to 'ctdb/include')
| -rw-r--r-- | ctdb/include/ctdb.h | 15 | ||||
| -rw-r--r-- | ctdb/include/ctdb_private.h | 24 |
2 files changed, 35 insertions, 4 deletions
diff --git a/ctdb/include/ctdb.h b/ctdb/include/ctdb.h index abe09a3f96..db4c5ccc4b 100644 --- a/ctdb/include/ctdb.h +++ b/ctdb/include/ctdb.h @@ -111,6 +111,10 @@ struct ctdb_call_info { */ #define CTDB_SRVID_TAKEOVER_RUN_RESPONSE 0xFD00000000000000LL +/* A port reserved for samba (top 32 bits) + */ +#define CTDB_SRVID_SAMBA_NOTIFY 0xFE00000000000000LL + /* used on the domain socket, send a pdu to the local daemon */ #define CTDB_CURRENT_NODE 0xF0000001 /* send a broadcast to all nodes in the cluster, active or not */ @@ -144,6 +148,15 @@ struct ctdb_client_control_state { } async; }; +struct ctdb_client_notify_register { + uint64_t srvid; + uint32_t len; + uint8_t notify_data[1]; +}; + +struct ctdb_client_notify_deregister { + uint64_t srvid; +}; struct event_context; @@ -196,7 +209,7 @@ int ctdb_ip_to_nodeid(struct ctdb_context *ctdb, const char *nodeip); start the ctdb protocol */ int ctdb_start(struct ctdb_context *ctdb); -int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork); +int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, bool use_syslog); /* attach to a ctdb database diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 2f4937e60f..ebb6d4ae0a 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -54,6 +54,11 @@ struct takeover_run_reply { }; /* + * pid of the ctdbd daemon + */ +extern pid_t ctdbd_pid; + +/* a tcp connection description */ struct ctdb_tcp_connection { @@ -160,7 +165,6 @@ typedef void (*ctdb_control_callback_fn_t)(struct ctdb_context *, int32_t status, TDB_DATA data, const char *errormsg, void *private_data); - /* structure describing a connected client in the daemon */ @@ -173,6 +177,7 @@ struct ctdb_client { struct ctdb_tcp_list *tcp_list; uint32_t db_id; uint32_t num_persistent_updates; + struct ctdb_client_notify_list *notify; }; @@ -445,8 +450,9 @@ struct ctdb_context { TALLOC_CTX *eventscripts_ctx; /* a context to hold data for the RUN_EVENTSCRIPTS control */ uint32_t *recd_ping_count; TALLOC_CTX *release_ips_ctx; /* a context used to automatically drop all IPs if we fail to recover the node */ - TALLOC_CTX *script_monitoring_ctx; /* a context where we store results while running the monitor event */ - TALLOC_CTX *last_monitoring_ctx; + TALLOC_CTX *script_monitor_ctx; /* a context where we store results while running the monitor event */ + TALLOC_CTX *last_monitor_ctx; + TALLOC_CTX *event_script_ctx; /* non-monitoring events */ TALLOC_CTX *banning_ctx; }; @@ -612,6 +618,9 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS = 0, CTDB_CONTROL_SET_DB_PRIORITY = 111, CTDB_CONTROL_GET_DB_PRIORITY = 112, CTDB_CONTROL_TRANSACTION_CANCEL = 113, + CTDB_CONTROL_REGISTER_NOTIFY = 114, + CTDB_CONTROL_DEREGISTER_NOTIFY = 115, + CTDB_CONTROL_TRANS2_ACTIVE = 116, }; /* @@ -1461,6 +1470,9 @@ int32_t ctdb_control_trans2_finished(struct ctdb_context *ctdb, struct ctdb_req_control *c); int32_t ctdb_control_trans2_error(struct ctdb_context *ctdb, struct ctdb_req_control *c); +int32_t ctdb_control_trans2_active(struct ctdb_context *ctdb, + struct ctdb_req_control *c, + uint32_t db_id); char *ctdb_addr_to_str(ctdb_sock_addr *addr); unsigned ctdb_addr_to_port(ctdb_sock_addr *addr); @@ -1501,4 +1513,10 @@ int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata); int32_t ctdb_control_get_ban_state(struct ctdb_context *ctdb, TDB_DATA *outdata); int32_t ctdb_control_set_db_priority(struct ctdb_context *ctdb, TDB_DATA indata); +int32_t ctdb_control_register_notify(struct ctdb_context *ctdb, uint32_t client_id, TDB_DATA indata); + +int32_t ctdb_control_deregister_notify(struct ctdb_context *ctdb, uint32_t client_id, TDB_DATA indata); + +int start_syslog_daemon(struct ctdb_context *ctdb); + #endif |
