From owner-freebsd-hackers Thu Aug 16 1: 7:31 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from robin.mail.pas.earthlink.net (robin.mail.pas.earthlink.net [207.217.120.65]) by hub.freebsd.org (Postfix) with ESMTP id 5398237B40A for ; Thu, 16 Aug 2001 01:07:27 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.244.105.125.Dial1.SanJose1.Level3.net [209.244.105.125]) by robin.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id BAA15122; Thu, 16 Aug 2001 01:07:19 -0700 (PDT) Message-ID: <3B7B7F62.70B37F2E@mindspring.com> Date: Thu, 16 Aug 2001 01:08:02 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Joe Clarke Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Writing a packet alias translator, need help References: <20010813124054.F13703-100000@shumai.marcuscom.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Joe Clarke wrote: > > I'm trying to write a packet alias translator for a protocol that uses TCP > to setup a UDP streaming session (much like the smedia driver that's > already there). I'm having a problem getting the translated port to mesh > with the actual port. Here's what I've done: > > /* msg is a TCP setup packet > struct msg { > u_int32_t ipAddr; > u_int32_t portNumber; > }; > */ One obvious thing is that ports are 16 bits, not 32.... but... > is UDP 16704, but the translation puts 50535 in the packet. The bit patterns these make are not even remotely similar, meaning that this isn't a byte order issue; I think you will need to run the code in a debugger (or add printf's). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message