From fe2494903422ba3b924eba82cb63a6a9188fad7a Mon Sep 17 00:00:00 2001 From: Mariusz Zaborski Date: Sun, 4 Nov 2018 19:29:19 +0000 Subject: [PATCH] libcasper: Document the cap_getaddrinfo and cap_getnameinfo functions Reviewed by: hrs Differential Revision: https://reviews.freebsd.org/D16929 --- lib/libcasper/services/cap_dns/Makefile | 1 + lib/libcasper/services/cap_dns/cap_dns.3 | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/libcasper/services/cap_dns/Makefile b/lib/libcasper/services/cap_dns/Makefile index eebe1d000c9c..cec3bb180a6a 100644 --- a/lib/libcasper/services/cap_dns/Makefile +++ b/lib/libcasper/services/cap_dns/Makefile @@ -30,6 +30,7 @@ MLINKS+=cap_dns.3 libcap_dns.3 MLINKS+=cap_dns.3 cap_gethostbyname.3 MLINKS+=cap_dns.3 cap_gethostbyname2.3 MLINKS+=cap_dns.3 cap_gethostbyaddr.3 +MLINKS+=cap_dns.3 cap_getaddrinfo.3 MLINKS+=cap_dns.3 cap_getnameinfo.3 MLINKS+=cap_dns.3 cap_dns_type_limit.3 MLINKS+=cap_dns.3 cap_dns_family_limit.3 diff --git a/lib/libcasper/services/cap_dns/cap_dns.3 b/lib/libcasper/services/cap_dns/cap_dns.3 index da0e511cdca4..cd9d659481de 100644 --- a/lib/libcasper/services/cap_dns/cap_dns.3 +++ b/lib/libcasper/services/cap_dns/cap_dns.3 @@ -24,14 +24,15 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2018 +.Dd November 4, 2018 .Dt CAP_DNS 3 .Os .Sh NAME +.Nm cap_getaddrinfo , +.Nm cap_getnameinfo , .Nm cap_gethostbyname , .Nm cap_gethostbyname2 , .Nm cap_gethostbyaddr , -.Nm cap_getnameinfo , .Nm cap_dns_type_limit , .Nm cap_dns_family_limit .Nd "library for getting network host entry in capability mode" @@ -41,6 +42,10 @@ .In sys/nv.h .In libcasper.h .In casper/cap_dns.h +.Ft int +.Fn cap_getaddrinfo "cap_channel_t *chan" "const char *hostname" "const char *servname" "const struct addrinfo *hints" "struct addrinfo **res" +.Ft int +.Fn cap_getnameinfo "cap_channel_t *chan" "const struct sockaddr *sa" "socklen_t salen" "char *host" "size_t hostlen" "char *serv" "size_t servlen" "int flags" .Ft "struct hostent *" .Fn cap_gethostbyname "const cap_channel_t *chan" "const char *name" .Ft "struct hostent *" @@ -48,12 +53,23 @@ .Ft "struct hostent *" .Fn cap_gethostbyaddr "const cap_channel_t *chan" "const void *addr" "socklen_t len" "int af" .Ft "int" -.Fn cap_getnameinfo "const cap_channel_t *chan" "const void *name" "int namelen" -.Ft "int" .Fn cap_dns_type_limit "cap_channel_t *chan" "const char * const *types" "size_t ntypes" .Ft "int" .Fn cap_dns_family_limit "const cap_channel_t *chan" "const int *families" "size_t nfamilies" .Sh DESCRIPTION +.Bf -symbolic +The +.Fn cap_getaddrinfo , +and +.Fn cap_getnameinfo , +functions are preferred over the +.Fn cap_gethostbyname , +.Fn cap_gethostbyname2 , +and +.Fn cap_gethostbyaddr +functions. +.Ef +.Pp The functions .Fn cap_gethostbyname , .Fn cap_gethostbyname2 ,