diff options
author | kmacy <kmacy@FreeBSD.org> | 2008-07-21 00:49:34 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2008-07-21 00:49:34 +0000 |
commit | 565bc001a58e180375c810cb3401b67fd051972d (patch) | |
tree | 4e09dc539d317d382f5d34010586da5363c0c56e /sys/sys/socket.h | |
parent | d24f4bd48af063b31a11caa2939d7cb9e7cb791e (diff) | |
download | FreeBSD-src-565bc001a58e180375c810cb3401b67fd051972d.zip FreeBSD-src-565bc001a58e180375c810cb3401b67fd051972d.tar.gz |
Add accessor functions for socket fields.
MFC after: 1 week
Diffstat (limited to 'sys/sys/socket.h')
-rw-r--r-- | sys/sys/socket.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 7ed9c70..1d7998c 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -650,4 +650,41 @@ __END_DECLS #endif /* !_KERNEL */ +#ifdef _KERNEL +struct socket; + +struct tcpcb *so_sototcpcb(struct socket *so); +struct inpcb *so_sotoinpcb(struct socket *so); +struct sockbuf *so_sockbuf_snd(struct socket *); +struct sockbuf *so_sockbuf_rcv(struct socket *); + +int so_state_get(const struct socket *); +void so_state_set(struct socket *, int); + +int so_options_get(const struct socket *); +void so_options_set(struct socket *, int); + +int so_error_get(const struct socket *); +void so_error_set(struct socket *, int); + +int so_linger_get(const struct socket *); +void so_linger_set(struct socket *, int); + +struct protosw *so_protosw_get(const struct socket *); +void so_protosw_set(struct socket *, struct protosw *); + +void so_sorwakeup_locked(struct socket *so); +void so_sowwakeup_locked(struct socket *so); + +void so_sorwakeup(struct socket *so); +void so_sowwakeup(struct socket *so); + +void so_lock(struct socket *so); +void so_unlock(struct socket *so); + +void so_listeners_apply_all(struct socket *so, void (*func)(struct socket *, void *), void *arg); + +#endif + + #endif /* !_SYS_SOCKET_H_ */ |