diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-10-14 12:22:15 +0000 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2005-10-14 12:22:15 +0000 |
commit | 1c70c7d99cc95bc920e7a2ea1943c522d94214c3 (patch) | |
tree | 1e93cdf26e4d21b4b5459d55fdc1653be142b8f8 /source/nbt_server/query.c | |
parent | f6406037ced0db2144bf54106e9b55a24d1a28d3 (diff) | |
download | samba-1c70c7d99cc95bc920e7a2ea1943c522d94214c3.tar.gz samba-1c70c7d99cc95bc920e7a2ea1943c522d94214c3.tar.xz samba-1c70c7d99cc95bc920e7a2ea1943c522d94214c3.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
Diffstat (limited to 'source/nbt_server/query.c')
-rw-r--r-- | source/nbt_server/query.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/source/nbt_server/query.c b/source/nbt_server/query.c index c51a146adf8..c64ac5986a8 100644 --- a/source/nbt_server/query.c +++ b/source/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)); } |