{
    "content": [
        {
            "type": "text",
            "text": "# getnetpath(3) (man)\n\n**Summary:** getnetpath, setnetpath, endnetpath — get /etc/netconfig entry corresponding to NETPATH compo‐ nent\n\n## See Also\n\n- getnetconfig(3)\n- netconfig(5)\n- environ(7)\n\n## Section Outline\n\n- **NAME** (3 lines)\n- **SYNOPSIS** (1 lines) — 1 subsections\n  - #include <netconfig.h> (9 lines)\n- **DESCRIPTION** (28 lines)\n- **RETURN VALUES** (11 lines)\n- **AVAILABILITY** (2 lines)\n- **SEE ALSO** (3 lines)\n\n## Full Content\n\n### NAME\n\ngetnetpath, setnetpath, endnetpath — get /etc/netconfig entry corresponding to NETPATH compo‐\nnent\n\n### SYNOPSIS\n\n#### #include <netconfig.h>\n\nstruct netconfig *\ngetnetpath(void *handlep);\n\nvoid *\nsetnetpath(void);\n\nint\nendnetpath(void *handlep);\n\n### DESCRIPTION\n\nThe routines described in this page provide the application access to the system network con‐\nfiguration database, /etc/netconfig, as it is “filtered” by the NETPATH environment variable\n(see environ(7)).  See getnetconfig(3) for other routines that also access the network configu‐\nration database directly.  The NETPATH variable is a list of colon-separated network identi‐\nfiers.\n\nThe getnetpath() function returns a pointer to the netconfig database entry corresponding to\nthe first valid NETPATH component.  The netconfig entry is formatted as a struct netconfig.  On\neach subsequent call, getnetpath() returns a pointer to the netconfig entry that corresponds to\nthe next valid NETPATH component.  The getnetpath() function can thus be used to search the\nnetconfig database for all networks included in the NETPATH variable.  When NETPATH has been\nexhausted, getnetpath() returns NULL.\n\nA call to setnetpath() “binds” to or “rewinds” NETPATH.  The setnetpath() function must be\ncalled before the first call to getnetpath() and may be called at any other time.  It returns a\nhandle that is used by getnetpath().\n\nThe getnetpath() function silently ignores invalid NETPATH components.  A NETPATH component is\ninvalid if there is no corresponding entry in the netconfig database.\n\nIf the NETPATH variable is unset, getnetpath() behaves as if NETPATH were set to the sequence\nof “default” or “visible” networks in the netconfig database, in the order in which they are\nlisted.\n\nThe endnetpath() function may be called to “unbind” from NETPATH when processing is complete,\nreleasing resources for reuse.  Programmers should be aware, however, that endnetpath() frees\nall memory allocated by getnetpath() for the struct netconfig data structure.\n\n### RETURN VALUES\n\nThe setnetpath() function returns a handle that is used by getnetpath().  In case of an error,\nsetnetpath() returns NULL.\n\nThe endnetpath() function returns 0 on success and -1 on failure (for example, if setnetpath()\nwas not called previously).  The ncperror() or ncsperror() function can be used to print out\nthe reason for failure.  See getnetconfig(3).\n\nWhen first called, getnetpath() returns a pointer to the netconfig database entry corresponding\nto the first valid NETPATH component.  When NETPATH has been exhausted, getnetpath() returns\nNULL.\n\n### AVAILABILITY\n\nThese functions are part of libtirpc.\n\n### SEE ALSO\n\ngetnetconfig(3), netconfig(5), environ(7)\n\nBSD                             April 22, 2000                             BSD\n\n"
        }
    ],
    "structuredContent": {
        "command": "getnetpath",
        "section": "3",
        "mode": "man",
        "summary": "getnetpath, setnetpath, endnetpath — get /etc/netconfig entry corresponding to NETPATH compo‐ nent",
        "synopsis": "",
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "getnetconfig",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/getnetconfig/3/json"
            },
            {
                "name": "netconfig",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/netconfig/5/json"
            },
            {
                "name": "environ",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/environ/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "#include <netconfig.h>",
                        "lines": 9
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "RETURN VALUES",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}