mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-daemon: Rename struct ctdb_control_tcp_addr to ctdb_connection
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
parent
699ee0df94
commit
a82ee238b5
@ -808,9 +808,9 @@ struct ctdb_uptime {
|
|||||||
struct timeval last_recovery_finished;
|
struct timeval last_recovery_finished;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ctdb_control_tcp_addr {
|
struct ctdb_connection {
|
||||||
ctdb_sock_addr src;
|
ctdb_sock_addr src;
|
||||||
ctdb_sock_addr dest;
|
ctdb_sock_addr dst;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ctdb_ban_time {
|
struct ctdb_ban_time {
|
||||||
|
@ -375,7 +375,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
|
|||||||
return ctdb_control_get_public_ips(ctdb, c, outdata);
|
return ctdb_control_get_public_ips(ctdb, c, outdata);
|
||||||
|
|
||||||
case CTDB_CONTROL_TCP_CLIENT:
|
case CTDB_CONTROL_TCP_CLIENT:
|
||||||
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_control_tcp_addr));
|
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_connection));
|
||||||
return ctdb_control_tcp_client(ctdb, client_id, indata);
|
return ctdb_control_tcp_client(ctdb, client_id, indata);
|
||||||
|
|
||||||
case CTDB_CONTROL_STARTUP:
|
case CTDB_CONTROL_STARTUP:
|
||||||
|
@ -2813,7 +2813,7 @@ int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
|
|||||||
TDB_DATA indata)
|
TDB_DATA indata)
|
||||||
{
|
{
|
||||||
struct ctdb_client *client = reqid_find(ctdb->idr, client_id, struct ctdb_client);
|
struct ctdb_client *client = reqid_find(ctdb->idr, client_id, struct ctdb_client);
|
||||||
struct ctdb_control_tcp_addr *tcp_sock = NULL;
|
struct ctdb_connection *tcp_sock = NULL;
|
||||||
struct ctdb_tcp_list *tcp;
|
struct ctdb_tcp_list *tcp;
|
||||||
struct ctdb_tcp_connection t;
|
struct ctdb_tcp_connection t;
|
||||||
int ret;
|
int ret;
|
||||||
@ -2827,15 +2827,15 @@ int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
tcp_sock = (struct ctdb_control_tcp_addr *)indata.dptr;
|
tcp_sock = (struct ctdb_connection *)indata.dptr;
|
||||||
|
|
||||||
addr = tcp_sock->src;
|
addr = tcp_sock->src;
|
||||||
ctdb_canonicalize_ip(&addr, &tcp_sock->src);
|
ctdb_canonicalize_ip(&addr, &tcp_sock->src);
|
||||||
addr = tcp_sock->dest;
|
addr = tcp_sock->dst;
|
||||||
ctdb_canonicalize_ip(&addr, &tcp_sock->dest);
|
ctdb_canonicalize_ip(&addr, &tcp_sock->dst);
|
||||||
|
|
||||||
ZERO_STRUCT(addr);
|
ZERO_STRUCT(addr);
|
||||||
memcpy(&addr, &tcp_sock->dest, sizeof(addr));
|
memcpy(&addr, &tcp_sock->dst, sizeof(addr));
|
||||||
vnn = find_public_ip_vnn(ctdb, &addr);
|
vnn = find_public_ip_vnn(ctdb, &addr);
|
||||||
if (vnn == NULL) {
|
if (vnn == NULL) {
|
||||||
switch (addr.sa.sa_family) {
|
switch (addr.sa.sa_family) {
|
||||||
@ -2877,12 +2877,12 @@ int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
|
|||||||
CTDB_NO_MEMORY(ctdb, tcp);
|
CTDB_NO_MEMORY(ctdb, tcp);
|
||||||
|
|
||||||
tcp->connection.src_addr = tcp_sock->src;
|
tcp->connection.src_addr = tcp_sock->src;
|
||||||
tcp->connection.dst_addr = tcp_sock->dest;
|
tcp->connection.dst_addr = tcp_sock->dst;
|
||||||
|
|
||||||
DLIST_ADD(client->tcp_list, tcp);
|
DLIST_ADD(client->tcp_list, tcp);
|
||||||
|
|
||||||
t.src_addr = tcp_sock->src;
|
t.src_addr = tcp_sock->src;
|
||||||
t.dst_addr = tcp_sock->dest;
|
t.dst_addr = tcp_sock->dst;
|
||||||
|
|
||||||
data.dptr = (uint8_t *)&t;
|
data.dptr = (uint8_t *)&t;
|
||||||
data.dsize = sizeof(t);
|
data.dsize = sizeof(t);
|
||||||
@ -2890,13 +2890,13 @@ int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
|
|||||||
switch (addr.sa.sa_family) {
|
switch (addr.sa.sa_family) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
DEBUG(DEBUG_INFO,("registered tcp client for %u->%s:%u (client_id %u pid %u)\n",
|
DEBUG(DEBUG_INFO,("registered tcp client for %u->%s:%u (client_id %u pid %u)\n",
|
||||||
(unsigned)ntohs(tcp_sock->dest.ip.sin_port),
|
(unsigned)ntohs(tcp_sock->dst.ip.sin_port),
|
||||||
ctdb_addr_to_str(&tcp_sock->src),
|
ctdb_addr_to_str(&tcp_sock->src),
|
||||||
(unsigned)ntohs(tcp_sock->src.ip.sin_port), client_id, client->pid));
|
(unsigned)ntohs(tcp_sock->src.ip.sin_port), client_id, client->pid));
|
||||||
break;
|
break;
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
DEBUG(DEBUG_INFO,("registered tcp client for %u->%s:%u (client_id %u pid %u)\n",
|
DEBUG(DEBUG_INFO,("registered tcp client for %u->%s:%u (client_id %u pid %u)\n",
|
||||||
(unsigned)ntohs(tcp_sock->dest.ip6.sin6_port),
|
(unsigned)ntohs(tcp_sock->dst.ip6.sin6_port),
|
||||||
ctdb_addr_to_str(&tcp_sock->src),
|
ctdb_addr_to_str(&tcp_sock->src),
|
||||||
(unsigned)ntohs(tcp_sock->src.ip6.sin6_port), client_id, client->pid));
|
(unsigned)ntohs(tcp_sock->src.ip6.sin6_port), client_id, client->pid));
|
||||||
break;
|
break;
|
||||||
|
@ -1186,7 +1186,7 @@ int ctdbd_register_ips(struct ctdbd_connection *conn,
|
|||||||
void *private_data),
|
void *private_data),
|
||||||
void *private_data)
|
void *private_data)
|
||||||
{
|
{
|
||||||
struct ctdb_control_tcp_addr p;
|
struct ctdb_connection p;
|
||||||
TDB_DATA data = { .dptr = (uint8_t *)&p, .dsize = sizeof(p) };
|
TDB_DATA data = { .dptr = (uint8_t *)&p, .dsize = sizeof(p) };
|
||||||
int ret;
|
int ret;
|
||||||
struct sockaddr_storage client;
|
struct sockaddr_storage client;
|
||||||
@ -1201,11 +1201,11 @@ int ctdbd_register_ips(struct ctdbd_connection *conn,
|
|||||||
|
|
||||||
switch (client.ss_family) {
|
switch (client.ss_family) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
memcpy(&p.dest.ip, &server, sizeof(p.dest.ip));
|
memcpy(&p.dst.ip, &server, sizeof(p.dst.ip));
|
||||||
memcpy(&p.src.ip, &client, sizeof(p.src.ip));
|
memcpy(&p.src.ip, &client, sizeof(p.src.ip));
|
||||||
break;
|
break;
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
memcpy(&p.dest.ip6, &server, sizeof(p.dest.ip6));
|
memcpy(&p.dst.ip6, &server, sizeof(p.dst.ip6));
|
||||||
memcpy(&p.src.ip6, &client, sizeof(p.src.ip6));
|
memcpy(&p.src.ip6, &client, sizeof(p.src.ip6));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user