Changeset View
Changeset View
Standalone View
Standalone View
head/sys/sys/socketvar.h
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Kernel structure per socket. | * Kernel structure per socket. | ||||
* Contains send and receive buffer queues, | * Contains send and receive buffer queues, | ||||
* handle on protocol and pointer to protocol | * handle on protocol and pointer to protocol | ||||
* private data and error information. | * private data and error information. | ||||
*/ | */ | ||||
typedef int so_upcall_t(struct socket *, void *, int); | typedef int so_upcall_t(struct socket *, void *, int); | ||||
typedef void so_dtor_t(struct socket *); | |||||
struct socket; | struct socket; | ||||
/*- | /*- | ||||
* Locking key to struct socket: | * Locking key to struct socket: | ||||
* (a) constant after allocation, no locking required. | * (a) constant after allocation, no locking required. | ||||
* (b) locked by SOCK_LOCK(so). | * (b) locked by SOCK_LOCK(so). | ||||
* (cr) locked by SOCKBUF_LOCK(&so->so_rcv). | * (cr) locked by SOCKBUF_LOCK(&so->so_rcv). | ||||
Show All 20 Lines | struct socket { | ||||
u_short so_error; /* (f) error affecting connection */ | u_short so_error; /* (f) error affecting connection */ | ||||
struct sigio *so_sigio; /* [sg] information for async I/O or | struct sigio *so_sigio; /* [sg] information for async I/O or | ||||
out of band data (SIGURG) */ | out of band data (SIGURG) */ | ||||
struct ucred *so_cred; /* (a) user credentials */ | struct ucred *so_cred; /* (a) user credentials */ | ||||
struct label *so_label; /* (b) MAC label for socket */ | struct label *so_label; /* (b) MAC label for socket */ | ||||
/* NB: generation count must not be first. */ | /* NB: generation count must not be first. */ | ||||
so_gen_t so_gencnt; /* (h) generation count */ | so_gen_t so_gencnt; /* (h) generation count */ | ||||
void *so_emuldata; /* (b) private data for emulators */ | void *so_emuldata; /* (b) private data for emulators */ | ||||
so_dtor_t *so_dtor; /* (b) optional destructor */ | |||||
struct osd osd; /* Object Specific extensions */ | struct osd osd; /* Object Specific extensions */ | ||||
/* | /* | ||||
* so_fibnum, so_user_cookie and friends can be used to attach | * so_fibnum, so_user_cookie and friends can be used to attach | ||||
* some user-specified metadata to a socket, which then can be | * some user-specified metadata to a socket, which then can be | ||||
* used by the kernel for various actions. | * used by the kernel for various actions. | ||||
* so_user_cookie is used by ipfw/dummynet. | * so_user_cookie is used by ipfw/dummynet. | ||||
*/ | */ | ||||
int so_fibnum; /* routing domain for this socket */ | int so_fibnum; /* routing domain for this socket */ | ||||
▲ Show 20 Lines • Show All 282 Lines • ▼ Show 20 Lines | |||||
int soclose(struct socket *so); | int soclose(struct socket *so); | ||||
int soconnect(struct socket *so, struct sockaddr *nam, struct thread *td); | int soconnect(struct socket *so, struct sockaddr *nam, struct thread *td); | ||||
int soconnectat(int fd, struct socket *so, struct sockaddr *nam, | int soconnectat(int fd, struct socket *so, struct sockaddr *nam, | ||||
struct thread *td); | struct thread *td); | ||||
int soconnect2(struct socket *so1, struct socket *so2); | int soconnect2(struct socket *so1, struct socket *so2); | ||||
int socreate(int dom, struct socket **aso, int type, int proto, | int socreate(int dom, struct socket **aso, int type, int proto, | ||||
struct ucred *cred, struct thread *td); | struct ucred *cred, struct thread *td); | ||||
int sodisconnect(struct socket *so); | int sodisconnect(struct socket *so); | ||||
void sodtor_set(struct socket *, so_dtor_t *); | |||||
struct sockaddr *sodupsockaddr(const struct sockaddr *sa, int mflags); | struct sockaddr *sodupsockaddr(const struct sockaddr *sa, int mflags); | ||||
void sofree(struct socket *so); | void sofree(struct socket *so); | ||||
void sohasoutofband(struct socket *so); | void sohasoutofband(struct socket *so); | ||||
int solisten(struct socket *so, int backlog, struct thread *td); | int solisten(struct socket *so, int backlog, struct thread *td); | ||||
void solisten_proto(struct socket *so, int backlog); | void solisten_proto(struct socket *so, int backlog); | ||||
int solisten_proto_check(struct socket *so); | int solisten_proto_check(struct socket *so); | ||||
int solisten_dequeue(struct socket *, struct socket **, int); | int solisten_dequeue(struct socket *, struct socket **, int); | ||||
struct socket * | struct socket * | ||||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |