Lines Matching refs:socket
102 * Kernel structure per socket.
113 /* We don't support BSD style socket filters */
117 struct socket {
119 short so_type; /* generic type, see socket.h */
120 short so_options; /* from socket call, see socket.h */
128 * If so_head is 0, socket is not related to an accept.
129 * For head socket so_incomp queues partially completed connections,
134 * and limit on number of queued connections for this socket.
136 struct socket *so_head; /* back pointer to accept socket */
137 TAILQ_HEAD(, socket) so_incomp; /* q of partially unaccepted conns */
138 TAILQ_HEAD(, socket) so_comp; /* q of complete unaccepted conns */
139 TAILQ_ENTRY(socket) so_list; /* list of unaccepted connections */
150 TAILQ_HEAD(, aiocblist) so_aiojobq; /* AIO ops waiting on socket */
153 * Variables for socket buffering.
166 struct socket *sb_so; /* socket back ptr for kexts */
189 #define SB_UNIX 0x800 /* UNIX domain socket buffer */
195 void (*so_upcall)(struct socket *so, caddr_t arg, int waitf);
197 uid_t so_uid; /* who opened the socket */
210 struct socket *cache_next;
211 struct socket *cache_prev;
215 /* Plug-in support - make the socket interface overridable */
222 #define SOF_DEFUNCT 0x8 /* accepted socket marked as inactive */
224 #define SOF_UPCALLINUSE 0x20 /* socket upcall is currently in progress */
227 #define SOF_ABORTED 0x100 /* soabort was already called once on the socket */
228 #define SOF_OVERFLOW 0x200 /* socket was dropped as overflow of listen queue */
233 int so_usecount; /* refcounting of socket use */;
235 u_int32_t so_filteruse; /* usecount for the socket filters */
236 u_int32_t so_traffic_mgt_flags; /* traffic_mgt socket config */
249 struct label *so_label; /* MAC label for socket */
250 struct label *so_peerlabel; /* cached MAC label for socket peer */
251 thread_t so_background_thread; /* thread that marked this socket background */
259 #define SS_ISCONNECTED 0x0002 /* socket connected to a peer */
272 #define SS_ISDISCONNECTED 0x2000 /* socket disconnected from peer */
285 * Externalized form of struct socket used by the sysctl(3) interface.
289 _XSOCKET_PTR(struct socket *) xso_so; /* makes a convenient handle */
320 * Macros for sockets and socket buffering.
326 * Functions for sockets and socket buffering.
334 int sosendallatonce(struct socket *so);
335 int soreadable(struct socket *so);
336 int sowriteable(struct socket *so);
341 void sorwakeup(struct socket *so);
342 void sowwakeup(struct socket *so);
460 extern int soabort(struct socket *so);
461 extern int soaccept(struct socket *so, struct sockaddr **nam);
462 extern int soacceptlock(struct socket *so, struct sockaddr **nam, int dolock);
463 extern int soacceptfilter(struct socket *so);
464 extern struct socket *soalloc(int waitok, int dom, int type);
465 extern int sobind(struct socket *so, struct sockaddr *nam);
466 extern void socantrcvmore(struct socket *so);
467 extern void socantsendmore(struct socket *so);
468 extern int soclose(struct socket *so);
469 extern int soconnect(struct socket *so, struct sockaddr *nam);
470 extern int soconnectlock(struct socket *so, struct sockaddr *nam, int dolock);
471 extern int soconnect2(struct socket *so1, struct socket *so2);
472 extern int socreate(int dom, struct socket **aso, int type, int proto);
473 extern void sodealloc(struct socket *so);
474 extern int sodisconnect(struct socket *so);
475 extern int sodisconnectlocked(struct socket *so);
476 extern void sofree(struct socket *so);
477 extern void soreference(struct socket *so);
478 extern void sodereference(struct socket *so);
479 extern void somultipages(struct socket *, boolean_t);
480 extern int sogetopt(struct socket *so, struct sockopt *sopt);
481 extern void sohasoutofband(struct socket *so);
482 extern void soisconnected(struct socket *so);
483 extern void soisconnecting(struct socket *so);
484 extern void soisdisconnected(struct socket *so);
485 extern void soisdisconnecting(struct socket *so);
486 extern int solisten(struct socket *so, int backlog);
487 extern struct socket *sodropablereq(struct socket *head);
488 extern struct socket *sonewconn(struct socket *head, int connstatus,
493 extern int socket_lock(struct socket *so, int refcount);
494 extern int socket_unlock(struct socket *so, int refcount);
495 extern void sofreelastref(struct socket *, int);
505 extern int sopoll(struct socket *so, int events, struct ucred *cred, void *wql);
506 extern int soreceive(struct socket *so, struct sockaddr **paddr,
508 extern int soreserve(struct socket *so, u_long sndcc, u_long rcvcc);
509 extern void sorflush(struct socket *so);
510 extern int sosend(struct socket *so, struct sockaddr *addr, struct uio *uio,
513 extern int sosetopt(struct socket *so, struct sockopt *sopt);
514 extern int soshutdown(struct socket *so, int how);
515 extern int soshutdownlock(struct socket *so, int how);
516 extern void sotoxsocket(struct socket *so, struct xsocket *xso);
517 extern void sowakeup(struct socket *so, struct sockbuf *sb);
518 extern int soioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p);