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]
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #ifndef _MDNS_COMMON_H
30 #define _MDNS_COMMON_H
34 #include <sys/types.h>
35 #include <sys/socket.h>
40 #include <sys/select.h>
41 #include <netinet/in.h>
42 #include <arpa/inet.h>
43 #include <arpa/nameser.h>
45 #include <nss_common.h>
46 #include <nss_dbdefs.h>
56 #define NSSMDNS_MAXQRYTMO 1
57 #define NSSMDNS_MAXSRCHDMNS 6
58 #define NSSMDNS_MAXVALIDDMNS 10
60 #define SMF_MDNS_FMRI "svc:/network/dns/multicast:default"
61 #define SMF_NSSMDNSCFG_PROPGRP "nss_mdns_config"
62 #define SMF_NSSMDNSCFG_SRCHPROP "search"
63 #define SMF_NSSMDNSCFG_DMNPROP "domain"
65 typedef struct mdns_backend
*mdns_backend_ptr_t
;
66 typedef nss_status_t (*mdns_backend_op_t
)(mdns_backend_ptr_t
, void *);
69 mdns_backend_op_t
*ops
;
71 char *dmnsrchlist
[NSSMDNS_MAXSRCHDMNS
];
72 char *validdmnlist
[NSSMDNS_MAXVALIDDMNS
];
73 struct timeval conftimestamp
;
76 struct mdns_querydata
{
77 nss_XbyY_args_t
*argp
;
84 char paddrbuf
[INET6_ADDRSTRLEN
+ 1];
89 nss_backend_t
*_nss_mdns_constr(mdns_backend_op_t
*, int);
90 void _nss_mdns_destr(mdns_backend_ptr_t
);
91 int _nss_mdns_querybyname(mdns_backend_ptr_t
, char *name
,
92 int af
, struct mdns_querydata
*data
);
93 int _nss_mdns_querybyaddr(mdns_backend_ptr_t
, char *name
,
94 int af
, struct mdns_querydata
*data
);
95 void _nss_mdns_updatecfg(mdns_backend_ptr_t
);
97 nss_status_t
_nss_mdns_gethost_withttl(void *buf
, size_t bufsize
, int ipnode
);
98 nss_status_t
_nss_get_mdns_hosts_name(mdns_backend_ptr_t
*be
,
99 void **bufp
, size_t *sizep
);
100 nss_status_t
_nss_get_mdns_ipnodes_name(mdns_backend_ptr_t
*be
,
101 void **bufp
, size_t *sizep
);
107 #endif /* _MDNS_COMMON_H */