X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/4452a7af2eac33dbad800bcc91f2399d62c18f53..7ddcb079202367355dddccdfa4318e57d50318be:/bsd/sys/protosw.h diff --git a/bsd/sys/protosw.h b/bsd/sys/protosw.h index 17c791118..75b6d6b28 100644 --- a/bsd/sys/protosw.h +++ b/bsd/sys/protosw.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2011 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -70,7 +70,12 @@ #include #define PR_SLOWHZ 2 /* 2 slow timeouts per second */ +#ifndef __APPLE__ +/* + * See rdar://7617868: pr_fasttimo was removed use your own timer or pr_slowtimo instead + */ #define PR_FASTHZ 5 /* 5 fast timeouts per second */ +#endif #ifdef PRIVATE @@ -105,7 +110,8 @@ struct socket_filter; * The userreq routine interfaces protocols to the system and is * described below. */ - + +#include #include #include #ifdef KERNEL @@ -132,8 +138,12 @@ struct protosw { void *pr_ousrreq; /* utility hooks */ void (*pr_init)(void); /* initialization hook */ +#if __APPLE__ + void (*pr_unused)(void); /* placeholder - fasttimo is removed */ +#else void (*pr_fasttimo)(void); /* fast timeout (200ms) */ +#endif void (*pr_slowtimo)(void); /* slow timeout (500ms) */ void (*pr_drain)(void); @@ -144,8 +154,8 @@ struct protosw { #endif struct pr_usrreqs *pr_usrreqs; /* supersedes pr_usrreq() */ #if __APPLE__ - int (*pr_lock) (struct socket *so, int locktype, int debug); /* lock function for protocol */ - int (*pr_unlock) (struct socket *so, int locktype, int debug); /* unlock for protocol */ + int (*pr_lock) (struct socket *so, int locktype, void *debug); /* lock function for protocol */ + int (*pr_unlock) (struct socket *so, int locktype, void *debug); /* unlock for protocol */ #ifdef _KERN_LOCKS_H_ lck_mtx_t * (*pr_getlock) (struct socket *so, int locktype); #else @@ -156,7 +166,7 @@ struct protosw { /* Implant hooks */ TAILQ_HEAD(, socket_filter) pr_filter_head; struct protosw *pr_next; /* Chain for domain */ - u_long reserved[1]; /* Padding for future use */ + u_int32_t reserved[1]; /* Padding for future use */ #endif }; @@ -181,6 +191,7 @@ struct protosw { #define PR_PROTOLOCK 0x80 /* protocol takes care of it's own locking */ #define PR_PCBLOCK 0x100 /* protocol supports per pcb finer grain locking */ #define PR_DISPOSE 0x200 /* protocol requires late lists disposal */ +#define PR_AGGDRAIN 0x400 /* protocol requires aggressive draining */ /* * The arguments to usrreq are: @@ -269,7 +280,7 @@ struct pr_usrreqs { #define PRUS_OOB 0x1 #define PRUS_EOF 0x2 #define PRUS_MORETOCOME 0x4 - int (*pru_sense)(struct socket *so, struct stat *sb); + int (*pru_sense)(struct socket *so, void *sb, int isstat64); int (*pru_shutdown)(struct socket *so); int (*pru_sockaddr)(struct socket *so, struct sockaddr **nam); @@ -316,7 +327,7 @@ extern int pru_rcvoob_notsupp(struct socket *so, struct mbuf *m, extern int pru_send_notsupp(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct proc *p); -extern int pru_sense_null(struct socket *so, struct stat *sb); +extern int pru_sense_null(struct socket *so, void * sb, int isstat64); extern int pru_shutdown_notsupp(struct socket *so); extern int pru_sockaddr_notsupp(struct socket *so, struct sockaddr **nam); @@ -406,6 +417,8 @@ char *prcorequests[] = { #ifdef KERNEL __BEGIN_DECLS +void domaininit(void) __attribute__((section("__TEXT, initcode"))); +void domainfin(void) __attribute__((section("__TEXT, fincode"))); void pfctlinput(int, struct sockaddr *); void pfctlinput2(int, struct sockaddr *, void *); @@ -416,6 +429,7 @@ struct protosw *pffindtype(int family, int type); extern int net_add_proto(struct protosw *, struct domain *); extern int net_del_proto(int, int, struct domain *); +extern u_int64_t net_uptime(void); __END_DECLS /* Temp hack to link static domains together */