From nobody Fri Aug 12 15:32:46 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M473L3rCqz4Yg8g; Fri, 12 Aug 2022 15:32:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M473L3Jnrz3ytr; Fri, 12 Aug 2022 15:32:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660318366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bdy+dLC/5O5zPqMMTuF/xmQyPrALLhhhiXxz6Lng8SM=; b=iEPo9In2MUzuR4h6r2urnEMJlPeo5p8Z4pHi/QpQMrPH9nHq5DBoamEGL1Wuv+DdHlLoX+ 6tu1kY8Vl4Pg17QNa2L11J14TBHgJ3TNlMRdOUxzsQvg0vvdcVVLEXd+cCW92geMKnp6ro vmzCNX8LGbd1tx0tdbWYwHyuuktd/CkaIH85yrLonN4spbre+ZWuQHYkcUWSRVY2wRZjzu hPGsEEsg3L94U6JzDt0J5/5psv4xRmukYgm+/vf0Odl5fd+uoK4MQ1scJ/3rgHHV0TYDIl ql2Cx8jh080h9IDQx/Om26sdGj1VFViFEO3JTcCRjTrftznGCBmrH2QppWfzcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M473L2M4jzckn; Fri, 12 Aug 2022 15:32:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27CFWkQh042791; Fri, 12 Aug 2022 15:32:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27CFWkid042790; Fri, 12 Aug 2022 15:32:46 GMT (envelope-from git) Date: Fri, 12 Aug 2022 15:32:46 GMT Message-Id: <202208121532.27CFWkid042790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 886fc1e80490 - main - protosw: provide prototypes for all protocol switch methods List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 886fc1e80490fb03e72e306774766cbb2c733ac6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660318366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bdy+dLC/5O5zPqMMTuF/xmQyPrALLhhhiXxz6Lng8SM=; b=GLsOfxfexvQmG/KHd4Rst9F4KEM34XAe29G/bcHz4T8gsfmKigc81pIkqCiDvm1qsQ9PvV vjUC8upaQ4+4SGBLeKyut6CZ94ylDC4j2wPcnhnSS7XmSraWQchAjrOTGOEcoKphbPMf8r 7O27KmusFeZ2xvxtFOLhPioeqwqUXwCLbA3X6i0Y1KkmmUvBaQacwrHiyy2vu+XhPE6MCo apTK6FDx4FOgIPP4R/J+KcOOu9H9S/zYifv0mQp7sWSnS5hZN5rsFOxfH20EuBpxucMbCJ xZxsu/JUVSQrYsYPdAX4mzAT6P0c8oXFWK/GeO1CpXzml89khw3kvGZfdb4DIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660318366; a=rsa-sha256; cv=none; b=Kwk9NFBh1qME3BWHlr0PZGg21KGLocf/kDZiPoI0gUbWKtgDRkSl1XzzoebbsmwaA/eH11 1FSvbkM8faDEF1wWlzjsIhjgiLgIwvcGooKAcN/hG3c8QLis3EQoMtufmBo0i7n6XcdtaA K+X8oQZoRx9c767uRQwpFd9nqSNTegFfvtwnAu7xJN8CQKf3S7Kb0R9mjS7It3G8/8pbGL 1zb+/3asKga85RK387lyLIofSKBjDkZnsrtshBLrBonswB6PJRu2/+0R8aWb85p7zHifSR Agqt8/ryXJRz27It6LE1DlD5zf+LsekzrQxAJ09BEXog7aG339F/ytx1ieVJ4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=886fc1e80490fb03e72e306774766cbb2c733ac6 commit 886fc1e80490fb03e72e306774766cbb2c733ac6 Author: Gleb Smirnoff AuthorDate: 2022-08-12 15:30:34 +0000 Commit: Gleb Smirnoff CommitDate: 2022-08-12 15:30:34 +0000 protosw: provide prototypes for all protocol switch methods Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D36153 --- sys/sys/protosw.h | 131 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 80 insertions(+), 51 deletions(-) diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index 22e057e5691a..7c7eece83e78 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -60,13 +60,60 @@ struct sockopt; * In retrospect, it would be a lot nicer to use an interface * similar to the vnode VOP interface. */ +struct ifnet; +struct stat; +struct ucred; +struct uio; + /* USE THESE FOR YOUR PROTOTYPES ! */ -typedef int pr_input_t (struct mbuf **, int*, int); -typedef void pr_ctlinput_t (int, struct sockaddr *, void *); -typedef int pr_ctloutput_t (struct socket *, struct sockopt *); -typedef void pr_fasttimo_t (void); -typedef void pr_slowtimo_t (void); -typedef void pr_drain_t (void); +typedef int pr_input_t(struct mbuf **, int*, int); +typedef void pr_ctlinput_t(int, struct sockaddr *, void *); +typedef int pr_ctloutput_t(struct socket *, struct sockopt *); +typedef void pr_fasttimo_t(void); +typedef void pr_slowtimo_t(void); +typedef void pr_drain_t(void); +typedef void pr_abort_t(struct socket *); +typedef int pr_accept_t(struct socket *, struct sockaddr **); +typedef int pr_attach_t(struct socket *, int, struct thread *); +typedef int pr_bind_t(struct socket *, struct sockaddr *, struct thread *); +typedef int pr_connect_t(struct socket *, struct sockaddr *, + struct thread *); +typedef int pr_connect2_t(struct socket *, struct socket *); +typedef int pr_control_t(struct socket *, u_long, caddr_t, struct ifnet *, + struct thread *); +typedef void pr_detach_t(struct socket *); +typedef int pr_disconnect_t(struct socket *); +typedef int pr_listen_t(struct socket *, int, struct thread *); +typedef int pr_peeraddr_t(struct socket *, struct sockaddr **); +typedef int pr_rcvd_t(struct socket *, int); +typedef int pr_rcvoob_t(struct socket *, struct mbuf *, int); +typedef enum { + PRUS_OOB = 0x1, + PRUS_EOF = 0x2, + PRUS_MORETOCOME = 0x4, + PRUS_NOTREADY = 0x8, + PRUS_IPV6 = 0x10, +} pr_send_flags_t; +typedef int pr_send_t(struct socket *, int, struct mbuf *, + struct sockaddr *, struct mbuf *, struct thread *); +typedef int pr_ready_t(struct socket *, struct mbuf *, int); +typedef int pr_sense_t(struct socket *, struct stat *); +typedef int pr_shutdown_t(struct socket *); +typedef int pr_flush_t(struct socket *, int); +typedef int pr_sockaddr_t(struct socket *, struct sockaddr **); +typedef int pr_sosend_t(struct socket *, struct sockaddr *, struct uio *, + struct mbuf *, struct mbuf *, int, struct thread *); +typedef int pr_soreceive_t(struct socket *, struct sockaddr **, + struct uio *, struct mbuf **, struct mbuf **, int *); +typedef int pr_sopoll_t(struct socket *, int, struct ucred *, + struct thread *); +typedef void pr_sosetlabel_t(struct socket *); +typedef void pr_close_t(struct socket *); +typedef int pr_bindat_t(int, struct socket *, struct sockaddr *, + struct thread *); +typedef int pr_connectat_t(int, struct socket *, struct sockaddr *, + struct thread *); +typedef int pr_aio_queue_t(struct socket *, struct kaiocb *); struct protosw { short pr_type; /* socket type used for */ @@ -181,51 +228,33 @@ struct uio; * Some fields initialized to defaults if they are NULL. */ struct pr_usrreqs { - void (*pru_abort)(struct socket *so); - int (*pru_accept)(struct socket *so, struct sockaddr **nam); - int (*pru_attach)(struct socket *so, int proto, struct thread *td); - int (*pru_bind)(struct socket *so, struct sockaddr *nam, - struct thread *td); - int (*pru_connect)(struct socket *so, struct sockaddr *nam, - struct thread *td); - int (*pru_connect2)(struct socket *so1, struct socket *so2); - int (*pru_control)(struct socket *so, u_long cmd, caddr_t data, - struct ifnet *ifp, struct thread *td); - void (*pru_detach)(struct socket *so); - int (*pru_disconnect)(struct socket *so); - int (*pru_listen)(struct socket *so, int backlog, - struct thread *td); - int (*pru_peeraddr)(struct socket *so, struct sockaddr **nam); - int (*pru_rcvd)(struct socket *so, int flags); - int (*pru_rcvoob)(struct socket *so, struct mbuf *m, int flags); - int (*pru_send)(struct socket *so, int flags, struct mbuf *m, - struct sockaddr *addr, struct mbuf *control, - struct thread *td); -#define PRUS_OOB 0x1 -#define PRUS_EOF 0x2 -#define PRUS_MORETOCOME 0x4 -#define PRUS_NOTREADY 0x8 -#define PRUS_IPV6 0x10 - int (*pru_ready)(struct socket *so, struct mbuf *m, int count); - int (*pru_sense)(struct socket *so, struct stat *sb); - int (*pru_shutdown)(struct socket *so); - int (*pru_flush)(struct socket *so, int direction); - int (*pru_sockaddr)(struct socket *so, struct sockaddr **nam); - int (*pru_sosend)(struct socket *so, struct sockaddr *addr, - struct uio *uio, struct mbuf *top, struct mbuf *control, - int flags, struct thread *td); - int (*pru_soreceive)(struct socket *so, struct sockaddr **paddr, - struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, - int *flagsp); - int (*pru_sopoll)(struct socket *so, int events, - struct ucred *cred, struct thread *td); - void (*pru_sosetlabel)(struct socket *so); - void (*pru_close)(struct socket *so); - int (*pru_bindat)(int fd, struct socket *so, struct sockaddr *nam, - struct thread *td); - int (*pru_connectat)(int fd, struct socket *so, - struct sockaddr *nam, struct thread *td); - int (*pru_aio_queue)(struct socket *so, struct kaiocb *job); + pr_abort_t *pru_abort; + pr_accept_t *pru_accept; + pr_attach_t *pru_attach; + pr_bind_t *pru_bind; + pr_connect_t *pru_connect; + pr_connect2_t *pru_connect2; + pr_control_t *pru_control; + pr_detach_t *pru_detach; + pr_disconnect_t *pru_disconnect; + pr_listen_t *pru_listen; + pr_peeraddr_t *pru_peeraddr; + pr_rcvd_t *pru_rcvd; + pr_rcvoob_t *pru_rcvoob; + pr_send_t *pru_send; + pr_ready_t *pru_ready; + pr_sense_t *pru_sense; + pr_shutdown_t *pru_shutdown; + pr_flush_t *pru_flush; + pr_sockaddr_t *pru_sockaddr; + pr_sosend_t *pru_sosend; + pr_soreceive_t *pru_soreceive; + pr_sopoll_t *pru_sopoll; + pr_sosetlabel_t *pru_sosetlabel; + pr_close_t *pru_close; + pr_bindat_t *pru_bindat; + pr_connectat_t *pru_connectat; + pr_aio_queue_t *pru_aio_queue; }; /*