docs/how-to-build.md: use proper markup for directory names
[unleashed/tickless.git] / include / nss_netdir.h
bloba04e3ca51b48ca5e2d7ec25133b77699bd9f07e5
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
29 * nss_netdir.h
31 * Defines structures that are shared between the OSNET-private
32 * _get_hostserv_inetnetdir_byYY() interfaces and the public
33 * interfaces gethostbyYY()/getservbyYY() and netdir_getbyYY().
34 * Ideally, this header file should never be visible to developers
35 * outside of the OSNET build.
38 #ifndef _NSS_NETDIR_H
39 #define _NSS_NETDIR_H
41 #include <sys/netconfig.h>
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
47 typedef enum {
48 NSS_HOST,
49 NSS_SERV,
50 NETDIR_BY,
51 NETDIR_BY_NOSRV, /* bypass service lookup */
52 NETDIR_BY6,
53 NETDIR_BY_NOSRV6, /* bypass service lookup */
54 NSS_HOST6
55 } nss_netdir_op_t;
57 struct nss_netdirbyname_in {
58 nss_netdir_op_t op_t;
59 union {
60 struct nd_hostserv *nd_hs;
61 union {
62 struct {
63 const char *name;
64 char *buf;
65 int buflen;
66 } host;
67 struct {
68 const char *name;
69 char *buf;
70 int buflen;
71 int af_family; /* for ipnode */
72 int flags; /* for ipnode */
73 } host6;
74 struct {
75 const char *name;
76 const char *proto;
77 char *buf;
78 int buflen;
79 } serv;
80 } nss;
81 } arg;
84 union nss_netdirbyname_out {
85 struct nd_addrlist **nd_alist;
86 union {
87 struct {
88 struct hostent *hent;
89 int *herrno_p;
90 } host;
91 struct servent *serv;
92 } nss;
95 struct nss_netdirbyaddr_in {
96 nss_netdir_op_t op_t;
97 union {
98 struct netbuf *nd_nbuf;
99 union {
100 struct {
101 const char *addr;
102 int len;
103 int type;
104 char *buf;
105 int buflen;
106 } host;
107 struct {
108 int port;
109 const char *proto;
110 char *buf;
111 int buflen;
112 } serv;
113 } nss;
114 } arg;
117 union nss_netdirbyaddr_out {
118 struct nd_hostservlist **nd_hslist;
119 union {
120 struct {
121 struct hostent *hent;
122 int *herrno_p;
123 } host;
124 struct servent *serv;
125 } nss;
128 int __classic_netdir_getbyname(struct netconfig *,
129 struct nd_hostserv *, struct nd_addrlist **);
130 int __classic_netdir_getbyaddr(struct netconfig *,
131 struct nd_hostservlist **, struct netbuf *);
132 int _get_hostserv_inetnetdir_byname(struct netconfig *,
133 struct nss_netdirbyname_in *, union nss_netdirbyname_out *);
134 int _get_hostserv_inetnetdir_byaddr(struct netconfig *,
135 struct nss_netdirbyaddr_in *, union nss_netdirbyaddr_out *);
136 int __inet_netdir_options(struct netconfig *,
137 int option, int fd, char *par);
138 struct netbuf *__inet_uaddr2taddr(struct netconfig *, char *);
139 char *__inet_taddr2uaddr(struct netconfig *, struct netbuf *);
141 #ifdef __cplusplus
143 #endif
145 #endif /* _NSS_NETDIR_H */