| version 1.148.6.2, 2006/12/10 07:19:11 |
version 1.149, 2006/10/05 17:35:19 |
| Line 139 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| Line 139 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| * UDP protocol implementation. |
* UDP protocol implementation. |
| * Per RFC 768, August, 1980. |
* Per RFC 768, August, 1980. |
| */ |
*/ |
| |
#ifndef COMPAT_42 |
| int udpcksum = 1; |
int udpcksum = 1; |
| |
#else |
| |
int udpcksum = 0; /* XXX */ |
| |
#endif |
| int udp_do_loopback_cksum = 0; |
int udp_do_loopback_cksum = 0; |
| |
|
| struct inpcbtable udbtable; |
struct inpcbtable udbtable; |
| Line 173 static void udp_notify (struct inpcb *, |
|
| Line 177 static void udp_notify (struct inpcb *, |
|
| int udbhashsize = UDBHASHSIZE; |
int udbhashsize = UDBHASHSIZE; |
| |
|
| #ifdef MBUFTRACE |
#ifdef MBUFTRACE |
| struct mowner udp_mowner = MOWNER_INIT("udp", ""); |
struct mowner udp_mowner = { "udp" }; |
| struct mowner udp_rx_mowner = MOWNER_INIT("udp", "rx"); |
struct mowner udp_rx_mowner = { "udp", "rx" }; |
| struct mowner udp_tx_mowner = MOWNER_INIT("udp", "tx"); |
struct mowner udp_tx_mowner = { "udp", "tx" }; |
| #endif |
#endif |
| |
|
| #ifdef UDP_CSUM_COUNTERS |
#ifdef UDP_CSUM_COUNTERS |
| Line 995 udp_ctlinput(int cmd, struct sockaddr *s |
|
| Line 999 udp_ctlinput(int cmd, struct sockaddr *s |
|
| } |
} |
| |
|
| int |
int |
| udp_ctloutput(int op, struct socket *so, int level, int optname, |
udp_ctloutput(op, so, level, optname, mp) |
| struct mbuf **mp) |
int op; |
| |
struct socket *so; |
| |
int level, optname; |
| |
struct mbuf **mp; |
| { |
{ |
| int s; |
int s; |
| int error = 0; |
int error = 0; |
| Line 1027 udp_ctloutput(int op, struct socket *so, |
|
| Line 1034 udp_ctloutput(int op, struct socket *so, |
|
| default: |
default: |
| error = EAFNOSUPPORT; |
error = EAFNOSUPPORT; |
| goto end; |
goto end; |
| |
break; |
| } |
} |
| |
|
| |
|
| Line 1039 udp_ctloutput(int op, struct socket *so, |
|
| Line 1047 udp_ctloutput(int op, struct socket *so, |
|
| case UDP_ENCAP: |
case UDP_ENCAP: |
| if (m == NULL || m->m_len < sizeof (int)) { |
if (m == NULL || m->m_len < sizeof (int)) { |
| error = EINVAL; |
error = EINVAL; |
| break; |
goto end; |
| } |
} |
| |
|
| switch(*mtod(m, int *)) { |
switch(*mtod(m, int *)) { |
| Line 1060 udp_ctloutput(int op, struct socket *so, |
|
| Line 1068 udp_ctloutput(int op, struct socket *so, |
|
| #endif |
#endif |
| default: |
default: |
| error = EINVAL; |
error = EINVAL; |
| |
goto end; |
| break; |
break; |
| } |
} |
| break; |
break; |
| |
|
| default: |
default: |
| error = ENOPROTOOPT; |
error = ENOPROTOOPT; |
| |
goto end; |
| break; |
break; |
| } |
} |
| if (m != NULL) { |
|
| m_free(m); |
|
| } |
|
| break; |
break; |
| |
|
| default: |
default: |
| error = EINVAL; |
error = EINVAL; |
| |
goto end; |
| break; |
break; |
| } |
} |
| |
|
| Line 1413 SYSCTL_SETUP(sysctl_net_inet_udp_setup, |
|
| Line 1421 SYSCTL_SETUP(sysctl_net_inet_udp_setup, |
|
| * -1 if an error occurent and m was freed |
* -1 if an error occurent and m was freed |
| */ |
*/ |
| static int |
static int |
| udp4_espinudp(struct mbuf **mp, int off, struct sockaddr *src, |
udp4_espinudp(mp, off, src, so) |
| struct socket *so) |
struct mbuf **mp; |
| |
int off; |
| |
struct sockaddr *src; |
| |
struct socket *so; |
| { |
{ |
| size_t len; |
size_t len; |
| caddr_t data; |
caddr_t data; |