Deleted Added
full compact
udp_usrreq.c (46155) udp_usrreq.c (46381)
1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
3 * The Regents of the University of California. 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

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
3 * The Regents of the University of California. 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

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
34 * $Id: udp_usrreq.c,v 1.49 1998/12/03 20:23:21 dillon Exp $
34 * $Id: udp_usrreq.c,v 1.50 1999/04/28 11:37:51 phk Exp $
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/kernel.h>
40#include <sys/malloc.h>
41#include <sys/mbuf.h>
42#include <sys/protosw.h>

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

70#else
71static int udpcksum = 0; /* XXX */
72#endif
73SYSCTL_INT(_net_inet_udp, UDPCTL_CHECKSUM, checksum, CTLFLAG_RW,
74 &udpcksum, 0, "");
75
76static int log_in_vain = 0;
77SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_RW,
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/kernel.h>
40#include <sys/malloc.h>
41#include <sys/mbuf.h>
42#include <sys/protosw.h>

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

70#else
71static int udpcksum = 0; /* XXX */
72#endif
73SYSCTL_INT(_net_inet_udp, UDPCTL_CHECKSUM, checksum, CTLFLAG_RW,
74 &udpcksum, 0, "");
75
76static int log_in_vain = 0;
77SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_RW,
78 &log_in_vain, 0, "");
78 &log_in_vain, 0, "Log all incoming UDP packets");
79
80static struct inpcbhead udb; /* from udp_var.h */
81static struct inpcbinfo udbinfo;
82
83#ifndef UDBHASHSIZE
84#define UDBHASHSIZE 16
85#endif
86
87static struct udpstat udpstat; /* from udp_var.h */
88SYSCTL_STRUCT(_net_inet_udp, UDPCTL_STATS, stats, CTLFLAG_RD,
79
80static struct inpcbhead udb; /* from udp_var.h */
81static struct inpcbinfo udbinfo;
82
83#ifndef UDBHASHSIZE
84#define UDBHASHSIZE 16
85#endif
86
87static struct udpstat udpstat; /* from udp_var.h */
88SYSCTL_STRUCT(_net_inet_udp, UDPCTL_STATS, stats, CTLFLAG_RD,
89 &udpstat, udpstat, "");
89 &udpstat, udpstat, "UDP statistics (struct udpstat, netinet/udp_var.h)");
90
91static struct sockaddr_in udp_in = { sizeof(udp_in), AF_INET };
92
93static int udp_output __P((struct inpcb *, struct mbuf *, struct sockaddr *,
94 struct mbuf *, struct proc *));
95static void udp_notify __P((struct inpcb *, int));
96
97void

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

548release:
549 m_freem(m);
550 return (error);
551}
552
553static u_long udp_sendspace = 9216; /* really max datagram size */
554 /* 40 1K datagrams */
555SYSCTL_INT(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW,
90
91static struct sockaddr_in udp_in = { sizeof(udp_in), AF_INET };
92
93static int udp_output __P((struct inpcb *, struct mbuf *, struct sockaddr *,
94 struct mbuf *, struct proc *));
95static void udp_notify __P((struct inpcb *, int));
96
97void

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

548release:
549 m_freem(m);
550 return (error);
551}
552
553static u_long udp_sendspace = 9216; /* really max datagram size */
554 /* 40 1K datagrams */
555SYSCTL_INT(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW,
556 &udp_sendspace, 0, "");
556 &udp_sendspace, 0, "Maximum outgoing UDP datagram size");
557
558static u_long udp_recvspace = 40 * (1024 + sizeof(struct sockaddr_in));
559SYSCTL_INT(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW,
557
558static u_long udp_recvspace = 40 * (1024 + sizeof(struct sockaddr_in));
559SYSCTL_INT(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW,
560 &udp_recvspace, 0, "");
560 &udp_recvspace, 0, "Maximum incoming UDP datagram size");
561
562static int
563udp_abort(struct socket *so)
564{
565 struct inpcb *inp;
566 int s;
567
568 inp = sotoinpcb(so);

--- 137 unchanged lines hidden ---
561
562static int
563udp_abort(struct socket *so)
564{
565 struct inpcb *inp;
566 int s;
567
568 inp = sotoinpcb(so);

--- 137 unchanged lines hidden ---