From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Michael Tuexen Newsgroups: gmane.lisp.guile.devel Subject: Re: Initial SCTP support for the upcoming 1.6.5 release Date: Fri, 20 Aug 2004 09:57:28 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <94FD6DA0-F27E-11D8-9417-000D932C78D8@lurchi.franken.de> References: <28C61BE4-EB92-11D8-9129-000D932C78D8@lurchi.franken.de> <87657jc3v2.fsf@zip.com.au> <87oel9fhv9.fsf@zip.com.au> <60ADA546-F20E-11D8-A47A-000D932C78D8@lurchi.franken.de> <87llgabohv.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1092988771 8244 80.91.224.253 (20 Aug 2004 07:59:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 20 Aug 2004 07:59:31 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Aug 20 09:59:20 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1By4Ix-0002Xc-00 for ; Fri, 20 Aug 2004 09:59:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1By4NF-0004XT-H7 for guile-devel@m.gmane.org; Fri, 20 Aug 2004 04:03:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1By4MO-0004Wn-W3 for guile-devel@gnu.org; Fri, 20 Aug 2004 04:02:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1By4ME-0004V1-P6 for guile-devel@gnu.org; Fri, 20 Aug 2004 04:02:45 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1By4MB-0004Uc-7S for guile-devel@gnu.org; Fri, 20 Aug 2004 04:02:41 -0400 Original-Received: from [193.175.24.27] (helo=ilsa.franken.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1By4HR-0007KO-S8 for guile-devel@gnu.org; Fri, 20 Aug 2004 03:57:46 -0400 Original-Received: from [192.168.1.22] (pD9FF1AA8.dip.t-dialin.net [217.255.26.168]) by ilsa.franken.de (Postfix) with ESMTP id 89A61245D1; Fri, 20 Aug 2004 09:57:42 +0200 (CEST) (KNF account authenticated via SMTP-AUTH) In-Reply-To: <87llgabohv.fsf@zip.com.au> Original-To: Kevin Ryde X-Mailer: Apple Mail (2.619) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3991 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3991 Kevin, see my comments in-line. Best regards Michael On Aug 20, 2004, at 3:13 AM, Kevin Ryde wrote: > Michael Tuexen writes: >> >> The argument, to use a function like getprotobyname >> to perform a lookup in /etc/protocols, is not valid in my opinion. >> The reason is, that besides I have not seen that, that the >> constants above are defined in /usr/include/netinet/in.h and >> are used. > > I don't want to go against the advice of the GNU/Linux man page. It's > pretty explicit. You are not going against it. You are not using them. You are only providing constants available in /usr/include/netinet/in.h to the guile user. > >> So if, a system (I do not know of any such system), >> uses a different number for TCP, this number will not only be in >> /etc/protocols, but also in /usr/include/netinet/in.h. A different >> story are port numbers. They can (and should) be looked up in >> /etc/services. >> There are no constants describing the port number for an echo >> server... > > Well I guess both protocol and service numbers for standard stuff are > constants. I don't know why one reads a file instead of just putting > numbers in a program. Maybe it dates right back to a time when such > things were still in flux. Or maybe the theory is to avoid numbers > hard coded in programs (though strings hard coded aren't much better > :-). You are right, both port numbers and protocol numbers are kind of standardized. But there is two differences: Normally a user of a program does not specify the transport protocol, but the port (telnet 127.0.0.1 echo, for example). That is why you need a translation service for these service names. The second is that there are no predefined constants for port numbers available on a system like it is for protocols. I agree with the man page that it is bad to use s = socket(AF_INET, SOCK_STREAM, 132); It should be s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); because you are not using a number, you are using a constant. So what is the difference if you use getprotocolbyname? You can move the binaries to a different host which uses different numbers? I have not seen that and I'm pretty sure that this is not in tune with the socket() call. BTW, for UDP and TCP the calls s = socket(AF_INET, SOCK_DGRAM, 0); s = socket(AF_INET, SOCK_STREAM, 0); are used as acronyms for s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); So I think the man page and reality match no pretty good for these things, but the man page seems to be pretty old (1995, on http://www.freebsd.org/cgi/man.cgi? query=protocols&apropos=0&sektion=0&manpath=Red+Hat+Linux%2Fi386+9&forma t=html Best regards Michael PS.: The usage of the third arg of the socket() call is the one described in the 3rd edition of Unix Network Programming, so I guess that some people will try to use it that way... _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel