From owner-freebsd-chat Sun Oct 28 14: 9:53 2001 Delivered-To: freebsd-chat@freebsd.org Received: from lists.blarg.net (lists.blarg.net [206.124.128.17]) by hub.freebsd.org (Postfix) with ESMTP id B07D037B403 for ; Sun, 28 Oct 2001 14:09:49 -0800 (PST) Received: from thig.blarg.net (thig.blarg.net [206.124.128.18]) by lists.blarg.net (Postfix) with ESMTP id 931D5BD07; Sun, 28 Oct 2001 14:09:48 -0800 (PST) Received: from localhost.localdomain ([206.124.139.115]) by thig.blarg.net (8.9.3/8.9.3) with ESMTP id OAA32062; Sun, 28 Oct 2001 14:09:48 -0800 Received: (from jojo@localhost) by localhost.localdomain (8.11.6/8.11.3) id f9SM8fr49767; Sun, 28 Oct 2001 14:08:41 -0800 (PST) (envelope-from swear@blarg.net) To: Fabio Miranda Cc: freebsd-chat@FreeBSD.ORG Subject: Re: offtopic: c questions References: <20011027181836.26603.qmail@web11505.mail.yahoo.com> From: swear@blarg.net (Gary W. Swearingen) Date: 28 Oct 2001 14:08:40 -0800 In-Reply-To: <20011027181836.26603.qmail@web11505.mail.yahoo.com> Message-ID: <37d737h0yf.737@localhost.localdomain> Lines: 35 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Fabio Miranda writes: > hi, I am freebsd user, i want to know: > 1. I would like to understand network byte ordering > concepts. I know some machines are "little endian" and > "big endian", and tcpip provides a standard called > network ordering throught htonl, htons,etc fuctions. > I want to know How does look like bigendians and > network byte ordering?, how can i know if i am in a > little or bigendian host? These terms refer to "byte ordering" in systems which allow addressing of the individual "bytes" of a larger "word" which is interpreted as an integer. In "big endian" systems, the bytes which have the word's biggest-power-of-two bits have lower addresses; i.e., the big end of the word comes first in memory. Roughly speaking, Intel and DEC (x86,PDP,VAX,Alpha(?)) are little endian and others are big endian. The command "uname -m" should give you a clue. "Bit ordering" has to do with the number of the bits within bytes and words; roughly speaking, left-to-right or right-to-left and I'll have to refer you to the documentation of the CPUs or I/O devices involved as I don't know who uses what conventions. AFAIK, the "endian" terms are never used in regard to bit ordering. > dont have money to buy a book at amazon, but, is that > the only way? can't i understand unix tcpip > programming with free resources? There's lots of stuff on the web if you've the time to hunt it down. Most of it is probably Linux-centric, but it should be helpful anyway. Then there's discount (last year's books) and used books stores which work fine for old subjects like this. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message