From: Neil Horman <nhorman@redhat.com>
To: ych43 <ych43@student.canterbury.ac.nz>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: TCP port numbers
Date: Mon, 01 Nov 2004 07:38:55 -0500 [thread overview]
Message-ID: <41862E5F.60300@redhat.com> (raw)
In-Reply-To: <41838517@webmail>
ych43 wrote:
> Hi,
> I got one question about unix socket functions. I have two machines (called A
> and B). I use A to telnet B, get the root password of B. Is there any unix
> socket function I can use to get the port number of A on B. Obviously, the
> port number of B is 23. I want to use a socket function implemented on B to
> get the port number of A because a TCP connection is established between them.
> I greatly appreciate it if you help me. Thank you in advance.
> Xue
>
I think getpeername is the library call you are looking for
HTH
Neil
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
/***************************************************
*Neil Horman
*Software Engineer
*Red Hat, Inc.
*nhorman@redhat.com
*gpg keyid: 1024D / 0x92A74FA1
*http://pgp.mit.edu
***************************************************/
prev parent reply other threads:[~2004-11-01 12:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-01 3:33 TCP port numbers ych43
2004-11-01 10:39 ` Jan Engelhardt
2004-11-01 12:38 ` Neil Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41862E5F.60300@redhat.com \
--to=nhorman@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ych43@student.canterbury.ac.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox