summaryrefslogtreecommitdiff
path: root/source4/nbt_server/query.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-10-14 12:22:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:52 -0500
commitfccbbf354634b31c9c3cb2bca15843f13e3b77f9 (patch)
tree6678adb19a88171fce5569d2183e212d08753aba /source4/nbt_server/query.c
parent0b0c38d899db75e6954af2618e7f063dbfc09fd6 (diff)
downloadsamba-fccbbf354634b31c9c3cb2bca15843f13e3b77f9.tar.gz
samba-fccbbf354634b31c9c3cb2bca15843f13e3b77f9.tar.bz2
samba-fccbbf354634b31c9c3cb2bca15843f13e3b77f9.zip
r10997: r11980@SERNOX (orig r10037): metze | 2005-09-05 14:21:40 +0200
add struct nbt_peer_socket and use it instead of passing const char *addr, uint16 port everyhwere (tridge: can you review this please, (make test works) metze (This used to be commit a599d7a4ae881c94be2c2d908a398838549942bb)
Diffstat (limited to 'source4/nbt_server/query.c')
-rw-r--r--source4/nbt_server/query.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/source4/nbt_server/query.c b/source4/nbt_server/query.c
index c51a146adf..c64ac5986a 100644
--- a/source4/nbt_server/query.c
+++ b/source4/nbt_server/query.c
@@ -31,7 +31,7 @@
*/
void nbtd_request_query(struct nbt_name_socket *nbtsock,
struct nbt_name_packet *packet,
- const char *src_address, int src_port)
+ const struct nbt_peer_socket *src)
{
struct nbtd_iface_name *iname;
struct nbt_name *name;
@@ -41,14 +41,14 @@ void nbtd_request_query(struct nbt_name_socket *nbtsock,
/* see if its a node status query */
if (packet->qdcount == 1 &&
packet->questions[0].question_type == NBT_QTYPE_STATUS) {
- nbtd_query_status(nbtsock, packet, src_address, src_port);
+ nbtd_query_status(nbtsock, packet, src);
return;
}
- NBTD_ASSERT_PACKET(packet, src_address, packet->qdcount == 1);
- NBTD_ASSERT_PACKET(packet, src_address,
+ NBTD_ASSERT_PACKET(packet, src->addr, packet->qdcount == 1);
+ NBTD_ASSERT_PACKET(packet, src->addr,
packet->questions[0].question_type == NBT_QTYPE_NETBIOS);
- NBTD_ASSERT_PACKET(packet, src_address,
+ NBTD_ASSERT_PACKET(packet, src->addr,
packet->questions[0].question_class == NBT_QCLASS_IP);
/* see if we have the requested name on this interface */
@@ -65,13 +65,12 @@ void nbtd_request_query(struct nbt_name_socket *nbtsock,
/* if the name does not exist, then redirect to WINS
server if recursion has been asked for */
if (packet->operation & NBT_FLAG_RECURSION_DESIRED) {
- nbtd_winsserver_request(nbtsock, packet, src_address, src_port);
+ nbtd_winsserver_request(nbtsock, packet, src);
return;
}
/* otherwise send a negative reply */
- nbtd_negative_name_query_reply(nbtsock, packet,
- src_address, src_port);
+ nbtd_negative_name_query_reply(nbtsock, packet, src);
return;
}
@@ -80,11 +79,11 @@ void nbtd_request_query(struct nbt_name_socket *nbtsock,
if (!(iname->nb_flags & NBT_NM_ACTIVE) &&
(packet->operation & NBT_FLAG_BROADCAST)) {
DEBUG(7,("Query for %s from %s - name not active yet on %s\n",
- nbt_name_string(packet, name), src_address, iface->ip_address));
+ nbt_name_string(packet, name), src->addr, iface->ip_address));
return;
}
- nbtd_name_query_reply(nbtsock, packet, src_address, src_port,
+ nbtd_name_query_reply(nbtsock, packet, src,
&iname->name, iname->ttl, iname->nb_flags,
nbtd_address_list(iface, packet));
}