{
    "content": [
        {
            "type": "text",
            "text": "# rpc_svc_reg (info)\n\n## NAME\n\nrpcsvcreg, rpcreg, svcreg, svcunreg, svcauthreg, xprtregister, xprtunregister -- library routines for registering servers\n\n## SYNOPSIS\n\n#include <rpc/rpc.h>\nint\nrpcreg(rpcprogt prognum, rpcverst versnum, rpcproct procnum,\nchar *(*procname)(), xdrproct inproc, xdrproct outproc,\nchar *nettype);\nboolt\nsvcreg(SVCXPRT *xprt, const rpcprogt prognum, const rpcverst versnum,\nvoid (*dispatch)(struct svcreq *, SVCXPRT *),\nconst struct netconfig *netconf);\nvoid\nsvcunreg(const rpcprogt prognum, const rpcverst versnum);\nint\nsvcauthreg(int credflavor,\nenum authstat (*handler)(struct svcreq *, struct rpcmsg *));\nvoid\nxprtregister(SVCXPRT *xprt);\nvoid\nxprtunregister(SVCXPRT *xprt);\n\n## DESCRIPTION\n\nThese routines are a part of the RPC library which allows the RPC servers\nto register themselves with rpcbind (see rpcbind(8)), and associate the\ngiven program and version number with the dispatch function.  When the\nRPC server receives a RPC request, the library invokes the dispatch rou-\ntine with the appropriate arguments.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **Routines**\n- **AVAILABILITY**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "rpc_svc_reg",
        "section": "",
        "mode": "info",
        "summary": "rpcsvcreg, rpcreg, svcreg, svcunreg, svcauthreg, xprtregister, xprtunregister -- library routines for registering servers",
        "synopsis": "#include <rpc/rpc.h>\nint\nrpcreg(rpcprogt prognum, rpcverst versnum, rpcproct procnum,\nchar *(*procname)(), xdrproct inproc, xdrproct outproc,\nchar *nettype);\nboolt\nsvcreg(SVCXPRT *xprt, const rpcprogt prognum, const rpcverst versnum,\nvoid (*dispatch)(struct svcreq *, SVCXPRT *),\nconst struct netconfig *netconf);\nvoid\nsvcunreg(const rpcprogt prognum, const rpcverst versnum);\nint\nsvcauthreg(int credflavor,\nenum authstat (*handler)(struct svcreq *, struct rpcmsg *));\nvoid\nxprtregister(SVCXPRT *xprt);\nvoid\nxprtunregister(SVCXPRT *xprt);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "select",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/select/2/json"
            },
            {
                "name": "rpc",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/rpc/3/json"
            },
            {
                "name": "rpcbind",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/rpcbind/3/json"
            },
            {
                "name": "rpcsvccalls",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/rpcsvccalls/3/json"
            },
            {
                "name": "rpcsvccreate",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/rpcsvccreate/3/json"
            },
            {
                "name": "rpcsvcerr",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/rpcsvcerr/3/json"
            },
            {
                "name": "rpcbind",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/rpcbind/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "Routines",
                "lines": 60,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "rpcsvcreg, rpcreg, svcreg, svcunreg, svcauthreg, xprtregister,\nxprtunregister -- library routines for registering servers\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "#include <rpc/rpc.h>\n\nint\nrpcreg(rpcprogt prognum, rpcverst versnum, rpcproct procnum,\nchar *(*procname)(), xdrproct inproc, xdrproct outproc,\nchar *nettype);\n\nboolt\nsvcreg(SVCXPRT *xprt, const rpcprogt prognum, const rpcverst versnum,\nvoid (*dispatch)(struct svcreq *, SVCXPRT *),\nconst struct netconfig *netconf);\n\nvoid\nsvcunreg(const rpcprogt prognum, const rpcverst versnum);\n\nint\nsvcauthreg(int credflavor,\nenum authstat (*handler)(struct svcreq *, struct rpcmsg *));\n\nvoid\nxprtregister(SVCXPRT *xprt);\n\nvoid\nxprtunregister(SVCXPRT *xprt);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "These routines are a part of the RPC library which allows the RPC servers\nto register themselves with rpcbind (see rpcbind(8)), and associate the\ngiven program and version number with the dispatch function.  When the\nRPC server receives a RPC request, the library invokes the dispatch rou-\ntine with the appropriate arguments.\n",
                "subsections": []
            },
            "Routines": {
                "content": "See rpc(3) for the definition of the SVCXPRT data structure.\n\nrpcreg()\nRegister program prognum, procedure procname, and version versnum\nwith the RPC service package.  If a request arrives for program\nprognum, version versnum, and procedure procnum, procname is\ncalled with a pointer to its argument(s); procname should return a\npointer to its static result(s); inproc is the XDR function used\nto decode the arguments while outproc is the XDR function used to\nencode the results.  Procedures are registered on all available\ntransports of the class nettype.  See rpc(3).  This routine re-\nturns 0 if the registration succeeded, -1 otherwise.\n\nsvcreg()\nAssociates prognum and versnum with the service dispatch proce-\ndure, dispatch.  If netconf is NULL, the service is not registered\nwith the rpcbind(8) service.  If netconf is non-zero, then a map-\nping of the triple [prognum, versnum, netconf->ncnetid] to\nxprt->xpltaddr is established with the local rpcbind service.\n\nThe svcreg() routine returns 1 if it succeeds, and 0 otherwise.\n\nsvcunreg()\nRemove from the rpcbind service, all mappings of the triple\n[prognum, versnum, all-transports] to network address and all map-\npings within the RPC service package of the double [prognum,\nversnum] to dispatch routines.\n\nsvcauthreg()\nRegisters the service authentication routine handler with the dis-\npatch mechanism so that it can be invoked to authenticate RPC re-\nquests received with authentication type credflavor.  This inter-\nface allows developers to add new authentication types to their\nRPC applications without needing to modify the libraries.  Service\nimplementors usually do not need this routine.\n\nTypical service application would call svcauthreg() after regis-\ntering the service and prior to calling svcrun().  When needed to\nprocess an RPC credential of type credflavor, the handler proce-\ndure will be called with two arguments, struct svcreq *rqst and\nstruct rpcmsg *msg, and is expected to return a valid enum\nauthstat value.  There is no provision to change or delete an au-\nthentication handler once registered.\n\nThe svcauthreg() routine returns 0 if the registration is suc-\ncessful, 1 if credflavor already has an authentication handler\nregistered for it, and -1 otherwise.\n\nxprtregister()\nAfter RPC service transport handle xprt is created, it is regis-\ntered with the RPC service package.  This routine modifies the\nglobal variable svcfdset (see rpcsvccalls(3)).  Service imple-\nmentors usually do not need this routine.\n\nxprtunregister()\nBefore an RPC service transport handle xprt is destroyed, it un-\nregisters itself with the RPC service package.  This routine modi-\nfies the global variable svcfdset (see rpcsvccalls(3)).  Ser-\nvice implementors usually do not need this routine.\n",
                "subsections": []
            },
            "AVAILABILITY": {
                "content": "These functions are part of libtirpc.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "select(2), rpc(3), rpcbind(3), rpcsvccalls(3), rpcsvccreate(3),\nrpcsvcerr(3), rpcbind(8)\n\nBSD                               May 3, 1993                              BSD",
                "subsections": []
            }
        }
    }
}