Open dgtlrift opened 5 months ago
@dgtlrift A good idea and I have used this NSS concept elsewhere (not for name resolution though). Someone needs to create this as a project, a part of which needs to specify how the information is stored / accessed / updated in coap-rd so that the NSS modules know how to access this data and return the appropriate information.
Problem Statement: Adoption of Coap-RD into legacy applications utilizing
getaddrinfo()
,getnameinfo()
,gethostbyname()
,gethostbyaddr()
,getservbyname()
, orgetservbyport()
requires refactoring of legacy code base of those applications.Description of suggested solution: Creation of a
libnss_coaprd.so.2
library with implementations of:and
as documented in https://www.gnu.org/software/libc/manual/html_node/NSS-Modules-Interface.html and there is also reference implementation of this concept with mDNS/SD via the Avahi project https://github.com/avahi/nss-mdns
This would allow any legacy applications to utilize coap-rd without any modification to their code base. The administrator would reconfigure the
/etc/nsswitch.conf
file to something like the following:which would allow the names services switch to utilize the implemented functions above contained within the installed
libnss_coaprd.so.2
library to provide querying thehosts
andservices
database services via coaprd.