diff options
author | Tim Prouty <tprouty@samba.org> | 2008-12-02 23:29:57 -0800 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2008-12-03 10:40:20 -0800 |
commit | 1eb743ab8e8b1141f99fabd3e4a46895c6dcc17e (patch) | |
tree | a43eb854b68ef6d65d6120d5ec0441bc26ea9612 /source3 | |
parent | fcbf88115c217cfe5090f8d60ab7627681c648c8 (diff) | |
download | samba-1eb743ab8e8b1141f99fabd3e4a46895c6dcc17e.tar.gz samba-1eb743ab8e8b1141f99fabd3e4a46895c6dcc17e.tar.bz2 samba-1eb743ab8e8b1141f99fabd3e4a46895c6dcc17e.zip |
s3: Change sockaddr util function names for consistency
Also eliminates name conflicts with OneFS system libraries
Diffstat (limited to 'source3')
-rw-r--r-- | source3/client/client.c | 2 | ||||
-rw-r--r-- | source3/include/proto.h | 4 | ||||
-rw-r--r-- | source3/lib/interface.c | 12 | ||||
-rw-r--r-- | source3/lib/util_sock.c | 10 | ||||
-rw-r--r-- | source3/libads/kerberos.c | 6 | ||||
-rw-r--r-- | source3/libsmb/cliconnect.c | 2 | ||||
-rw-r--r-- | source3/libsmb/clidfs.c | 4 | ||||
-rw-r--r-- | source3/libsmb/libsmb_server.c | 6 | ||||
-rw-r--r-- | source3/libsmb/namequery.c | 10 | ||||
-rw-r--r-- | source3/libsmb/namequery_dc.c | 4 | ||||
-rw-r--r-- | source3/rpcclient/rpcclient.c | 2 | ||||
-rw-r--r-- | source3/torture/locktest.c | 4 | ||||
-rw-r--r-- | source3/torture/masktest.c | 4 | ||||
-rw-r--r-- | source3/torture/torture.c | 2 | ||||
-rw-r--r-- | source3/utils/net.c | 2 | ||||
-rw-r--r-- | source3/utils/smbcacls.c | 2 | ||||
-rw-r--r-- | source3/utils/smbcquotas.c | 2 | ||||
-rw-r--r-- | source3/utils/smbfilter.c | 2 | ||||
-rw-r--r-- | source3/winbindd/winbindd_cm.c | 2 |
19 files changed, 41 insertions, 41 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index 39f8f90bba..da789161c9 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -4623,7 +4623,7 @@ static int do_message_op(void) snprintf(name_type_hex, sizeof(name_type_hex), "#%X", name_type); fstrcat(server_name, name_type_hex); - zero_addr(&ss); + zero_sockaddr(&ss); if (have_ip) ss = dest_ss; diff --git a/source3/include/proto.h b/source3/include/proto.h index f2bbb07f92..d9430e2909 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1396,13 +1396,13 @@ bool is_loopback_ip_v4(struct in_addr ip); bool is_loopback_addr(const struct sockaddr *pss); bool is_zero_addr(const struct sockaddr *pss); void zero_ip_v4(struct in_addr *ip); -void zero_addr(struct sockaddr_storage *pss); +void zero_sockaddr(struct sockaddr_storage *pss); void in_addr_to_sockaddr_storage(struct sockaddr_storage *ss, struct in_addr ip); bool same_net(const struct sockaddr *ip1, const struct sockaddr *ip2, const struct sockaddr *mask); -bool addr_equal(const struct sockaddr *ip1, +bool sockaddr_equal(const struct sockaddr *ip1, const struct sockaddr *ip2); bool is_address_any(const struct sockaddr *psa); uint16_t get_sockaddr_port(const struct sockaddr_storage *pss); diff --git a/source3/lib/interface.c b/source3/lib/interface.c index f533ec92c7..48fa4d32a9 100644 --- a/source3/lib/interface.c +++ b/source3/lib/interface.c @@ -33,7 +33,7 @@ bool ismyaddr(const struct sockaddr *ip) { struct interface *i; for (i=local_interfaces;i;i=i->next) { - if (addr_equal((struct sockaddr *)&i->ip,ip)) { + if (sockaddr_equal((struct sockaddr *)&i->ip,ip)) { return true; } } @@ -65,7 +65,7 @@ static struct interface *iface_find(const struct sockaddr *ip, if (same_net(ip, (struct sockaddr *)&i->ip, (struct sockaddr *)&i->netmask)) { return i; } - } else if (addr_equal((struct sockaddr *)&i->ip, ip)) { + } else if (sockaddr_equal((struct sockaddr *)&i->ip, ip)) { return i; } } @@ -93,7 +93,7 @@ void setup_linklocal_scope_id(struct sockaddr *pss) { struct interface *i; for (i=local_interfaces;i;i=i->next) { - if (addr_equal((struct sockaddr *)&i->ip,pss)) { + if (sockaddr_equal((struct sockaddr *)&i->ip,pss)) { struct sockaddr_in6 *psa6 = (struct sockaddr_in6 *)pss; psa6->sin6_scope_id = if_nametoindex(i->name); @@ -388,7 +388,7 @@ static void interpret_interface(char *token) } for (i=0;i<total_probed;i++) { - if (addr_equal((struct sockaddr *)&ss, (struct sockaddr *)&probed_ifaces[i].ip)) { + if (sockaddr_equal((struct sockaddr *)&ss, (struct sockaddr *)&probed_ifaces[i].ip)) { add_interface(&probed_ifaces[i]); return; } @@ -441,8 +441,8 @@ static void interpret_interface(char *token) make_net(&ss_net, &ss, &ss_mask); /* Maybe the first component was a broadcast address. */ - if (addr_equal((struct sockaddr *)&ss_bcast, (struct sockaddr *)&ss) || - addr_equal((struct sockaddr *)&ss_net, (struct sockaddr *)&ss)) { + if (sockaddr_equal((struct sockaddr *)&ss_bcast, (struct sockaddr *)&ss) || + sockaddr_equal((struct sockaddr *)&ss_net, (struct sockaddr *)&ss)) { for (i=0;i<total_probed;i++) { if (same_net((struct sockaddr *)&ss, (struct sockaddr *)&probed_ifaces[i].ip, diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 5721f412d6..605bbf1fb6 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -52,7 +52,7 @@ bool interpret_string_addr(struct sockaddr_storage *pss, } #endif - zero_addr(pss); + zero_sockaddr(pss); if (!interpret_string_addr_internal(&res, str, flags|AI_ADDRCONFIG)) { return false; @@ -81,7 +81,7 @@ bool interpret_string_addr(struct sockaddr_storage *pss, Set an address to INADDR_ANY. ******************************************************************/ -void zero_addr(struct sockaddr_storage *pss) +void zero_sockaddr(struct sockaddr_storage *pss) { memset(pss, '\0', sizeof(*pss)); /* Ensure we're at least a valid sockaddr-storage. */ @@ -1254,7 +1254,7 @@ static bool matchname(const char *remotehost, if (!res->ai_addr) { continue; } - if (addr_equal((const struct sockaddr *)res->ai_addr, + if (sockaddr_equal((const struct sockaddr *)res->ai_addr, (struct sockaddr *)pss)) { freeaddrinfo(ailist); return true; @@ -1367,7 +1367,7 @@ const char *get_peer_name(int fd, bool force_lookup) p = get_peer_addr_internal(fd, addr_buf, sizeof(addr_buf), (struct sockaddr *)&ss, &length); /* it might be the same as the last one - save some DNS work */ - if (addr_equal((struct sockaddr *)&ss, (struct sockaddr *)&nc.ss)) { + if (sockaddr_equal((struct sockaddr *)&ss, (struct sockaddr *)&nc.ss)) { return nc.name ? nc.name : "UNKNOWN"; } @@ -1687,7 +1687,7 @@ bool is_myname_or_ipaddr(const char *s) } n = get_interfaces(nics, MAX_INTERFACES); for (i=0; i<n; i++) { - if (addr_equal((struct sockaddr *)&nics[i].ip, (struct sockaddr *)&ss)) { + if (sockaddr_equal((struct sockaddr *)&nics[i].ip, (struct sockaddr *)&ss)) { TALLOC_FREE(nics); return true; } diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index 4658f66cfd..7dfc19b462 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -772,7 +772,7 @@ static char *get_kdc_ip_string(char *mem_ctx, get_kdc_list(realm, sitename, &ip_srv_site, &count_site); for (i = 0; i < count_site; i++) { - if (addr_equal((struct sockaddr *)&ip_srv_site[i].ss, + if (sockaddr_equal((struct sockaddr *)&ip_srv_site[i].ss, (struct sockaddr *)pss)) { continue; } @@ -795,13 +795,13 @@ static char *get_kdc_ip_string(char *mem_ctx, for (i = 0; i < count_nonsite; i++) { int j; - if (addr_equal((struct sockaddr *)&ip_srv_nonsite[i].ss, (struct sockaddr *)pss)) { + if (sockaddr_equal((struct sockaddr *)&ip_srv_nonsite[i].ss, (struct sockaddr *)pss)) { continue; } /* Ensure this isn't an IP already seen (YUK! this is n*n....) */ for (j = 0; j < count_site; j++) { - if (addr_equal((struct sockaddr *)&ip_srv_nonsite[i].ss, + if (sockaddr_equal((struct sockaddr *)&ip_srv_nonsite[i].ss, (struct sockaddr *)&ip_srv_site[j].ss)) { break; } diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 8b7ac7d718..b063475f4e 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -1623,7 +1623,7 @@ NTSTATUS cli_start_connection(struct cli_state **output_cli, if (dest_ss) { ss = *dest_ss; } else { - zero_addr(&ss); + zero_sockaddr(&ss); } again: diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index 7b63f9535e..35922b13e9 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -144,13 +144,13 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, server_n = server; - zero_addr(&ss); + zero_sockaddr(&ss); make_nmb_name(&calling, global_myname(), 0x0); make_nmb_name(&called , server, name_type); again: - zero_addr(&ss); + zero_sockaddr(&ss); if (have_ip) ss = dest_ss; diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c index aeec255350..5e37871deb 100644 --- a/source3/libsmb/libsmb_server.c +++ b/source3/libsmb/libsmb_server.c @@ -248,7 +248,7 @@ SMBC_server(TALLOC_CTX *ctx, const char *username_used; NTSTATUS status; - zero_addr(&ss); + zero_sockaddr(&ss); ZERO_STRUCT(c); if (server[0] == 0) { @@ -348,7 +348,7 @@ SMBC_server(TALLOC_CTX *ctx, again: - zero_addr(&ss); + zero_sockaddr(&ss); /* have to open a new connection */ if ((c = cli_initialise()) == NULL) { @@ -595,7 +595,7 @@ SMBC_attr_server(TALLOC_CTX *ctx, flags |= CLI_FULL_CONNECTION_USE_KERBEROS; } - zero_addr(&ss); + zero_sockaddr(&ss); nt_status = cli_full_connection(&ipc_cli, global_myname(), server, &ss, 0, "IPC$", "?????", diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index e6eed8289e..bcf849b795 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -331,7 +331,7 @@ bool name_status_find(const char *q_name, if (!interpret_string_addr(&ss, lp_socket_address(), AI_NUMERICHOST|AI_PASSIVE)) { - zero_addr(&ss); + zero_sockaddr(&ss); } sock = open_socket_in(SOCK_DGRAM, 0, 3, &ss, True); @@ -526,9 +526,9 @@ static int remove_duplicate_addrs2(struct ip_service *iplist, int count ) } for ( j=i+1; j<count; j++ ) { - if (addr_equal((struct sockaddr *)&iplist[i].ss, (struct sockaddr *)&iplist[j].ss) && + if (sockaddr_equal((struct sockaddr *)&iplist[i].ss, (struct sockaddr *)&iplist[j].ss) && iplist[i].port == iplist[j].port) { - zero_addr(&iplist[j].ss); + zero_sockaddr(&iplist[j].ss); } } } @@ -954,7 +954,7 @@ NTSTATUS name_resolve_bcast(const char *name, if (!interpret_string_addr(&ss, lp_socket_address(), AI_NUMERICHOST|AI_PASSIVE)) { - zero_addr(&ss); + zero_sockaddr(&ss); } sock = open_socket_in( SOCK_DGRAM, 0, 3, &ss, true ); @@ -1042,7 +1042,7 @@ NTSTATUS resolve_wins(const char *name, /* the address we will be sending from */ if (!interpret_string_addr(&src_ss, lp_socket_address(), AI_NUMERICHOST|AI_PASSIVE)) { - zero_addr(&src_ss); + zero_sockaddr(&src_ss); } if (src_ss.ss_family != AF_INET) { diff --git a/source3/libsmb/namequery_dc.c b/source3/libsmb/namequery_dc.c index 306f720a02..7b0748f86b 100644 --- a/source3/libsmb/namequery_dc.c +++ b/source3/libsmb/namequery_dc.c @@ -134,7 +134,7 @@ static bool ads_dc_name(const char *domain, #ifdef HAVE_ADS *dc_ss = ads->ldap.ss; #else - zero_addr(dc_ss); + zero_sockaddr(dc_ss); #endif ads_destroy(&ads); @@ -217,7 +217,7 @@ bool get_dc_name(const char *domain, bool ret; bool our_domain = False; - zero_addr(&dc_ss); + zero_sockaddr(&dc_ss); ret = False; diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index 61d8d7c485..e8ffddb6dc 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -776,7 +776,7 @@ out_free: load_case_tables(); - zero_addr(&server_ss); + zero_sockaddr(&server_ss); setlinebuf(stdout); diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c index b58cb3deec..247c9abcc1 100644 --- a/source3/torture/locktest.c +++ b/source3/torture/locktest.c @@ -176,7 +176,7 @@ static struct cli_state *connect_one(char *share, int snum) server_n = server; - zero_addr(&ss); + zero_sockaddr(&ss); slprintf(myname,sizeof(myname), "lock-%lu-%u", (unsigned long)getpid(), count++); @@ -184,7 +184,7 @@ static struct cli_state *connect_one(char *share, int snum) make_nmb_name(&called , server, 0x20); again: - zero_addr(&ss); + zero_sockaddr(&ss); /* have to open a new connection */ if (!(c=cli_initialise())) { diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c index c5612fefaa..8fea15877f 100644 --- a/source3/torture/masktest.c +++ b/source3/torture/masktest.c @@ -178,13 +178,13 @@ static struct cli_state *connect_one(char *share) server_n = server; - zero_addr(&ss); + zero_sockaddr(&ss); make_nmb_name(&calling, "masktest", 0x0); make_nmb_name(&called , server, 0x20); again: - zero_addr(&ss); + zero_sockaddr(&ss); /* have to open a new connection */ if (!(c=cli_initialise())) { diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 603426b67c..382b3b65eb 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -158,7 +158,7 @@ static struct cli_state *open_nbt_connection(void) make_nmb_name(&calling, myname, 0x0); make_nmb_name(&called , host, 0x20); - zero_addr(&ss); + zero_sockaddr(&ss); if (!(c = cli_initialise())) { printf("Failed initialize cli_struct to connect with %s\n", host); diff --git a/source3/utils/net.c b/source3/utils/net.c index bab2f41d11..f1a5be1876 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -662,7 +662,7 @@ static struct functable net_func[] = { }; - zero_addr(&c->opt_dest_ip); + zero_sockaddr(&c->opt_dest_ip); load_case_tables(); diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 10b55014c2..1bfc4757da 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -956,7 +956,7 @@ static struct cli_state *connect_one(const char *server, const char *share) NTSTATUS nt_status; uint32_t flags = 0; - zero_addr(&ss); + zero_sockaddr(&ss); if (get_cmdline_auth_info_use_kerberos()) { flags |= CLI_FULL_CONNECTION_USE_KERBEROS | diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c index b769c2bce0..8938cc5e65 100644 --- a/source3/utils/smbcquotas.c +++ b/source3/utils/smbcquotas.c @@ -371,7 +371,7 @@ static struct cli_state *connect_one(const char *share) NTSTATUS nt_status; uint32_t flags = 0; - zero_addr(&ss); + zero_sockaddr(&ss); if (get_cmdline_auth_info_use_machine_account() && !set_cmdline_auth_info_machine_account_creds()) { diff --git a/source3/utils/smbfilter.c b/source3/utils/smbfilter.c index d274e09299..1e22a40201 100644 --- a/source3/utils/smbfilter.c +++ b/source3/utils/smbfilter.c @@ -212,7 +212,7 @@ static void start_filter(char *desthost) /* start listening on port 445 locally */ - zero_addr(&my_ss); + zero_sockaddr(&my_ss); s = open_socket_in(SOCK_STREAM, 445, 0, &my_ss, True); if (s == -1) { diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 3c69859731..5f592fc6b7 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -1038,7 +1038,7 @@ static bool add_one_dc_unique(TALLOC_CTX *mem_ctx, const char *domain_name, /* Make sure there's no duplicates in the list */ for (i=0; i<*num; i++) - if (addr_equal((struct sockaddr *)&(*dcs)[i].ss, (struct sockaddr *)pss)) + if (sockaddr_equal((struct sockaddr *)&(*dcs)[i].ss, (struct sockaddr *)pss)) return False; *dcs = TALLOC_REALLOC_ARRAY(mem_ctx, *dcs, struct dc_name_ip, (*num)+1); |