Deleted Added
full compact
socketvar.h (60938) socketvar.h (61837)
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 60938 2000-05-26 02:09:24Z jake $
34 * $FreeBSD: head/sys/sys/socketvar.h 61837 2000-06-20 01:09:23Z alfred $
35 */
36
37#ifndef _SYS_SOCKETVAR_H_
38#define _SYS_SOCKETVAR_H_
39
40#include <sys/queue.h> /* for TAILQ macros */
41#include <sys/select.h> /* for struct selinfo */
42
43/*
44 * Kernel structure per socket.
45 * Contains send and receive buffer queues,
46 * handle on protocol and pointer to protocol
47 * private data and error information.
48 */
49typedef u_quad_t so_gen_t;
50
35 */
36
37#ifndef _SYS_SOCKETVAR_H_
38#define _SYS_SOCKETVAR_H_
39
40#include <sys/queue.h> /* for TAILQ macros */
41#include <sys/select.h> /* for struct selinfo */
42
43/*
44 * Kernel structure per socket.
45 * Contains send and receive buffer queues,
46 * handle on protocol and pointer to protocol
47 * private data and error information.
48 */
49typedef u_quad_t so_gen_t;
50
51struct accept_filter;
52
51struct socket {
52 struct vm_zone *so_zone; /* zone we were allocated from */
53 short so_type; /* generic type, see socket.h */
54 short so_options; /* from socket call, see socket.h */
55 short so_linger; /* time to linger while closing */
56 short so_state; /* internal state flags SS_*, below */
57 caddr_t so_pcb; /* protocol control block */
58 struct protosw *so_proto; /* protocol handle */

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

107#define SB_KNOTE 0x100 /* kernel note attached */
108
109 void (*so_upcall) __P((struct socket *, void *, int));
110 void *so_upcallarg;
111 struct ucred *so_cred; /* user credentials */
112 /* NB: generation count must not be first; easiest to make it last. */
113 so_gen_t so_gencnt; /* generation count */
114 void *so_emuldata; /* private data for emulators */
53struct socket {
54 struct vm_zone *so_zone; /* zone we were allocated from */
55 short so_type; /* generic type, see socket.h */
56 short so_options; /* from socket call, see socket.h */
57 short so_linger; /* time to linger while closing */
58 short so_state; /* internal state flags SS_*, below */
59 caddr_t so_pcb; /* protocol control block */
60 struct protosw *so_proto; /* protocol handle */

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

109#define SB_KNOTE 0x100 /* kernel note attached */
110
111 void (*so_upcall) __P((struct socket *, void *, int));
112 void *so_upcallarg;
113 struct ucred *so_cred; /* user credentials */
114 /* NB: generation count must not be first; easiest to make it last. */
115 so_gen_t so_gencnt; /* generation count */
116 void *so_emuldata; /* private data for emulators */
117 struct so_accf {
118 struct accept_filter *so_accept_filter;
119 void *so_accept_filter_arg; /* saved filter args */
120 char *so_accept_filter_str; /* saved user args */
121 } *so_accf;
115};
116
117/*
118 * Socket state bits.
119 */
120#define SS_NOFDREF 0x0001 /* no file table ref any more */
121#define SS_ISCONNECTED 0x0002 /* socket connected to a peer */
122#define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */

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

265
266struct sf_buf {
267 SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */
268 int refcnt; /* reference count */
269 struct vm_page *m; /* currently mapped page */
270 vm_offset_t kva; /* va of mapping */
271};
272
122};
123
124/*
125 * Socket state bits.
126 */
127#define SS_NOFDREF 0x0001 /* no file table ref any more */
128#define SS_ISCONNECTED 0x0002 /* socket connected to a peer */
129#define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */

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

272
273struct sf_buf {
274 SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */
275 int refcnt; /* reference count */
276 struct vm_page *m; /* currently mapped page */
277 vm_offset_t kva; /* va of mapping */
278};
279
280struct accept_filter {
281 char accf_name[16];
282 void (*accf_callback)
283 __P((struct socket *so, void *arg, int waitflag));
284 void * (*accf_create)
285 __P((struct socket *so, char *arg));
286 void (*accf_destroy)
287 __P((struct socket *so));
288 SLIST_ENTRY(accept_filter) accf_next; /* next on the list */
289};
290
273#ifdef MALLOC_DECLARE
274MALLOC_DECLARE(M_PCB);
275MALLOC_DECLARE(M_SONAME);
291#ifdef MALLOC_DECLARE
292MALLOC_DECLARE(M_PCB);
293MALLOC_DECLARE(M_SONAME);
294MALLOC_DECLARE(M_ACCF);
276#endif
277
278extern int maxsockets;
279extern u_long sb_max;
280extern struct vm_zone *socket_zone;
281extern so_gen_t so_gencnt;
282
283struct file;

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

375int sosend __P((struct socket *so, struct sockaddr *addr, struct uio *uio,
376 struct mbuf *top, struct mbuf *control, int flags,
377 struct proc *p));
378int sosetopt __P((struct socket *so, struct sockopt *sopt));
379int soshutdown __P((struct socket *so, int how));
380void sotoxsocket __P((struct socket *so, struct xsocket *xso));
381void sowakeup __P((struct socket *so, struct sockbuf *sb));
382
295#endif
296
297extern int maxsockets;
298extern u_long sb_max;
299extern struct vm_zone *socket_zone;
300extern so_gen_t so_gencnt;
301
302struct file;

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

394int sosend __P((struct socket *so, struct sockaddr *addr, struct uio *uio,
395 struct mbuf *top, struct mbuf *control, int flags,
396 struct proc *p));
397int sosetopt __P((struct socket *so, struct sockopt *sopt));
398int soshutdown __P((struct socket *so, int how));
399void sotoxsocket __P((struct socket *so, struct xsocket *xso));
400void sowakeup __P((struct socket *so, struct sockbuf *sb));
401
402/* accept filter functions */
403int accept_filt_add __P((struct accept_filter *filt));
404int accept_filt_del __P((char *name));
405struct accept_filter * accept_filt_get __P((char *name));
406#ifdef ACCEPT_FILTER_MOD
407int accept_filt_generic_mod_event __P((module_t mod, int event, void *data));
408#endif /* ACCEPT_FILTER_MOD */
409
383#endif /* _KERNEL */
384
385#endif /* !_SYS_SOCKETVAR_H_ */
410#endif /* _KERNEL */
411
412#endif /* !_SYS_SOCKETVAR_H_ */