socketvar.h (118453) | socketvar.h (121628) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1990, 1993 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 * @(#)socketvar.h 8.3 (Berkeley) 2/19/95 | 1/*- 2 * Copyright (c) 1982, 1986, 1990, 1993 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 * @(#)socketvar.h 8.3 (Berkeley) 2/19/95 |
34 * $FreeBSD: head/sys/sys/socketvar.h 118453 2003-08-05 00:27:54Z hsu $ | 34 * $FreeBSD: head/sys/sys/socketvar.h 121628 2003-10-28 05:47:40Z sam $ |
35 */ 36 37#ifndef _SYS_SOCKETVAR_H_ 38#define _SYS_SOCKETVAR_H_ 39 40#include <sys/_label.h> /* for struct label */ 41#include <sys/queue.h> /* for TAILQ macros */ 42#include <sys/selinfo.h> /* for struct selinfo */ --- 54 unchanged lines hidden (view full) --- 97 TAILQ_HEAD(, aiocblist) so_aiojobq; /* AIO ops waiting on socket */ 98/* 99 * Variables for socket buffering. 100 */ 101 struct sockbuf { 102 struct selinfo sb_sel; /* process selecting read/write */ 103#define sb_startzero sb_mb 104 struct mbuf *sb_mb; /* the mbuf chain */ | 35 */ 36 37#ifndef _SYS_SOCKETVAR_H_ 38#define _SYS_SOCKETVAR_H_ 39 40#include <sys/_label.h> /* for struct label */ 41#include <sys/queue.h> /* for TAILQ macros */ 42#include <sys/selinfo.h> /* for struct selinfo */ --- 54 unchanged lines hidden (view full) --- 97 TAILQ_HEAD(, aiocblist) so_aiojobq; /* AIO ops waiting on socket */ 98/* 99 * Variables for socket buffering. 100 */ 101 struct sockbuf { 102 struct selinfo sb_sel; /* process selecting read/write */ 103#define sb_startzero sb_mb 104 struct mbuf *sb_mb; /* the mbuf chain */ |
105 struct mbuf *sb_mbtail; /* the last mbuf in the chain */ 106 struct mbuf *sb_lastrecord; /* first mbuf of last record in 107 * socket buffer */ |
|
105 u_int sb_cc; /* actual chars in buffer */ 106 u_int sb_hiwat; /* max actual char count */ 107 u_int sb_mbcnt; /* chars of mbufs used */ 108 u_int sb_mbmax; /* max chars of mbufs to use */ 109 u_int sb_ctl; /* non-data chars in buffer */ 110 int sb_lowat; /* low water mark */ 111 int sb_timeo; /* timeout for read/write */ 112 short sb_flags; /* flags, see below */ --- 19 unchanged lines hidden (view full) --- 132 void *so_emuldata; /* private data for emulators */ 133 struct so_accf { 134 struct accept_filter *so_accept_filter; 135 void *so_accept_filter_arg; /* saved filter args */ 136 char *so_accept_filter_str; /* saved user args */ 137 } *so_accf; 138}; 139 | 108 u_int sb_cc; /* actual chars in buffer */ 109 u_int sb_hiwat; /* max actual char count */ 110 u_int sb_mbcnt; /* chars of mbufs used */ 111 u_int sb_mbmax; /* max chars of mbufs to use */ 112 u_int sb_ctl; /* non-data chars in buffer */ 113 int sb_lowat; /* low water mark */ 114 int sb_timeo; /* timeout for read/write */ 115 short sb_flags; /* flags, see below */ --- 19 unchanged lines hidden (view full) --- 135 void *so_emuldata; /* private data for emulators */ 136 struct so_accf { 137 struct accept_filter *so_accept_filter; 138 void *so_accept_filter_arg; /* saved filter args */ 139 char *so_accept_filter_str; /* saved user args */ 140 } *so_accf; 141}; 142 |
143#define SB_EMPTY_FIXUP(sb) do { \ 144 if ((sb)->sb_mb == NULL) { \ 145 (sb)->sb_mbtail = NULL; \ 146 (sb)->sb_lastrecord = NULL; \ 147 } \ 148} while (/*CONSTCOND*/0) 149 |
|
140/* 141 * Socket state bits. 142 */ 143#define SS_NOFDREF 0x0001 /* no file table ref any more */ 144#define SS_ISCONNECTED 0x0002 /* socket connected to a peer */ 145#define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */ 146#define SS_ISDISCONNECTING 0x0008 /* in process of disconnecting */ 147#define SS_CANTSENDMORE 0x0010 /* can't send more data to peer */ --- 200 unchanged lines hidden (view full) --- 348 349/* 350 * From uipc_socket and friends 351 */ 352struct sockaddr *dup_sockaddr(struct sockaddr *sa, int canwait); 353int sockargs(struct mbuf **mp, caddr_t buf, int buflen, int type); 354int getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len); 355void sbappend(struct sockbuf *sb, struct mbuf *m); | 150/* 151 * Socket state bits. 152 */ 153#define SS_NOFDREF 0x0001 /* no file table ref any more */ 154#define SS_ISCONNECTED 0x0002 /* socket connected to a peer */ 155#define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */ 156#define SS_ISDISCONNECTING 0x0008 /* in process of disconnecting */ 157#define SS_CANTSENDMORE 0x0010 /* can't send more data to peer */ --- 200 unchanged lines hidden (view full) --- 358 359/* 360 * From uipc_socket and friends 361 */ 362struct sockaddr *dup_sockaddr(struct sockaddr *sa, int canwait); 363int sockargs(struct mbuf **mp, caddr_t buf, int buflen, int type); 364int getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len); 365void sbappend(struct sockbuf *sb, struct mbuf *m); |
366void sbappendstream(struct sockbuf *sb, struct mbuf *m); |
|
356int sbappendaddr(struct sockbuf *sb, struct sockaddr *asa, 357 struct mbuf *m0, struct mbuf *control); 358int sbappendcontrol(struct sockbuf *sb, struct mbuf *m0, 359 struct mbuf *control); 360void sbappendrecord(struct sockbuf *sb, struct mbuf *m0); 361void sbcheck(struct sockbuf *sb); 362void sbcompress(struct sockbuf *sb, struct mbuf *m, struct mbuf *n); 363struct mbuf * --- 53 unchanged lines hidden (view full) --- 417int sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, 418 struct mbuf *top, struct mbuf *control, int flags, 419 struct thread *td); 420int sosetopt(struct socket *so, struct sockopt *sopt); 421int soshutdown(struct socket *so, int how); 422void sotoxsocket(struct socket *so, struct xsocket *xso); 423void sowakeup(struct socket *so, struct sockbuf *sb); 424 | 367int sbappendaddr(struct sockbuf *sb, struct sockaddr *asa, 368 struct mbuf *m0, struct mbuf *control); 369int sbappendcontrol(struct sockbuf *sb, struct mbuf *m0, 370 struct mbuf *control); 371void sbappendrecord(struct sockbuf *sb, struct mbuf *m0); 372void sbcheck(struct sockbuf *sb); 373void sbcompress(struct sockbuf *sb, struct mbuf *m, struct mbuf *n); 374struct mbuf * --- 53 unchanged lines hidden (view full) --- 428int sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, 429 struct mbuf *top, struct mbuf *control, int flags, 430 struct thread *td); 431int sosetopt(struct socket *so, struct sockopt *sopt); 432int soshutdown(struct socket *so, int how); 433void sotoxsocket(struct socket *so, struct xsocket *xso); 434void sowakeup(struct socket *so, struct sockbuf *sb); 435 |
436#ifdef SOCKBUF_DEBUG 437void sblastrecordchk(struct sockbuf *, const char *, int); 438#define SBLASTRECORDCHK(sb) sblastrecordchk((sb), __FILE__, __LINE__) 439 440void sblastmbufchk(struct sockbuf *, const char *, int); 441#define SBLASTMBUFCHK(sb) sblastmbufchk((sb), __FILE__, __LINE__) 442#else 443#define SBLASTRECORDCHK(sb) /* nothing */ 444#define SBLASTMBUFCHK(sb) /* nothing */ 445#endif /* SOCKBUF_DEBUG */ 446 |
|
425/* 426 * Accept filter functions (duh). 427 */ 428int accept_filt_add(struct accept_filter *filt); 429int accept_filt_del(char *name); 430struct accept_filter *accept_filt_get(char *name); 431#ifdef ACCEPT_FILTER_MOD 432#ifdef SYSCTL_DECL 433SYSCTL_DECL(_net_inet_accf); 434#endif 435int accept_filt_generic_mod_event(module_t mod, int event, void *data); 436#endif 437 438#endif /* _KERNEL */ 439 440#endif /* !_SYS_SOCKETVAR_H_ */ | 447/* 448 * Accept filter functions (duh). 449 */ 450int accept_filt_add(struct accept_filter *filt); 451int accept_filt_del(char *name); 452struct accept_filter *accept_filt_get(char *name); 453#ifdef ACCEPT_FILTER_MOD 454#ifdef SYSCTL_DECL 455SYSCTL_DECL(_net_inet_accf); 456#endif 457int accept_filt_generic_mod_event(module_t mod, int event, void *data); 458#endif 459 460#endif /* _KERNEL */ 461 462#endif /* !_SYS_SOCKETVAR_H_ */ |