Deleted Added
full compact
smb_trantcp.c (108107) smb_trantcp.c (109623)
1/*
2 * Copyright (c) 2000-2001 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

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
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 *
1/*
2 * Copyright (c) 2000-2001 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

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
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 * $FreeBSD: head/sys/netsmb/smb_trantcp.c 108107 2002-12-19 22:58:27Z bmilekic $
32 * $FreeBSD: head/sys/netsmb/smb_trantcp.c 109623 2003-01-21 08:56:16Z alfred $
33 */
34#include <sys/param.h>
35#include <sys/condvar.h>
36#include <sys/kernel.h>
37#include <sys/lock.h>
38#include <sys/malloc.h>
39#include <sys/mbuf.h>
40#include <sys/poll.h>

--- 468 unchanged lines hidden (view full) ---

509/*
510 * SMB transport interface
511 */
512static int
513smb_nbst_create(struct smb_vc *vcp, struct thread *td)
514{
515 struct nbpcb *nbp;
516
33 */
34#include <sys/param.h>
35#include <sys/condvar.h>
36#include <sys/kernel.h>
37#include <sys/lock.h>
38#include <sys/malloc.h>
39#include <sys/mbuf.h>
40#include <sys/poll.h>

--- 468 unchanged lines hidden (view full) ---

509/*
510 * SMB transport interface
511 */
512static int
513smb_nbst_create(struct smb_vc *vcp, struct thread *td)
514{
515 struct nbpcb *nbp;
516
517 MALLOC(nbp, struct nbpcb *, sizeof *nbp, M_NBDATA, M_WAITOK);
517 MALLOC(nbp, struct nbpcb *, sizeof *nbp, M_NBDATA, 0);
518 bzero(nbp, sizeof *nbp);
519 nbp->nbp_timo.tv_sec = 15; /* XXX: sysctl ? */
520 nbp->nbp_state = NBST_CLOSED;
521 nbp->nbp_vc = vcp;
522 nbp->nbp_sndbuf = smb_tcpsndbuf;
523 nbp->nbp_rcvbuf = smb_tcprcvbuf;
524 vcp->vc_tdata = nbp;
525 return 0;

--- 117 unchanged lines hidden (view full) ---

643{
644 struct nbpcb *nbp = vcp->vc_tdata;
645 int error;
646
647 if (nbp->nbp_state != NBST_SESSION) {
648 error = ENOTCONN;
649 goto abort;
650 }
518 bzero(nbp, sizeof *nbp);
519 nbp->nbp_timo.tv_sec = 15; /* XXX: sysctl ? */
520 nbp->nbp_state = NBST_CLOSED;
521 nbp->nbp_vc = vcp;
522 nbp->nbp_sndbuf = smb_tcpsndbuf;
523 nbp->nbp_rcvbuf = smb_tcprcvbuf;
524 vcp->vc_tdata = nbp;
525 return 0;

--- 117 unchanged lines hidden (view full) ---

643{
644 struct nbpcb *nbp = vcp->vc_tdata;
645 int error;
646
647 if (nbp->nbp_state != NBST_SESSION) {
648 error = ENOTCONN;
649 goto abort;
650 }
651 M_PREPEND(m0, 4, M_TRYWAIT);
651 M_PREPEND(m0, 4, 0);
652 if (m0 == NULL)
653 return ENOBUFS;
654 nb_sethdr(m0, NB_SSN_MESSAGE, m_fixhdr(m0) - 4);
655 error = nb_sosend(nbp->nbp_tso, m0, 0, td);
656 return error;
657abort:
658 if (m0)
659 m_freem(m0);

--- 96 unchanged lines hidden ---
652 if (m0 == NULL)
653 return ENOBUFS;
654 nb_sethdr(m0, NB_SSN_MESSAGE, m_fixhdr(m0) - 4);
655 error = nb_sosend(nbp->nbp_tso, m0, 0, td);
656 return error;
657abort:
658 if (m0)
659 m_freem(m0);

--- 96 unchanged lines hidden ---