nbns_rq.c (87867) | nbns_rq.c (150802) |
---|---|
1/* 2 * Copyright (c) 2000, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * $Id: nbns_rq.c,v 1.5 2001/02/17 03:07:24 bp Exp $ | 1/* 2 * Copyright (c) 2000, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * $Id: nbns_rq.c,v 1.5 2001/02/17 03:07:24 bp Exp $ |
33 * $FreeBSD: head/contrib/smbfs/lib/smb/nbns_rq.c 150802 2005-10-02 08:32:49Z bp $ |
|
33 */ 34#include <sys/param.h> 35#include <sys/socket.h> 36#include <sys/time.h> 37 38#include <ctype.h> 39#include <netdb.h> 40#include <err.h> --- 40 unchanged lines hidden (view full) --- 81 rqp->nr_qdtype = NBNS_QUESTION_TYPE_NB; 82 rqp->nr_qdclass = NBNS_QUESTION_CLASS_IN; 83 rqp->nr_qdcount = 1; 84 dest = &rqp->nr_dest; 85 *dest = ctx->nb_ns; 86 dest->sin_family = AF_INET; 87 dest->sin_len = sizeof(*dest); 88 if (dest->sin_port == 0) | 34 */ 35#include <sys/param.h> 36#include <sys/socket.h> 37#include <sys/time.h> 38 39#include <ctype.h> 40#include <netdb.h> 41#include <err.h> --- 40 unchanged lines hidden (view full) --- 82 rqp->nr_qdtype = NBNS_QUESTION_TYPE_NB; 83 rqp->nr_qdclass = NBNS_QUESTION_CLASS_IN; 84 rqp->nr_qdcount = 1; 85 dest = &rqp->nr_dest; 86 *dest = ctx->nb_ns; 87 dest->sin_family = AF_INET; 88 dest->sin_len = sizeof(*dest); 89 if (dest->sin_port == 0) |
89 dest->sin_port = htons(137); | 90 dest->sin_port = htons(ctx->nb_nmbtcpport); |
90 if (dest->sin_addr.s_addr == INADDR_ANY) 91 dest->sin_addr.s_addr = htonl(INADDR_BROADCAST); 92 if (dest->sin_addr.s_addr == INADDR_BROADCAST) 93 rqp->nr_flags |= NBRQF_BROADCAST; 94 error = nbns_rq_prepare(rqp); 95 if (error) { 96 nbns_rq_done(rqp); 97 return error; --- 28 unchanged lines hidden (view full) --- 126 len = sizeof(struct sockaddr_in); 127 dest = malloc(len); 128 if (dest == NULL) 129 return ENOMEM; 130 bzero(dest, len); 131 dest->sin_len = len; 132 dest->sin_family = AF_INET; 133 bcopy(rr.rr_data + 2, &dest->sin_addr.s_addr, 4); | 91 if (dest->sin_addr.s_addr == INADDR_ANY) 92 dest->sin_addr.s_addr = htonl(INADDR_BROADCAST); 93 if (dest->sin_addr.s_addr == INADDR_BROADCAST) 94 rqp->nr_flags |= NBRQF_BROADCAST; 95 error = nbns_rq_prepare(rqp); 96 if (error) { 97 nbns_rq_done(rqp); 98 return error; --- 28 unchanged lines hidden (view full) --- 127 len = sizeof(struct sockaddr_in); 128 dest = malloc(len); 129 if (dest == NULL) 130 return ENOMEM; 131 bzero(dest, len); 132 dest->sin_len = len; 133 dest->sin_family = AF_INET; 134 bcopy(rr.rr_data + 2, &dest->sin_addr.s_addr, 4); |
134 dest->sin_port = htons(SMB_TCP_PORT); | 135 dest->sin_port = htons(ctx->nb_smbtcpport); |
135 *adpp = (struct sockaddr*)dest; 136 ctx->nb_lastns = rqp->nr_sender; 137 break; 138 } 139 nbns_rq_done(rqp); 140 return error; 141} 142 --- 238 unchanged lines hidden --- | 136 *adpp = (struct sockaddr*)dest; 137 ctx->nb_lastns = rqp->nr_sender; 138 break; 139 } 140 nbns_rq_done(rqp); 141 return error; 142} 143 --- 238 unchanged lines hidden --- |