X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sockctrl.tex;h=62989d4a2deaa2922461f33ff4c9e966f0a82500;hp=1b99e53285a8c279410038e81450cd0e80414aa6;hb=9f5fac5abf66c3a2fe782ecc17d63b62af2485ef;hpb=4e3373d365196f6ce538057dd912f6e89424bf92 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