From: Simone Piccardi Date: Sun, 18 Jul 2004 23:15:26 +0000 (+0000) Subject: Altra roba, res_query. X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=commitdiff_plain;h=9f5fac5abf66c3a2fe782ecc17d63b62af2485ef;ds=inline Altra roba, res_query. --- diff --git a/sockctrl.tex b/sockctrl.tex index 1b99e53..62989d4 100644 --- a/sockctrl.tex +++ b/sockctrl.tex @@ -269,8 +269,6 @@ ad esempio il valore di default dato dalla costante \const{RES\_DEFAULT} definito come: \includecodesnip{listati/resolv_option_def.c} - - \begin{table}[htb] \centering \footnotesize @@ -320,6 +318,23 @@ definito come: \label{tab:resolver_option} \end{table} +La funzione di richiesta principale è \funcd{res\_query}, che serve ad +eseguire una richiesta ad un server DNS per un nome a dominio completamente +specificato (quello che si chiama FQDN, \textit{Fully Qualified Domain Name}); +il suo prototipo è: + +\begin{functions} +\headdecl{netinet/in.h} +\headdecl{arpa/nameser.h} +\headdecl{resolv.h} +\funcdecl{int res\_query(const char *dname, int class, int type, + unsigned char *answer, int anslen)} + + Esegue una interrogazione al DNS. + +\bodydesc{La funzione restituisce 0 in caso di successo e -1 in caso di + errore.} +\end{functions} Per quanto ci interessa i tipi di \textit{resource record} che vengono