Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f16d5fa4
Kaydet (Commit)
f16d5fa4
authored
Mar 02, 1995
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
The final bit of my Mac documentation.
üst
d211220c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
232 additions
and
0 deletions
+232
-0
libmacdnr.tex
Doc/libmacdnr.tex
+116
-0
libmacdnr.tex
Doc/mac/libmacdnr.tex
+116
-0
No files found.
Doc/libmacdnr.tex
0 → 100644
Dosyayı görüntüle @
f16d5fa4
\section
{
Built-in module
\sectcode
{
macdnr
}}
\bimodindex
{
macdnr
}
This module provides an interface to the Macintosh Domain Name
Resolver. It is usually used in conjunction with the
\var
{
mactcp
}
module, to
map hostnames to IP-addresses.
The
\code
{
macdnr
}
module defines the following functions:
\renewcommand
{
\indexsubitem
}{
(in module macdnr)
}
\begin{funcdesc}
{
Open
}{
\optional
{
filename
}}
Open the domain name resolver extension. If
\var
{
filename
}
is given it
should be the pathname of the extension, otherwise a default is
used. Normally, this call is not needed since the other calls will
open the extension automatically.
\end{funcdesc}
\begin{funcdesc}
{
Close
}{}
Close the resolver extension. Again, not needed for normal use.
\end{funcdesc}
\begin{funcdesc}
{
StrToAddr
}{
hostname
}
Look up the IP address for
\var
{
hostname
}
. This call returns a dnr
result object of the ``address'' variation.
\end{funcdesc}
\begin{funcdesc}
{
AddrToName
}{
addr
}
Do a reverse lookup on the 32-bit integer IP-address
\var
{
addr
}
. Returns a dnr result object of the ``address'' variation.
\end{funcdesc}
\begin{funcdesc}
{
AddrToStr
}{
addr
}
Convert the 32-bit integer IP-address
\var
{
addr
}
to a dotted-decimal
string. Returns the string.
\end{funcdesc}
\begin{funcdesc}
{
HInfo
}{
hostname
}
Query the nameservers for a
\code
{
HInfo
}
record for host
\var
{
hostname
}
. These records contain hardware and software
information about the machine in question (if they are available in
the first place). Returns a dnr result object of the ``hinfo''
variety.
\end{funcdesc}
\begin{funcdesc}
{
MXInfo
}{
domain
}
Query the nameservers for a mail exchanger for
\var
{
domain
}
. This is
the hostname of a host willing to accept SMTP mail for the given
domain. Returns a dnr result object of the ``mx'' variety.
\end{funcdesc}
\subsection
{
dnr result object
}
Since the DNR calls all execute asynchronously you do not get the
results back immedeately. In stead, you get a dnr result object. You
can check this object to see whether the query is complete, and access
its attributes to obtain the information when it is.
Alternatively, you can also reference the result attributes directly,
this will result in an implicit wait for the query to complete.
The
\var
{
rtnCode
}
and
\var
{
cname
}
attributes are always available, the
others depend on the type of query (address, hinfo or mx).
\renewcommand
{
\indexsubitem
}{
(dnr result object method)
}
% Add args, as in {arg1\, arg2 \optional{\, arg3}}
\begin{funcdesc}
{
wait
}{}
Wait for the query to complete.
\end{funcdesc}
% Add args, as in {arg1\, arg2 \optional{\, arg3}}
\begin{funcdesc}
{
isdone
}{}
Return 1 if the query is complete.
\end{funcdesc}
\begin{datadesc}
{
rtnCode
}
The error code returned by the query.
\end{datadesc}
\begin{datadesc}
{
cname
}
The canonical name of the host that was queried.
\end{datadesc}
\begin{datadesc}
{
ip0
}
\dataline
{
ip1
}
\dataline
{
ip2
}
\dataline
{
ip3
}
At most four integer IP addresses for this host. Unused entries are
zero. Valid only for address queries.
\end{datadesc}
\begin{datadesc}
{
cpuType
}
\dataline
{
osType
}
Textual strings giving the machine type an OS name. Valid for hinfo
queries.
\end{datadesc}
\begin{datadesc}
{
exchange
}
The name of a mail-exchanger host. Valid for mx queries.
\end{datadesc}
\begin{datadesc}
{
preference
}
The preference of this mx record. Not too useful, since the Macintosh
will only return a single mx record. Mx queries only.
\end{datadesc}
The simplest way to use the module to convert names to dotted-decimal
strings, without worrying about idle time, etc:
\begin{verbatim}
>>> def gethostname(name):
... import macdnr
... dnrr = macdnr.StrToAddr(name)
... return macdnr.AddrToStr(dnrr.ip0)
\end{verbatim}
Doc/mac/libmacdnr.tex
0 → 100644
Dosyayı görüntüle @
f16d5fa4
\section
{
Built-in module
\sectcode
{
macdnr
}}
\bimodindex
{
macdnr
}
This module provides an interface to the Macintosh Domain Name
Resolver. It is usually used in conjunction with the
\var
{
mactcp
}
module, to
map hostnames to IP-addresses.
The
\code
{
macdnr
}
module defines the following functions:
\renewcommand
{
\indexsubitem
}{
(in module macdnr)
}
\begin{funcdesc}
{
Open
}{
\optional
{
filename
}}
Open the domain name resolver extension. If
\var
{
filename
}
is given it
should be the pathname of the extension, otherwise a default is
used. Normally, this call is not needed since the other calls will
open the extension automatically.
\end{funcdesc}
\begin{funcdesc}
{
Close
}{}
Close the resolver extension. Again, not needed for normal use.
\end{funcdesc}
\begin{funcdesc}
{
StrToAddr
}{
hostname
}
Look up the IP address for
\var
{
hostname
}
. This call returns a dnr
result object of the ``address'' variation.
\end{funcdesc}
\begin{funcdesc}
{
AddrToName
}{
addr
}
Do a reverse lookup on the 32-bit integer IP-address
\var
{
addr
}
. Returns a dnr result object of the ``address'' variation.
\end{funcdesc}
\begin{funcdesc}
{
AddrToStr
}{
addr
}
Convert the 32-bit integer IP-address
\var
{
addr
}
to a dotted-decimal
string. Returns the string.
\end{funcdesc}
\begin{funcdesc}
{
HInfo
}{
hostname
}
Query the nameservers for a
\code
{
HInfo
}
record for host
\var
{
hostname
}
. These records contain hardware and software
information about the machine in question (if they are available in
the first place). Returns a dnr result object of the ``hinfo''
variety.
\end{funcdesc}
\begin{funcdesc}
{
MXInfo
}{
domain
}
Query the nameservers for a mail exchanger for
\var
{
domain
}
. This is
the hostname of a host willing to accept SMTP mail for the given
domain. Returns a dnr result object of the ``mx'' variety.
\end{funcdesc}
\subsection
{
dnr result object
}
Since the DNR calls all execute asynchronously you do not get the
results back immedeately. In stead, you get a dnr result object. You
can check this object to see whether the query is complete, and access
its attributes to obtain the information when it is.
Alternatively, you can also reference the result attributes directly,
this will result in an implicit wait for the query to complete.
The
\var
{
rtnCode
}
and
\var
{
cname
}
attributes are always available, the
others depend on the type of query (address, hinfo or mx).
\renewcommand
{
\indexsubitem
}{
(dnr result object method)
}
% Add args, as in {arg1\, arg2 \optional{\, arg3}}
\begin{funcdesc}
{
wait
}{}
Wait for the query to complete.
\end{funcdesc}
% Add args, as in {arg1\, arg2 \optional{\, arg3}}
\begin{funcdesc}
{
isdone
}{}
Return 1 if the query is complete.
\end{funcdesc}
\begin{datadesc}
{
rtnCode
}
The error code returned by the query.
\end{datadesc}
\begin{datadesc}
{
cname
}
The canonical name of the host that was queried.
\end{datadesc}
\begin{datadesc}
{
ip0
}
\dataline
{
ip1
}
\dataline
{
ip2
}
\dataline
{
ip3
}
At most four integer IP addresses for this host. Unused entries are
zero. Valid only for address queries.
\end{datadesc}
\begin{datadesc}
{
cpuType
}
\dataline
{
osType
}
Textual strings giving the machine type an OS name. Valid for hinfo
queries.
\end{datadesc}
\begin{datadesc}
{
exchange
}
The name of a mail-exchanger host. Valid for mx queries.
\end{datadesc}
\begin{datadesc}
{
preference
}
The preference of this mx record. Not too useful, since the Macintosh
will only return a single mx record. Mx queries only.
\end{datadesc}
The simplest way to use the module to convert names to dotted-decimal
strings, without worrying about idle time, etc:
\begin{verbatim}
>>> def gethostname(name):
... import macdnr
... dnrr = macdnr.StrToAddr(name)
... return macdnr.AddrToStr(dnrr.ip0)
\end{verbatim}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment