FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_param.h"
#include <sys/param.h>
#include <sys/aio.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mbuf.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/protosw.h>
#include <sys/resourcevar.h>
#include <sys/signalvar.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sx.h>
#include <sys/sysctl.h>
Go to the source code of this file.
Macros | |
#define | SBLINKRECORD(sb, m0) |
Functions | |
__FBSDID ("$BSDSUniX$") | |
static void | sbdrop_internal (struct sockbuf *sb, int len) |
static void | sbflush_internal (struct sockbuf *sb) |
void | socantsendmore_locked (struct socket *so) |
void | socantsendmore (struct socket *so) |
void | socantrcvmore_locked (struct socket *so) |
void | socantrcvmore (struct socket *so) |
int | sbwait (struct sockbuf *sb) |
int | sblock (struct sockbuf *sb, int flags) |
void | sbunlock (struct sockbuf *sb) |
void | sowakeup (struct socket *so, struct sockbuf *sb) |
int | soreserve (struct socket *so, u_long sndcc, u_long rcvcc) |
static int | sysctl_handle_sb_max (SYSCTL_HANDLER_ARGS) |
int | sbreserve_locked (struct sockbuf *sb, u_long cc, struct socket *so, struct thread *td) |
int | sbreserve (struct sockbuf *sb, u_long cc, struct socket *so, struct thread *td) |
void | sbrelease_internal (struct sockbuf *sb, struct socket *so) |
void | sbrelease_locked (struct sockbuf *sb, struct socket *so) |
void | sbrelease (struct sockbuf *sb, struct socket *so) |
void | sbdestroy (struct sockbuf *sb, struct socket *so) |
void | sbappend_locked (struct sockbuf *sb, struct mbuf *m) |
void | sbappend (struct sockbuf *sb, struct mbuf *m) |
void | sbappendstream_locked (struct sockbuf *sb, struct mbuf *m) |
void | sbappendstream (struct sockbuf *sb, struct mbuf *m) |
void | sbappendrecord_locked (struct sockbuf *sb, struct mbuf *m0) |
void | sbappendrecord (struct sockbuf *sb, struct mbuf *m0) |
static int | sbappendaddr_locked_internal (struct sockbuf *sb, const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control, struct mbuf *ctrl_last) |
int | sbappendaddr_locked (struct sockbuf *sb, const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control) |
int | sbappendaddr_nospacecheck_locked (struct sockbuf *sb, const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control) |
int | sbappendaddr (struct sockbuf *sb, const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control) |
int | sbappendcontrol_locked (struct sockbuf *sb, struct mbuf *m0, struct mbuf *control) |
int | sbappendcontrol (struct sockbuf *sb, struct mbuf *m0, struct mbuf *control) |
void | sbcompress (struct sockbuf *sb, struct mbuf *m, struct mbuf *n) |
void | sbflush_locked (struct sockbuf *sb) |
void | sbflush (struct sockbuf *sb) |
void | sbdrop_locked (struct sockbuf *sb, int len) |
void | sbdrop (struct sockbuf *sb, int len) |
struct mbuf * | sbsndptr (struct sockbuf *sb, u_int off, u_int len, u_int *moff) |
struct mbuf * | sbsndmbuf (struct sockbuf *sb, u_int off, u_int *moff) |
void | sbdroprecord_locked (struct sockbuf *sb) |
void | sbdroprecord (struct sockbuf *sb) |
struct mbuf * | sbcreatecontrol (caddr_t p, int size, int type, int level) |
void | sbtoxsockbuf (struct sockbuf *sb, struct xsockbuf *xsb) |
SYSCTL_INT (_kern, KERN_DUMMY, dummy, CTLFLAG_RW,&dummy, 0,"") | |
SYSCTL_OID (_kern_ipc, KIPC_MAXSOCKBUF, maxsockbuf, CTLTYPE_ULONG|CTLFLAG_RW,&sb_max, 0, sysctl_handle_sb_max,"LU","Maximum socket buffer size") | |
SYSCTL_ULONG (_kern_ipc, KIPC_SOCKBUF_WASTE, sockbuf_waste_factor, CTLFLAG_RW,&sb_efficiency, 0,"") | |
Variables | |
void(* | aio_swake )(struct socket *, struct sockbuf *) |
u_long | sb_max = SB_MAX |
u_long | sb_max_adj |
static u_long | sb_efficiency = 8 |
static int | dummy |
#define SBLINKRECORD | ( | sb, | |
m0 | |||
) |
Definition at line 442 of file uipc_sockbuf.c.
Referenced by sbappendaddr_locked_internal(), sbappendcontrol_locked(), and sbappendrecord_locked().
__FBSDID | ( | "$BSDSUniX$" | ) |
void sbappend | ( | struct sockbuf * | sb, |
struct mbuf * | m | ||
) |
Definition at line 508 of file uipc_sockbuf.c.
References sbappend_locked().
void sbappend_locked | ( | struct sockbuf * | sb, |
struct mbuf * | m | ||
) |
Definition at line 457 of file uipc_sockbuf.c.
References sbappendrecord_locked(), and sbcompress().
Referenced by sbappend(), and uipc_send().
int sbappendaddr | ( | struct sockbuf * | sb, |
const struct sockaddr * | asa, | ||
struct mbuf * | m0, | ||
struct mbuf * | control | ||
) |
Definition at line 704 of file uipc_sockbuf.c.
References sbappendaddr_locked().
int sbappendaddr_locked | ( | struct sockbuf * | sb, |
const struct sockaddr * | asa, | ||
struct mbuf * | m0, | ||
struct mbuf * | control | ||
) |
Definition at line 660 of file uipc_sockbuf.c.
References m_length(), panic(), and sbappendaddr_locked_internal().
Referenced by sbappendaddr(), and uipc_send().
|
static |
Definition at line 622 of file uipc_sockbuf.c.
References SBLINKRECORD.
Referenced by sbappendaddr_locked(), and sbappendaddr_nospacecheck_locked().
int sbappendaddr_nospacecheck_locked | ( | struct sockbuf * | sb, |
const struct sockaddr * | asa, | ||
struct mbuf * | m0, | ||
struct mbuf * | control | ||
) |
Definition at line 686 of file uipc_sockbuf.c.
References sbappendaddr_locked_internal().
Referenced by uipc_send().
int sbappendcontrol | ( | struct sockbuf * | sb, |
struct mbuf * | m0, | ||
struct mbuf * | control | ||
) |
Definition at line 748 of file uipc_sockbuf.c.
References sbappendcontrol_locked().
int sbappendcontrol_locked | ( | struct sockbuf * | sb, |
struct mbuf * | m0, | ||
struct mbuf * | control | ||
) |
Definition at line 716 of file uipc_sockbuf.c.
References m_length(), panic(), and SBLINKRECORD.
Referenced by sbappendcontrol(), and uipc_send().
void sbappendrecord | ( | struct sockbuf * | sb, |
struct mbuf * | m0 | ||
) |
Definition at line 612 of file uipc_sockbuf.c.
References sbappendrecord_locked().
void sbappendrecord_locked | ( | struct sockbuf * | sb, |
struct mbuf * | m0 | ||
) |
Definition at line 582 of file uipc_sockbuf.c.
References sbcompress(), and SBLINKRECORD.
Referenced by sbappend_locked(), and sbappendrecord().
void sbappendstream | ( | struct sockbuf * | sb, |
struct mbuf * | m | ||
) |
Definition at line 543 of file uipc_sockbuf.c.
References sbappendstream_locked().
void sbappendstream_locked | ( | struct sockbuf * | sb, |
struct mbuf * | m | ||
) |
Definition at line 522 of file uipc_sockbuf.c.
References sbcompress().
Referenced by sbappendstream().
void sbcompress | ( | struct sockbuf * | sb, |
struct mbuf * | m, | ||
struct mbuf * | n | ||
) |
Definition at line 779 of file uipc_sockbuf.c.
Referenced by sbappend_locked(), sbappendrecord_locked(), and sbappendstream_locked().
struct mbuf* sbcreatecontrol | ( | caddr_t | p, |
int | size, | ||
int | type, | ||
int | level | ||
) |
Definition at line 1062 of file uipc_sockbuf.c.
Referenced by unp_addsockcred(), unp_externalize(), and unp_internalize().
void sbdestroy | ( | struct sockbuf * | sb, |
struct socket * | so | ||
) |
Definition at line 364 of file uipc_sockbuf.c.
References sbrelease_internal().
Referenced by sofree().
void sbdrop | ( | struct sockbuf * | sb, |
int | len | ||
) |
Definition at line 936 of file uipc_sockbuf.c.
References sbdrop_locked().
|
static |
Definition at line 873 of file uipc_sockbuf.c.
References panic().
Referenced by sbdrop_locked(), and sbflush_internal().
void sbdrop_locked | ( | struct sockbuf * | sb, |
int | len | ||
) |
Definition at line 927 of file uipc_sockbuf.c.
References sbdrop_internal().
Referenced by sbdrop(), soisdisconnected(), and soreceive_stream().
void sbdroprecord | ( | struct sockbuf * | sb | ) |
Definition at line 1049 of file uipc_sockbuf.c.
References sbdroprecord_locked().
void sbdroprecord_locked | ( | struct sockbuf * | sb | ) |
Definition at line 1027 of file uipc_sockbuf.c.
Referenced by sbdroprecord(), and soreceive_generic().
void sbflush | ( | struct sockbuf * | sb | ) |
Definition at line 861 of file uipc_sockbuf.c.
References sbflush_locked().
|
static |
Definition at line 835 of file uipc_sockbuf.c.
References panic(), and sbdrop_internal().
Referenced by sbflush_locked(), and sbrelease_internal().
void sbflush_locked | ( | struct sockbuf * | sb | ) |
Definition at line 853 of file uipc_sockbuf.c.
References sbflush_internal().
Referenced by sbflush().
int sblock | ( | struct sockbuf * | sb, |
int | flags | ||
) |
Definition at line 136 of file uipc_sockbuf.c.
Referenced by kern_sendfile(), soreceive_generic(), soreceive_stream(), sorflush(), and sosend_generic().
void sbrelease | ( | struct sockbuf * | sb, |
struct socket * | so | ||
) |
Definition at line 355 of file uipc_sockbuf.c.
References sbrelease_locked().
void sbrelease_internal | ( | struct sockbuf * | sb, |
struct socket * | so | ||
) |
Definition at line 336 of file uipc_sockbuf.c.
References chgsbsize(), and sbflush_internal().
Referenced by sbdestroy(), sbrelease_locked(), and sorflush().
void sbrelease_locked | ( | struct sockbuf * | sb, |
struct socket * | so | ||
) |
Definition at line 346 of file uipc_sockbuf.c.
References sbrelease_internal().
Referenced by sbrelease(), and soreserve().
int sbreserve | ( | struct sockbuf * | sb, |
u_long | cc, | ||
struct socket * | so, | ||
struct thread * | td | ||
) |
Definition at line 321 of file uipc_sockbuf.c.
References sbreserve_locked().
Referenced by sosetopt().
int sbreserve_locked | ( | struct sockbuf * | sb, |
u_long | cc, | ||
struct socket * | so, | ||
struct thread * | td | ||
) |
Definition at line 289 of file uipc_sockbuf.c.
References chgsbsize(), lim_cur(), sb_max, and sb_max_adj.
Referenced by sbreserve(), and soreserve().
struct mbuf* sbsndmbuf | ( | struct sockbuf * | sb, |
u_int | off, | ||
u_int * | moff | ||
) |
Definition at line 996 of file uipc_sockbuf.c.
struct mbuf* sbsndptr | ( | struct sockbuf * | sb, |
u_int | off, | ||
u_int | len, | ||
u_int * | moff | ||
) |
Definition at line 949 of file uipc_sockbuf.c.
References panic().
void sbtoxsockbuf | ( | struct sockbuf * | sb, |
struct xsockbuf * | xsb | ||
) |
Definition at line 1101 of file uipc_sockbuf.c.
Referenced by sotoxsocket().
void sbunlock | ( | struct sockbuf * | sb | ) |
Definition at line 157 of file uipc_sockbuf.c.
Referenced by kern_sendfile(), soreceive_generic(), soreceive_stream(), sorflush(), and sosend_generic().
int sbwait | ( | struct sockbuf * | sb | ) |
Definition at line 124 of file uipc_sockbuf.c.
Referenced by kern_sendfile(), soreceive_dgram(), soreceive_generic(), soreceive_stream(), and sosend_generic().
void socantrcvmore | ( | struct socket * | so | ) |
Definition at line 112 of file uipc_sockbuf.c.
References socantrcvmore_locked().
Referenced by sorflush(), and unp_shutdown().
void socantrcvmore_locked | ( | struct socket * | so | ) |
Definition at line 101 of file uipc_sockbuf.c.
Referenced by socantrcvmore().
void socantsendmore | ( | struct socket * | so | ) |
Definition at line 92 of file uipc_sockbuf.c.
References socantsendmore_locked().
Referenced by uipc_send(), and uipc_shutdown().
void socantsendmore_locked | ( | struct socket * | so | ) |
Definition at line 81 of file uipc_sockbuf.c.
Referenced by socantsendmore().
int soreserve | ( | struct socket * | so, |
u_long | sndcc, | ||
u_long | rcvcc | ||
) |
Definition at line 241 of file uipc_sockbuf.c.
References sbrelease_locked(), and sbreserve_locked().
Referenced by sonewconn(), and uipc_attach().
void sowakeup | ( | struct socket * | so, |
struct sockbuf * | sb | ||
) |
Definition at line 176 of file uipc_sockbuf.c.
References aio_swake, pgsigio(), selwakeuppri(), soisconnected(), soupcall_clear(), and wakeup().
|
static |
Definition at line 269 of file uipc_sockbuf.c.
References sb_max, sb_max_adj, and sysctl_handle_long().
SYSCTL_INT | ( | _kern | , |
KERN_DUMMY | , | ||
dummy | , | ||
CTLFLAG_RW | , | ||
& | dummy, | ||
0 | , | ||
"" | |||
) |
SYSCTL_OID | ( | _kern_ipc | , |
KIPC_MAXSOCKBUF | , | ||
maxsockbuf | , | ||
CTLTYPE_ULONG| | CTLFLAG_RW, | ||
& | sb_max, | ||
0 | , | ||
sysctl_handle_sb_max | , | ||
"LU" | , | ||
"Maximum socket buffer size" | |||
) |
SYSCTL_ULONG | ( | _kern_ipc | , |
KIPC_SOCKBUF_WASTE | , | ||
sockbuf_waste_factor | , | ||
CTLFLAG_RW | , | ||
& | sb_efficiency, | ||
0 | , | ||
"" | |||
) |
void(* aio_swake) (struct socket *, struct sockbuf *) |
Definition at line 56 of file uipc_sockbuf.c.
Referenced by aio_onceonly(), aio_unload(), and sowakeup().
|
static |
Definition at line 1116 of file uipc_sockbuf.c.
Referenced by buf_splay(), and lookup().
|
static |
Definition at line 66 of file uipc_sockbuf.c.
u_long sb_max = SB_MAX |
Definition at line 62 of file uipc_sockbuf.c.
Referenced by sbreserve_locked(), and sysctl_handle_sb_max().
u_long sb_max_adj |
Definition at line 63 of file uipc_sockbuf.c.
Referenced by sbreserve_locked(), and sysctl_handle_sb_max().