version 1.3, 1996/06/26 05:37:21 |
version 1.4, 1997/01/17 07:12:57 |
|
|
int width; |
int width; |
|
|
sprintf(line, "%.*s.", (Aflag && !nflag) ? 12 : 16, inetname(in)); |
sprintf(line, "%.*s.", (Aflag && !nflag) ? 12 : 16, inetname(in)); |
cp = index(line, '\0'); |
cp = strchr(line, '\0'); |
if (!nflag && port) |
if (!nflag && port) |
sp = getservbyport((int)port, proto); |
sp = getservbyport((int)port, proto); |
if (sp || port == 0) |
if (sp || port == 0) |
|
|
if (first && !nflag) { |
if (first && !nflag) { |
first = 0; |
first = 0; |
if (gethostname(domain, MAXHOSTNAMELEN) == 0 && |
if (gethostname(domain, MAXHOSTNAMELEN) == 0 && |
(cp = index(domain, '.'))) |
(cp = strchr(domain, '.'))) |
(void) strcpy(domain, cp + 1); |
(void) strcpy(domain, cp + 1); |
else |
else |
domain[0] = 0; |
domain[0] = 0; |
|
|
if (cp == 0) { |
if (cp == 0) { |
hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET); |
hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET); |
if (hp) { |
if (hp) { |
if ((cp = index(hp->h_name, '.')) && |
if ((cp = strchr(hp->h_name, '.')) && |
!strcmp(cp + 1, domain)) |
!strcmp(cp + 1, domain)) |
*cp = 0; |
*cp = 0; |
cp = hp->h_name; |
cp = hp->h_name; |