1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

ctdb-daemon: Rename struct ctdb_control_ip_iface to ctdb_addr_info_old

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2015-10-29 14:46:21 +11:00 committed by Martin Schwenke
parent cb0be4126f
commit 357bc60947
5 changed files with 30 additions and 33 deletions

View File

@ -3060,16 +3060,15 @@ int ctdb_ctrl_get_all_tunables(struct ctdb_context *ctdb,
/*
add a public address to a node
*/
int ctdb_ctrl_add_public_ip(struct ctdb_context *ctdb,
struct timeval timeout,
uint32_t destnode,
struct ctdb_control_ip_iface *pub)
int ctdb_ctrl_add_public_ip(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
struct ctdb_addr_info_old *pub)
{
TDB_DATA data;
int32_t res;
int ret;
data.dsize = offsetof(struct ctdb_control_ip_iface, iface) + pub->len;
data.dsize = offsetof(struct ctdb_addr_info_old, iface) + pub->len;
data.dptr = (unsigned char *)pub;
ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_ADD_PUBLIC_IP, 0, data, NULL,
@ -3085,16 +3084,15 @@ int ctdb_ctrl_add_public_ip(struct ctdb_context *ctdb,
/*
delete a public address from a node
*/
int ctdb_ctrl_del_public_ip(struct ctdb_context *ctdb,
struct timeval timeout,
uint32_t destnode,
struct ctdb_control_ip_iface *pub)
int ctdb_ctrl_del_public_ip(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
struct ctdb_addr_info_old *pub)
{
TDB_DATA data;
int32_t res;
int ret;
data.dsize = offsetof(struct ctdb_control_ip_iface, iface) + pub->len;
data.dsize = offsetof(struct ctdb_addr_info_old, iface) + pub->len;
data.dptr = (unsigned char *)pub;
ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_DEL_PUBLIC_IP, 0, data, NULL,

View File

@ -401,10 +401,10 @@ int ctdb_ctrl_get_all_tunables(struct ctdb_context *ctdb,
int ctdb_ctrl_add_public_ip(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
struct ctdb_control_ip_iface *pub);
struct ctdb_addr_info_old *pub);
int ctdb_ctrl_del_public_ip(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
struct ctdb_control_ip_iface *pub);
struct ctdb_addr_info_old *pub);
int ctdb_ctrl_killtcp(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,

View File

@ -923,7 +923,7 @@ enum ctdb_runstate {
struct holding a ctdb_sock_addr and an interface name,
used to add/remove public addresses
*/
struct ctdb_control_ip_iface {
struct ctdb_addr_info_old {
ctdb_sock_addr addr;
uint32_t mask;
uint32_t len;

View File

@ -4020,22 +4020,22 @@ int32_t ctdb_control_send_gratious_arp(struct ctdb_context *ctdb, TDB_DATA indat
int32_t ctdb_control_add_public_address(struct ctdb_context *ctdb, TDB_DATA indata)
{
struct ctdb_control_ip_iface *pub = (struct ctdb_control_ip_iface *)indata.dptr;
struct ctdb_addr_info_old *pub = (struct ctdb_addr_info_old *)indata.dptr;
int ret;
/* verify the size of indata */
if (indata.dsize < offsetof(struct ctdb_control_ip_iface, iface)) {
DEBUG(DEBUG_ERR,(__location__ " Too small indata to hold a ctdb_control_ip_iface structure\n"));
if (indata.dsize < offsetof(struct ctdb_addr_info_old, iface)) {
DEBUG(DEBUG_ERR,(__location__ " Too small indata to hold a ctdb_addr_info structure\n"));
return -1;
}
if (indata.dsize !=
( offsetof(struct ctdb_control_ip_iface, iface)
( offsetof(struct ctdb_addr_info_old, iface)
+ pub->len ) ){
DEBUG(DEBUG_ERR,(__location__ " Wrong size of indata. Was %u bytes "
"but should be %u bytes\n",
(unsigned)indata.dsize,
(unsigned)(offsetof(struct ctdb_control_ip_iface, iface)+pub->len)));
(unsigned)(offsetof(struct ctdb_addr_info_old, iface)+pub->len)));
return -1;
}
@ -4075,22 +4075,22 @@ int32_t ctdb_control_del_public_address(struct ctdb_context *ctdb,
struct ctdb_req_control_old *c,
TDB_DATA indata, bool *async_reply)
{
struct ctdb_control_ip_iface *pub = (struct ctdb_control_ip_iface *)indata.dptr;
struct ctdb_addr_info_old *pub = (struct ctdb_addr_info_old *)indata.dptr;
struct ctdb_vnn *vnn;
/* verify the size of indata */
if (indata.dsize < offsetof(struct ctdb_control_ip_iface, iface)) {
DEBUG(DEBUG_ERR,(__location__ " Too small indata to hold a ctdb_control_ip_iface structure\n"));
if (indata.dsize < offsetof(struct ctdb_addr_info_old, iface)) {
DEBUG(DEBUG_ERR,(__location__ " Too small indata to hold a ctdb_addr_info structure\n"));
return -1;
}
if (indata.dsize !=
( offsetof(struct ctdb_control_ip_iface, iface)
( offsetof(struct ctdb_addr_info_old, iface)
+ pub->len ) ){
DEBUG(DEBUG_ERR,(__location__ " Wrong size of indata. Was %u bytes "
"but should be %u bytes\n",
(unsigned)indata.dsize,
(unsigned)(offsetof(struct ctdb_control_ip_iface, iface)+pub->len)));
(unsigned)(offsetof(struct ctdb_addr_info_old, iface)+pub->len)));
return -1;
}
@ -4389,14 +4389,13 @@ static int ctdb_reloadips_child(struct ctdb_context *ctdb)
if (vnn == NULL) {
/* Delete IP ips->ips[i] */
struct ctdb_control_ip_iface *pub;
struct ctdb_addr_info_old *pub;
DEBUG(DEBUG_NOTICE,
("IP %s no longer configured, deleting it\n",
ctdb_addr_to_str(&ips->ips[i].addr)));
pub = talloc_zero(mem_ctx,
struct ctdb_control_ip_iface);
pub = talloc_zero(mem_ctx, struct ctdb_addr_info_old);
CTDB_NO_MEMORY(ctdb, pub);
pub->addr = ips->ips[i].addr;
@ -4405,7 +4404,7 @@ static int ctdb_reloadips_child(struct ctdb_context *ctdb)
timeout = TAKEOVER_TIMEOUT();
data.dsize = offsetof(struct ctdb_control_ip_iface,
data.dsize = offsetof(struct ctdb_addr_info_old,
iface) + pub->len;
data.dptr = (uint8_t *)pub;
@ -4436,7 +4435,7 @@ static int ctdb_reloadips_child(struct ctdb_context *ctdb)
}
if (i == ips->num) {
/* Add IP ips->ips[i] */
struct ctdb_control_ip_iface *pub;
struct ctdb_addr_info_old *pub;
const char *ifaces = NULL;
uint32_t len;
int iface = 0;
@ -4473,7 +4472,7 @@ static int ctdb_reloadips_child(struct ctdb_context *ctdb)
len = strlen(ifaces) + 1;
pub = talloc_zero_size(mem_ctx,
offsetof(struct ctdb_control_ip_iface, iface) + len);
offsetof(struct ctdb_addr_info_old, iface) + len);
CTDB_NO_MEMORY(ctdb, pub);
pub->addr = vnn->public_address;
@ -4483,7 +4482,7 @@ static int ctdb_reloadips_child(struct ctdb_context *ctdb)
timeout = TAKEOVER_TIMEOUT();
data.dsize = offsetof(struct ctdb_control_ip_iface,
data.dsize = offsetof(struct ctdb_addr_info_old,
iface) + pub->len;
data.dptr = (uint8_t *)pub;

View File

@ -2376,7 +2376,7 @@ static int control_addip(struct ctdb_context *ctdb, int argc, const char **argv)
int len, retries = 0;
unsigned mask;
ctdb_sock_addr addr;
struct ctdb_control_ip_iface *pub;
struct ctdb_addr_info_old *pub;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
struct ctdb_public_ip_list_old *ips;
@ -2414,7 +2414,7 @@ static int control_addip(struct ctdb_context *ctdb, int argc, const char **argv)
*/
alarm(0);
len = offsetof(struct ctdb_control_ip_iface, iface) + strlen(argv[1]) + 1;
len = offsetof(struct ctdb_addr_info_old, iface) + strlen(argv[1]) + 1;
pub = talloc_size(tmp_ctx, len);
CTDB_NO_MEMORY(ctdb, pub);
@ -2555,7 +2555,7 @@ static int control_delip(struct ctdb_context *ctdb, int argc, const char **argv)
{
int i, ret;
ctdb_sock_addr addr;
struct ctdb_control_ip_iface pub;
struct ctdb_addr_info_old pub;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
struct ctdb_public_ip_list_old *ips;